qiskit_qec.linear.is_center

is_center(cntr, matrix)[source]

Does the input center matrix represent the center of the supplied matrix?

Let op(cntr) = [op(c_0),op(c_1),…,op(c_(k-1))] be the Pauli operators represented by the input center_matrix. Let op(matrix) = [op(m_0),op(m_1),…,op(m_(t-1))] be the Pauli operators represented by the input matrix. This method returns True if <op(cntr)> = Z(<op(matrix)>) and False otherwise.

Parameters:
  • cntr (np.ndarray) – Generators of center to be checked

  • matrix (np.ndarray) – Generators of full group

Raises:

QiskitError – Not all inputs are not GF(2) symplectic matrices/vectors

Return type:

bool

Returns:

True if <op(cntr)> = Z(<op(matrix)>), False otherwise

Examples

>>> matrix = numpy.array(
    [[0,1,0,0,1,0,1,0],
    [0,0,0,0,1,1,0,1],
    [1,1,1,0,0,1,0,0],
    [1,1,0,1,0,0,0,0]], dtype=numpy.bool_)
>>> cntr = numpy.array([[1, 1, 1, 0, 1, 0, 0, 1],
                        [1, 0, 0, 1, 0, 1, 1, 1]], dtype=numpy.bool_)
>>> is_center(cntr, matrix)
True