state_apply_diagonal_tensor_operator#
-
cuquantum.
bindings. cutensornet. state_apply_diagonal_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,
Applies a diagonal 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 diagonal tensor operator acts on.
state_modes (object) –
Pointer to the state modes the diagonal tensor operator acts on. It can be:
an
intas the pointer address to the array, ora Python sequence of
int32_t.
tensor_data (intptr_t) – Elements of the diagonal tensor operator (must be of the same data type as the elements of the state tensor).
tensor_mode_strides (object) –
Strides of the diagonal tensor operator data layout corresponding to the state modes. Passing NULL will assume the default generalized columnwise storage layout. It can be:
an
intas the pointer address to the array, ora Python sequence of
int64_t.
immutable (int32_t) – Whether or not the diagonal 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 diagonal tensor operator is applied as its adjoint (ket and bra modes reversed, with all tensor elements complex conjugated). Note that for a diagonal tensor operator, adjoint is equivalent to complex conjugation.
unitary (int32_t) – Whether or not the diagonal tensor operator is unitary with respect to its ket and bra. For diagonal tensor operators, this corresponds to whether the imaginary component of all its entries is zero.
- Returns:
Unique integer id (for later identification of the diagonal tensor operator).
- Return type:
int64_t