state_projection_mps_extract_tensor#

cuquantum.bindings.cutensornet.state_projection_mps_extract_tensor(
intptr_t handle,
intptr_t tensor_network_projection,
intptr_t env_spec,
strides,
intptr_t env_tensor_data,
intptr_t work_desc,
intptr_t cuda_stream,
)[source]#

Extracts the MPS representation tensor for the specified contiguous 0-, 1-, or 2-site subset of sites.

Parameters:
  • handle (intptr_t) – cuTensorNet library handle.

  • tensor_network_projection (intptr_t) – Tensor network state MPS projection.

  • env_spec (intptr_t) – Specification of environment. The environment has to have been requested during the creation of the tensor network state MPS projection. 0-, 1-, and 2-site environments are supported.

  • strides (object) –

    Strides of the externally provided MPS representation tensor for the specified environment. A nullptr for this argument will use default (column-major) strides. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int64_t.

  • env_tensor_data (intptr_t) – The computed tensor of the MPS representation for the specified environment will be written to this buffer with the provided strides. Extents of the provided buffer need to be queried using cutensornetStateProjectionMPSGetTensorInfo. For 2-site environments the extracted tensor is the merged Theta = A_l . A_r at the current shared bond extent (which may be smaller than the maximum after a previous insertion’s SVD truncation).

  • work_desc (intptr_t) – Allocated workspace descriptor.

  • cuda_stream (intptr_t) – CUDA stream.