-
Notifications
You must be signed in to change notification settings - Fork 342
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
Remove requirements used for RAM-style sampling #874
Conversation
tests are unhappy |
@ecpeterson I had to modify read_memory, and did so by guessing at your intention; I'm concerned that I don't see any use of I think that the behavior of pyqvm.run is now consistent with qvm.run. I see the appeal of adding |
The |
I'm going to rebase this onto the current master; I think the parser changes that have happened in the meantime are why pytest is balking. |
5d42ba9
to
131cbcd
Compare
@ecpeterson and @kylegulshen it looks good, and if merged it will help resolve some issues/errors in some of our benchmarking code :) I see you want to have both options i.e. re-include |
I don't have any preference about the ultimate fate of |
sorry @notmgsk I was trying to re request a review. |
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.
As usual, I am useless for reviewing semantics, but my nitpick game is on point.
131cbcd
to
199e4e7
Compare
be15890
to
ea30211
Compare
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.
My nits have been picked, so I'll approve.
Was the previous "sampled bitstrings" version more efficient but otherwise equivalent for "run and measure" style programs? If so, would it make sense to just check and see if you have "run and measure" style program and use the sampled-bitstrings method if possible, otherwise fallback to this new version? Apologies in advance if I have completely missed the point :-)
Hmm, reviewing the PR conversation thread, it seems like adding "run and measure" style behavior back might happen in a follow-on PR, which sounds reasonable to me.
You haven't missed the point, that's definitely a desirable thing to do—people might even be displeased with a slower measurement scheme being the default. (I prefer robust to fast, but what can you do?) It is my intention to go back and add some 'if we never did anything r_a_m-illegal, then...' logic in a future PR. |
ea30211
to
fcd2a93
Compare
In #874, PyQVM was changed to remove the restriction for run-and-measure style programs. In the process, PyQVM.execute lost the ability to execute programs with user defined gates, which apparently broke pennylane-forest's PyQVM support. This commit re-instates the block of code for extracting defined_gates from the Program passed to PyQVM.execute, and with it the ability to execute Programs with (non-parametric) defgates. Fixes #1059 See also: PennyLaneAI/pennylane-rigetti#22
In #874, PyQVM was changed to remove the restriction for run-and-measure style programs. In the process, PyQVM.execute lost the ability to execute programs with user defined gates, which apparently broke pennylane-forest's PyQVM support. This commit reinstates the block of code for extracting defined_gates from the Program passed to PyQVM.execute, and with it the ability to execute Programs with (non-parametric) defgates. Fixes #1059 See also: PennyLaneAI/pennylane-rigetti#22
This PR removes the requirements enforced in PyQVM that let it always do efficient
run_and_measure
-style sampling of bitstrings.On reflection, it might be desirable to offer a separate pathway that does do
run_and_measure
-style sampling, rather than remove it outright. I'll return to this before making this a real PR.