Skip to content

utils 模块

pyqpanda3.utils 模块提供了量子程序和变分线路的协议序列化、通信配置和二进制交换工具。

概述

本模块包含两组功能:

  • 协议配置和序列化 -- CommProtocolConfig 类捆绑了控制量子程序处理方式的执行参数(映射、错误缓解、优化级别、采样次数)。comm_protocol_encodecomm_protocol_decode 函数将 QProg 对象列表及其配置序列化和反序列化为适合网络传输的紧凑二进制格式。

  • OriginBIS 转换 -- 一组用于在 QProgVariationalQuantumCircuit 以及组合的变分线路与配置对象与 OriginBIS 二进制字符串(基于 Protocol Buffers 的序列化)之间进行相互转换的函数。这实现了量子程序在进程间或通过网络的高效存储和传输。

子主题

主题描述
协议CommProtocolConfigcomm_protocol_encodecomm_protocol_decode
OriginBISQProgVariationalQuantumCircuit 及组合对象的 OriginBIS 序列化

Released under the MIT License.