-
Notifications
You must be signed in to change notification settings - Fork 147
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
[RFC] Improve the internal data implementation for cudaq::state #1107
Comments
|
Good point. How would you cover those cases? Maybe have another overload that takes the computational basis state as a string? What would be best for those types of backends? |
We may consider an 'overcomplete' representation ( An additional state accessor API for consideration:
Rationale: block-access to a contiguous section of the state-vector, e.g., In cases where we cannot reconstruct the full state vector, we can use this type of masking API to get sub state vector. Doing this masking with an explicit list of indices is not efficient. |
Missing in the above write-up of tasks are the necessary compiler passes to support this on quantum backends (discussed offline). |
Background
Currently, state just wraps a tuple containing the shape of the state data and a vector to the state data. This is sub-optimal because it forces the creation of copies, especially for state vector data managed by the GPU.
We need to rethink the internal data representation for
cudaq::state
to remove this tuple and replace with a new data type specific to simulation backends (i.e. some interface that backend simulators must implement) that allowscudaq::state
to track the state data in a backend-native manner, i.e. holding the GPU device pointer.Proposal
This RFC introduces the following new types and type changes:
Concrete CircuitSimulators are then responsible for subclassing
SimulationState
and returning as a pointer.Examples
TODO
Before merging to
main
:SimulationState impls for tensornet, tensornet-mps, mgpu
getAmplitude implementations
overlap() and amplitude() API functions
Cloud support for overlap() and amplitude() ([StateHandling] State API for remote platforms #1653)
from_data for multiple tensors (Create MPS Simulation State from Tensors #1711)
std::vector/numpy array qvector initialization
cudaq::state qvector initialization
kernel_builder
mode (Add C++kernel_builder::qalloc(state&)
#1722)qvector initialization for hardware backends (@1tnguyen: output error messages)
Post merging to main
The text was updated successfully, but these errors were encountered: