qsteed


Nameqsteed JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/BAQIS-Quantum/QSteed
SummaryQuantum Software of Compilation for supporting Real Quantum device
upload_time2024-07-13 11:58:02
maintainerNone
docs_urlNone
authorXuhongze
requires_python>=3.10
licenseApache-2.0 License
keywords qsteed quantum compiling quantum computing quantum operating system
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QSteed

[![License](https://img.shields.io/github/license/BAQIS-Quantum/qsteed.svg?)](https://opensource.org/licenses/Apache-2.0)
[![Current Release](https://img.shields.io/github/release/BAQIS-Quantum/qsteed.svg?)](https://github.com/BAQIS-Quantum/qsteed/releases)
![Python versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)
[![Downloads](https://img.shields.io/pypi/dm/qsteed.svg?)](https://pypi.org/project/qsteed/)

[//]: # (![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qsteed))


**QSteed** is a **Q**uantum **S**of**t**war**e** of 
Compilation for supporting R**e**al Quantum **d**evice, 
including a quantum compiler, a quantum resource 
virtualization manager, and a task scheduler.

## Installation
### Install from PyPI
You can install QSteed via pip:
```bash
pip install qsteed
```

### Install from source
You can directly download the [source code](https://github.com/BAQIS-Quantum/qsteed/archive/refs/heads/master.zip) from GitHub
or clone the repository using the following command.
```bash
git clone https://github.com/BAQIS-Quantum/QSteed.git
```
Change to the qsteed directory install using the following command.
```bash
pip install -r requirements.txt
python setup.py install
```

## Example
```python
import matplotlib.pyplot as plt
from qsteed import Transpiler
from qsteed.backends.backend import Backend
from qsteed.passes.mapping.layout.sabre_layout import SabreLayout
from qsteed.passes.model import Model
from qsteed.passes.optimization.optimization_combine import GateCombineOptimization
from qsteed.passes.optimization.one_qubit_optimization import OneQubitGateOptimization
from qsteed.passes.unroll.unroll_to_2qubit import UnrollTo2Qubit
from qsteed.passes.unroll.unroll_to_basis import UnrollToBasis
from qsteed.utils.random_circuit import RandomCircuit
from qsteed.passflow.passflow import PassFlow

# Generating random quantum circuits (needs to be a pyquafu QuantumCircuit class)
rqc = RandomCircuit(num_qubit=5, gates_number=100, gates_list=['cx', 'rx', 'rz', 'ry', 'h'])
qc = rqc.random_circuit()

# Set chip information (the number of chip qubits needs to be consistent
# with the number of quantum circuit qubits)
basis_gates = ['cx', 'rx', 'ry', 'rz', 'id', 'h']
c_list = [(2, 3, 0.982), (3, 2, 0.982), (3, 4, 0.973), (4, 3, 0.973), 
          (0, 1, 0.98), (1, 0, 0.98), (1, 2, 0.97), (2, 1, 0.97)]
backend_properties = {
    'name': 'ExampleBackend',
    'backend_type': 'superconducting',
    'qubits_num': 5,
    'coupling_list': c_list,
    'basis_gates': basis_gates,
}

# Predefined compilation passflow
passes = [
    UnrollTo2Qubit(),
    SabreLayout(heuristic='fidelity', max_iterations=3),  # heuristic='distance' or 'fidelity', 'mixture'
    UnrollToBasis(basis_gates=basis_gates),
    GateCombineOptimization(),
    OneQubitGateOptimization()
]
passflow = PassFlow(passes=passes)

backend_instance = Backend(**backend_properties)
initial_model = Model(backend=backend_instance)

compiler = Transpiler(passflow, initial_model)
compiled_circuit = compiler.transpile(qc)
compiled_circuit.plot_circuit()
plt.show()
```

You can also use preset compilation passflow with optimization_level 0-3:
Using preset compilation passflow, see [preset_passflow.py](qsteed/passflow/preset_passflow.py)
```python
compiler = Transpiler(initial_model=initial_model)
compiled_circuit = compiler.transpile(qc, optimization_level=3)
```

## More Tests
See [tests](tests) for more examples.

## Real machine deployment
QSteed has been successfully deployed to the [Quafu Quantum Cloud Computing Cluster](https://quafu.baqis.ac.cn/), 
supporting the compilation and optimization of user tasks into quantum circuits 
executable by quantum processors. 
You can submit tasks through the [Quafu Composer](https://quafu.baqis.ac.cn/#/composer) web interface,
[Pyquafu](https://scq-cloud.github.io/) client, 
or [QuarkStudio](https://www.yuque.com/wuming-6g8w2/ghzgfk/azika5xqlpxig3q3?singleDoc#) client.

The public version of QSteed does not yet provide features such as 
quantum resource management and unified software-hardware interface calls. 
We will gradually make these features available according to our plan. 
If you would like to learn more about real machine deployment, please contact us.


## How to contribute
For information on how to contribute, please send an e-mail to members of developer of this project.

QSteed was developed by the quantum operating system team of the Beijing Academy of Quantum Information Sciences.

## License
QSteed is released under the Apache 2.0 license. See [LICENSE](LICENSE) for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/BAQIS-Quantum/QSteed",
    "name": "qsteed",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "qsteed, quantum compiling, quantum computing, quantum operating system",
    "author": "Xuhongze",
    "author_email": "xhzby1995@163.com",
    "download_url": "https://files.pythonhosted.org/packages/62/ec/b1117606ccf62aebfa6c8e136b182e618bbf22e76f6dead254695b534989/qsteed-0.1.1.tar.gz",
    "platform": null,
    "description": "# QSteed\n\n[![License](https://img.shields.io/github/license/BAQIS-Quantum/qsteed.svg?)](https://opensource.org/licenses/Apache-2.0)\n[![Current Release](https://img.shields.io/github/release/BAQIS-Quantum/qsteed.svg?)](https://github.com/BAQIS-Quantum/qsteed/releases)\n![Python versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)\n[![Downloads](https://img.shields.io/pypi/dm/qsteed.svg?)](https://pypi.org/project/qsteed/)\n\n[//]: # (![PyPI - Python Version](https://img.shields.io/pypi/pyversions/qsteed))\n\n\n**QSteed** is a **Q**uantum **S**of**t**war**e** of \nCompilation for supporting R**e**al Quantum **d**evice, \nincluding a quantum compiler, a quantum resource \nvirtualization manager, and a task scheduler.\n\n## Installation\n### Install from PyPI\nYou can install QSteed via pip:\n```bash\npip install qsteed\n```\n\n### Install from source\nYou can directly download the [source code](https://github.com/BAQIS-Quantum/qsteed/archive/refs/heads/master.zip) from GitHub\nor clone the repository using the following command.\n```bash\ngit clone https://github.com/BAQIS-Quantum/QSteed.git\n```\nChange to the qsteed directory install using the following command.\n```bash\npip install -r requirements.txt\npython setup.py install\n```\n\n## Example\n```python\nimport matplotlib.pyplot as plt\nfrom qsteed import Transpiler\nfrom qsteed.backends.backend import Backend\nfrom qsteed.passes.mapping.layout.sabre_layout import SabreLayout\nfrom qsteed.passes.model import Model\nfrom qsteed.passes.optimization.optimization_combine import GateCombineOptimization\nfrom qsteed.passes.optimization.one_qubit_optimization import OneQubitGateOptimization\nfrom qsteed.passes.unroll.unroll_to_2qubit import UnrollTo2Qubit\nfrom qsteed.passes.unroll.unroll_to_basis import UnrollToBasis\nfrom qsteed.utils.random_circuit import RandomCircuit\nfrom qsteed.passflow.passflow import PassFlow\n\n# Generating random quantum circuits (needs to be a pyquafu QuantumCircuit class)\nrqc = RandomCircuit(num_qubit=5, gates_number=100, gates_list=['cx', 'rx', 'rz', 'ry', 'h'])\nqc = rqc.random_circuit()\n\n# Set chip information (the number of chip qubits needs to be consistent\n# with the number of quantum circuit qubits)\nbasis_gates = ['cx', 'rx', 'ry', 'rz', 'id', 'h']\nc_list = [(2, 3, 0.982), (3, 2, 0.982), (3, 4, 0.973), (4, 3, 0.973), \n          (0, 1, 0.98), (1, 0, 0.98), (1, 2, 0.97), (2, 1, 0.97)]\nbackend_properties = {\n    'name': 'ExampleBackend',\n    'backend_type': 'superconducting',\n    'qubits_num': 5,\n    'coupling_list': c_list,\n    'basis_gates': basis_gates,\n}\n\n# Predefined compilation passflow\npasses = [\n    UnrollTo2Qubit(),\n    SabreLayout(heuristic='fidelity', max_iterations=3),  # heuristic='distance' or 'fidelity', 'mixture'\n    UnrollToBasis(basis_gates=basis_gates),\n    GateCombineOptimization(),\n    OneQubitGateOptimization()\n]\npassflow = PassFlow(passes=passes)\n\nbackend_instance = Backend(**backend_properties)\ninitial_model = Model(backend=backend_instance)\n\ncompiler = Transpiler(passflow, initial_model)\ncompiled_circuit = compiler.transpile(qc)\ncompiled_circuit.plot_circuit()\nplt.show()\n```\n\nYou can also use preset compilation passflow with optimization_level 0-3:\nUsing preset compilation passflow, see [preset_passflow.py](qsteed/passflow/preset_passflow.py)\n```python\ncompiler = Transpiler(initial_model=initial_model)\ncompiled_circuit = compiler.transpile(qc, optimization_level=3)\n```\n\n## More Tests\nSee [tests](tests) for more examples.\n\n## Real machine deployment\nQSteed has been successfully deployed to the [Quafu Quantum Cloud Computing Cluster](https://quafu.baqis.ac.cn/), \nsupporting the compilation and optimization of user tasks into quantum circuits \nexecutable by quantum processors. \nYou can submit tasks through the [Quafu Composer](https://quafu.baqis.ac.cn/#/composer) web interface,\n[Pyquafu](https://scq-cloud.github.io/) client, \nor [QuarkStudio](https://www.yuque.com/wuming-6g8w2/ghzgfk/azika5xqlpxig3q3?singleDoc#) client.\n\nThe public version of QSteed does not yet provide features such as \nquantum resource management and unified software-hardware interface calls. \nWe will gradually make these features available according to our plan. \nIf you would like to learn more about real machine deployment, please contact us.\n\n\n## How to contribute\nFor information on how to contribute, please send an e-mail to members of developer of this project.\n\nQSteed was developed by the quantum operating system team of the Beijing Academy of Quantum Information Sciences.\n\n## License\nQSteed is released under the Apache 2.0 license. See [LICENSE](LICENSE) for more details.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0 License",
    "summary": "Quantum Software of Compilation for supporting Real Quantum device",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/BAQIS-Quantum/QSteed"
    },
    "split_keywords": [
        "qsteed",
        " quantum compiling",
        " quantum computing",
        " quantum operating system"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae164cd0b992e4fe54a1fc3ab25273efc91530682e07d8457cfb0ef2938dc52d",
                "md5": "52465090fdcfb06c425ec46321a9ec43",
                "sha256": "f0d8a110edc0f2561decd470e0d94c0244eb4012476086d9370257084a7b40ae"
            },
            "downloads": -1,
            "filename": "qsteed-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "52465090fdcfb06c425ec46321a9ec43",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 157755,
            "upload_time": "2024-07-13T11:57:59",
            "upload_time_iso_8601": "2024-07-13T11:57:59.991309Z",
            "url": "https://files.pythonhosted.org/packages/ae/16/4cd0b992e4fe54a1fc3ab25273efc91530682e07d8457cfb0ef2938dc52d/qsteed-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "62ecb1117606ccf62aebfa6c8e136b182e618bbf22e76f6dead254695b534989",
                "md5": "2710b0d9fb5034f56d5e643f180acade",
                "sha256": "05b3737fb6610c38fb6c4cc275f28641fb7b975aea5e664e7670fbfba499d2c8"
            },
            "downloads": -1,
            "filename": "qsteed-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2710b0d9fb5034f56d5e643f180acade",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 71025,
            "upload_time": "2024-07-13T11:58:02",
            "upload_time_iso_8601": "2024-07-13T11:58:02.395018Z",
            "url": "https://files.pythonhosted.org/packages/62/ec/b1117606ccf62aebfa6c8e136b182e618bbf22e76f6dead254695b534989/qsteed-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-13 11:58:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "BAQIS-Quantum",
    "github_project": "QSteed",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qsteed"
}
        
Elapsed time: 0.29368s