-
Notifications
You must be signed in to change notification settings - Fork 355
Access state vector from kernel #4214
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Required prerequisites
- Search the issue tracker to check if your feature has already been mentioned or rejected in other issues.
Describe the feature
For some operations, it's useful to access the state vector directly from the kernel.
For example, when the user has an 8-qubit register, and wants to peek at the probability of that register having the value 100.
In our tools, this is done via my_qreg.peek_read_probability(100)
We provide this feature, and it's working, but for CUDA-Q simulation back-end it's slow and sometimes causes RAM errors. Currently, the way we're accessing the state vector is via numpy.array(cudaq.get_state(kernel)), which (if we're simulating a 34-qubit QPU) makes a 256 GB numpy array in CPU RAM, and then inspecting it takes some time.
Is there already a way to inspect the state vector in-place? If it already exists, any guidance is appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request