Skip to content

Conversation

@khalatepradnya
Copy link
Collaborator

This PR introduces explicit detection and propagation of measurement operations within quantum kernels and enforces new restrictions and warnings when using the sample API with kernels that contain explicit measurements.

  • Added a hasMeasurements flag to the QuakeMetadata struct and logic to detect measurement operations in MLIR passes, setting the hasMeasurements attribute on functions when found.
  • Updated the metadata propagation pass to propagate both qubitMeasurementFeedback and hasMeasurements attributes through the call graph.
  • Introduced a hasMeasurements attribute to Python kernel builders, setting it whenever an explicit measurement (mz, mx, or my) is performed.
  • Updated the runtime and sampling logic in both Python and C++ to check for the presence of explicit measurements in kernels, raising errors on hardware targets and warning on simulators.
  • Figure out proper handling for explicit_measurements option.

@khalatepradnya khalatepradnya added the breaking change Change breaks backwards compatibility label Nov 19, 2025
no explicit measurement operation allowed.
For simulators, issue a warning.

Signed-off-by: Pradnya Khalate <[email protected]>
github-actions bot pushed a commit that referenced this pull request Nov 19, 2025
@github-actions
Copy link

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

breaking change Change breaks backwards compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant