Skip to content

Commit

Permalink
remove redundant cast
Browse files Browse the repository at this point in the history
  • Loading branch information
eliottrosenberg committed Mar 2, 2025
1 parent 3c13148 commit 5a15d68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cirq-core/cirq/transformers/gauge_compiling/cphase_gauge.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
)
from cirq import ops
import numpy as np
from typing import cast


class CPhasePauliGauge(Gauge):
Expand Down Expand Up @@ -128,7 +127,7 @@ def sample(self, gate: ops.Gate, prng: np.random.Generator) -> ConstantGauge:
if not type(gate) == ops.CZPowGate:
raise TypeError("gate must be a CZPowGate")
pre_q0, pre_q1 = prng.choice(np.array([ops.I, ops.X, ops.Y, ops.Z]), size=2, replace=True)
return self._get_constant_gauge(cast(ops.CZPowGate, gate), pre_q0, pre_q1)
return self._get_constant_gauge(gate, pre_q0, pre_q1)


CPhaseGaugeSelector = GaugeSelector(gauges=[CPhasePauliGauge()])
Expand Down

0 comments on commit 5a15d68

Please sign in to comment.