Skip to content

[ Feature ] Post-selected measurement #239

Open

Description

@jon-wurtz

Given a generalized tableau, there is an existing feature

GeneralizedTableau.measure(index:int)->MeasurementResult

that lets one measure a qubit and project/mutate it to a new state given the MeasurementResult. The selection on which outcome to choose is based on internal RNG.

It would be useful to invert this to post-select and project on a set measurement, e.g. a signature

GeneralizedTableau.project(index:int, value:MeasurementResult) -> float

where the value is what is projected to, the return is the probability of being projected to that state, and the state is mutated to a new state given the MeasurementResult.

From what Claude and I can understand, this is exposed in Rust but not in Python. I can compute the probability via the expectation value of Z, but I cannot project. Instead, that requires GeneralizedTableau.fork and repeat until success, which admittedly feels a little hacky.

While non-physical, this would be super useful for modeling the action of stochastic programs as well as computing marginal bitstring probabilities $P(z) = |\langle \psi |z\rangle|^2$ through the chain rule. I have a use case that requires this marginal probability not to be mentioned in open source 😉.

Activity

  1. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    👋 Thanks for opening your first issue against PPVM!

    A maintainer will take a look soon. To help us resolve it
    faster, please include:

    • A minimal reproducer (Rust or Python code that triggers
      the behavior).
    • The PPVM version (commit SHA or release tag).
    • What you expected vs. what happened.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: featureCategory: new feature or feature request.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions