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/ 目录,自 v1.0.0 起拆分为独立仓库、独立版本、独立发布。UnifiedQuantum 通过 PyPI 依赖本包,二者接口保持兼容。

安装本包后,import 名为 uniqc_cpp(分发名 uniqc-cppsimulator,import 名 uniqc_cpp)。

安装

pip install uniqc-cppsimulator

提供 Linux / Windows 的 cp310–cp314 预编译 wheel。macOS 及其他平台自动从 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.0.tar.gz (912.2 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.0-cp314-cp314-win_amd64.whl (234.9 kB view details)

Uploaded CPython 3.14Windows x86-64

uniqc_cppsimulator-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (286.1 kB view details)

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

uniqc_cppsimulator-1.0.0-cp314-cp314-macosx_11_0_arm64.whl (216.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.0-cp313-cp313-win_amd64.whl (228.8 kB view details)

Uploaded CPython 3.13Windows x86-64

uniqc_cppsimulator-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (286.0 kB view details)

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

uniqc_cppsimulator-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (216.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.0-cp312-cp312-win_amd64.whl (228.8 kB view details)

Uploaded CPython 3.12Windows x86-64

uniqc_cppsimulator-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (285.9 kB view details)

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

uniqc_cppsimulator-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (215.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.0-cp311-cp311-win_amd64.whl (227.1 kB view details)

Uploaded CPython 3.11Windows x86-64

uniqc_cppsimulator-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (284.3 kB view details)

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

uniqc_cppsimulator-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (215.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

uniqc_cppsimulator-1.0.0-cp310-cp310-win_amd64.whl (225.8 kB view details)

Uploaded CPython 3.10Windows x86-64

uniqc_cppsimulator-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (282.9 kB view details)

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

uniqc_cppsimulator-1.0.0-cp310-cp310-macosx_11_0_arm64.whl (214.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: uniqc_cppsimulator-1.0.0.tar.gz
  • Upload date:
  • Size: 912.2 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.0.tar.gz
Algorithm Hash digest
SHA256 1df060b58517cf65dc5c6d4958bf6ecc6d5e5c6b55aa8639b4e7cecad24470da
MD5 9076ff878d0f78f27a5dc92bc59cfdf1
BLAKE2b-256 bd16bf42e262ef062e34f1d42bcd87eec2581538a6ab081e6aafa047d8774587

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0.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.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 844d7e466bd929945dc61fa116190a24afd0313406f33bc601ddc60705d9864f
MD5 04016d14f98646a144fbaeb2feac94b1
BLAKE2b-256 4456630d053ced4a5d19781fb58f6c3d78e5ced9f6dd7f39aee2672a3e536900

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 756e45ce6495e78a1731236be31c253aa8edd0040b77c6cf2e7241914e30b838
MD5 989863c34ec962e973d7960ae1947340
BLAKE2b-256 6a625be0b367af690d53a609476012ec8a4e931aafc3c2d939bdf2f514e21804

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ce63b2b15f67810133c6eac2183348868d68483ff2290388135256785bd6bf9
MD5 a4b0526ab913a6058c0fb3bfb344d2e7
BLAKE2b-256 902788365919ad85375fbd41e737f84fadaa49f6e9d5c3523b0a3ddb3254d375

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d83730e20a953d1c00b67a7c2c6e49f236f327c8967f8abe56c712182df56e25
MD5 bd494f27b0da96489663cf6eb9e90248
BLAKE2b-256 96922914d9a1f11650cdee954441d9bd392ba953794ab82e46d852e5e7cd89f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 652f41896553521d23df00ed51ac683b955f8b27fe278a2e832b316c00244e9d
MD5 5b1b4199868412808eda57593098e6ec
BLAKE2b-256 0e49fd855e831604a4d2d7b8146f3490440451f89152993ba127a1428aabc11b

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77c261ef77ecbcf50b235d864894bde0897b2485662cc09d81386a9c1143011d
MD5 b1e11d6fdb214211bb9d6bedbf4d3475
BLAKE2b-256 539a5e63a81271a8a46c21ff1eb877f2ad9d52eb9331a0af19a633786cf0b0cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bc9bae0c7d01f3fde792f2a23b60ae1d94cd02a1554b0450590aea3713670013
MD5 ba5fbb2a2bcef850d272a28b96c2d7b6
BLAKE2b-256 149e79f582cfdb57939afad317226fd7d2f62db38fa464296d8b42ed7b2bff56

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b4c56fc9a75b4bd6dbd03be818abfce107e97123698064f3d21e088fd8258af
MD5 1f4c56e0af0489737b5c8c068d753893
BLAKE2b-256 da18d78cdcd1ea5c9c86c21e263c3eae0ffd37ead8f5603ee633d07f113b377c

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f8c08c8491dc21b9c8b58832d371b33be61b5d1f691a4047a19de5ee13f1cce5
MD5 4caa8b3ef3da3460e7c270e809c8fae9
BLAKE2b-256 3c67da075eb6f41fcb171045e896b168ba4c63a38b2246f3253f54ac6702f1dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 760b4ddaea69574b8b7368cdfbce2819ce2186b1b0c88f0f22527eedb5ae6f72
MD5 3bf0b7a0ce1f48bdadb1ee7ad35a6bf0
BLAKE2b-256 fc7bf9f74d6dbadcaaf090b193c269085f9d519b99150153d9752361c5519a09

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c258b292b394e832f56889e4a5dca14da6f15a4fae7b1b85746ce4c4dfd0df8d
MD5 c7cda4608985388a7c24ff409944e325
BLAKE2b-256 2a7471a237ac45600127041afa52624c10723e9e5de26be4acd2b3d0ca334696

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 96e2a3d64909ded4ecce085b32cc2a496642eda4419e3ae877477ec3fe00cd39
MD5 14c14a87729100479069524cf2c0a962
BLAKE2b-256 3cbb80754618a7ccd71d5ce5fb25f24c5da90d500732dba58b10ec95046512fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 822f59ed1017d3eae1d86e6245fed1977fbf19c0c9bdfca6c018a16d16f2f024
MD5 77ba552960b649c36f77c81e69cd569d
BLAKE2b-256 6dcf0be4a6f98df5e13d90075947f0338d31df9ecefdc3c37c5a5c1fdf8ed11c

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da5e37f8bb6044e98a3f5c4654c6298dc53a25ce7cecbaff4ac05f74f35246ea
MD5 3ec5ee440f9a7bc5fd057b2cfacc1a44
BLAKE2b-256 2877aed750e7ffde45f806f365b5f78c0eef3219cfe0ef665378876307b2dbfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for uniqc_cppsimulator-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bdaefafcd7140530bcbfd416338d35a5f1f912a36000e2cad45e7b1f4e533b91
MD5 0c59b370dec9432b4b9f2d19f867b7d6
BLAKE2b-256 ceeb807c5ec495ae9b61dcf1c9cec345bb431b9db2eb94414613d2247295bfd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for uniqc_cppsimulator-1.0.0-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

1.0.1

16 files

This release

1.0.0 This release

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