cuquantum.cutensornet.state_apply_tensor_operator

cuquantum.cutensornet.state_apply_tensor_operator(intptr_t handle, intptr_t tensor_network_state, int32_t num_state_modes, state_modes, intptr_t tensor_data, tensor_mode_strides, int32_t immutable, int32_t adjoint, int32_t unitary) int64_t[source]

Applies a tensor operator to the tensor network state.

Parameters
  • handle (intptr_t) – cuTensorNet library handle.

  • tensor_network_state (intptr_t) – Tensor network state.

  • num_state_modes (int32_t) – Number of state modes the tensor operator acts on.

  • state_modes (object) –

    Pointer to the state modes the tensor operator acts on. It can be:

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

    • a Python sequence of int32_t.

  • tensor_data (intptr_t) – Elements of the tensor operator (must be of the same data type as the elements of the state tensor).

  • tensor_mode_strides (object) –

    Strides of the tensor operator data layout (note that the tensor operator has twice more modes than the number of state modes it acts on). Passing NULL will assume the default generalized columnwise layout. It can be:

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

    • a Python sequence of int64_t.

  • immutable (int32_t) – Whether or not the tensor operator data may change during the lifetime of the tensor network state. Any data change must be registered via a call to cutensornetStateUpdateTensorOperator.

  • adjoint (int32_t) – Whether or not the tensor operator is applied as an adjoint (ket and bra modes reversed, with all tensor elements complex conjugated).

  • unitary (int32_t) – Whether or not the tensor operator is unitary with respect to the first and second halves of its modes.

Returns

Unique integer id (for later identification of the tensor operator).

Return type

int64_t