qml.math.binary_finite_reduced_row_echelon

binary_finite_reduced_row_echelon(binary_matrix)[source]

Returns the reduced row echelon form (RREF) of a matrix in a binary finite field \(\mathbb{Z}_2\).

Parameters:

binary_matrix (array[int]) – binary matrix representation of a Hamiltonian

Returns:

reduced row-echelon form of the given binary_matrix

Return type:

array[int]

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]])
>>> qml.math.binary_finite_reduced_row_echelon(binary_matrix)
array([[1, 0, 0, 0, 0, 1, 0, 0],
       [0, 0, 1, 0, 0, 1, 1, 0],
       [0, 0, 0, 1, 1, 0, 0, 1]])