Skip to content

Add ability to create a measurement matrix from a Clifford-only kernel #2919

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

bmhowe23
Copy link
Collaborator

@bmhowe23 bmhowe23 commented May 15, 2025

This PR adds the ability to create a noise-aware measurement matrix. Each row of the matrix corresponds to a measurement in the kernel, and each column of the matrix corresponds to a particular error (noise) mechanism. Each entry in the matrix tells you whether a particular measurement (row) would flip if a particular error (column) happened. This is implemented using Stim's stim::FrameSimulator C++ API to keep track of what would flip and what would not, depending on the circuit.

As currently written, this is only supported via our C++ API.

Summary of changes:

  • Add 2 optional entries into the cudaq::ExecutionContext structure.
  • Add 2 new execution context names ("pcm_size" and "pcm") from which the Stim simulator will recognize and process accordingly. (runtime/nvqir/CircuitSimulator.h had to be updated to recognize these as well.)
    • The "pcm_size" needs to be run first to count the number of measurements and error mechanisms in a circuit. The "pcm" version is run right after that to populate the matrix. (See test for details.)

Todo:

  • Add a bit more validation to the tests (done)

github-actions bot pushed a commit that referenced this pull request May 15, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request May 15, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request May 16, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@sacpis sacpis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments.

github-actions bot pushed a commit that referenced this pull request May 19, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Collaborator

@schweitzpgi schweitzpgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -117,6 +117,13 @@ class ExecutionContext {
/// order.
bool explicitMeasurements = false;

/// @brief Probability of occurrence of each error mechanism (column) in PCM
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some offline discussions with @justinlietz, I'm going to rename the "PCM" references to "MSM" (Measurement Syndrome Matrix), per https://arxiv.org/pdf/2407.13826

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed in 8cc4d61

bmhowe23 and others added 2 commits May 20, 2025 22:11
For accuracy in names, use Measurement Syndrome Matrix instead of Parity
Check Matrix.

Reference: https://arxiv.org/pdf/2407.13826

Signed-off-by: Ben Howe <[email protected]>
github-actions bot pushed a commit that referenced this pull request May 21, 2025
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Jun 4, 2025
Copy link

github-actions bot commented Jun 4, 2025

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

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.

4 participants