-
Notifications
You must be signed in to change notification settings - Fork 1k
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.MutablePauliString
supports identity gates but cirq.PauliString
doesn't, which leads to inconsistencies
#5572
Comments
cirq.MutablePauliString
supports identity gates but cirq.PauliString
doesn'tcirq.MutablePauliString
supports identity gates but cirq.PauliString
doesn't, which leads to inconsistencies
Also, I see that |
Operations are hashable, mutable things aren't hashable, so a mutable thing can't be an operation. No strong opinion on keeping or removing the identities but my default expectation would be that they were removed. Do some tests fail if they're removed? |
I don't remember why we had a mutable version of PauliString. Was it just convenience? |
Also, since it's not an operation, can we make it a private class? |
@tanujkhattar It used to be private: #3299 |
Description of the issue
cirq.MutablePauliString
seems to support identity gates (for example: when passed inpauli_int_dict
parameter). The type annotations on on methods like.values()
and.items()
also have aUnion[Pauli, IdentityGate]
.This is bad because
cirq.PauliString
does not support identity gates and hence this leads to inconsistencies between the mutable vs the non-mutable version.How to reproduce the issue
Cirq version
0.15dev
The text was updated successfully, but these errors were encountered: