Python objects & constants

Objects

tensor_qualifiers_dtype

DType class corresponding to the scalar type and dtype of the same name.

contraction_path_dtype

DType class corresponding to the scalar type and dtype of the same name.

slice_info_pair_dtype

DType class corresponding to the scalar type and dtype of the same name.

slicing_config_dtype

DType class corresponding to the scalar type and dtype of the same name.

Enums

NetworkAttribute(value)

See cutensornetNetworkAttributes_t.

ContractionAutotunePreferenceAttribute(value)

See cutensornetContractionAutotunePreferenceAttributes_t.

ContractionOptimizerConfigAttribute(value)

See cutensornetContractionOptimizerConfigAttributes_t.

ContractionOptimizerInfoAttribute(value)

See cutensornetContractionOptimizerInfoAttributes_t.

GraphAlgo(value)

See cutensornetGraphAlgo_t.

MemoryModel(value)

See cutensornetMemoryModel_t.

OptimizerCost(value)

See cutensornetOptimizerCost_t.

WorksizePref(value)

See cutensornetWorksizePref_t.

Memspace(value)

See cutensornetMemspace_t.

TensorSVDConfigAttribute(value)

See cutensornetTensorSVDConfigAttributes_t.

TensorSVDInfoAttribute(value)

See cutensornetTensorSVDInfoAttributes_t.

TensorSVDNormalization(value)

See cutensornetTensorSVDNormalization_t.

TensorSVDPartition(value)

See cutensornetTensorSVDPartition_t.

GateSplitAlgo(value)

See cutensornetGateSplitAlgo_t.

StatePurity(value)

See cutensornetStatePurity_t.

MarginalAttribute(value)

See cutensornetMarginalAttributes_t.

SamplerAttribute(value)

See cutensornetSamplerAttributes_t.

Python functions

Handle Management API

create()

Create a cuTensorNet handle.

destroy(intptr_t handle)

Destroy a cuTensorNet handle.

Network Descriptor API

create_network_descriptor(intptr_t handle, ...)

Create a tensor network descriptor.

destroy_network_descriptor(intptr_t tn_desc)

Destroy a tensor network descriptor.

get_output_tensor_details(intptr_t handle, ...)

Get the output tensor's metadata.

get_output_tensor_descriptor(...)

Get the networks output tensor descriptor.

network_get_attribute(intptr_t handle, ...)

Get the network descriptor attribute.

network_set_attribute(intptr_t handle, ...)

Set the network descriptor attribute.

Tensor Descriptor API

create_tensor_descriptor(intptr_t handle, ...)

Create a tensor descriptor.

destroy_tensor_descriptor(intptr_t desc)

Destroy a tensor descriptor.

get_tensor_details(intptr_t handle, ...)

Get the tensor's metadata.

Contraction Optimizer API

create_contraction_optimizer_info(...)

Create a contraction optimizer info object.

create_contraction_optimizer_info_from_packed_data(...)

Create a contraction optimizer info object from the packed data.

update_contraction_optimizer_info_from_packed_data(...)

Update an existing contraction optimizer info object from the packed data.

destroy_contraction_optimizer_info(intptr_t info)

Destroy a contraction optimizer info object.

contraction_optimizer_info_get_attribute_dtype(...)

Get the Python data type of the corresponding optimizer info attribute.

contraction_optimizer_info_get_attribute(...)

Get the optimizer info attribute.

contraction_optimizer_info_set_attribute(...)

Set the optimizer info attribute.

contraction_optimizer_info_get_packed_size(...)

Get the required buffer size for packing the optimizer info object.

contraction_optimizer_info_pack_data(...)

Pack the contraction optimizer info data into a contiguous buffer.

create_contraction_optimizer_config(...)

Create a contraction optimizer config object.

destroy_contraction_optimizer_config(...)

Destroy a contraction optimizer config object.

contraction_optimizer_config_get_attribute_dtype(...)

Get the Python data type of the corresponding optimizer config attribute.

contraction_optimizer_config_get_attribute(...)

Get the optimizer config attribute.

contraction_optimizer_config_set_attribute(...)

Set the optimizer config attribute.

contraction_optimize(intptr_t handle, ...)

Optimize the contraction path, slicing, etc, for the given tensor network.

Contraction Plan API

create_contraction_plan(intptr_t handle, ...)

Create a contraction plan for the given tensor network and the associated path.

destroy_contraction_plan(intptr_t plan)

Destroy a contraction plan.

create_contraction_autotune_preference(...)

Create a handle to hold all autotune parameters.

destroy_contraction_autotune_preference(...)

Destroy the autotue preference handle.

contraction_autotune_preference_get_attribute_dtype(...)

Get the Python data type of the corresponding autotune preference attribute.

contraction_autotune_preference_get_attribute(...)

Get the autotue preference attributes.

contraction_autotune_preference_set_attribute(...)

Set the autotue preference attributes.

contraction_autotune(intptr_t handle, ...)

Autotune the contraction plan to find the best kernels for each pairwise tensor contraction.

Workspace Management API

create_workspace_descriptor(intptr_t handle)

Create a workspace descriptor.

destroy_workspace_descriptor(intptr_t workspace)

Destroy a workspace descriptor.

workspace_compute_sizes(intptr_t handle, ...)

Compute the required workspace sizes.

workspace_compute_contraction_sizes(...)

