# PyQuafu
[![License](https://img.shields.io/github/license/ScQ-Cloud/pyquafu.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)
[![](https://github.com/ScQ-Cloud/pyquafu/actions/workflows/unittest.yml/badge.svg)](https://github.com/ScQ-Cloud/pyquafu/actions/workflows/unittest.yml)
[![](https://img.shields.io/github/release/ScQ-Cloud/pyquafu.svg?style=popout-square)](https://github.com/ScQ-Cloud/pyquafu/releases)
[![](https://img.shields.io/pypi/dm/pyquafu?style=popout-square)](https://pypi.org/project/pyquafu/)
## Introduction
**PyQuafu** is designed for users to construct, compile, and execute quantum circuits on quantum devices on [Quafu](http://quafu.baqis.ac.cn/) using Python. With PyQuafu, you can interact with various real quantum backends provided by the experimental group from [Quafu](http://quafu.baqis.ac.cn/).
## Installation
### Install via PyPI
You can install PyQuafu directly from PyPI:
```bash
pip install pyquafu
```
### Build from Source
Alternatively, you can build PyQuafu from the source:
```bash
pip install -r requirements.txt
python setup.py install
```
### Graphviz Dependency
If you need to visualize Directed Acyclic Graphs (DAGs), ensure that the [Graphviz software](https://graphviz.org/) is installed on your system. Refer to the [graphviz ยท PyPI](https://pypi.org/project/graphviz/#description) 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](https://developer.nvidia.com/cuda-downloads) is installed. Use the following command to install the GPU version:
```bash
python setup.py install -DUSE_GPU=ON
```
If you also have [cuQuantum](https://developer.nvidia.com/cuquantum-sdk) installed, you can install PyQuafu with cuQuantum support:
```bash
python setup.py install -DUSE_GPU=ON -DUSE_CUQUANTUM=ON
```
## Documentation
For detailed documentation about usage, please visit the [PyQuafu documentation website](https://scq-cloud.github.io/).
## 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](https://github.com/abess-team/abess/issues/310) 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](https://github.com/enchanted123/quantum-RL-with-quafu).
## Author
This project is developed by the quantum cloud computing team at the Beijing Academy of Quantum Information Sciences.
Raw data
{
"_id": null,
"home_page": "https://github.com/ScQ-Cloud/pyquafu",
"name": "pyquafu",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "ssli",
"author_email": "ssli@iphy.ac.cn",
"download_url": null,
"platform": null,
"description": "# PyQuafu\n[![License](https://img.shields.io/github/license/ScQ-Cloud/pyquafu.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)\n[![](https://github.com/ScQ-Cloud/pyquafu/actions/workflows/unittest.yml/badge.svg)](https://github.com/ScQ-Cloud/pyquafu/actions/workflows/unittest.yml)\n[![](https://img.shields.io/github/release/ScQ-Cloud/pyquafu.svg?style=popout-square)](https://github.com/ScQ-Cloud/pyquafu/releases)\n[![](https://img.shields.io/pypi/dm/pyquafu?style=popout-square)](https://pypi.org/project/pyquafu/)\n\n## Introduction\n\n**PyQuafu** is designed for users to construct, compile, and execute quantum circuits on quantum devices on [Quafu](http://quafu.baqis.ac.cn/) using Python. With PyQuafu, you can interact with various real quantum backends provided by the experimental group from [Quafu](http://quafu.baqis.ac.cn/).\n\n## Installation\n\n### Install via PyPI\n\nYou can install PyQuafu directly from PyPI:\n\n```bash\npip install pyquafu\n```\n\n### Build from Source\n\nAlternatively, you can build PyQuafu from the source:\n\n```bash\npip install -r requirements.txt\npython setup.py install\n```\n\n### Graphviz Dependency\n\nIf you need to visualize Directed Acyclic Graphs (DAGs), ensure that the [Graphviz software](https://graphviz.org/) is installed on your system. Refer to the [graphviz \u00b7 PyPI](https://pypi.org/project/graphviz/#description) page for installation guidance.\n\n### GPU Support\n\nTo install PyQuafu with GPU-based circuit simulation, you need to build from the source and ensure that the [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads) is installed. Use the following command to install the GPU version:\n\n```bash\npython setup.py install -DUSE_GPU=ON\n```\n\nIf you also have [cuQuantum](https://developer.nvidia.com/cuquantum-sdk) installed, you can install PyQuafu with cuQuantum support:\n\n```bash\npython setup.py install -DUSE_GPU=ON -DUSE_CUQUANTUM=ON\n```\n\n## Documentation\n\nFor detailed documentation about usage, please visit the [PyQuafu documentation website](https://scq-cloud.github.io/).\n\n## Note for Apple Silicon Mac Users\n\nIf 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](https://github.com/abess-team/abess/issues/310) for more details.\n\n## Examples\n\n### Quantum Reinforcement Learning\n\nThis 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](https://github.com/enchanted123/quantum-RL-with-quafu).\n\n## Author\n\nThis project is developed by the quantum cloud computing team at the Beijing Academy of Quantum Information Sciences.\n",
"bugtrack_url": null,
"license": "Apache-2.0 License",
"summary": "Python toolkit for Quafu-Cloud",
"version": "0.4.1",
"project_urls": {
"Homepage": "https://github.com/ScQ-Cloud/pyquafu"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "46ba76cc52a25f9b688a1653a43a1865fb32af58194483c3fc53a3454f0bb1ad",
"md5": "f6f392ff331553f52e9e21389e3bec4d",
"sha256": "e900026482f304dc68db2950e502717055f170e0d3f061ada45e1631ebc6701a"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp310-cp310-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "f6f392ff331553f52e9e21389e3bec4d",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 245134,
"upload_time": "2024-07-02T08:21:24",
"upload_time_iso_8601": "2024-07-02T08:21:24.597078Z",
"url": "https://files.pythonhosted.org/packages/46/ba/76cc52a25f9b688a1653a43a1865fb32af58194483c3fc53a3454f0bb1ad/pyquafu-0.4.1-cp310-cp310-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c914944b61c7df20a5987b29d6cd1f7e9bc42d3a049e23a57b1648f43720943d",
"md5": "bc22ab7cdaf729a77f7e8c01d49d8339",
"sha256": "26a1924a847ffa492e7b1ba08ac5a2518a1576115e11cbf7c8c6485609a3d4e8"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp310-cp310-macosx_13_0_x86_64.whl",
"has_sig": false,
"md5_digest": "bc22ab7cdaf729a77f7e8c01d49d8339",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 262454,
"upload_time": "2024-07-02T08:20:34",
"upload_time_iso_8601": "2024-07-02T08:20:34.098371Z",
"url": "https://files.pythonhosted.org/packages/c9/14/944b61c7df20a5987b29d6cd1f7e9bc42d3a049e23a57b1648f43720943d/pyquafu-0.4.1-cp310-cp310-macosx_13_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9d7aef44f9773bc621e0784d07727048cd84aab4c36042b56cb8f44a5f91e549",
"md5": "dd3f2fdc2714f7559218209d9194aaf6",
"sha256": "33f4a937ebc8499c971390afeac9872b924da081ae75cd7d9501367036911fca"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "dd3f2fdc2714f7559218209d9194aaf6",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 370965,
"upload_time": "2024-07-02T08:20:06",
"upload_time_iso_8601": "2024-07-02T08:20:06.782693Z",
"url": "https://files.pythonhosted.org/packages/9d/7a/ef44f9773bc621e0784d07727048cd84aab4c36042b56cb8f44a5f91e549/pyquafu-0.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2b6c5458847b5ce8ed4f1b5c4d21470056932be473a2bbefd2dea957886b1212",
"md5": "56a41a83b45f7958799e6c7bb4345201",
"sha256": "7463ff8c26d7a122b49435c841c25f4c666f7f6453cc18a5b95200eb5b9522a2"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "56a41a83b45f7958799e6c7bb4345201",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 270566,
"upload_time": "2024-07-02T08:21:49",
"upload_time_iso_8601": "2024-07-02T08:21:49.925313Z",
"url": "https://files.pythonhosted.org/packages/2b/6c/5458847b5ce8ed4f1b5c4d21470056932be473a2bbefd2dea957886b1212/pyquafu-0.4.1-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac5953d0856df69d66d13a2bae0a2167117e539050ad30863eb0f847b7eb0ae4",
"md5": "47714cfef74b8df690740a2dcee1e409",
"sha256": "008e173f3bad825ecfdc09b1a3beb941900e5ea58fc997a51e36b2541ea264fd"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp311-cp311-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "47714cfef74b8df690740a2dcee1e409",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 246567,
"upload_time": "2024-07-02T08:20:16",
"upload_time_iso_8601": "2024-07-02T08:20:16.339802Z",
"url": "https://files.pythonhosted.org/packages/ac/59/53d0856df69d66d13a2bae0a2167117e539050ad30863eb0f847b7eb0ae4/pyquafu-0.4.1-cp311-cp311-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d951e4407e66794ec8753b5c89bb472a1929ed01c9ed5c0a7bd246e24c17336f",
"md5": "130a303059388463e77b2d6d89ca1c00",
"sha256": "2d971b123b6c63e23e84eee1f57e82c4d6dabc9c083bb815b0b177b103340e2e"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp311-cp311-macosx_13_0_x86_64.whl",
"has_sig": false,
"md5_digest": "130a303059388463e77b2d6d89ca1c00",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 263863,
"upload_time": "2024-07-02T08:21:55",
"upload_time_iso_8601": "2024-07-02T08:21:55.738189Z",
"url": "https://files.pythonhosted.org/packages/d9/51/e4407e66794ec8753b5c89bb472a1929ed01c9ed5c0a7bd246e24c17336f/pyquafu-0.4.1-cp311-cp311-macosx_13_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b82472234ca7e100dbb0e827c5ed100def7b4e67a412d92ae366f8ed9ce2059c",
"md5": "502d15b78a0689dd1498b640c61e7033",
"sha256": "519305167e24c732e0539997b4c2aed9287687977e0a0b3c11020767fe3264c0"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "502d15b78a0689dd1498b640c61e7033",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 372627,
"upload_time": "2024-07-02T08:20:03",
"upload_time_iso_8601": "2024-07-02T08:20:03.206946Z",
"url": "https://files.pythonhosted.org/packages/b8/24/72234ca7e100dbb0e827c5ed100def7b4e67a412d92ae366f8ed9ce2059c/pyquafu-0.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "771de5c8dfff54a72d3595b6de4959454aed87eb6cfe7050c201ad46b5b0fef0",
"md5": "e7da16aba604db021b8b4723e859d0ec",
"sha256": "cf48175a98dcf948bcef1239fd2cead86bc79e71eaf8c235adb5384c761e7abe"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "e7da16aba604db021b8b4723e859d0ec",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 271270,
"upload_time": "2024-07-02T08:22:10",
"upload_time_iso_8601": "2024-07-02T08:22:10.814284Z",
"url": "https://files.pythonhosted.org/packages/77/1d/e5c8dfff54a72d3595b6de4959454aed87eb6cfe7050c201ad46b5b0fef0/pyquafu-0.4.1-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c0abf73155f4f1940c35ed94a9b3ed3b9b3039ceafbd8f1b3cce2fe6aa74a7fb",
"md5": "4c6cee0aa3b0c27b92372df954ef400c",
"sha256": "7c0554369e099d818be21fc6054993547f420feed4203e82005cfcb4a4e453d9"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp38-cp38-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "4c6cee0aa3b0c27b92372df954ef400c",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 245031,
"upload_time": "2024-07-02T08:20:58",
"upload_time_iso_8601": "2024-07-02T08:20:58.378943Z",
"url": "https://files.pythonhosted.org/packages/c0/ab/f73155f4f1940c35ed94a9b3ed3b9b3039ceafbd8f1b3cce2fe6aa74a7fb/pyquafu-0.4.1-cp38-cp38-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "14c159ea7e542ce3272950fe3e0325bb709d1bdf841049f38c1ed13a22e2ec0a",
"md5": "b8f84fe4ccb52910be6faff643a41c8b",
"sha256": "9a0b930670dca21c6cb91bd1385cf613025f935fd9f228b04346e1b6966e580c"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp38-cp38-macosx_13_0_x86_64.whl",
"has_sig": false,
"md5_digest": "b8f84fe4ccb52910be6faff643a41c8b",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 262389,
"upload_time": "2024-07-02T08:22:33",
"upload_time_iso_8601": "2024-07-02T08:22:33.589832Z",
"url": "https://files.pythonhosted.org/packages/14/c1/59ea7e542ce3272950fe3e0325bb709d1bdf841049f38c1ed13a22e2ec0a/pyquafu-0.4.1-cp38-cp38-macosx_13_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "583322d5029fcb754a049e359954d1ec808c022b91abe8495ba9f800194954b4",
"md5": "a1e11ae73d8fe9e06f1f55717f6ae588",
"sha256": "f716113e7b70956ee82d446842e115fc31a126594106a492a8bcb64af5176ee3"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a1e11ae73d8fe9e06f1f55717f6ae588",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 370712,
"upload_time": "2024-07-02T08:19:58",
"upload_time_iso_8601": "2024-07-02T08:19:58.967679Z",
"url": "https://files.pythonhosted.org/packages/58/33/22d5029fcb754a049e359954d1ec808c022b91abe8495ba9f800194954b4/pyquafu-0.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3cd7a3211ad112591196fb2a4e46d2170e6d0e4db2f1ccfbc104c36c05e0dd7c",
"md5": "4870caf5c63b52544e044918014446c9",
"sha256": "4ab0d956992503de737787a23ebb84f8ff6cf4a499ec26ff32485f1f29424cbf"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "4870caf5c63b52544e044918014446c9",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 270650,
"upload_time": "2024-07-02T08:22:53",
"upload_time_iso_8601": "2024-07-02T08:22:53.584299Z",
"url": "https://files.pythonhosted.org/packages/3c/d7/a3211ad112591196fb2a4e46d2170e6d0e4db2f1ccfbc104c36c05e0dd7c/pyquafu-0.4.1-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0b7f37e66eea23d2ac0ee97e6ad9652ddc6535823fa341b23b153bf04f7ad68c",
"md5": "16b47b47e1f60f522f6014d66042442c",
"sha256": "3912d8d0975830288967b6356dca08a440398779bd9c520eaec8603b677ad2a0"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp39-cp39-macosx_13_0_arm64.whl",
"has_sig": false,
"md5_digest": "16b47b47e1f60f522f6014d66042442c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 245226,
"upload_time": "2024-07-02T08:20:31",
"upload_time_iso_8601": "2024-07-02T08:20:31.593763Z",
"url": "https://files.pythonhosted.org/packages/0b/7f/37e66eea23d2ac0ee97e6ad9652ddc6535823fa341b23b153bf04f7ad68c/pyquafu-0.4.1-cp39-cp39-macosx_13_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dbb331d609c5cdec79ac393e43bef29f28fedcba588351b2debd387140400ad0",
"md5": "69848421346857df5c773b795c30267b",
"sha256": "135e7093d8a086f35a3ba92106412f89204d3c7c93025f24dcdaf902a411668b"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp39-cp39-macosx_13_0_x86_64.whl",
"has_sig": false,
"md5_digest": "69848421346857df5c773b795c30267b",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 262487,
"upload_time": "2024-07-02T08:22:27",
"upload_time_iso_8601": "2024-07-02T08:22:27.573482Z",
"url": "https://files.pythonhosted.org/packages/db/b3/31d609c5cdec79ac393e43bef29f28fedcba588351b2debd387140400ad0/pyquafu-0.4.1-cp39-cp39-macosx_13_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8e574e37bbc2251f080d0097eff7ec3d195dd41619d3499ce03aa160b2a17181",
"md5": "c57d1ec7798f92ab59f811a6cb474bcc",
"sha256": "ac4c2421e951b6de9a5ac3d2399a4c0c74504fc230e04d3d16b539fe7efbde44"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "c57d1ec7798f92ab59f811a6cb474bcc",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 371154,
"upload_time": "2024-07-02T08:19:57",
"upload_time_iso_8601": "2024-07-02T08:19:57.713380Z",
"url": "https://files.pythonhosted.org/packages/8e/57/4e37bbc2251f080d0097eff7ec3d195dd41619d3499ce03aa160b2a17181/pyquafu-0.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1b71e1bc92e981aaec8d80d041e04c1e64d8136efac98037cef75df8bb4835c8",
"md5": "cd8512e2dd78cc1f0e329ab5b1001cfb",
"sha256": "0bc8b4a7084984f11fe1c831f570e38b6655374ea1e21b09df48f1e1ecea9bf1"
},
"downloads": -1,
"filename": "pyquafu-0.4.1-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "cd8512e2dd78cc1f0e329ab5b1001cfb",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 270271,
"upload_time": "2024-07-02T08:23:04",
"upload_time_iso_8601": "2024-07-02T08:23:04.357329Z",
"url": "https://files.pythonhosted.org/packages/1b/71/e1bc92e981aaec8d80d041e04c1e64d8136efac98037cef75df8bb4835c8/pyquafu-0.4.1-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-02 08:21:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ScQ-Cloud",
"github_project": "pyquafu",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pyquafu"
}