cuquantum.cutensornet.state_finalize_mps

cuquantum.cutensornet.state_finalize_mps(intptr_t handle, intptr_t tensor_network_state, int boundary_condition, extents_out, strides_out)[source]

Imposes a user-defined MPS (Matrix Product State) factorization on the final tensor network state with the given shape.

Parameters
  • handle (intptr_t) – cuTensorNet library handle.

  • tensor_network_state (intptr_t) – Tensor network state.

  • boundary_condition (BoundaryCondition) – The boundary condition of the target MPS representation.

  • extents_out (object) –

    Array of size nStateModes specifying the maximal extents of all tensors defining the target MPS representation. extents_out[i] is expected to be consistent with the mode order (shared mode between (i-1)th and i-th MPS tensor, state mode of the i-th MPS tensor, shared mode between i-th and (i+1)th MPS tensor). For the open boundary condition, the modes for the first tensor get reduced to (state mode, shared mode with the second site) while the modes for the last tensor become (shared mode with the second last site, state mode). It can be:

    • an int as the pointer address to the nested sequence, or

    • a Python sequence of ints, each of which is a pointer address to a valid sequence, or

    • a nested Python sequence of int64_t.

  • strides_out (object) –

    Array of size nStateModes specifying the strides of all tensors defining the target MPS representation. Similar to extents_out, strides_out is also expected to be consistent with the mode order of each MPS tensor. If NULL, the default generalized column-major strides will be assumed. It can be:

    • an int as the pointer address to the nested sequence, or

    • a Python sequence of ints, each of which is a pointer address to a valid sequence, or

    • a nested Python sequence of int64_t.