LoomQ: 量子接入平权计划 (Quantum Access Equality Project) - 统一量子中间层与智能体适配器
Project description
LoomQ: 量子接入平权计划 (Quantum Access Equality Project)
LoomQ 旨在打破硬核科技的门槛与话语权壁垒,让不懂底层“黑话”与物理指令集的创造者,也能通过自然语言和统一接口自由指挥前沿的量子算力。
🎯 核心目标
- 量子通用中间层 (Unified Quantum Layer):以 OpenQASM 2.0 为统一输入,提供跨平台的翻译、适配与运行能力。
- 说“人话”的量子智能体 (Natural Language Agent):支持通过自然语言生成/修复量子电路、智能推荐执行后端。
- 量子-经典混合编译 (Hybrid-QASM & RISC-V):将混合了经典控制流的量子电路编译为 RISC-V 汇编与量子序列,探索量子软硬件一体化设计。
📦 支持后端
目前 LoomQ 规划并打通以下后端的适配:
- 量旋云 / SpinQit (支持 Taurus 超导真机及模拟器)
- 本源量子云 (QPanda3 / OriginIR,支持悟空真机)
- AWS Braket (支持 OpenQASM 3.0 与本地模拟器)
🚀 快速开始
安装
pip install LoomQ
核心接口使用示例
import loomq
# 1. 线路转译 (Transpile OpenQASM 2.0 to Target Backend Native Code)
qasm_code = """
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
creg c[2];
h q[0];
cx q[0], q[1];
measure q -> c;
"""
target_code = loomq.transpile(qasm_code, target="braket")
print("Braket QASM 3.0:\n", target_code)
# 2. 统一运行接口 (Run on Target Backend)
result = loomq.run(qasm_code, target="spinq", shots=1024)
print("Execution Result:\n", result)
# 3. 智能体交互 (Interactive Quantum Agent)
response = loomq.agent_chat("帮我生成一个 3 比特 GHZ 最大纠缠态线路")
print("Agent:\n", response)
# 4. 混合控制流编译 (Hybrid Compilation to RISC-V Assembly)
quantum_ops, riscv_asm = loomq.compile_hybrid("""
OPENQASM 2.0;
qreg q[2];
creg c[2];
h q[0];
measure q[0] -> c[0];
classical {
if (c[0] == 1) {
r1 = 1;
}
}
""")
📄 开源协议
本项目采用 MIT 协议开源。
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 Distribution
loomq-0.1.0.tar.gz
(5.9 kB
view details)
Built Distribution
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
loomq-0.1.0-py3-none-any.whl
(6.6 kB
view details)
File details
Details for the file loomq-0.1.0.tar.gz.
File metadata
- Download URL: loomq-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90b8a4cd7e73474c1d18bc53d5031d7d71e68bc1571683554178701db130da70
|
|
| MD5 |
c44ec9148e9634e16917ff7ab19bb736
|
|
| BLAKE2b-256 |
f51fc5d680dab563fccb5642c5cc81793e4289452ba05b94ba0bca58e94d5f2f
|
File details
Details for the file loomq-0.1.0-py3-none-any.whl.
File metadata
- Download URL: loomq-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4f3dd4060c1c67126bb0f9d3d228c98e74262cd77b057ca1850895e7f838bf9
|
|
| MD5 |
b4e22b03a8d9e43a6899f2276c0baab6
|
|
| BLAKE2b-256 |
f51cd7fa33946a252a004f11d6ea25c97f700071a4375b70277508d6783cd5ba
|