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.

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_get_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_get(intptr_t handle, ...)

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

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.

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.

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.