PhasedISwapPowGate doesn't override the _value_equality_approximate_values_ implementation it inherits from EigenGate, which means its phase exponent attribute isn't included in approximate comparisons
the one exception is when its phase exponent is zero, in which case approximate comparison fails even when it shouldn't due to some of the same inconsistencies described for cirq.PhasedXPowGate in #6528
How to reproduce the issue
gate0 = cirq.PhasedISwapPowGate(phase_exponent=0)
gate1 = cirq.PhasedISwapPowGate(phase_exponent=1e-12)
gate2 = cirq.PhasedISwapPowGate(phase_exponent=2e-12)
gate3 = cirq.PhasedISwapPowGate(phase_exponent=0.345)
assert cirq.approx_eq(gate1, gate2) # ok
assert cirq.approx_eq(gate1, gate0) # fails, even though they are as close as the previous two
assert cirq.approx_eq(gate1, gate3) # passes, but shouldn't
assert cirq.equal_up_to_global_phase(gate1, gate2) # ok
assert cirq.equal_up_to_global_phase(gate1, gate0) # fails, even though they are as close as the previous two
assert cirq.equal_up_to_global_phase(gate1, gate3) # passes, but shouldn't
Description of the issue
PhasedISwapPowGate
doesn't override the_value_equality_approximate_values_
implementation it inherits fromEigenGate
, which means its phase exponent attribute isn't included in approximate comparisonsthe one exception is when its phase exponent is zero, in which case approximate comparison fails even when it shouldn't due to some of the same inconsistencies described for
cirq.PhasedXPowGate
in #6528How to reproduce the issue
Cirq version