cuStateVec Data Types¶
Opaque Data Structures¶
custatevecIndex_t¶
ThecustatevecIndex_tmust be used for state vector indices in some operations.
custatevecHandle_t¶
ThecustatevecHandle_tstructure holds the cuStateVec library context (device properties, system information, etc.).The handle must be initialized and destroyed with custatevecCreate() and custatevecDestroy() functions respectively.
custatevecSamplerDescriptor_t¶
ThecustatevecSamplerDescriptor_tstructure captures the context of the sampling operation.It is initialized with custatevecSampler_create().
custatevecLoggerCallback_t¶
ThecustatevecLoggerCallback_tis a callback function pointer type.custatevecLoggerSetCallback() is used to set the callback function.Logging levels are defined as follows:
“0” - Off - logging is disabled (default)
“1” - Error - only errors will be logged
“2” - Trace - API calls that launch CUDA kernels will log their parameters and important information
“3” - Hints - hints that can potentially improve the application’s performance
“4” - Info - provides general information about the library execution, may contain details about heuristic status
“5” - API Trace - API calls will log their parameter and important information
Parameter |
Input/Output |
Description |
|---|---|---|
logLevel |
Output |
The log level. |
functionName |
Output |
The name of the API that logged this message. |
message |
Output |
The log message. |
Enumerators¶
custatevecStatus_t¶
ThecustatevecStatus_tenumerator specifies the library status. Each cuStateVec API returns this enumerator.
Value |
Description |
|---|---|
|
The API call has finished successfully. |
|
The library handle was not initialized. |
|
Memory allocation in the library was failed. |
|
Wrong parameter was passed. For example, a null pointer as input data, or an invalid enum value. |
|
The device capabilities are not enough for the set of input parameters provided. |
|
Error during the execution of the device tasks. |
|
Unknown error occured in the library. |
|
API is not supported by the backend. |
|
Workspace on device is too small to execute. |
|
Sampler was called prior to preprocessing. |
custatevecPauli_t¶
ThecustatevecPauli_tenumerator specifies Pauli basis:\(\boldsymbol{\sigma}_0 = \mathbf{I} = \left[ \begin{array}{rr} 1 & 0 \\ 0 & 1 \end{array}\right]\), \(\boldsymbol{\sigma}_x = \left[ \begin{array}{rr} 0 & 1 \\ 1 & 0 \end{array}\right]\), \(\boldsymbol{\sigma}_y = \left[ \begin{array}{rr} 0 & -i \\ i & 0 \end{array}\right]\), \(\boldsymbol{\sigma}_z = \left[ \begin{array}{rr} 1 & 0 \\ 0 & -1 \end{array}\right]\),
Value |
Description |
|---|---|
|
the Identity matrix or the zeroth Pauli matrix |
|
the Pauli-X matrix \(\boldsymbol{\sigma}_x\) |
|
the Pauli-Y matrix \(\boldsymbol{\sigma}_y\) |
|
the Pauli-Z matrix \(\boldsymbol{\sigma}_z\) |
custatevecMatrixLayout_t¶
ThecustatevecMatrixLayout_tenumerator specifies the information of matrix memory layout.
Value |
Description |
|---|---|
|
Matrix components are stored in column-major ordering |
|
Matrix components are stored in row-major ordering |
custatevecMatrixType_t¶
ThecustatevecMatrixType_tenumerator specifies the specific type of target matrices.
Value |
Description |
|---|---|
|
Matrices are general. |
|
Matrices are unitary matrices. |
|
Matrices are hermitian matrices. |
custatevecCollapseOp_t¶
ThecustatevecCollapseOp_tenumerator specifies the operation in the collapse.
Value |
Description |
|---|---|
|
Collapse will not be executed. |
|
Collapse will be executed and the vector will be zeroed out and normalized. |
custatevecComputeType_t¶
ThecustatevecComputeType_tenumerator specifies the information of compute type.
Value |
Description |
|---|---|
|
FP32(float) is used for Complex64 and FP64(double) is used for Complex128. |
|
TP32(tensor-float-32) is used. |
|
FP32(float) is used. |
|
FP64(double) is used. |
custatevecSamplerOutput_t¶
ThecustatevecSamplerOutput_tenumerator specifies the preference of the output in sampling.
Value |
Description |
|---|---|
|
No reordering is issued. |
|
Output will be reordered in the ascending order. |