cuDensityMat (cuquantum.bindings.cudensitymat)

函数

句柄管理 API

创建()

创建和初始化库上下文。

destroy(intptr_t handle)

销毁库上下文。

reset_distributed_configuration(...)

重置与给定库上下文关联的当前分布式执行配置。

get_num_ranks(intptr_t handle)

返回与给定库上下文关联的分布式进程的总数。

get_proc_rank(intptr_t handle)

返回与给定库上下文关联的分布式配置中当前进程的秩。

reset_random_seed(intptr_t handle, ...)

重置库上下文中随机数生成器使用的随机种子。

内存管理 API

create_workspace(intptr_t handle)

创建工作区描述符。

destroy_workspace(intptr_t workspace_descr)

销毁工作区描述符。

workspace_get_memory_size(intptr_t handle, ...)

查询所需的工作区缓冲区大小。

workspace_set_memory(intptr_t handle, ...)

将内存附加到工作区缓冲区。

workspace_get_memory(intptr_t handle, ...)

检索工作区缓冲区。

算符 API

create_elementary_operator(intptr_t handle, ...)

创建作用于给定数量量子态模式(又名空间模式)的基本张量算符。

destroy_elementary_operator(...)

销毁基本张量算符。

create_operator_term(intptr_t handle, ...)

创建一个空的算符项,它将是单个张量算符的张量积之和,其中乘积中的每个单个张量算符作用于不相交的量子态模式(量子自由度)。

destroy_operator_term(intptr_t operator_term)

销毁算符项。

operator_term_append_elementary_product(...)

将作用于量子态模式的基本张量算符的乘积附加到算符项。

operator_term_append_general_product(...)

将作用于不同量子态模式的通用稠密张量算符的乘积附加到算符项。

create_operator(intptr_t handle, ...)

创建一个空算符,它将是算符项的集合。

destroy_operator(intptr_t superoperator)

销毁算符。

operator_append_term(intptr_t handle, ...)

将算符项附加到算符。

operator_prepare_action(intptr_t handle, ...)

准备算符以对量子态执行操作。

operator_compute_action(intptr_t handle, ...)

计算算符对给定输入量子态的操作,并将结果累积到输出量子态中(累积操作)。

create_operator_action(intptr_t handle, ...)

为一个或多个算符创建操作描述符,从而定义算符对一组与算符域兼容的输入量子态的聚合操作,其中所有输入量子态也可以批量处理。

destroy_operator_action(intptr_t operator_action)

销毁算符操作描述符。

operator_action_prepare(intptr_t handle, ...)

准备(聚合)算符操作以进行计算。

operator_action_compute(intptr_t handle, ...)

执行构成聚合算符操作的一个或多个算符对相同数量的输入量子态的操作,并将结果累积到单个输出量子态中。

量子态 API

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

定义给定纯度和形状的空量子态,或一批此类量子态。

destroy_state(intptr_t state)

销毁量子态。

state_get_num_components(intptr_t handle, ...)

查询构成所选量子态表示的组件(张量)的数量(在多进程运行中的当前进程上)。

state_get_component_num_modes(...)

查询本地组件张量(在多进程运行中的当前进程上)中模式的数量。

state_get_component_info(intptr_t handle, ...)

查询本地存储的组件张量的信息,该张量表示完整组件或其切片(在多进程运行中的当前进程上)。

state_attach_component_storage(...)

为构成量子态表示的每个组件(张量)(在多进程运行中的当前进程上)附加用户拥有的 GPU 可访问存储缓冲区。

state_get_component_storage_size(...)

查询构成量子态表示的每个组件(张量)的存储大小(以字节为单位)(在多进程运行中的当前进程上)。

state_initialize_zero(intptr_t handle, ...)

将量子态初始化为零(空态)。

state_compute_scaling(intptr_t handle, ...)

将量子态初始化为随机值。

state_compute_norm(intptr_t handle, ...)

计算量子态的平方弗罗贝尼乌斯范数。

state_compute_trace(intptr_t handle, ...)

计算量子态的迹。

state_compute_accumulation(intptr_t handle, ...)

计算量子态到另一个兼容形状的量子态的累积。

state_compute_inner_product(intptr_t handle, ...)

计算左量子态和右量子态之间的内积:< state(s)Left | state(s)Right >。

期望值 API

create_expectation(intptr_t handle, ...)

创建算符期望值计算对象。

destroy_expectation(intptr_t expectation)

销毁期望值对象。

expectation_prepare(intptr_t handle, ...)

准备期望值对象以进行计算。

expectation_compute(intptr_t handle, ...)

计算关于给定量子态的算符期望值。