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

cirq.X**1 should be _PauliX instead of XPowGate #4328

Closed
balopat opened this issue Jul 16, 2021 · 0 comments · Fixed by #4330
Closed

cirq.X**1 should be _PauliX instead of XPowGate #4328

balopat opened this issue Jul 16, 2021 · 0 comments · Fixed by #4330
Labels
area/paulis kind/bug-report Something doesn't seem to work.

Comments

@balopat
Copy link
Contributor

balopat commented Jul 16, 2021

Description of the issue

As @ybc1991 pointed out - the type of cirq.X**1 should be _PauliX instead of XPowGate. Context: https://github.com/quantumlib/Cirq/pull/4165/files#r646844399.

Discussed on Cirq Cynque on June 9th 2021:

  • We should just fix this
  • That would make the output type value-dependent. -- that is true, but it should be fine this direction, because _PauliX is a subclass of the XPowGate

How to reproduce the issue

print(type(cirq.X), type(cirq.X**1))
# Prints:
# <class 'cirq.ops.pauli_gates._PauliX'> <class 'cirq.ops.common_gates.XPowGate'>
@balopat balopat added kind/bug-report Something doesn't seem to work. area/paulis labels Jul 16, 2021
BichengYing added a commit to BichengYing/Cirq that referenced this issue Jul 17, 2021
CirqBot pushed a commit that referenced this issue Jul 20, 2021
CirqBot pushed a commit that referenced this issue Sep 9, 2022
Clean up TODO-s for fixed issues #4328 and #4532
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
rht pushed a commit to rht/Cirq that referenced this issue May 1, 2023
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this issue Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/paulis kind/bug-report Something doesn't seem to work.
Projects
None yet
1 participant