def _to_label(pauli, phase): """Return the Pauli stabilizer string from symplectic representation.""" # pylint: disable=arguments-differ # Cast in symplectic representation # This should avoid a copy if the pauli is already a row # in the symplectic table label = PauliTable._to_label(pauli) if phase: return '-' + label return '+' + label
def __getitem__(self, key): coeff = self.obj.coeffs[key] pauli = PauliTable._to_label(self.obj.table.array[key]) return (pauli, coeff)