flamingpy.utils.linalg

Helper functions for linear algebra used for testing LC equivalence.

Functions

are_lc_equivalent(graph1, graph2[, ...])

Check if two EGraphs are LC equivalent, and return the Clifford operation if so.

clifford_vec_to_global(vec)

Convert a local Clifford gate on n qubits to a local Clifford gate on all n qubits.

clifford_vec_to_tensors(vec)

Convert a local Clifford gate on n qubits to a list of n single-qubit Cliffords.

lc_constraint_system(G, H)

Build the constraint for LC-equivalence of two adjacency matrices.

nullspace_basis(M)

Return the nullspace basis of matrix M.

reduce_RREform_mod2(M[, max_cols])

Put a binary matrix into row reduced echelon form modulo 2, up to a maximum number of columns given by max_cols.

search_nullspace(basis)

Check if the nullspace satisfies the determinant constraints.