uniqc-cppsimulator
UnifiedQuantum 的 C++ 量子线路模拟内核,独立发版。
The native C++ simulation kernel of UnifiedQuantum, published as a standalone package.
定位
本仓库提供两个高性能 C++ 模拟器,通过 pybind11 暴露为 uniqc_cpp Python 扩展模块:
StatevectorSimulator— 态矢量模拟器(最多 30 量子比特)DensityOperatorSimulator— 密度算符模拟器(最多 10 量子比特,支持噪声通道)
它原来是 UnifiedQuantum 仓库的 UniqcCpp/ 目录,自 v0.0.18 起拆分为独立仓库、独立版本、独立发布。UnifiedQuantum 通过 PyPI 依赖本包,二者接口保持兼容。
安装本包后,import 名为 uniqc_cpp(分发名 uniqc-cppsimulator,import 名 uniqc_cpp)。
安装
pip install uniqc-cppsimulator
提供 Linux / Windows / macOS 的 cp310–cp314 预编译 wheel;其余平台自动从 sdist 源码编译,需要满足下方"源码构建要求"。
快速上手
import uniqc_cpp
sim = uniqc_cpp.StatevectorSimulator()
sim.init_n_qubit(2)
sim.hadamard(0)
sim.cnot(0, 1)
print(sim.pmeasure([0, 1])) # Bell 态: [0.5, 0, 0, 0.5]
完整 API 见仓库根目录的类型存根 uniqc_cpp.pyi(安装后随扩展一起发布,IDE / 类型检查器可直接使用)。
源码构建要求
- CMake >= 3.22
- 支持 C++17 的编译器(MSVC / gcc / clang)
- pybind11(构建隔离模式下由
pyproject.toml自动提供) - 第三方库 fmt 已 vendored 在
UniqcCpp/Thirdparty/,无需额外安装
git clone https://github.com/IAI-USTC-Quantum/uniqc-cppsimulator.git
cd uniqc-cppsimulator
pip install .
测试
# Python 绑定测试
pytest tests/
# C++ 原生测试
cmake -S . -B build-cpp -DCMAKE_BUILD_TYPE=Release \
-Dpybind11_DIR="$(python -c 'import pybind11; print(pybind11.get_cmake_dir())')"
cmake --build build-cpp --config Release
./build-cpp/bin/Release/UnifiedQuantumTest # Windows: .\build-cpp\bin\Release\UnifiedQuantumTest.exe
版本与兼容
- 本包版本与 UnifiedQuantum 独立演进。UnifiedQuantum 在其
pyproject.toml中以uniqc-cppsimulator>=x.y,<z声明兼容区间。 - 破坏性 API 变更会提升 major 版本并在 CHANGELOG 中标注。
许可证
Apache License 2.0,见 LICENSE。
Metadata
Release files for uniqc-cppsimulator 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uniqc_cppsimulator-1.0.1.tar.gz | 912.6 kB | Details |
Built distributions (wheels)
Total release size: 4.6 MB
Release files / uniqc_cppsimulator-1.0.1.tar.gz
| Download URL | uniqc_cppsimulator-1.0.1.tar.gz |
|---|---|
| Size | 912.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d89982192d3094d96b7fafe937b24ff9617a9f6bf851edb99e87318ad3ef3cfe
|
|
BLAKE2b-256 checksum How to use checksums |
f2dec2aa38e8b91b04ba2670f6e9bd30098663d10042af0263f6881fd6841069
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp314-cp314-win_amd64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 234.8 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
67a24e9bd29f451143466183de6435569593ca0b5677071bce4e8330d9a7c631
|
|
BLAKE2b-256 checksum How to use checksums |
cae4281597bf59294828bee73fcd0206c3b05104fb3b9a0eb0e007469495cd4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 285.8 kB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c581e6fbe9014ee09fd34398841c8c14115e9fa8d60d35d152cd300fa5d28d09
|
|
BLAKE2b-256 checksum How to use checksums |
25431cbb25eba378f512656e517d1718262e278eaae9c13b491d8355f10e0018
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 216.1 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5989269b9c6f0e7c62a7caea0c4896feff3a40ed93b10808bc48176c335834e5
|
|
BLAKE2b-256 checksum How to use checksums |
b540d941a50719b2df0203472d266456e437fded3a2fe7b4c74dbd04c6489077
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp313-cp313-win_amd64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 228.7 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e7184bbf5aec7e77a3498bb58660897cf78c417f68011ccf02c6eeee995692a3
|
|
BLAKE2b-256 checksum How to use checksums |
99c64009c1ed64302a514feee77d1de9d94e376e11e6ea35028b74747d464e01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 285.7 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6e07750d65c3440ab2e366872406c687afff08b66247b5af309a93f59beb8a9e
|
|
BLAKE2b-256 checksum How to use checksums |
31242be3a7397483ca4b85c1b6dc048e991afd5434122db726390ae5e54a14be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 215.8 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c985c153b995fcd479af854c94ce3b6042bc6e2c3babeca613aa303047666fa7
|
|
BLAKE2b-256 checksum How to use checksums |
612f4cf58322f13328d14567be7d669c833f1b624a7fc5c2a2d4b41970ebe944
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp312-cp312-win_amd64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 228.7 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
99c44540739eec9a524118cbcf3681f065776a77acfb6f0c5f1e6e0e20f1b736
|
|
BLAKE2b-256 checksum How to use checksums |
2a90f3b3ff7c1a1b238d84a6a77a670e8a52bf2c87d31b3eca132fdb93d7b693
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 285.6 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
edd56f338ec2be9414e25909696f28cd2d63e094627e11168f6869d6a3230af9
|
|
BLAKE2b-256 checksum How to use checksums |
c9d8afa6fefce9288246ffd0f781590f45c5d5db0eac0c8e1f30b460c05c4881
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 215.7 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
34d3bcfd1b138fcefea76d35900893baef8ca840a7e8d60d2ea1a7e156a3f791
|
|
BLAKE2b-256 checksum How to use checksums |
fc6220b1b92e975d2a2a566b4fd40197e98ad8619d79a8bde96321b82e329002
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp311-cp311-win_amd64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 227.0 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5272cf910d725ee789a684c19a4dd43797b48718029e3afd7ec87c35d8d20724
|
|
BLAKE2b-256 checksum How to use checksums |
1aae38602d383b803b9871dcdac3c0f3eba9aafc4dfe51ab65469fc998629008
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 283.9 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
37937ac5cb921d9e3e9ffca124ed90fab2e2b2fefd8df9cce8d6534f42d081ed
|
|
BLAKE2b-256 checksum How to use checksums |
e949ece5e05cdeaa0120fe9026aedcfd2e4fa6115c7024359fc70ae31c6ec739
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 215.4 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bc028f421aaec9cba6d6909ecf0db22a11a646c2ff50fb4ffb19be887d86aca5
|
|
BLAKE2b-256 checksum How to use checksums |
1634fc1913da2270f07f31a4ce3051b5d9420a9413bce8b263bbb7df0730dd0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp310-cp310-win_amd64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 225.6 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5a8c39998796d30024754291632ccdd2f1fb317033a3d96e3a08612d0b88e7a4
|
|
BLAKE2b-256 checksum How to use checksums |
5200e256b01c262296c809e11e2e4554e6e80764839c6b406350445ef4667f5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 282.6 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
83a32d1f2fb2056ee81476caeef0575c5826af900376d0e7ab1c6966d9f1c98b
|
|
BLAKE2b-256 checksum How to use checksums |
c533f4405175c0bcc336c2977a322ef7b2e28dc5c4ae9158f45da5a3e4f438cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uniqc_cppsimulator-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | uniqc_cppsimulator-1.0.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 214.3 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
694513f535102a35ec776787c41fc81100d7328585fe6c06026b224b4712249d
|
|
BLAKE2b-256 checksum How to use checksums |
b58d8127730521dcdd84a6f02326e4a41298dcafef2d8048da5a7f58ed94d0b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency log