cuStateVec Data Types

Opaque Data Structures

custatevecIndex_t

The custatevecIndex_t must be used for state vector indices in some operations.

custatevecHandle_t

The custatevecHandle_t structure 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

The custatevecSamplerDescriptor_t structure captures the context of the sampling operation.
It is initialized with custatevecSampler_create().

custatevecLoggerCallback_t

The custatevecLoggerCallback_t is 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

The custatevecStatus_t enumerator specifies the library status. Each cuStateVec API returns this enumerator.

Value

Description

CUSTATEVEC_STATUS_SUCCESS (0)

The API call has finished successfully.

CUSTATEVEC_STATUS_NOT_INITIALIZED (1)

The library handle was not initialized.

CUSTATEVEC_STATUS_ALLOC_FAILED (2)

Memory allocation in the library was failed.

CUSTATEVEC_STATUS_INVALID_VALUE (3)

Wrong parameter was passed. For example, a null pointer as input data, or an invalid enum value.

CUSTATEVEC_STATUS_ARCH_MISMATCH (4)

The device capabilities are not enough for the set of input parameters provided.

CUSTATEVEC_STATUS_EXECUTION_FAILED (5)

Error during the execution of the device tasks.

CUSTATEVEC_STATUS_INTERNAL_ERROR (6)

Unknown error occured in the library.

CUSTATEVEC_STATUS_NOT_SUPPORTED (7)

API is not supported by the backend.

CUSTATEVEC_STATUS_INSUFFICIENT_WORKSPACE (8)

Workspace on device is too small to execute.

CUSTATEVEC_STATUS_SAMPLER_NOT_PREPROCESSED (9)

Sampler was called prior to preprocessing.


custatevecPauli_t

The custatevecPauli_t enumerator 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

CUSTATEVEC_PAULI_I

the Identity matrix or the zeroth Pauli matrix

CUSTATEVEC_PAULI_X

the Pauli-X matrix \(\boldsymbol{\sigma}_x\)

CUSTATEVEC_PAULI_Y

the Pauli-Y matrix \(\boldsymbol{\sigma}_y\)

CUSTATEVEC_PAULI_Z

the Pauli-Z matrix \(\boldsymbol{\sigma}_z\)


custatevecMatrixLayout_t

The custatevecMatrixLayout_t enumerator specifies the information of matrix memory layout.

Value

Description

CUSTATEVEC_MATRIX_LAYOUT_COL

Matrix components are stored in column-major ordering

CUSTATEVEC_MATRIX_LAYOUT_ROW

Matrix components are stored in row-major ordering


custatevecMatrixType_t

The custatevecMatrixType_t enumerator specifies the specific type of target matrices.

Value

Description

CUSTATEVEC_MATRIX_TYPE_GENERAL

Matrices are general.

CUSTATEVEC_MATRIX_TYPE_UNITARY

Matrices are unitary matrices.

CUSTATEVEC_MATRIX_TYPE_HERMITIAN

Matrices are hermitian matrices.


custatevecCollapseOp_t

The custatevecCollapseOp_t enumerator specifies the operation in the collapse.

Value

Description

CUSTATEVEC_COLLAPSE_NONE

Collapse will not be executed.

CUSTATEVEC_COLLAPSE_NORMALIZE_AND_ZERO

Collapse will be executed and the vector will be zeroed out and normalized.


custatevecComputeType_t

The custatevecComputeType_t enumerator specifies the information of compute type.

Value

Description

CUSTATEVEC_COMPUTE_DEFAULT

FP32(float) is used for Complex64 and FP64(double) is used for Complex128.

CUSTATEVEC_COMPUTE_TF32

TP32(tensor-float-32) is used.

CUSTATEVEC_COMPUTE_32F

FP32(float) is used.

CUSTATEVEC_COMPUTE_64F

FP64(double) is used.


custatevecSamplerOutput_t

The custatevecSamplerOutput_t enumerator specifies the preference of the output in sampling.

Value

Description

CUSTATEVEC_SAMPLER_OUTPUT_RANDNUM_ORDER

No reordering is issued.

CUSTATEVEC_SAMPLER_OUTPUT_ASCENDING_ORDER

Output will be reordered in the ascending order.