Skip to main content

LQCloud SDK

English | 简体中文

License Python

LQCloud 是量子云平台的 Python 客户端 SDK,用于构建量子线路、提交线路、批量线路、 脉冲序列和采样波形任务,并获取执行结果。线路 API 借鉴 Qiskit 的命名,Qiskit 互操作通过可选依赖提供。

安装

需要 Python 3.11 或 3.12。

python -m pip install lqcloud

运行时依赖包括 numpy、requests、envelopes-qc、scikit-learn 与 matplotlib。 可选安装 lqcloud[qiskit] 或 lqcloud[full],用途与配置见快速入门。

最小示例

先在平台创建 API Key,将 LQCLOUD_API_KEY 设置为凭据,并确认账号可访问 MQ02。 MQ02 提供 24 比特一维链,支持线路任务。自定义平台地址使用 LQCLOUD_URL, 持久化凭据配置见认证接口。

以下示例提交一个 256 shots 的单比特任务,会消耗云端配额。设备需支持物理比特 0。

from lqcloud import LQCloudProvider, QuantumCircuit

provider = LQCloudProvider(interactive=False)
backend = provider.get_backend("MQ02")

circuit = QuantumCircuit(1, 1)
circuit.h(0)
circuit.barrier()
circuit.measure_all()

job = backend.run(circuit, shots=256)
result = job.result()
print(result.get_counts())

功能概览

  • 构建参数化线路、分解复合门,并在提交前完成本地校验。
  • 提交单条或批量线路、脉冲序列与采样波形,按设备能力使用读出矫正及动态解耦。
  • 查询、等待、取消和重新获取任务,访问 counts、memory、原始 IQ 及矫正概率。
  • 保存本地任务记录与标定参数快照,提供线路、直方图和结果显示工具。

门、参数、提交限制与异常行为见文档索引。

架构概览

用户程序 → SDK 本地构建与校验 → HTTPS 云平台 API → SDK 解析响应 → 用户结果对象
模块 客户端职责
circuit、sequence 构建线路与脉冲,管理参数及快照
provider、auth 解析凭据、发现设备和编排提交
backend、wire、transport 本地校验、序列化、HTTP 重试与错误解析
job、store 任务生命周期、结果访问和本地记录
visualization 线路图、直方图与结果显示
  • 构建与提交前校验在客户端完成,HTTP 请求通过统一传输入口处理重试与幂等键。
  • 本地任务存储默认开启,隐式配额为 2 GB 并自动清理旧记录;隐式建库或自动记录失败不阻断提交与取结果。 使用 LQCloudProvider(store=False) 可关闭,保留策略见存储接口。
  • 脉冲序列导入使用 HAS_SEQUENCE 守卫,缺少 envelopes-qc 时核心线路功能仍可使用。

HTTP 契约见 接口格式与依赖,维护约定见 AGENTS.md。

文档与贡献

开发、问题与合并请求统一在 Gitee 主仓维护,其他仓库为单向镜像。 正式组织与仓库地址待确定。

许可证

Apache License 2.0。

Metadata

Release files for lqcloud 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lqcloud 0.6.2
File Size Uploaded Provenance Actions
lqcloud-0.6.2.tar.gz 240.8 kB Without provenance Details for lqcloud-0.6.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lqcloud 0.6.2
File Interpreter ABI Platform Actions
lqcloud-0.6.2-py3-none-any.whl Python 3 none any Details for lqcloud-0.6.2-py3-none-any.whl

Total release size: 507.9 kB

Release files / lqcloud-0.6.2.tar.gz

Download URL lqcloud-0.6.2.tar.gz
Size 240.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5a02e21335e33f5ed273b6e67dc47e1464cd20f5ea361e1247696e784138d9a4
BLAKE2b-256 checksum
How to use checksums
796ae571ad46d07ecee259fa57690b6c3311db749e77c3f5548ea8301499536e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / lqcloud-0.6.2-py3-none-any.whl

Download URL lqcloud-0.6.2-py3-none-any.whl
Size 267.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cd6f4127cfb05ba7c2480fffe2c65f811bd5387327c597d42e031a91fb4d048
BLAKE2b-256 checksum
How to use checksums
36a213aadfd413fd50c4d6c9e1fce698c9567088e1cd28645fb30a9c7ae1de81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for lqcloud 0.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page