-
Notifications
You must be signed in to change notification settings - Fork 12
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
Enable multi circuit submission in PennyLane IonQ, second attempt. #121
Enable multi circuit submission in PennyLane IonQ, second attempt. #121
Conversation
…into multi-circuit-submission-2
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## multi-circuit-submission #121 +/- ##
============================================================
- Coverage 96.93% 91.73% -5.21%
============================================================
Files 5 5
Lines 326 387 +61
============================================================
+ Hits 316 355 +39
- Misses 10 32 +22 ☔ View full report in Codecov by Sentry. |
Hi @radumarg , thank you for opening this new PR. @lillian542 will be reviewing it this week. In the meantime, could you please take a look at the formatting checks (black), CodeFactor, and codecov, as they’re currently not passing? |
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.
Thanks for the submission, and for making the changes requested on the last PR! 🚀 This looks like a very useful addition to the plugin. I’ve left some initial feedback and suggestions, have a look and see what you think!
Wrt the tests, the CodeCov bot has indicated all the uncovered lines, and ideally let’s go for full test coverage - but there are some places that I would say are more significant than others. I’ve commented on a few spots where I think it’s particularly important we add more comprehensive tests (i.e. more thorough than just what will satisfy CodeCov in terms of line coverage).
I’ll give it another pass once comments are addressed and the test coverage is more complete :)
…nto multi-circuit-submission-2
…arg/PennyLane-IonQ into multi-circuit-submission-2
@lillian542 The rework is complete. Review comments were implemented, tests were extended, black and code factor issues were fixed. Can you please make sure tests with requires_api flag are included in test code coverage? Those tests need an IonQ API key in the test virtual environment in order to run. Note that using this is not my invention, I just took as an example some pre-existing testing code :) |
Thanks @radumarg! I'll get started on another 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.
Looking good 🎉 I left a couple more comments. At this point I'll find a second reviewer to have a look - we generally aim for 2 approvals for PRs adding new functionality.
@lillian542 Thanks for reviewing this change. I left a few questions regarding the latest set of comments. Please have a look. Also I see that black formatter is failing but I am not sure why. When I run it locally it passes, I am not sure with what arguments is being run during integration tests. |
@radumarg, when I run |
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.
Looks good. I mostly just suggested minor formatting/docs fixes. I agree with @lillian542 's comment about the generation of samples inside the estimate_probability
and sample
methods. We've resolved this concern for devices using the new API, but it would be a breaking change to use the current behaviour as per the old device API. For me, that is a blocker for an approval.
Other than that, the PR looks quite complete. The tests are very thorough. I'm happy to approve once the above comment and the test failures are resolved 🚀
@lillian542 and @mudit2812 Review comments were implemented as requested. I have added requires_api to failing tests, hopefully this time the test will pass. |
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.
Looks like all the tests are passing now 😄 . I'm quite happy with the state of this PR, and am ready to approve once code coverage is fixed. We can ignore the coverage issue for the logger.debug
line by adding a # pragma: no cover
to that line.
…these are not supported by IonQ devices.
@mudit2812 I have added the pragma as suggested. Also, I have removed checks for BasisState, QubitStateVector and StatePrep because these operations are not supported by IonQ devices so there is no way to test those lines. Regarding the code coverage: this now should be complete, however the code coverage tool does not take into account tests with requires_api which require an IonQ API key in order to run. For example the code lines under "if self.tracker.active" are reported as uncovered but those lines are covered by this test: test_recording_when_pennylane_tracker_active The same applies for other code lines reported as uncovered. |
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.
Thanks, I'm approving, and I've reached out to the rest of the team to figure out the best strategy to address the coverage issues.
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.
Thanks for all your work here, this looks good! The tests aren’t running with the API token because this is on a fork of the repo - we’ll merge it to a new branch on the main repo to get those running.
I'm approving this before merging, it looks like everything is in order to me. If any issues come up once all the tests run, we’ll let you know; we can merge these changes to master
as soon as the tests are passing with the API token on the new branch :)
255a212
into
PennyLaneAI:multi-circuit-submission
) (#124) * Adding code for batch circuit submit. * Remove unused imports. * Update version number. * Initialize self._samples in overloaded methods. * Various fixes. * Running existing unit tests from previous implementation and fixing bugs. * Correct unit test after updating pennylane baseline code to latest version. * Fix codefactor issues. * Run black code formatter. * Shots cannot be none in an IonQDevice. Remove check on shots. * Correct docstring comment. * Remove exeception handling code. * Remove self.histogram, replace with self.histograms. * Uniformize treatment of one vs multiple circuits. * Improve current_circuit_index handling with raising exceptions, add tests. * Reset samples in reset function. * Run black code formatter. * Remove unused includes. * Fix codefactor reported issues. * Adding doc string to method. * Fix docstring. * Add test with shot vector. * Add test with an observable that requires rotations for diagonalization. * Adding unit tests for using pennylane tracker in batch_execute method. Adding unit tests for user warnings. * Add tests for logging in batch_execute. * Run black. * Remove method override. * Implement review comments.' * Implement more review comments.' * Remove unused imports. * Remove unused imports. * Remove checks for BasisState, QubitStateVector and StatePrep because these are not supported by IonQ devices. * Fix code formatting. --------- Co-authored-by: Radu Marginean <[email protected]> Co-authored-by: Alex Preciado <[email protected]>
Thanks, please let me know in case more tests will be necessary. |
Enable multi circuit submission. This is a second attempt to implement this functionality because the first implementation involved a lot of code duplication with respect to the PennyLane baseline code.