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'>
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