cuquantum.cutensornet.sampler_sample

cuquantum.cutensornet.sampler_sample(intptr_t handle, intptr_t tensor_network_sampler, int64_t num_shots, intptr_t work_desc, intptr_t samples, intptr_t cuda_stream)[源代码]

执行张量网络状态的采样,即生成请求数量的样本。

参数
  • handle (intptr_t) – cuTensorNet 库句柄。

  • tensor_network_sampler (intptr_t) – 张量网络状态采样器。

  • num_shots (int64_t) – 要生成的样本数量。

  • work_desc (intptr_t) – 工作区描述符(用户必须设置所需的工作区/缓存内存缓冲区)。

  • samples (intptr_t) – 将在其中存储生成的状态张量样本的主机内存指针。样本将以 C 表示法 samples[SampleId][ModeId] 存储,并且将遵守最初指定的要从中采样的张量网络状态模式的顺序。

  • cuda_stream (intptr_t) – CUDA 流。