qiskit_qec.linear.is_same_span

is_same_span(matrix1, matrix2)[source]

Does span(rows of matrix1) = span(rows of matrix2)?

Parameters:
  • matrix1 (ndarray) – First set of vectors

  • matrix2 (ndarray) – Second set of vectors

Return type:

bool

Returns:

True if span(rows of matrix1) = span(rows of matrix2). False otherwise

Raises:

QiskitError – Inpiut matrices must by GF(2) symplectic matrices

Examples

>>> matrix1 = numpy.array([[1,1,0,0],[0,0,1,0]], dtype=numpy.bool_)
>>> matrix2 = numpy.array([[1,1,1,0],[0,0,1,0]], dtype=numpy.bool_)
>>> is_same_span(matrix1, matrix2)
True
>>> matrix1 = numpy.array([[1,1,0,0],[0,0,1,0]], dtype=numpy.bool_)
>>> matrix2 = numpy.array([[1,1,1,0],[0,0,0,1]], dtype=numpy.bool_)
>>> is_same_span(matrix1, matrix2)
False