Reconstruct probabilities - #63
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Version 2.1.0
Reconstructing a probability distribution
get_experiment_circuits()takesqubitsin place ofobservables, andestimate_probabilities()then reconstructs thedistribution over those qubits by an inverse Walsh-Hadamard transform. Costs
2**kobservables but no extra circuits, since they share one measurementsetting.
See the derivation: https://jooniv.github.io/QCut/theory/Probability_reconstruction.html.
dictof quasi-probabilities, which can be negative.:code:
nearest_probabilities()gives the closest true distribution and:code:
counts()scales it by the shots the experiment ran at, or by one of your own.circuit passed in is left as it was.
RawResult.shotsandCutExperiment.can_reconstruct_probabilitiesarepublic, and the types the public functions return are importable from
QCut.Type of Change
Please check the type(s) of changes made in this PR:
Bug Fix (non-breaking change that fixes an issue)
New Feature (non-breaking change that adds functionality)
Breaking Change (fix or feature that would cause existing functionality to not work as expected)
Documentation Update (adds or updates documentation)
Refactor (code restructuring without changing external behaviour)
Other (please specify):
For non-breaking changes remember to run
toxto test against older qiskit versions.Checklist
Please check all relevant boxes to ensure your pull request is ready for review:
toxin addition to pytest tests ran by CI