Skip to content
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

New cudaq::sample option: explicit measurements #2567

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

bmhowe23
Copy link
Collaborator

@bmhowe23 bmhowe23 commented Jan 31, 2025

Draft for now ... kicking the CI tires. This also needs spec review/approval before being merged.

This PR introduces a new sample_options parameter called explicit_measurements. When this new option is selected, the behavior of the global register in the sample_result is changed. Rather than retaining a single measurement of the final "state" of each qubit in the system, this new option instructs the runtime to record all qubit measurements into the global register ... effectively "stacking" all measurements together.

While this change is supported by all simulators, the motivating factor for the change is that this will enable more efficient simulation when using Stim simulator for circuits containing mid-circuit measurements (as long as those mid-circuit measurements do not influence later gate sequences). Prior to this change, if one wanted to generically extract mid-circuit measurements out of the kernel, they would have to avoid using the cudaq::sample API.

TODO

  • Finish spec, get approval
  • Error handling (precisely what an error is needs to be called out in the spec)
  • Add error-handling tests
  • Create Python tests
  • If time, update hardware backends; if no time, throw "unsupported" error message
  • Update docs

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 Jan 31, 2025
@bmhowe23 bmhowe23 changed the title New cudaq::sample option: stacked measurements New cudaq::sample option: explicit measurements Feb 5, 2025
@bmhowe23 bmhowe23 force-pushed the pr-stack-measurements branch from 5cfc41f to e6d3bda Compare February 5, 2025 04:54
github-actions bot pushed a commit that referenced this pull request Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

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

Copy link

github-actions bot commented Feb 6, 2025

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

github-actions bot pushed a commit that referenced this pull request Feb 6, 2025
github-actions bot pushed a commit that referenced this pull request Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

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

@khalatepradnya khalatepradnya self-assigned this Feb 7, 2025
Copy link

github-actions bot commented Feb 7, 2025

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

github-actions bot pushed a commit that referenced this pull request Feb 7, 2025
* Run test on all available simulator targets

Signed-off-by: Pradnya Khalate <[email protected]>
Copy link

github-actions bot commented Feb 7, 2025

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

github-actions bot pushed a commit that referenced this pull request Feb 7, 2025
khalatepradnya and others added 2 commits February 7, 2025 16:09
…onal logic

* Simple Python test added
* TODO:  Add C++ test(s)

Signed-off-by: Pradnya Khalate <[email protected]>
Copy link

github-actions bot commented Feb 8, 2025

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

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

github-actions bot commented Feb 8, 2025

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

github-actions bot pushed a commit that referenced this pull request Feb 8, 2025
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.

2 participants