-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Refactor classical postprocessing in shadows module #2152
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
+ Coverage 98.20% 98.26% +0.06%
==========================================
Files 88 88
Lines 4167 4143 -24
==========================================
- Hits 4092 4071 -21
+ Misses 75 72 -3 ☔ View full report in Codecov by Sentry. |
this is consistent with how we do it in other parts of the codebase
use optional fidelities instead
4c38a82
to
caf8971
Compare
ebae19d
to
b757043
Compare
i misunderstood how `np.array_split` worked. it uses the number of splits, as opposed to the size of each batch. (-1)^x + (-1)^y =/= (-1)^(x + y)
d32a301
to
dd61f23
Compare
@Min-Li, we noticed some slight differences in the plots after the re-factor. Is this a concern, or do you think the module is working fine? |
Hi Nate, I had a look at your PR today by going over the commits and it looks good to me! The only concern is the very small difference in the first plots you show, but that might be some randomness that is not fixed. |
Any idea where that change could be coming from? I have not been able to find it. |
looking at the shadows_tutorial notebook, the seed is fixed, and you didn't change that. So maybe that is not the cause. |
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, not much to add besides the insignificant differences in the plot in the tutorial notebook.
Looks good to me, since there are some changes in the code, for me, this slight change of the figure seems to result from adding/removing stages of random sampling (especially in the quantum measurement). But overall, I don't think there are any issues here. |
Description
PR to refactor
mitiq/shadows/classical_postprocessing.py
.Addresses some issues raised in #2129
Docs
Despite there being tests for the shadows module, as we saw in #2113 the tests do not cover everything and a change can pass tests despite making drastic changes to the results in a tutorial.
Note there is a slight difference in the above plot. I'm not totally sure why.
All the other plots that I checked look either identical, or very close.