Skip to content

Commit

Permalink
Implement PauliStringPhasorGate (#4696)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: PauliStringPhasor no longer inherits from PauliStringGateOperation.

Implements PauliStringPhasor in terms of a GateOperation on a new class PauliStringPhasorGate.

Mostly involved moving existing functions from the operation to the gate, and then having the operation call those methods under the hood.

Closes #1561, xref #4683

@tanujkhattar
  • Loading branch information
daxfohl committed Dec 20, 2021
1 parent 2e60ca1 commit 1d8d2f3
Show file tree
Hide file tree
Showing 10 changed files with 503 additions and 50 deletions.
1 change: 1 addition & 0 deletions cirq-core/cirq/__init__.py
Expand Up @@ -260,6 +260,7 @@
PauliString,
PauliStringGateOperation,
PauliStringPhasor,
PauliStringPhasorGate,
PauliSum,
PauliSumExponential,
PauliSumLike,
Expand Down
2 changes: 2 additions & 0 deletions cirq-core/cirq/json_resolver_cache.py
Expand Up @@ -118,6 +118,8 @@ def _parallel_gate_op(gate, qubits):
'ParallelGateFamily': cirq.ParallelGateFamily,
'PauliMeasurementGate': cirq.PauliMeasurementGate,
'PauliString': cirq.PauliString,
'PauliStringPhasor': cirq.PauliStringPhasor,
'PauliStringPhasorGate': cirq.PauliStringPhasorGate,
'_PauliX': cirq.ops.pauli_gates._PauliX,
'_PauliY': cirq.ops.pauli_gates._PauliY,
'_PauliZ': cirq.ops.pauli_gates._PauliZ,
Expand Down
1 change: 1 addition & 0 deletions cirq-core/cirq/ops/__init__.py
Expand Up @@ -237,6 +237,7 @@

from cirq.ops.pauli_string_phasor import (
PauliStringPhasor,
PauliStringPhasorGate,
)

from cirq.ops.pauli_string_raw_types import (
Expand Down

0 comments on commit 1d8d2f3

Please sign in to comment.