Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EigenGate equality does not account for exponent when comparing global phase #7052

Open
daxfohl opened this issue Feb 9, 2025 · 0 comments · May be fixed by #7057
Open

EigenGate equality does not account for exponent when comparing global phase #7052

daxfohl opened this issue Feb 9, 2025 · 0 comments · May be fixed by #7057
Labels
kind/bug-report Something doesn't seem to work. triage/discuss Needs decision / discussion, bring these up during Cirq Cynque

Comments

@daxfohl
Copy link
Collaborator

daxfohl commented Feb 9, 2025

Description of the issue

global phase should be multiplied by the exponent and normalized when comparing eigen gates.

How to reproduce the issue

https://github.com/quantumlib/Cirq/blob/main/cirq-core/cirq/ops/common_gates_test.py#L247-L249 has ZPowGate(phase=-0.5)**5, and https://github.com/quantumlib/Cirq/blob/main/cirq-core/cirq/ops/common_gates_test.py#L252 has a ZPowGate(phase=-0.1)**5 in a different equality group. These are equal gates with the same unitary though, and should be in the same equality group. In the first, the exponentiated phase causes a -5/4 rotation, and in the second it causes a -1/4 rotation, so both end up at the same spot.

Unitaries:

[[0-1j 0+0j]
 [0+0j 0+1j]]

[[0-1j 0+0j]
 [0+0j 0+1j]]
@daxfohl daxfohl added the kind/bug-report Something doesn't seem to work. label Feb 9, 2025
@mhucka mhucka added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-report Something doesn't seem to work. triage/discuss Needs decision / discussion, bring these up during Cirq Cynque
Projects
None yet
2 participants