Skip to content

Reconstruct probabilities - #63

Merged
JooNiv merged 27 commits into
mainfrom
reconstruct_probabilities
Aug 29, 2026
Merged

Reconstruct probabilities#63
JooNiv merged 27 commits into
mainfrom
reconstruct_probabilities

Conversation

@JooNiv

@JooNiv JooNiv commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Description

Version 2.1.0

Reconstructing a probability distribution

  • get_experiment_circuits() takes qubits in place of
    observables, and estimate_probabilities() then reconstructs the
    distribution over those qubits by an inverse Walsh-Hadamard transform. Costs
    2**k observables but no extra circuits, since they share one measurement
    setting.
    See the derivation: https://jooniv.github.io/QCut/theory/Probability_reconstruction.html.
  • The result is a dict of 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.
  • A circuit carrying final measurements can be cut. They are removed on a copy, so the
    circuit passed in is left as it was.
  • RawResult.shots and CutExperiment.can_reconstruct_probabilities are
    public, 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:

  • I have tested my changes locally and they work as expected.
    • For changes that should be backwards compatible to older Qiskit versions run tox in addition to pytest tests ran by CI
  • I have added/updated relevant documentation (if applicable).
  • I have formatted my code using the project’s coding style or linter.
  • I have added tests that prove my fix is effective or my feature works (if applicable).
  • All new and existing tests pass.
  • My code follows the CONTRIBUTING.md guidelines.

@JooNiv
JooNiv merged commit dd4efd7 into main Aug 29, 2026
10 checks passed
@JooNiv
JooNiv deleted the reconstruct_probabilities branch August 29, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant