Skip to content

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

Merged
merged 4 commits into from
Apr 8, 2021

Conversation

mpharrigan
Copy link
Collaborator

@mpharrigan mpharrigan commented Apr 6, 2021

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

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.
@mpharrigan mpharrigan requested a review from maffoo April 6, 2021 16:27
@mpharrigan mpharrigan requested review from cduck, vtomole and a team as code owners April 6, 2021 16:27
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Apr 6, 2021
@mpharrigan mpharrigan added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Apr 7, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Apr 7, 2021
@CirqBot
Copy link
Collaborator

CirqBot commented Apr 7, 2021

Automerge cancelled: A status check is failing.

@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Apr 7, 2021
labels: Dict['cirq.Pauli', str] = {
pauli_gates.X: 'X',
pauli_gates.Y: 'Y',
pauli_gates.Z: '@',
Copy link
Collaborator

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

Copy link
Collaborator

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.

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Apr 8, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Apr 8, 2021
@CirqBot CirqBot merged commit 259dd91 into quantumlib:master Apr 8, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/numpy cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants