Skip to main content

PyQuafu

License

Introduction

PyQuafu is designed for users to construct, compile, and execute quantum circuits on quantum devices on Quafu using Python. With PyQuafu, you can interact with various real quantum backends provided by the experimental group from Quafu.

Installation

Install via PyPI

You can install PyQuafu directly from PyPI:

pip install pyquafu

Build from Source

Alternatively, you can build PyQuafu from the source:

pip install .

Development Installation

For developers, it is recommended to use the editable installation below, which automatically includes development dependencies (pytest, pre-commit):

pip install -e ".[dev]"

To run unit tests, you can use:

python -m pytest tests

Graphviz Dependency

If you need to visualize Directed Acyclic Graphs (DAGs), ensure that the Graphviz software is installed on your system. Refer to the graphviz · PyPI page for installation guidance.

GPU Support

To install PyQuafu with GPU-based circuit simulation, you need to build from the source and ensure that the CUDA Toolkit is installed. Use the following command to install the GPU version:

python setup.py install -DUSE_GPU=ON

If you also have cuQuantum installed, you can install PyQuafu with cuQuantum support:

python setup.py install -DUSE_GPU=ON -DUSE_CUQUANTUM=ON

Documentation

For detailed documentation about usage, please visit the PyQuafu documentation website.

Note for Apple Silicon Mac Users

If you encounter the error "illegal hardware instruction" on an Apple silicon Mac, ensure that you have updated to the arm64 version of Anaconda. See this issue for more details.

Examples

Quantum Reinforcement Learning

This example demonstrates how quantum reinforcement learning interacts with Quafu to solve the CartPole environment. For more details, refer to the quantum-RL-with-quafu repository.

Author

This project is developed by the quantum cloud computing team at the Beijing Academy of Quantum Information Sciences.

Release files for pyquafu 0.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyquafu 0.4.5
File
pyquafu-0.4.5-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pyquafu-0.4.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
pyquafu-0.4.5-cp313-cp313-macosx_13_0_x86_64.whl CPython 3.13 CPython 3.13 macOS 13.0+ x86-64 Details
pyquafu-0.4.5-cp313-cp313-macosx_13_0_arm64.whl CPython 3.13 CPython 3.13 macOS 13.0+ ARM64 Details
pyquafu-0.4.5-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyquafu-0.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
pyquafu-0.4.5-cp312-cp312-macosx_13_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 13.0+ x86-64 Details
pyquafu-0.4.5-cp312-cp312-macosx_13_0_arm64.whl CPython 3.12 CPython 3.12 macOS 13.0+ ARM64 Details
pyquafu-0.4.5-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pyquafu-0.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pyquafu-0.4.5-cp311-cp311-macosx_13_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 13.0+ x86-64 Details
pyquafu-0.4.5-cp311-cp311-macosx_13_0_arm64.whl CPython 3.11 CPython 3.11 macOS 13.0+ ARM64 Details
pyquafu-0.4.5-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pyquafu-0.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pyquafu-0.4.5-cp310-cp310-macosx_13_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 13.0+ x86-64 Details
pyquafu-0.4.5-cp310-cp310-macosx_13_0_arm64.whl CPython 3.10 CPython 3.10 macOS 13.0+ ARM64 Details
pyquafu-0.4.5-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pyquafu-0.4.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pyquafu-0.4.5-cp39-cp39-macosx_13_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 13.0+ x86-64 Details
pyquafu-0.4.5-cp39-cp39-macosx_13_0_arm64.whl CPython 3.9 CPython 3.9 macOS 13.0+ ARM64 Details

Total release size: 6.9 MB

Release files / pyquafu-0.4.5-cp313-cp313-win_amd64.whl

Download URL pyquafu-0.4.5-cp313-cp313-win_amd64.whl
Size 328.6 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
0b6237387f61d206cb17be69d8b7e19a3b9678c738a1bbad2d01acfd8e0446e9
BLAKE2b-256 checksum
How to use checksums
2e1c1c0a7f2f661b51c4c120e36cbaacfe620c0f2ada632257757e012f0493fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyquafu-0.4.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 433.2 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a9a5207267e64a35c602b78298c50d971203627e0849fc3ddf7bee42bb562ce3
BLAKE2b-256 checksum
How to use checksums
69d9ecb1f1d924d01db0a3ba019da41b1278d8b61eaff1c174574c10d424ab59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp313-cp313-macosx_13_0_x86_64.whl