Compute the required workspace sizes for tensor network contraction.

workspace_compute_qr_sizes(intptr_t handle, ...)

Compute the required workspace sizes for tensor_qr().

workspace_compute_svd_sizes(intptr_t handle, ...)

Compute the required workspace sizes for tensor_svd().

workspace_compute_gate_split_sizes(...)

Compute the required workspace sizes for gate_split().

workspace_get_size(intptr_t handle, ...)

Get the workspace size for the corresponding preference and memory space.

workspace_get_memory_size(intptr_t handle, ...)

Get the workspace size for the corresponding preference and memory space.

workspace_set(intptr_t handle, ...)

Set the workspace pointer and size for the corresponding memory space in the workspace descriptor for later use.

workspace_set_memory(intptr_t handle, ...)

Set the workspace pointer and size for the corresponding memory space and workspace kind in the workspace descriptor for later use.

workspace_get(intptr_t handle, ...)

Get the workspace pointer and size for the corresponding memory space that are set in a workspace descriptor.

workspace_get_memory(intptr_t handle, ...)

Get the workspace pointer and size for the corresponding memory space and workspace kind that are set in a workspace descriptor.

workspace_purge_cache(intptr_t handle, ...)

Purge the cached data in the specified memory space.

Memory Management API

set_device_mem_handler(intptr_t handle, handler)

Set the device memory handler for cuTensorNet.

get_device_mem_handler(intptr_t handle)

Get the device memory handler for cuTensorNet.

Network Contraction API

contraction(intptr_t handle, intptr_t plan, ...)

Perform the contraction of the input tensors.

contract_slices(intptr_t handle, ...)

Perform the contraction of the input tensors.

Gradient Computation API

compute_gradients_backward(intptr_t handle, ...)

Compute the gradients of the network w.r.t.

Slice Group API

create_slice_group_from_id_range(...)

Create a slice group that contains a sequence of slice IDs from slice_start (inclusive) to slice_stop (exclusive) by slice_step.

create_slice_group_from_ids(intptr_t handle, ...)

Create a slice group from a sequence of slice IDs.

destroy_slice_group(intptr_t slice_group)

Destroy the slice group.

Approximate Tensor Network Execution API

tensor_qr(intptr_t handle, ...)

Perform QR decomposition of a tensor.

tensor_svd(intptr_t handle, ...)

Perform SVD decomposition of a tensor.

gate_split(intptr_t handle, ...)

Perform gate split operation.

Tensor SVD Config API

create_tensor_svd_config(intptr_t handle)

Create a tensor SVD config object.

destroy_tensor_svd_config(intptr_t config)

Destroy a tensor SVD config object.

tensor_svd_config_get_attribute_dtype(int attr)

Get the Python data type of the corresponding tensor SVD config attribute.

tensor_svd_config_get_attribute(...)

Get the tensor SVD config attribute.

tensor_svd_config_set_attribute(...)

Set the tensor SVD config attribute.

Tensor SVD Info API

create_tensor_svd_info(intptr_t handle)

Create a tensor SVD info object.

destroy_tensor_svd_info(intptr_t info)

Destroy a tensor SVD info object.

tensor_svd_info_get_attribute_dtype(int attr)

Get the Python data type of the corresponding tensor SVD info attribute.

tensor_svd_info_get_attribute(...)

Get the tensor SVD info attribute.

Distributed Parallelization API

distributed_reset_configuration(...)

Reset the distributed communicator.

distributed_get_num_ranks(intptr_t handle)

Get the number of distributed ranks.

distributed_get_proc_rank(intptr_t handle)

Get the current process rank.

distributed_synchronize(intptr_t handle)

Synchronize the distributed communicator.

get_mpi_comm_pointer(comm)

Simple helper to get the address to and size of a MPI_Comm handle.

High-Level Tensor Network API

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

Create a tensor network state.

destroy_state(intptr_t state)

Destroy a tensor network state.

state_apply_tensor(intptr_t handle, ...)

Apply a tensor operator to the tensor network state.

state_update_tensor(intptr_t handle, ...)

Update a tensor operand that has been applied to the tensor network state.

create_marginal(intptr_t handle, ...)

Create a representation for the tensor network state marginal distribution.

destroy_marginal(intptr_t marginal)

Destroy a tensor network marginal representation.

marginal_get_attribute_dtype(int attr)

Get the Python data type of the corresponding marginal attribute.

marginal_configure(intptr_t handle, ...)

Configures computation of the tensor network state marginal distribution.

marginal_prepare(intptr_t handle, ...)

Prepares computation of the tensor network state marginal distribution.

marginal_compute(intptr_t handle, ...)

Computes the tensor network state marginal distribution.

create_sampler(intptr_t handle, ...)

Creates a tensor network state sampler.

destroy_sampler(intptr_t sampler)

Destroy a tensor network state sampler.

sampler_get_attribute_dtype(int attr)

Get the Python data type of the corresponding sampler attribute.

sampler_configure(intptr_t handle, ...)

Configures the tensor network state sampler.

sampler_prepare(intptr_t handle, ...)

Prepares computation of the tensor network state marginal distribution.

sampler_sample(intptr_t handle, ...)

Computes the tensor network state marginal distribution.

Versioning API

get_version()

Query the version of the cuTensorNet library.

get_cudart_version()

Query the version of the CUDA runtime used to build cuTensorNet.