UnifiedQuantum - A unified, non-commercial quantum computing aggregation framework.
Project description
UnifiedQuantum
UnifiedQuantum — A unified, non-commercial quantum computing aggregation framework.
UnifiedQuantum is a lightweight Python framework that provides a unified interface for quantum circuit construction, simulation, and cloud execution across multiple quantum computing platforms. It aggregates backends including OriginQ, Quafu, and IBM Quantum under one consistent API.
核心工作流
UnifiedQuantum 围绕一个简洁的工作流设计:任意方式构建线路 → CLI 统一执行。
1. 安装
pip install unified-quantum
2. 构建线路(支持原生 API 或任意第三方工具)
from uniq.circuit_builder import Circuit
c = Circuit()
c.h(0)
c.cnot(0, 1)
c.measure(0, 1)
# 输出 OriginIR 格式,可供 CLI 使用
open('circuit.ir', 'w').write(c.originir)
你也可以使用 Qiskit、Cirq 等工具构建线路,只需最终输出 OriginIR 或 OpenQASM 2.0 格式。
3. CLI 统一执行
# 本地模拟
uniq simulate circuit.ir --shots 1000
# 提交到云端
uniq submit circuit.ir --platform originq --shots 1000
# 查询任务结果
uniq result <task_id>
设计理念
UnifiedQuantum 是一个非商业性的开源项目,致力于:
- 聚合:整合多种量子云平台(OriginQ、Quafu、IBM Quantum),提供统一接口
- 统一:一致的 API 设计,屏蔽各平台差异
- 透明:清晰的量子程序组装与执行方式,无隐藏行为
- 轻量:纯 Python 实现,安装简单,集成方便
| 线路构建 | 原生 API 或任意工具,输出 OriginIR / QASM2 | | CLI 执行 | 统一接口:模拟、云端、任务管理 | | 结果分析 | 原生 Python 结构,易于集成 |
Features
| 特性 | 说明 |
|---|---|
| 多后端聚合 | 统一接口支持 OriginQ、Quafu、IBM Quantum 等多种量子云平台 |
| 本地模拟 | 内置 OriginIR Simulator、QASM Simulator |
| 透明 | 清晰的量子程序组装与执行方式 |
| Python 原生 | 纯 Python 实现,安装简单,集成方便 |
| 同步/异步 | 支持同步和异步两种任务提交模式 |
| 可扩展 | 易于添加新的量子门、操作符和模拟后端 |
核心概念:
- Circuit — 量子线路构建器,支持 OriginIR / OpenQASM 格式输出
- Backend — 量子模拟器或真实量子计算机
- Result — 测量结果以原生 Python 数据结构返回(dict / list / ndarray)
Installation
Supported Platforms
- Windows / Linux / macOS
Requirements
- Python 3.10 – 3.13
pip(推荐)
pip install unified-quantum
Build from Source
纯 Python(无 C++ 依赖):
git clone https://github.com/IAI-USTC-Quantum/UnifiedQuantum.git
cd UnifiedQuantum
pip install . --no-cpp
开发模式:
pip install -e .
含 C++ 模拟器(需 CMake):
git clone --recurse-submodules https://github.com/IAI-USTC-Quantum/UnifiedQuantum.git
cd UnifiedQuantum
pip install .
Optional Dependencies
核心依赖(包括 scipy)在默认安装中已包含。以下为可选功能依赖:
| 功能 | 安装命令 |
|---|---|
| OriginQ 云平台 | pip install unified-quantum[originq] |
| Quafu 执行后端 | pip install unified-quantum[quafu] |
| Qiskit 执行后端 | pip install unified-quantum[qiskit] |
| 高级模拟 (QuTiP) | pip install unified-quantum[simulation] |
| 可视化 | pip install unified-quantum[visualization] |
| PyTorch 集成 | pip install unified-quantum[pytorch] |
| 安装所有可选依赖 | pip install unified-quantum[all] |
CLI Quick Reference
# 查看帮助
uniq --help
# 本地模拟
uniq simulate circuit.ir --shots 1000
# 提交到云端(支持 originq / quafu / ibm / dummy)
uniq submit circuit.ir --platform originq --shots 1000
# 查询任务结果
uniq result <task_id>
# 配置云平台 Token
uniq config init
uniq config set originq.token YOUR_TOKEN
# 也可以用 python -m 调用
python -m uniq simulate circuit.ir
Examples
📁 examples/ — Runnable demonstrations
Getting Started
| Example | Description |
|---|---|
| Circuit Remapping | Build a circuit and remap qubits for real hardware |
| Dummy Server | Submit tasks to the local dummy simulator |
| Result Post-Processing | Convert and analyze results |
Algorithms
| Example | Description |
|---|---|
| Grover Search | Unstructured search with quadratic speedup |
| Quantum Phase Estimation | Eigenvalue phase estimation |
Documentation
Status
🚧 Actively developing. API may change.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unified_quantum-0.0.3-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 512.9 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fff63ac8f1da3dc90125f2a0a6e3e93ea73d2e52c5dc23481b8e386be8281e1
|
|
| MD5 |
861ba165d6a7bfec6d19ff8f392ff964
|
|
| BLAKE2b-256 |
63302151cc698eabb7ccb0fdb4644417f2c87f9cb82879b5ab0c7ae3caa9b975
|
File details
Details for the file unified_quantum-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 590.9 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08248a5248659d2b9c1fc6477ebbe982a5b0f5a179c50f3ef9900559c50a1752
|
|
| MD5 |
c20ddd0b74618348186c63d46946db08
|
|
| BLAKE2b-256 |
cb8df496c99cada18cef05889f17df40e99f2b80628169cd1d428dbd37aa21b9
|
File details
Details for the file unified_quantum-0.0.3-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 601.9 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1954fc96a12ee966e8274b5e33a8d73316238e547c40aeccde08781ad5212184
|
|
| MD5 |
3a8d938896c034955d7f7b17a41d10c6
|
|
| BLAKE2b-256 |
41e5e5a9c41f8e50cec14846667043c07b5f1ea42736562004e35fd888d458d2
|
File details
Details for the file unified_quantum-0.0.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 512.9 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8818e141e0d41f4cc64e245549f2e06a14ab0d9935e7cb15e8627d88e4236852
|
|
| MD5 |
c14ea7ac00e8684f5bc7409c8ec5a8fb
|
|
| BLAKE2b-256 |
139fef660e2fbb2cbc56838a5c5a54d88a0664d973dc778dfc5cd7f8105a5cf9
|
File details
Details for the file unified_quantum-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 590.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d86652f897263e2b82c5404e5f35d9a2e6e1f6261ab3ac8a75e0d0aa941ee63
|
|
| MD5 |
27ea0234753e8004718c141cb24e4ab7
|
|
| BLAKE2b-256 |
47832cc9d16c2efde2e59b16c5579faeb3f406db0e24f6d1f486d4ee8e2bf2df
|
File details
Details for the file unified_quantum-0.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 601.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8a58ad838b1bc5127558d2d850cd9a92e02ec764fefe6d24f8a90c8307de68
|
|
| MD5 |
808cabf2a89e963796cffa60465227cf
|
|
| BLAKE2b-256 |
5175da342496f25a06a958282be1d1ca7856f16f300a9e04ab6ee43e57cf8b1f
|
File details
Details for the file unified_quantum-0.0.3-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 512.9 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdcab546565d5fb47687aec1211f18ca903aa15c6d72001e7283d52aa31671dc
|
|
| MD5 |
11fdad4087a353d0d467a2c37a2459ee
|
|
| BLAKE2b-256 |
ba0329c81121e56037cf190409db2d5bc781657260a62243bc0a7ab7678fe631
|
File details
Details for the file unified_quantum-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 590.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a43fc4876279b554b5f638fca6a246ab21ef41187109289fe527a46fcf828ae
|
|
| MD5 |
ccf9f487a7f5fdc0e61ca31c186dcb36
|
|
| BLAKE2b-256 |
4db86fbbc3d5c2c32482ac8f404f9f4d40cffacdca18ae0080ac9fc0fac747cc
|
File details
Details for the file unified_quantum-0.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 601.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ca92a29e9d0b5ae395cfff288b991be73df47f30abdd41c279b53c5177f7c8b
|
|
| MD5 |
1f6e32818874670e3be8911d77262ed5
|
|
| BLAKE2b-256 |
f1a5ff8fa93516acd93319c5f15470c8541636cbf235ef43b5de68452a6fb0a7
|
File details
Details for the file unified_quantum-0.0.3-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 512.9 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5db1a11690d894b1a579658a292911ee4409ff865f9bdea669d62328f58282ca
|
|
| MD5 |
2376f7a9a0a9ecb419748e81616ea6e1
|
|
| BLAKE2b-256 |
b8111b01efb2d602d859d9da46539150609d6c9cc09dfe49681d5e2067e8a1b1
|
File details
Details for the file unified_quantum-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 590.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
298b24cb910ffba058a8db2e0d6148f5d1a720964e304ee6f3a75f159606c7f5
|
|
| MD5 |
72fcd5241f5c2043e7e547e2a67e5914
|
|
| BLAKE2b-256 |
f2f1ef1e3d222044c6a2073aeb3827596e7e82f360717bad3dafab14db77682a
|
File details
Details for the file unified_quantum-0.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: unified_quantum-0.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 601.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bdc565e81ff066f2f084cee2713ce4d91c60070b2aa5a0b3d4fdc31634f36d5
|
|
| MD5 |
060adeed88669dcd00b0af18f9bb6de2
|
|
| BLAKE2b-256 |
e883f5e3028bf805a3f446e3230bdf43749213ea5ff539681dd8eecd4737c807
|