Skip to content

Commit

Permalink
Implement PauliStringPhasorGate (quantumlib#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 quantumlib#1561, xref quantumlib#4683

@tanujkhattar
  • Loading branch information
daxfohl authored and MichaelBroughton committed Jan 22, 2022
1 parent 60973a3 commit ce51917
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
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
PauliString,
PauliStringGateOperation,
PauliStringPhasor,
PauliStringPhasorGate,
PauliSum,
PauliSumExponential,
PauliSumLike,
Expand Down
2 changes: 2 additions & 0 deletions cirq-core/cirq/json_resolver_cache.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@

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

from cirq.ops.pauli_string_raw_types import (
Expand Down
Loading

0 comments on commit ce51917

Please sign in to comment.