cuDensityMat (cuquantum.bindings.cudensitymat)

Python objects & constants

Objects

WrappedScalarCallback(callback, device)

Wrapped scalar callback Python extension type.

WrappedTensorCallback(callback, device)

Wrapped tensor callback Python extension type.

WrappedScalarGradientCallback(callback, device)

Wrapped scalar gradient callback Python extension type.

WrappedTensorGradientCallback(callback, device)

Wrapped tensor gradient callback Python extension type.

Enums

Status(value[, names, module, qualname, ...])

See cudensitymatStatus_t.

DistributedProvider(value[, names, module, ...])

See cudensitymatDistributedProvider_t.

CallbackDevice(value[, names, module, ...])

See cudensitymatCallbackDevice_t.

DifferentiationDir(value[, names, module, ...])

See cudensitymatDifferentiationDir_t.

StatePurity(value[, names, module, ...])

See cudensitymatStatePurity_t.

ElementaryOperatorSparsity(value[, names, ...])

See cudensitymatElementaryOperatorSparsity_t.

Memspace(value[, names, module, qualname, ...])

See cudensitymatMemspace_t.

WorkspaceKind(value[, names, module, ...])

See cudensitymatWorkspaceKind_t.

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 by importing a user-provided inter-process communicator (e.g., MPI_Comm).

get_num_ranks(intptr_t handle)

Returns the total number of distributed processes associated with the given library context in its current distributed execution configuration.

get_proc_rank(intptr_t handle)

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

reset_random_seed(intptr_t handle, ...)

Resets the context-level 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).

create_elementary_operator_batch(...)

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

destroy_elementary_operator(...)

Destroys an elementary tensor operator (simple or batched).

create_matrix_operator_dense_local(...)

Creates a full matrix operator acting on all quantum state modes (aka space modes) from a dense matrix stored (replicated) locally on each process.

create_matrix_operator_dense_local_batch(...)

Creates a batch of full matrix operators acting on all quantum state modes (aka space modes) from an array of dense matrices stored (replicated) locally on each process.

destroy_matrix_operator(intptr_t matrix_operator)

Destroys a full matrix operator (simple or batched).

create_operator_term(intptr_t handle, ...)

Creates an empty operator term which is going to be a sum of products of either elementary tensor operators or full matrix operators.

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_elementary_product_batch(...)

Appends a batch of elementary tensor operator products acting on quantum state modes to the operator term.

operator_term_append_matrix_product(...)

Appends a product of full matrix operators, each acting on all quantum state modes, to the operator term.

operator_term_append_matrix_product_batch(...)

Appends a batch of full matrix operators to the operator term, each full matrix operator acting on all quantum state modes.

create_operator(intptr_t handle, ...)

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

destroy_operator(intptr_t superoperator)

Destroys an operator.

operator_append_term(intptr_t handle, ...)

Appends an operator term to the operator.

operator_append_term_batch(intptr_t handle, ...)

Appends a batch of operator terms 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).

operator_prepare_action_backward_diff(...)

Prepares backward differentiation of the operator action on a quantum state.

operator_compute_action_backward_diff(...)

Computes backward differentiation of the operator action on a given quantum state.

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_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_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_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_initialize_zero(intptr_t handle, ...)

Initializes the quantum state to zero (null state).

state_compute_scaling(intptr_t handle, ...)

Multiplies the quantum state(s) by a scalar factor(s).

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).

Versioning API

get_version()

Returns the semantic version number of the cuDensityMat library.