-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Modularize DDD functionality #2610
Conversation
@natestemen Do you think the second function |
On the community call, it was agreed that the second function is important for consistency with ZNE and PEC. Also, I changed |
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.
LGTM! Left one comment, and my only other hold-up was thinking generate_circuits_with_ddd
is a bit of a mouthful, but I can't think of a better name!
mitiq/ddd/tests/test_ddd.py
Outdated
@@ -226,3 +231,14 @@ def exec_xx_small_spacing(circuit): | |||
# What is important to test is getting different results. | |||
assert not np.isclose(unmitigated, mitigated_small_spacing) | |||
assert not np.isclose(mitigated_large_spacing, mitigated_small_spacing) | |||
|
|||
|
|||
@mark.parametrize("num_trials", [1, 3, 5]) |
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.
Since this test should be fast (correct me if i'm wrong) can we add a few more trials? Say up to 30?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2610 +/- ##
=======================================
Coverage 98.73% 98.73%
=======================================
Files 92 92
Lines 4176 4198 +22
=======================================
+ Hits 4123 4145 +22
Misses 53 53 ☔ View full report in Codecov by Sentry. |
Going to merge before CI passes. I ran the new test locally and it looks good! |
Description
This PR introduces two functions
generate_circuits_with_ddd
generate_ddd_value
for generating circuits with DDD sequences and using the results from running those circuits to get an expectation value. The first function moves generating the circuits outside of
execute_with_ddd
, allowing users to generate and return DDD circuits.The second function takes the results from all of the DDD circuits used in
execute_with_ddd
and averages the results to produce a single expectation value (float) that is returned.fixes #2562