Skip to content

Commit 0837a45

Browse files
committed
Remove _as_pauli_string
Since it is unused now, and __neg__ could use _try_interpret_as_pauli_string instead.
1 parent 1c25b43 commit 0837a45

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cirq-core/cirq/ops/pauli_string.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,11 +1134,8 @@ def qubit(self) -> raw_types.Qid:
11341134
assert len(self.qubits) == 1
11351135
return self.qubits[0]
11361136

1137-
def _as_pauli_string(self) -> PauliString:
1138-
return PauliString(qubit_pauli_map={self.qubit: self.pauli})
1139-
11401137
def __neg__(self):
1141-
return -self._as_pauli_string()
1138+
return -_try_interpret_as_pauli_string(self)
11421139

11431140
def _json_dict_(self) -> dict[str, Any]:
11441141
return protocols.obj_to_dict_helper(self, ['pauli', 'qubit'])

0 commit comments

Comments
 (0)