Skip to main content

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uniqc_cppsimulator-1.0.1.tar.gz (912.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

uniqc_cppsimulator-1.0.1-cp314-cp314-win_amd64.whl (234.8 kB view details)

Uploaded CPython 3.14Windows x86-64

uniqc_cppsimulator-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (285.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

uniqc_cppsimulator-1.0.1-cp314-cp314-macosx_11_0_arm64.whl (216.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.1-cp313-cp313-win_amd64.whl (228.7 kB view details)

Uploaded CPython 3.13Windows x86-64

uniqc_cppsimulator-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (285.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

uniqc_cppsimulator-1.0.1-cp313-cp313-macosx_11_0_arm64.whl (215.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.1-cp312-cp312-win_amd64.whl (228.7 kB view details)

Uploaded CPython 3.12Windows x86-64

uniqc_cppsimulator-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (285.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

uniqc_cppsimulator-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (215.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.1-cp311-cp311-win_amd64.whl (227.0 kB view details)

Uploaded CPython 3.11Windows x86-64

uniqc_cppsimulator-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (283.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

uniqc_cppsimulator-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (215.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.1-cp310-cp310-win_amd64.whl (225.6 kB view details)

Uploaded CPython 3.10Windows x86-64

uniqc_cppsimulator-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (282.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

uniqc_cppsimulator-1.0.1-cp310-cp310-macosx_11_0_arm64.whl (214.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file uniqc_cppsimulator-1.0.1.tar.gz.

File metadata

  • Download URL: uniqc_cppsimulator-1.0.1.tar.gz
  • Upload date:
  • Size: 912.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for uniqc_cppsimulator-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d89982192d3094d96b7fafe937b24ff9617a9f6bf851edb99e87318ad3ef3cfe
MD5 da0d65c67f6c581f8545e72569ef947a
BLAKE2b-256 f2dec2aa38e8b91b04ba2670f6e9bd30098663d10042af0263f6881fd6841069

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1.tar.gz:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 67a24e9bd29f451143466183de6435569593ca0b5677071bce4e8330d9a7c631
MD5 c01ea46e83c39450744209fa3b3c4c74
BLAKE2b-256 cae4281597bf59294828bee73fcd0206c3b05104fb3b9a0eb0e007469495cd4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp314-cp314-win_amd64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c581e6fbe9014ee09fd34398841c8c14115e9fa8d60d35d152cd300fa5d28d09
MD5 a4fb620861bb8d3b2678d225bdbec8a2
BLAKE2b-256 25431cbb25eba378f512656e517d1718262e278eaae9c13b491d8355f10e0018

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5989269b9c6f0e7c62a7caea0c4896feff3a40ed93b10808bc48176c335834e5
MD5 ed4df37afe637d43ffbd67edaf7171e8
BLAKE2b-256 b540d941a50719b2df0203472d266456e437fded3a2fe7b4c74dbd04c6489077

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e7184bbf5aec7e77a3498bb58660897cf78c417f68011ccf02c6eeee995692a3
MD5 b9eeba5182722b7e690dc453c7887d02
BLAKE2b-256 99c64009c1ed64302a514feee77d1de9d94e376e11e6ea35028b74747d464e01

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp313-cp313-win_amd64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6e07750d65c3440ab2e366872406c687afff08b66247b5af309a93f59beb8a9e
MD5 e93f1fa5c20933de9d36fce86a5771a7
BLAKE2b-256 31242be3a7397483ca4b85c1b6dc048e991afd5434122db726390ae5e54a14be

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c985c153b995fcd479af854c94ce3b6042bc6e2c3babeca613aa303047666fa7
MD5 8dbe46f90dc6fb9b8d9b4db3d6e2d6b6
BLAKE2b-256 612f4cf58322f13328d14567be7d669c833f1b624a7fc5c2a2d4b41970ebe944

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 99c44540739eec9a524118cbcf3681f065776a77acfb6f0c5f1e6e0e20f1b736
MD5 7af0f7884f67f77bdca09d00a14fb7a4
BLAKE2b-256 2a90f3b3ff7c1a1b238d84a6a77a670e8a52bf2c87d31b3eca132fdb93d7b693

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp312-cp312-win_amd64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 edd56f338ec2be9414e25909696f28cd2d63e094627e11168f6869d6a3230af9
MD5 51f7e2ba5af230e1f47203149cc28619
BLAKE2b-256 c9d8afa6fefce9288246ffd0f781590f45c5d5db0eac0c8e1f30b460c05c4881

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34d3bcfd1b138fcefea76d35900893baef8ca840a7e8d60d2ea1a7e156a3f791
MD5 0938c3bec22214716488e99678e03967
BLAKE2b-256 fc6220b1b92e975d2a2a566b4fd40197e98ad8619d79a8bde96321b82e329002

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5272cf910d725ee789a684c19a4dd43797b48718029e3afd7ec87c35d8d20724
MD5 4e5f2def23cd84f9310310b0e31cde2f
BLAKE2b-256 1aae38602d383b803b9871dcdac3c0f3eba9aafc4dfe51ab65469fc998629008

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp311-cp311-win_amd64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 37937ac5cb921d9e3e9ffca124ed90fab2e2b2fefd8df9cce8d6534f42d081ed
MD5 c2d613bd8cb9fc5e8def56bbd8faab8a
BLAKE2b-256 e949ece5e05cdeaa0120fe9026aedcfd2e4fa6115c7024359fc70ae31c6ec739

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc028f421aaec9cba6d6909ecf0db22a11a646c2ff50fb4ffb19be887d86aca5
MD5 104cf78593efc0ec6705a4320d3dc8e7
BLAKE2b-256 1634fc1913da2270f07f31a4ce3051b5d9420a9413bce8b263bbb7df0730dd0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5a8c39998796d30024754291632ccdd2f1fb317033a3d96e3a08612d0b88e7a4
MD5 9d43c6eb1dc4804e96ff62c19d960a00
BLAKE2b-256 5200e256b01c262296c809e11e2e4554e6e80764839c6b406350445ef4667f5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp310-cp310-win_amd64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 83a32d1f2fb2056ee81476caeef0575c5826af900376d0e7ab1c6966d9f1c98b
MD5 6a6e9b0cfadd52fc9722e2759dca61a6
BLAKE2b-256 c533f4405175c0bcc336c2977a322ef7b2e28dc5c4ae9158f45da5a3e4f438cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file uniqc_cppsimulator-1.0.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 694513f535102a35ec776787c41fc81100d7328585fe6c06026b224b4712249d
MD5 b2c54d3e4254e439032dca8bb1ebd558
BLAKE2b-256 b58d8127730521dcdd84a6f02326e4a41298dcafef2d8048da5a7f58ed94d0b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on IAI-USTC-Quantum/uniqc-cppsimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.1 This release

16 files

1.0.0

16 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page