-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix most numpy type errors in cirq/ops #3997
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
Conversation
Using `check/mypy --next | grep cirq/ops` this fixes almost all of the issues raised with simple modifications. There is a looming problem with places where we use `numbers.Complex`, which is a nice generalization for Union[int, float, complex] but does not play nice with numpy type information.
Automerge cancelled: A status check is failing. |
labels: Dict['cirq.Pauli', str] = { | ||
pauli_gates.X: 'X', | ||
pauli_gates.Y: 'Y', | ||
pauli_gates.Z: '@', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not relevant to this PR: I'm curious as to why this is @
instead of Z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it is to make the diagram resemble the standard quantum circuit symbol for controlled-Z.
Using
check/mypy --next | grep cirq/ops
this fixes almost all of the issues raised with simple modifications.There is a looming problem with places where we use
numbers.Complex
, which is a nice generalization for Union[int, float, complex] but does not play nice with numpy type information.Towards #3767