qml.math.binary_finite_reduced_row_echelon¶
- binary_finite_reduced_row_echelon(binary_matrix, inplace=False)[source]¶
Computes the reduced row echelon form (RREF) of a matrix with entries from the binary numbers, a.k.a. the finite field \(\mathbb{Z}_2\).
- Parameters:
binary_matrix (array[int]) – binary matrix
inplace (bool) – Whether to perform the modification of
binary_matrixin place. Defaults toFalse, making a copy before running the calculation.
- Returns:
reduced row-echelon form of the given
binary_matrix. The output has the same shape as the input. Ifinplace=True, the returned array is the same object as the inputbinary_matrix, which then has been modified in place.- Return type:
array[int]
Warning
This function is currently not compatible with JAX.
Example
>>> binary_matrix = np.array([[1, 0, 0, 0, 0, 1, 0, 0], ... [1, 0, 1, 0, 0, 0, 1, 0], ... [0, 0, 0, 1, 1, 0, 0, 1]]) >>> print(qml.math.binary_finite_reduced_row_echelon(binary_matrix)) [[1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 1, 0, 0, 1]]
code/api/pennylane.math.binary_finite_reduced_row_echelon
Download Python script
Download Notebook
View on GitHub