qiskit_qec.linear.build_hyper_partner

build_hyper_partner(matrix, index)[source]

Builds an independent hyperbolic partner for the input vector indexed

Let the input matrix be [m_0,…,m_(k-1)] and v = m_index. It is assumed that the vectors m_0,…,m_(k-1) have a zero pairwise symplectic product (i.e. represent a set of Pauli operators that pairwise commmute). This method will find a GF(2) symplectic vector that has zero symplectic product with each m_i != v and a symplectic product of 1 with the vector v. If the vectors represent Pauli operators then this method will find a Pauli operator that commute with the operators represented by the vectors m_i != v and that anticommutes with the Pauli operator that is represented by v.

Parameters:
  • matrix (np.array, SimplecticMatrix) – GF(2) symplectic matrix representing a set of independent commuting generators

  • index (int) – index of generator to build a hyperbolic partner for

Raises:
  • QiskitError – Input matrix must be a GF(2) symplectic matrix

  • QiskitError – Input matrix must represent a set of commuting operators

  • QiskitError – Input matrix does not represent a set of independent operators, it does not have have full rank

  • QiskitError – Input index out or range

Return type:

ndarray

Returns:

a hyperbolic partner for the given vector wrt the set of commuting

generators

Examples

>>> matrix = numpy.array(
    [[1,0,0,0,0,0,0,0],
     [0,1,0,0,0,0,0,0],
     [0,0,1,0,0,0,0,0],
     [0,0,0,1,0,0,0,0]], dtype=numpy.bool_)
>>> av = build_hyper_partner(matrix, 0)
>>> av.astype(int)
array([0, 0, 0, 0, 1, 0, 0, 0])

See Also: _build_hyper_partner, locate_hyper_partner, _locate_hyper_partner

Notes: This method is the implementation of Proposition 10.4 from Nielsen and Chuang’s Quantum Computation and Quantum Information