qiskit_qec.linear.is_symplectic_vector_form

is_symplectic_vector_form(vector, dtype=None)[source]

Is the input vector GF(2) symplectic

Checks if the given array like vector is in the form of a symplectic vector: two dimensional, even number of columns, 0/1 or boolean entries. The optional argument dtype can be given to check if entries are a specific dtype

Parameters:
  • vector (ndarray) – Input vector to be checked

  • dtype (Union[bool, bool_, int, integer, None]) – Optional. Check if given vector is of type dtype. Default: None

Return type:

bool

Returns:

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

Examples

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

See Also: is_symplectic_matrix_form, is_symplectic_form