Create read only simulation state vector #6248
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This class provides a limited set of functionalities provided by simulation state vector classes and bypasses the numpy limit on the number of dimensions numpy/numpy#5744 by not reshaping the array.
This class will be used as the return result for qsim simulator which will store the 1D numpy array representation of the simulation result without reshaping it. This is inorder to mitigate #6031
The user of qsim simulator will choose through a parameter whether they want the current behaviour or to use the new one.
Users can convert objects of this class to the buffered version using
to_mutable_state
which will only succeed if the number of qubits is less than or equal to the dimension limit of numpy (currently 32)