Exemple #1
0
 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
Exemple #2
0
 def __getitem__(self, key):
     coeff = self.obj.coeffs[key]
     pauli = PauliTable._to_label(self.obj.table.array[key])
     return (pauli, coeff)