cuquantum.cutensornet.state_initialize_mps

cuquantum.cutensornet.state_initialize_mps(intptr_t handle, intptr_t tensor_network_state, int boundary_condition, extents_in, strides_in, state_tensors_in)[source]

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

Parameters
  • handle (intptr_t) – cuTensorNet library handle.

  • tensor_network_state (intptr_t) – Tensor network state.

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

  • extents_in (object) –

    Array of size nStateModes specifying the extents of all tensors defining the initial MPS representation. extents[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 the (i+1)th MPS tensor). For the open boundary condition, the modes of the first tensor get reduced to (state mode, shared mode with the second site) while the modes of the last tensor become (shared mode with the second to the 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_in (object) –

    Array of size nStateModes specifying the strides of all tensors in the chosen MPS representation. Similar to extents_in, strides_in 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.

  • state_tensors_in (object) –

    Array of size nStateModes specifying the data for all tensors defining the chosen MPS representation. If NULL, the initial MPS-factorized state will represent the vacuum state. It can be:

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

    • a Python sequence of ints (as pointer addresses).