cuquantum.cutensornet.create_contraction_plan(intptr_t handle, intptr_t desc_net, intptr_t optimizer_info, intptr_t work_desc) intptr_t[source]

Initializes a cutensornetContractionPlan_t.

  • handle (intptr_t) – Opaque handle holding cuTensorNet’s library context.

  • desc_net (intptr_t) – Describes the tensor network (i.e., its tensors and their connectivity).

  • optimizer_info (intptr_t) – Opaque structure.

  • work_desc (intptr_t) – Opaque structure describing the workspace. At the creation of the contraction plan, only the workspace size is needed; the pointer to the workspace memory may be left null. If a device memory handler is set, work_desc can be set either to null (in which case the “recommended” workspace size is inferred, see CUTENSORNET_WORKSIZE_PREF_RECOMMENDED) or to a valid cutensornetWorkspaceDescriptor_t with the desired workspace size set and a null workspace pointer, see Memory Management API section.


cuTensorNet’s contraction plan holds all the information required to perform the tensor contractions; to be precise, it initializes a cutensorContractionPlan_t for each tensor contraction that is required to contract the entire tensor network.

Return type