-
Notifications
You must be signed in to change notification settings - Fork 368
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 some missing snapshots #309
Add some missing snapshots #309
Conversation
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 a simple comment that would be great if we can address.
switch (type) { | ||
case SnapshotDataType::average: | ||
data.add_average_snapshot("expectation_value", op.string_params[0], | ||
BaseState::creg_.memory_hex(), expval, false); |
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.
What is the last true
and false
argument? I'd definitely put an enum here so I don't have to go the function definition to know what's this boolean means.
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.
hmmm no tests?
For tests we really need the instructions @kanejess and @merav-aharoni are working on in #300 |
* add stabilizer snapshot * add single-shot expectation values to statevector method
Summary
Adds three new snapshots:
Details and comments
The single shot expectation value take the same params as the other expectation value snapshots, but instead of returning the average value over shots they return the list of expectation values for each shot. These kind of snapshots are needed for quantum error correction simulations.
They are returned under the field
"expectation_values"
rather than"expectation_value"
.Example
Returns