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

Allow get_state to return state vector and results from mid-circuit measurement #2547

Open
1 task done
mawolf2023 opened this issue Jan 27, 2025 · 0 comments
Open
1 task done
Labels
enhancement New feature or request

Comments

@mawolf2023
Copy link
Contributor

Required prerequisites

  • Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.

Describe the feature

For use cases like magic state distillation, a user needs to use a kernel that performs mid-circuit measurement on some of the qubits and allows extraction of the the resulting state vector and the mid-circuit measurement results.

@cudaq.kernel
def kernel():
    reg=cudaq.qvector(2)

    a = mz(reg[1])



state, measurements = cudaq.get_state(kernel)  # Returns SV and list of mid-circuit measurements. 
   

This is used for QEC applications where the measurements are syndromes and determine if the resulting state is good or not, so both results need to be extracted from a single kernel execution.

PS: It would also be helpful if the SV that is returned is the dimension of the Hilbert space of the unmeasured qubits. This would allow easy computation of the overlap between this result and a noiseless state.

@mawolf2023 mawolf2023 added the enhancement New feature or request label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant