cuDensityMat (cuquantum.bindings.cudensitymat)

Functions

Handle Management API

create()

Creates and initializes the library context.

destroy(intptr_t handle)

Destroys the library context.

reset_distributed_configuration(...)

Resets the current distributed execution configuration associated with the given library context.

get_num_ranks(intptr_t handle)

Returns the total number of distributed processes associated with the given library context.

get_proc_rank(intptr_t handle)

Returns the rank of the current process in the distributed configuration associated with the given library context.

reset_random_seed(intptr_t handle, ...)

Resets the random seed used by the random number generator inside the library context.

Memory Management API

create_workspace(intptr_t handle)

Creates a workspace descriptor.

destroy_workspace(intptr_t workspace_descr)

Destroys a workspace descriptor.

workspace_get_memory_size(intptr_t handle, ...)

Queries the required workspace buffer size.

workspace_set_memory(intptr_t handle, ...)

Attaches memory to a workspace buffer.

workspace_get_memory(intptr_t handle, ...)

Retrieves a workspace buffer.

Operator API

create_elementary_operator(intptr_t handle, ...)

Creates an elementary tensor operator acting on a given number of quantum state modes (aka space modes).

destroy_elementary_operator(...)

Destroys an elementary tensor operator.

create_operator_term(intptr_t handle, ...)

Creates an empty operator term which is going to be a sum of tensor products of individual tensor operators, where each individual tensor operator within a product acts on disjoint quantum state modes (quantum degrees of freedom).

destroy_operator_term(intptr_t operator_term)

Destroys an operator term.

operator_term_append_elementary_product(...)

Appends a product of elementary tensor operators acting on quantum state modes to the operator term.

operator_term_append_general_product(...)

Appends a product of generic dense tensor operators acting on different quantum state modes to the operator term.

create_operator(intptr_t handle, ...)

Creates an empty operator which is going to be a collection of operator terms.

destroy_operator(intptr_t superoperator)

Destroys an operator.

operator_append_term(intptr_t handle, ...)

Appends an operator term to the operator.

operator_prepare_action(intptr_t handle, ...)

Prepares the operator for an action on a quantum state.

operator_compute_action(intptr_t handle, ...)

Computes the action of the operator on a given input quantum state, accumulating the result in the output quantum state (accumulative action).

create_operator_action(intptr_t handle, ...)

Creates an action descriptor for one or more operators, thus defining an aggregate action of the operator(s) on a set of input quantum states compliant with the operator domains, where all input quantum states can also be batched.

destroy_operator_action(intptr_t operator_action)

Destroys the operator action descriptor.

operator_action_prepare(intptr_t handle, ...)

Prepares the (aggregate) operator(s) action for computation.

operator_action_compute(intptr_t handle, ...)

Executes the action of one or more operators constituting the aggreggate operator(s) action on the same number of input quantum states, accumulating the results into a single output quantum state.

Quantum State API

create_state(intptr_t handle, int purity, ...)

Defines an empty quantum state of a given purity and shape, or a batch of such quantum states.

destroy_state(intptr_t state)

Destroys the quantum state.

state_get_num_components(intptr_t handle, ...)

Queries the number of components (tensors) constituting the chosen quantum state representation (on the current process in multi-process runs).

state_get_component_num_modes(...)

Queries the number of modes in a local component tensor (on the current process in multi-process runs).

state_get_component_info(intptr_t handle, ...)

Queries information for a locally stored component tensor which represents either the full component or its slice (on the current process in multi-process runs).

state_attach_component_storage(...)

Attaches a user-owned GPU-accessible storage buffer for each component (tensor) constituting the quantum state representation (on the current process in multi-process runs).

state_get_component_storage_size(...)

Queries the storage size (in bytes) for each component (tensor) constituting the quantum state representation (on the current process in multi-process runs).

state_initialize_zero(intptr_t handle, ...)

Initializes the quantum state to zero (null state).

state_compute_scaling(intptr_t handle, ...)

Initializes the quantum state to a random value.

state_compute_norm(intptr_t handle, ...)

Computes the squared Frobenius norm(s) of the quantum state(s).

state_compute_trace(intptr_t handle, ...)

Computes the trace(s) of the quantum state(s).

state_compute_accumulation(intptr_t handle, ...)

Computes accumulation of a quantum state(s) into another quantum state(s) of compatible shape.

state_compute_inner_product(intptr_t handle, ...)

Computes the inner product(s) between the left quantum state(s) and the right quantum state(s): < state(s)Left | state(s)Right >.

Expectation API

create_expectation(intptr_t handle, ...)

Creates the operator expectation value computation object.

destroy_expectation(intptr_t expectation)

Destroys an expectation value object.

expectation_prepare(intptr_t handle, ...)

Prepares the expectation value object for computation.

expectation_compute(intptr_t handle, ...)

Computes the operator expectation value(s) with respect to the given quantum state(s).