Python toolkit for Quafu-Cloud


License
Apache-2.0
Install
pip install pyquafu==0.4.0

Documentation

PyQuafu

Python toolkit for submitting quantum circuits on the superconducting quantum computing cloud Quafu.

Introduction

PyQuafu is developed for the users of Quafu to construct, compile and execute quantum circuits on real quantum devices. One can use PyQuafu to interact with different quantum backends provides by the experimental group of Quafu.

Installation

You can directly install via PyPI,

pip install pyquafu

or build from source

pip install -r requirements.txt
python setup.py install

Note that we visualize DAG(directed acyclic graph) through python package graphviz. And if you need it, make sure Graphviz software being installed on your system. Refer to graphviz · PyPI for installation guidance.

GPU support

To install PyQuafu with GPU-based circuit simulator, you need build from the source and make sure that CUDA Toolkit is installed. You can run

python setup.py install -DUSE_GPU=ON

to install the GPU version. If you further have cuQuantum installed, you can install PyQuafu with cuQuantum support.

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

Document

Please see the website docs.

Note

If you are using an Apple silicon Mac and meet the error "illegal hardware instruction", please confirm whether you have updated to the arm64 version of Anaconda (see abess-team/abess#310).

Examples

1.quantum_rl

The example shows quantum reinforcement learning interacts with Quafu to solve CartPole environment.

Refer to https://github.com/enchanted123/quantum-RL-with-quafu for more details.

Author

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