-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
Allow for Executor class and batched Executors for LRE #2676
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2676 +/- ##
=======================================
Coverage 98.74% 98.74%
=======================================
Files 93 93
Lines 4219 4223 +4
=======================================
+ Hits 4166 4170 +4
Misses 53 53 ☔ View full report in Codecov by Sentry. |
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.
Great work!
A suggestion for the tests: we should steer away from testing accuracy in the tests. This type of test often leads to non-deterministic behavior which causes spurious failures. I'd recommend two different tests instead:
- Ensure the
evaluate
method has been called$n$ times on theExecutor
object when the executor cannot batch, and there are$n$ circuits to run. - Ensure the
evaluate
method is only called once when the executor can batch.
WDYT?
num_chunks, | ||
) | ||
executor_obj = Executor(executor) | ||
if not executor_obj.can_batch: |
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 know this is the pattern we have in zne/zne.py
, but I think it's more readable to have
if executor_obj.can_batch:
...
else:
# cannot batch
@natestemen I like your idea for the tests. Unfortunately, for testing |
Fixes #2668
Fixes #2675
This PR updates the LRE technique to allow for Executor class objects to be passed in to
execute_with_lre
. Along with that update, there is also an update to allow for a batched executor.License
Before opening the PR, please ensure you have completed the following where appropriate.