Python objects & constants¶
Objects¶
A wrapper class holding a set of data transfer parameters. |
|
NumPy dtype object that represents the |
Enums and constants¶
|
See |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Python functions¶
Library Management¶
Handle Management API¶
|
This function initializes the cuStateVec library and creates a handle on the cuStateVec context. |
|
This function releases resources used by the cuStateVec library. |
|
This function returns the default workspace size defined by the cuStateVec library. |
|
This function sets the workspace used by the cuStateVec library. |
CUDA Stream Management API¶
|
This function sets the stream to be used by the cuStateVec library to execute its routine. |
|
This function gets the cuStateVec library stream used to execute all calls from the cuStateVec library functions. |
Logger API¶
|
Set the logger callback along with arguments. |
|
Experimental: This function opens a logging output file in the given path. |
|
Experimental: This function sets the value of the logging level. |
|
Experimental: This function sets the value of the logging mask. |
Experimental: This function disables logging for the entire run. |
Memory Management API¶
|
Set the device memory handler for cuStateVec. |
|
Get the device memory handler for cuStateVec. |
Versioning API¶
|
This function returns the version information of the cuStateVec library. |
This function returns the version information of the cuStateVec library. |
State Vector Initialization¶
|
Initialize the state vector to a certain form. |
Gate Application¶
General Matrices¶
This function gets the required workspace size for |
|
|
Apply gate matrix. |
This function gets the required workspace size for |
|
|
This function applies one gate matrix to each one of a set of batched state vectors. |
Pauli Matrices¶
|
Apply the exponential of a multi-qubit Pauli operator. |
Generalized Permutation Matrices¶
|
Get the extra workspace size required by |
Apply generalized permutation matrix. |
Measurement¶
Measurement on Z-bases¶
|
Calculates the sum of squared absolute values on a given Z product basis. |
|
Collapse state vector on a given Z product basis. |
|
Measurement on a given Z-product basis. |
Qubit Measurement¶
|
Calculate abs2sum array for a given set of index bits. |
|
Collapse state vector to the state specified by a given bit string. |
|
Batched single qubit measurement. |
|
Calculate batched abs2sum array for a given set of index bits. |
This function gets the required workspace size for |
|
Collapse the batched state vectors to the state specified by a given bit string. |
|
|
Single qubit measurements for batched state vectors. |
|
Batched single qubit measurement for partial vector. |
Expectation¶
Expectation via a Matrix¶
This function gets the required workspace size for |
|
|
Compute expectation of matrix observable. |
This function gets the required workspace size for |
|
|
Compute the expectation values of matrix observables for each of the batched state vectors. |
Expectation on Pauli Basis¶
Calculate expectation values for a batch of (multi-qubit) Pauli operators. |
Sampling¶
|
Create sampler descriptor. |
|
This function releases resources used by the sampler. |
|
Preprocess the state vector for preparation of sampling. |
|
Sample bit strings from the state vector. |
|
Get the squared norm of the state vector. |
|
Apply the partial norm and norm to the state vector to the sample descriptor. |
Accessor¶
|
Create accessor to copy elements between the state vector and an external buffer. |
|
Create accessor for the constant state vector. |
|
This function releases resources used by the accessor. |
Set the external workspace to the accessor. |
|
|
Copy state vector elements to an external buffer. |
|
Set state vector elements from an external buffer. |
Single-process qubit reordering¶
|
Swap index bits and reorder statevector elements on the device. |
|
Swap index bits and reorder statevector elements on multiple devices. |
Multi-process qubit reordering¶
|
Create communicator. |
|
This function releases communicator. |
Create distributed index bit swap scheduler. |
|
This function releases distributed index bit swap scheduler. |
|
Schedule the index bits to be swapped across processes. |
|
Get the data transfer parameters from the scheduler. |
|
|
Create state vector swap worker. |
|
This function releases the state vector swap worker. |
Set extra workspace. |
|
Set transfer workspace. |
|
Set sub state vector pointers accessible via GPUDirect P2P. |
|
Set data transfer parameters for the distributed sub statevector swap workers. |
|
|
Execute the data transfer. |
Sub state vector migration¶
|
Create sub state vector migrator descriptor. |
|
Destroy sub state vector migrator descriptor. |
|
Sub state vector migration. |
Test gate matrix type¶
Get extra workspace size for |
|
|
Test the deviation of a given matrix from a Hermitian (or Unitary) matrix. |