cuquantum.cutensornet.expectation_compute

cuquantum.cutensornet.expectation_compute(intptr_t handle, intptr_t tensor_network_expectation, intptr_t work_desc, intptr_t expectation_value, intptr_t state_norm, intptr_t cuda_stream)[source]

Computes an (unnormalized) expectation value of a given tensor network operator over a given tensor network state.

Parameters
  • handle (intptr_t) – cuTensorNet library handle.

  • tensor_network_expectation (intptr_t) – Tensor network state expectation value representation.

  • work_desc (intptr_t) – Workspace descriptor (the required scratch/cache memory buffers must be set by the user).

  • expectation_value (intptr_t) – Computed unnormalized tensor network state expectation value (Host pointer). The returned scalar will have the same numerical data type as the tensor circuit state.

  • state_norm (intptr_t) – The squared 2-norm of the underlying tensor circuit state (Host pointer). The returned scalar will have the same numerical data type as the tensor circuit state. Providing a NULL pointer will ignore norm calculation.

  • cuda_stream (intptr_t) – CUDA stream.