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

PauliString repr does not preserve qubit order. #5564

Closed
dabacon opened this issue Jun 21, 2022 · 1 comment · Fixed by #5565
Closed

PauliString repr does not preserve qubit order. #5564

dabacon opened this issue Jun 21, 2022 · 1 comment · Fixed by #5565
Labels
area/gates area/paulis kind/bug-report Something doesn't seem to work.

Comments

@dabacon
Copy link
Collaborator

dabacon commented Jun 21, 2022

Description of the issue

If you create a PauliString

p = cirq.PauliString({q2: cirq.Z, q1: cirq.Y, q0: cirq.X})

and round trip it via its repr, the qubit order does not match.

eval(repr(p)).qubits == p.qubits
>>> False

PauliString having ordered qubits was introduced in #4270

@dabacon dabacon added the kind/bug-report Something doesn't seem to work. label Jun 21, 2022
@viathor viathor added triage/discuss Needs decision / discussion, bring these up during Cirq Cynque area/gates area/paulis labels Jun 22, 2022
@dabacon
Copy link
Collaborator Author

dabacon commented Jun 22, 2022

#5565 will fix this.

@tanujkhattar tanujkhattar removed the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gates area/paulis kind/bug-report Something doesn't seem to work.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants