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

Compare pauli matrices in commute using equality instead of is #2911

Merged
merged 4 commits into from
Apr 23, 2020

Conversation

tanujkhattar
Copy link
Collaborator

To fix #2813

@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Apr 15, 2020
Copy link
Collaborator

@viathor viathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two comments:

  1. Perhaps rather than making commutes work with multiple instances of each Pauli we could continue to use the single instance we have in Pauli._XYZ like we do in some other methods in the class.
  2. Could you add a test that captures the problem? It should fail before your change and succeed after it.

cirq/ops/pauli_gates.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@viathor viathor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my response to comment above.

@tanujkhattar
Copy link
Collaborator Author

Updated as per the suggestion. PTAL.

@tanujkhattar tanujkhattar merged commit 10fc655 into quantumlib:master Apr 23, 2020
@tanujkhattar tanujkhattar deleted the pauli-operator-commutes branch April 23, 2020 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pauli operator deserialization, and commutation checking
4 participants