cuquantum.cutensornet.contraction_optimize

cuquantum.cutensornet.contraction_optimize(intptr_t handle, intptr_t tn_desc, intptr_t config, uint64_t size_limit, intptr_t info)[source]

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

Parameters
  • handle (intptr_t) – The library handle.

  • tn_desc (intptr_t) – The tensor network descriptor.

  • config (intptr_t) – The optimizer config handle.

  • size_limit (uint64_t) – Maximal device memory that is available to the user.

  • info (intptr_t) – The optimizer info handle.

Note

The size_limit argument here should not be confused with the workspace size returned by contraction_get_workspace_size(). The former is an upper bound for the available memory, whereas the latter is the needed size to perform the actual contraction.