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

equal_up_to_global_phase on gates doesn't work as expected #6574

Open
babacry opened this issue Apr 24, 2024 · 0 comments
Open

equal_up_to_global_phase on gates doesn't work as expected #6574

babacry opened this issue Apr 24, 2024 · 0 comments
Assignees
Labels
kind/bug-report Something doesn't seem to work. triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add

Comments

@babacry
Copy link
Contributor

babacry commented Apr 24, 2024

Description of the issue
Test cases

        (
            cirq.PhasedXPowGate(phase_exponent=1.5, exponent=1.0),
            cirq.PhasedXPowGate(phase_exponent=0.5, exponent=1.0),
            True,
        ),
        (cirq.XPowGate(exponent=2.0), cirq.I, True),

should pass the test suite IIUC?

If I apply equal_up_to_global_phase to matrices of gates, the test can pass:

cirq.equal_up_to_global_phase(cirq.PhasedXPowGate(phase_exponent=1.5, exponent=1.0),cirq.PhasedXPowGate(phase_exponent=0.5, exponent=1.0))

-> False

cirq.equal_up_to_global_phase(cirq.unitary(cirq.PhasedXPowGate(phase_exponent=1.5, exponent=1.0)),cirq.unitary(cirq.PhasedXPowGate(phase_exponent=0.5, exponent=1.0)))

-> True

How to reproduce the issue

Run the test cases above.

Cirq version

1.4.0.dev

@babacry babacry added the kind/bug-report Something doesn't seem to work. label Apr 24, 2024
@NoureldinYosri NoureldinYosri added the triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add label May 8, 2024
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/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Projects
None yet
Development

No branches or pull requests

2 participants