-
Notifications
You must be signed in to change notification settings - Fork 68
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
Add samples and variance support #46
Conversation
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
- Coverage 96.96% 90.48% -6.48%
==========================================
Files 8 9 +1
Lines 264 347 +83
==========================================
+ Hits 256 314 +58
- Misses 8 33 +25
Continue to review full report at Codecov.
|
if self.devices is None: | ||
return | ||
self.logTestName() | ||
# def test_basicaer_chop_threshold(self): |
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.
Is this test supposed to be commented out?
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.
A bit embarrassing, but I spent a good couple of hours attempting to debug this test, but (a) couldn't work out what it was supposed to do, and (b) couldn't work out why any of my changes broke it. I figured with your test refactor PR happening at the same time, we could replace it and then see what happened 😆
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
==========================================
- Coverage 96.96% 90.48% -6.48%
==========================================
Files 8 9 +1
Lines 264 347 +83
==========================================
+ Hits 256 314 +58
- Misses 8 33 +25
Continue to review full report at Codecov.
|
The last PR to get the Qiskit plugin up to feature parity with the latest PennyLane. This PR adds the following:
Support for sampling. If a hardware device, the keyword argument
memory=True
is passed to the executor to force Qiskit to return raw sampling data. If a state simulator, sampling data is generated from the statevector probabilities by doing a spectral decomposition of the observable.Support for variance. On hardware devices, this is done by simply taking the variance of the samples generated via probability distributions. On state simulators, this is done by doing either (a) doing an inner product directly, or (b) if shots > 0, taking the variance of the samples.
Speed up expectation value calculations on state simulators. Previously, all state simulators were treated as hardware devices. Now, the expectation value is calculated using the same approach as variance: (a) doing an inner product directly, or (b) if shots > 0, taking the mean of the samples.
This PR addresses #42