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

Improve type safety with generics on simulators #3818

Merged
merged 10 commits into from
Feb 18, 2021

Conversation

daxfohl
Copy link
Contributor

@daxfohl daxfohl commented Feb 17, 2021

No description provided.

@daxfohl daxfohl requested review from cduck, mrwojtek, vtomole, wcourtney and a team as code owners February 17, 2021 16:18
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Feb 17, 2021
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

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

We've had some complaints about unclear simulator result types in the past - this should go a long way towards resolving those! Just a couple comments.

cirq/sim/simulator.py Outdated Show resolved Hide resolved
cirq/experiments/xeb_simulation.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

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

One final item to check: how does this interact with external simulators? e.g. will qsim.QSimSimulator break when this change is released, or can it remain a typeless SimulatesFinalState without issue?

cirq/experiments/xeb_simulation.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@95-martin-orion 95-martin-orion left a comment

Choose a reason for hiding this comment

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

Thanks for going the extra mile to verify - this is good to go!

@95-martin-orion 95-martin-orion added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Feb 17, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Feb 17, 2021
@CirqBot CirqBot merged commit 7b2abd8 into quantumlib:master Feb 18, 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 Feb 18, 2021
@daxfohl daxfohl deleted the generics branch February 18, 2021 01:47
@mpharrigan
Copy link
Collaborator

I think there are some open issues complaining about some of these things? Can you find them and see if this addresses them?

@daxfohl
Copy link
Contributor Author

daxfohl commented Feb 19, 2021

@mpharrigan There was only #554 about the general problem from a while ago. Added a link there but there's still more work to be done before closing that particular issue. There are some other open type issues around gates and operations, parameters, and such but I didn't see any open issues referring specifically to simulators.

@mpharrigan
Copy link
Collaborator

Does this PR address #2413?

@daxfohl
Copy link
Contributor Author

daxfohl commented Feb 19, 2021 via email

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.

5 participants