qml.math.binary_is_independent

binary_is_independent(vector, basis)[source]

Check whether a binary vector, i.e., a bitstring, is linearly independent (over \(\mathbb{Z}_2\)) of a basis of binary vectors, given as column vectors of a matrix.

Parameters:
  • vector (np.ndarray) – Binary vector to check.

  • basis (np.ndarray) – Basis of binary vectors against which vector is checked. If vector has shape (r,), basis should have shape (r, m) and rank min(r, m). I.e., the columns of basis all need to be linearly independent.

Returns:

Whether vector is linearly independent of basis over \(\mathbb{Z}_2\).

Return type:

bool

Warning

This function is currently not compatible with JAX.