Download URL pyquafu-0.4.5-cp313-cp313-macosx_13_0_x86_64.whl
Size 324.5 kB
Tags CPython 3.13 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
be94d7f92db2039521e1fa6ed8fa9e18a344cba362333a4c60203001ba60dcc9
BLAKE2b-256 checksum
How to use checksums
4e2f66c515968acebf617e0c266407eeca0190c66d595de4097afd37e95792de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp313-cp313-macosx_13_0_arm64.whl

Download URL pyquafu-0.4.5-cp313-cp313-macosx_13_0_arm64.whl
Size 298.5 kB
Tags CPython 3.13 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
9932166ac382533f2213eb896914cd680c105fdb633c6ed893c729d201423826
BLAKE2b-256 checksum
How to use checksums
8360fdf76d61dc5a25f13b03b49f364c874ad591e35e0e60853b5cc2d647a676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp312-cp312-win_amd64.whl

Download URL pyquafu-0.4.5-cp312-cp312-win_amd64.whl
Size 328.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
d350c1fa0666e92b5a7eae6a78d31230523071927820c49d8c227db1e550985a
BLAKE2b-256 checksum
How to use checksums
3da4df12c23dfb81665e1bc60f9fb53b0039bd66dd56fc34530415360c45e4b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyquafu-0.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 433.2 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
613cf378e4f4b8bdc010bdba85d2a3e7fb6e3bd0dbf0f1cb12442a73de54ecad
BLAKE2b-256 checksum
How to use checksums
f3b7be9b7140ab6562f5ca2c46129dce3a55a29a90f171ebc5149b38792c491d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp312-cp312-macosx_13_0_x86_64.whl

Download URL pyquafu-0.4.5-cp312-cp312-macosx_13_0_x86_64.whl
Size 324.5 kB
Tags CPython 3.12 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
c64681461ae6f149620583f4f6da38f2e2fd2420658c10fd76ad85e099329921
BLAKE2b-256 checksum
How to use checksums
453b8ff13b5aff924f1675d7eb795dcf97619a9bb575a6833dc839106ec8de76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp312-cp312-macosx_13_0_arm64.whl

Download URL pyquafu-0.4.5-cp312-cp312-macosx_13_0_arm64.whl
Size 298.5 kB
Tags CPython 3.12 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
915c73c7321596f71ea9a1685cf37276daf5c53a4631d07a0bf39cbdc44d834a
BLAKE2b-256 checksum
How to use checksums
4f4604ed0c7f66e712f6215bdc4fb81fc3052aa1eada1202397749b3cabf8edf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp311-cp311-win_amd64.whl

Download URL pyquafu-0.4.5-cp311-cp311-win_amd64.whl
Size 327.2 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
7bc5381f42f06053eb1451dd8e2ea1c8d500ab2cffe0968998fd95aaa5b40b61
BLAKE2b-256 checksum
How to use checksums
2c7d12f4ef6cd2faa6eb8709352dc173af42197f6887683cde4b8b1bddf2bc05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyquafu-0.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 432.9 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
dac37917eee54966f60239923c7d0b366b4a582f80d455603f348bb1c3cdbb60
BLAKE2b-256 checksum
How to use checksums
458a2ba5073a22e5d643ea1e621ce5e76d12aed211d410ce1ed4ef7a7ad28bb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp311-cp311-macosx_13_0_x86_64.whl

Download URL pyquafu-0.4.5-cp311-cp311-macosx_13_0_x86_64.whl
Size 323.3 kB
Tags CPython 3.11 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
80fdc5f797978dc7b0c5628b6fbaf0d8cc9d8f669fca4d460808395d47913453
BLAKE2b-256 checksum
How to use checksums
af8963c5179df7142be4fe75f0b14dd9c0ac31c8f247df3ec1332e4e873b2324
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp311-cp311-macosx_13_0_arm64.whl

