{ "info": { "author": "Rigetti Computing", "author_email": "softapps@rigetti.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pyQuil\n\nA library for easily generating Quil programs to be executed using the Rigetti Forest platform.\npyQuil is licensed under the [Apache 2.0 license](https://github.com/rigetti/pyQuil/blob/master/LICENSE).\n\n[![Build Status](https://semaphoreci.com/api/v1/rigetti/pyquil/branches/master/badge.svg)](https://semaphoreci.com/rigetti/pyquil)\n[![Documentation Status](https://readthedocs.org/projects/pyquil/badge/?version=latest)](http://pyquil.readthedocs.io/en/latest/?badge=latest)\n\n## Documentation\n\nDocumentation is hosted at [http://pyquil.readthedocs.io/en/latest/](http://pyquil.readthedocs.io/en/latest/)\n\n## Installation\n\nYou can install pyQuil as a conda package (recommended):\n\n```bash\nconda install -c rigetti pyquil\n```\n\nor using `pip`:\n\n```\npip install pyquil\n```\n\nTo instead install pyQuil from source, clone this repository, `cd` into it, and run:\n```\npip install -e .\n```\n\n## Connecting to Rigetti Forest\n\npyQuil can be used to build and manipulate Quil programs without restriction. However, to run\nprograms (e.g., to get wavefunctions, get multishot experiment data), you will need an API key\nfor [Rigetti Forest](http://forest.rigetti.com). This will allow you to run your programs on the\nRigetti Quantum Virtual Machine (QVM) or on a real quantum processor (QPU).\n\nOnce you have your key, run the following command to automatically set up your config:\n\n```\npyquil-config-setup\n```\n\nYou can also create the configuration file manually if you'd like and place it at `~/.pyquil_config`.\nThe configuration file is in INI format and should contain all the information required to connect to Forest:\n\n```\n[Rigetti Forest]\nkey: \nuser_id: \n```\n\nYou can change the location of this file by setting the `PYQUIL_CONFIG` environment variable.\n\nIf you encounter errors or warnings trying to connect to Forest then see the full\n[Getting Started Guide](https://go.rigetti.com/getting-started)\n\n## Examples using the Rigetti QVM\n\nHere is how to construct a Bell state program and how to compute the amplitudes of its wavefunction:\n\n```python\n>>> from pyquil.quil import Program\n>>> from pyquil.api import QVMConnection\n>>> from pyquil.gates import *\n>>> qvm = QVMConnection()\n>>> p = Program(H(0), CNOT(0,1))\n\n>>> qvm.wavefunction(p).amplitudes\narray([0.7071067811865475+0j, 0j, 0j, 0.7071067811865475+0j])\n```\n\nHow to do a simulated multishot experiment measuring qubits 0 and 1 of a Bell state. (Of course,\neach measurement pair will be `00` or `11`.)\n\n```python\n>>> from pyquil.quil import Program\n>>> from pyquil.api import QVMConnection\n>>> from pyquil.gates import *\n>>> qvm = QVMConnection()\n>>> p = Program()\n>>> p.inst(H(0),\n... CNOT(0, 1),\n... MEASURE(0, 0),\n... MEASURE(1, 1))\n\n>>> print(p)\nH 0\nCNOT 0 1\nMEASURE 0 [0]\nMEASURE 1 [1]\n\n>>> qvm.run(p, [0, 1], 10)\n[[0, 0], [1, 1], [1, 1], [0, 0], [0, 0], [1, 1], [0, 0], [0, 0], [0, 0], [0, 0]]\n```\n\n## Community\n\nJoin the public Forest Slack channel at [http://slack.rigetti.com](http://slack.rigetti.com).\n\nThe following projects have been contributed by community members:\n\n- [Syntax Highlighting for Quil](https://github.com/JavaFXpert/quil-syntax-highlighter)\n contributed by [James Weaver](https://github.com/JavaFXpert)\n- [Web Based Circuit Simulator](https://github.com/rasa97/quil-sim/tree/master)\n contributed by [Ravisankar A V](https://github.com/rasa97)\n- [Quil in Javascript](https://github.com/mapmeld/jsquil)\n contributed by [Nick Doiron](https://github.com/mapmeld)\n- [Quil in Java](https://github.com/QCHackers/jquil)\n contributed by [Victory Omole](https://github.com/vtomole)\n\n## Developing PyQuil\n\nTo make changes to PyQuil itself see [DEVELOPMENT.md](DEVELOPMENT.md) for instructions on development and testing.\n\n## How to cite pyQuil and Forest\n\nIf you use pyQuil, Grove, or other parts of the Rigetti Forest stack in your research, please cite it as follows:\n\nBibTeX:\n```\n@misc{1608.03355,\n title={A Practical Quantum Instruction Set Architecture},\n author={Smith, Robert S and Curtis, Michael J and Zeng, William J},\n journal={arXiv preprint arXiv:1608.03355},\n year={2016}\n}\n```\n\nText:\n```\nR. Smith, M. J. Curtis and W. J. Zeng, \"A Practical Quantum Instruction Set Architecture,\" (2016), \n arXiv:1608.03355 [quant-ph], https://arxiv.org/abs/1608.03355\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rigetti/pyquil.git", "keywords": "quantum quil programming hybrid", "license": "Apache-2.0", "maintainer": "", "maintainer_email": "", "name": "qcs", "package_url": "https://pypi.org/project/qcs/", "platform": "", "project_url": "https://pypi.org/project/qcs/", "project_urls": { "Homepage": "https://github.com/rigetti/pyquil.git" }, "release_url": "https://pypi.org/project/qcs/2.1.0/", "requires_dist": null, "requires_python": ">=3.5", "summary": "A Python library to generate Quantum Instruction Language (Quil) Programs.", "version": "2.1.0" }, "last_serial": 5211559, "releases": { "2.1.0": [ { "comment_text": "", "digests": { "md5": "02a59a17bf70f06c325543f9be2aed8e", "sha256": "6d1923d09ca716385e5390b3e2ab8023f5bd7ef9aaa27f7bb8897b0e7f1ff494" }, "downloads": -1, "filename": "qcs-2.1.0.tar.gz", "has_sig": false, "md5_digest": "02a59a17bf70f06c325543f9be2aed8e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 119734, "upload_time": "2018-12-04T19:58:50", "url": "https://files.pythonhosted.org/packages/20/2b/96f2bf8dad777f40d0cb20ddcaf9161cc9d60f9364d38872e8297828da43/qcs-2.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "02a59a17bf70f06c325543f9be2aed8e", "sha256": "6d1923d09ca716385e5390b3e2ab8023f5bd7ef9aaa27f7bb8897b0e7f1ff494" }, "downloads": -1, "filename": "qcs-2.1.0.tar.gz", "has_sig": false, "md5_digest": "02a59a17bf70f06c325543f9be2aed8e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 119734, "upload_time": "2018-12-04T19:58:50", "url": "https://files.pythonhosted.org/packages/20/2b/96f2bf8dad777f40d0cb20ddcaf9161cc9d60f9364d38872e8297828da43/qcs-2.1.0.tar.gz" } ] }