qiskit_qec.linear.is_symplectic_form

is_symplectic_form(a, dtype=None)[source]

Is the input a GF(2) symplectic matrix or vector

Parameters:
  • a (Any) – Input to be checked

  • dtype (Optional) – Check if given matrix/vector is of type dtype. Defaults to None.

Return type:

bool

Returns:

True if the input matrix/vector is GF(2) symplectic. False otherwise.

Examples

>>> vector = numpy.array([[1,0,0,1,0,0,1,0]], dtype=numpy.bool_)
>>> is_symplectic_form(vector)
True
>>> matrix = numpy.array([[1,0,0,1,0,0,1],[0,1,1,1,0,0,0]], dtype=numpy.bool_)
>>> is_symplectic_form(matrix)
False

See Also: is_symplectic_vector_form, is_symplectic_matrix_form