Download URL pyquafu-0.4.5-cp311-cp311-macosx_13_0_arm64.whl
Size 297.5 kB
Tags CPython 3.11 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
4dbb981ef6a8730856958b0f3b5797331a8b999462c4c2db6686bdf90b136f1f
BLAKE2b-256 checksum
How to use checksums
db4e15a78238f2849e98364c1d379f0fa41586f38ec2255259b91927baa3bf6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp310-cp310-win_amd64.whl

Download URL pyquafu-0.4.5-cp310-cp310-win_amd64.whl
Size 326.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
22c2e42317a3f6f2d608cee1eafb3bb037efc1862034005fbae48243b070c2ef
BLAKE2b-256 checksum
How to use checksums
1fed678baf8f0999319f17f2e76a89df30ceb3761811231b1d0889b3b004f54c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyquafu-0.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 432.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9c6e72b80b90fae016ccabfbc84d5d3fb1f678957226c6ced9630b6fdaf3e2cf
BLAKE2b-256 checksum
How to use checksums
eab76507420a3c5b6775edb15bf05b6d85cc911ef1d54127ff696d66b340495f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp310-cp310-macosx_13_0_x86_64.whl

Download URL pyquafu-0.4.5-cp310-cp310-macosx_13_0_x86_64.whl
Size 321.7 kB
Tags CPython 3.10 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
64398ed94cb8c5b7e99409fe7cf42b5ec370e60a5b70357a2e1b59509ff38642
BLAKE2b-256 checksum
How to use checksums
a04dde47e1f196113490b9d4365fc5c4d48a8498c306f9034d5bae8061ac0707
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp310-cp310-macosx_13_0_arm64.whl

Download URL pyquafu-0.4.5-cp310-cp310-macosx_13_0_arm64.whl
Size 296.1 kB
Tags CPython 3.10 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
5e8047f6f0a6ccebcabbc4a5f52b34e50d6d6fdf425ff5aa5a2124969ec1f6f5
BLAKE2b-256 checksum
How to use checksums
508c69b955fc964647f6d3b352bad23ef56bd04fce7d0932757d13f2a35318d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp39-cp39-win_amd64.whl

Download URL pyquafu-0.4.5-cp39-cp39-win_amd64.whl
Size 327.2 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
2be45466a9d955efb1560d314c65e9b01a1bfdf9f9d28417d918ddc0c930fd20
BLAKE2b-256 checksum
How to use checksums
30136b8cc382efad5d7d4c79dcd5ecb940c3e771da0dbf2a3e5baecd410ed5e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / pyquafu-0.4.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyquafu-0.4.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 432.6 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
52eb1b2f466b7b862d6db37c89c6d4d4f2c3ebf152ec35af132d00edd097c42d
BLAKE2b-256 checksum
How to use checksums
f003a2a9bc83d80a1c1309d4227c14045e462d8b74af1599a289f3fde7fd0bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp39-cp39-macosx_13_0_x86_64.whl

Download URL pyquafu-0.4.5-cp39-cp39-macosx_13_0_x86_64.whl
Size 321.8 kB
Tags CPython 3.9 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
37a9ddf1b702c98cdf522a5f7325249810b3a1638d9eb1bc203e298cab2a879a
BLAKE2b-256 checksum
How to use checksums
a8239b0283713f74c211d670c10ad661d13084dec66593463b25a98f5590fdec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / pyquafu-0.4.5-cp39-cp39-macosx_13_0_arm64.whl

Download URL pyquafu-0.4.5-cp39-cp39-macosx_13_0_arm64.whl
Size 296.2 kB
Tags CPython 3.9 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
bcc31ad72ecf44a1f21ad1e24be950d8b10a42c71555cff10ccb6323076d3b69
BLAKE2b-256 checksum
How to use checksums
3983910a3e582f453457215715a582e11a80116cb916f3e0443a18496f59c05f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.4.5 This release

20 release files

0.4.3

16 release files

0.4.0

16 release files

0.3.6

16 release files

0.3.3

16 release files

0.3.2

16 release files

0.2.9

8 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page