{ "info": { "author": "QuantumInspire", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Quantum Inspire SDK\n\n*Note: this SDK is made available as a public beta, please report any\nissues or bugs in the github issue tracker.*\n\nThe Quantum Inspire platform allows to execute quantum algorithms using the cQASM language. \n\nThe software development kit (SDK) for the Quantum Inspire platform consists of:\n\n* An API for the [Quantum Inspire](https://www.quantum-inspire.com/) platform (the QuantumInspireAPI class);\n* Backends for:\n * the [ProjectQ SDK](https://github.com/ProjectQ-Framework/ProjectQ);\n * the [Qiskit SDK](https://qiskit.org/).\n\nFor more information on Quantum Inspire see\n[https://www.quantum-inspire.com/](https://www.quantum-inspire.com/). Detailed information\non cQASM can be found in the Quantum Inspire\n[knowledge base](https://www.quantum-inspire.com/kbase/advanced-guide/).\n\n\n## Installation\n\nThe Quantum Inspire SDK can be installed from PyPI via pip:\n\n```\n$ pip install quantuminspire\n```\n\nIn addition, to use Quantum Inspire through Qiskit or ProjectQ, install either or both of\nthe qiskit and projectq packages:\n\n```\n$ pip install qiskit\n$ pip install projectq\n```\n\n### Installing from source\n\nThe source for the SDK can also be found at Github. For the default installation execute:\n\n```\n$ git clone https://github.com/QuTech-Delft/quantuminspire\n$ cd quantuminspire\n$ pip install .\n```\n\nThis does not install ProjectQ or Qiskit, but will install the Quantum Inspire backends for\nthose projects.\n\nIf you want to include a specific SDK as a dependency, install with\n(e.g. for the ProjectQ backend):\n\n```\n$ pip install .[projectq]\n```\n\nTo install both ProjectQ as well as Qiskit as a dependency:\n\n```\n$ pip install .[qiskit,projectq]\n```\n\n## Running\n\nFor example usage see the python scripts and Jupyter notebooks in the [docs/](docs/) directory\nwhen installed from source or the share/doc/quantuminspire/examples/ directory in the\nlibrary root (Python\u2019s sys.prefix for system installations; site.USER_BASE for user\ninstallations) when installed from PyPI.\n\nFor example, to run the ProjectQ example notebook after installing from source:\n\n```\ncd docs\njupyter notebook example_projectq.ipynb\n```\n\nOr to perform Grover's with the ProjectQ backend from a Python script:\n\n```\ncd docs\npython example_projectq_grover.py\n```\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuTech-Delft/quantuminspire/master?filepath=docs)\n\nAnother way to browse and run the available notebooks is by clicking the 'launch binder' button above.\n\nIt is also possible to use the API through the QuantumInspireAPI object\ndirectly. This is for advanced users that really know what they are\ndoing. The intention of the QuantumInspireAPI class is that it is used\nas a thin layer between existing SDK's such as ProjectQ and Qiskit,\nand is not primarily meant for general use. You may want to explore this\nif you intend to write a new backend for an existing SDK.\n\nA simple example to perform entanglement between two qubits by using the\nAPI wrapper directly:\n\n```python\nfrom getpass import getpass\nfrom coreapi.auth import BasicAuthentication\nfrom quantuminspire.api import QuantumInspireAPI\n\nprint('Enter mail address')\nemail = input()\n\nprint('Enter password')\npassword = getpass()\n\nserver_url = r'https://api.quantum-inspire.com'\nauthentication = BasicAuthentication(email, password)\nqi = QuantumInspireAPI(server_url, authentication)\n\nqasm = '''version 1.0\n\nqubits 2\n\nH q[0]\nCNOT q[0], q[1]\ndisplay\n'''\n\nbackend_type = qi.get_backend_type_by_name('QX single-node simulator')\nresult = qi.execute_qasm(qasm, backend_type=backend_type, number_of_shots=1024)\n\nprint(result['histogram'])\n```\n\n## Configure your token credentials for Quantum Inspire\n\n1. Create a Quantum Inspire account if you do not already have one.\n2. Get an API token from the Quantum Inspire website.\n3. With your API token run: \n```python\nfrom quantuminspire.credentials import save_account\nsave_account('YOUR_API_TOKEN')\n```\nAfter calling save_account(), your credentials will be stored on disk.\nThose who do not want to save their credentials to disk should use instead:\n```python\nfrom quantuminspire.credentials import enable_account\nenable_account('YOUR_API_TOKEN')\n```\nand the token will only be active for the session.\n\nAfter calling save_account() once or enable_account() within your session, token authentication is done automatically\nwhen creating the Quantum Inspire API object.\n\nFor Qiskit users this means:\n```python\nfrom quantuminspire.qiskit import QI\nQI.set_authentication()\n```\nProjectQ users do something like:\n```python\nfrom quantuminspire.api import QuantumInspireAPI\nqi = QuantumInspireAPI()\n```\nTo create a token authentication object yourself using the stored token you do:\n```python\nfrom quantuminspire.credentials import get_token_authentication\nauth = get_token_authentication()\n```\nThis `auth` can then be used to initialize the Quantum Inspire API object.\n ## Known issues\n\n* Some test-cases call protected methods\n* Known issues and common questions regarding the Quantum Inspire platform\n can be found in the [FAQ](https://www.quantum-inspire.com/faq/).\n \n## Bug reports\n\nPlease submit bug-reports [on the github issue tracker](https://github.com/QuTech-Delft/quantuminspire/issues).\n\n## Testing\n\nRun all unit tests and collect the code coverage using:\n\n```\ncoverage run --source=\"./src/quantuminspire\" -m unittest discover -s src/tests -t src -v\ncoverage report -m\n```\n\n## Note\n\nIf you are getting import errors related to `tests.quantuminspire` when running\nthe above commands after a `pip install -e .`, as a workaround you should remove\nthe package `tests` installed by older versions of `marshmallow-polyfield` (a Qiskit\ndependency):\n\n`rm -Rf env/lib/python3.6/site-packages/tests`", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "quantuminspire", "package_url": "https://pypi.org/project/quantuminspire/", "platform": "", "project_url": "https://pypi.org/project/quantuminspire/", "project_urls": null, "release_url": "https://pypi.org/project/quantuminspire/1.1.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "SDK for the Quantum Inspire platform", "version": "1.1.0" }, "last_serial": 5735079, "releases": { "0.4.0": [ { "comment_text": "", "digests": { "md5": "c91921b1be4796022c3ddca84cb55465", "sha256": "b4a906b8fa3b4977f497650ffb1420fe9e5aab29a334a875ece33272466a2d14" }, "downloads": -1, "filename": "quantuminspire-0.4.0.tar.gz", "has_sig": false, "md5_digest": "c91921b1be4796022c3ddca84cb55465", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17351, "upload_time": "2019-01-08T09:37:09", "url": "https://files.pythonhosted.org/packages/75/7f/8c0113a603e256f8c9819b38ad8e3a7d0e2a293ce35ba3aab1120203fd5b/quantuminspire-0.4.0.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "ce5c7e79d7bdd503f83546eb76a3ece3", "sha256": "2b3447a0c7747bb147883e9d6c628f019aca3b3619e98216d866ed05a9243cf2" }, "downloads": -1, "filename": "quantuminspire-0.4.2.tar.gz", "has_sig": false, "md5_digest": "ce5c7e79d7bdd503f83546eb76a3ece3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17485, "upload_time": "2019-01-08T11:47:16", "url": "https://files.pythonhosted.org/packages/d8/81/9258a4f6e72a1eda9846cfe1ed912bf21474d21ec0f3f22e77075e1bb472/quantuminspire-0.4.2.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "f22d3fff9de528775bba77a383b5baf6", "sha256": "48d0524c2e26260897dea3319bf561d656de23856fcf461626378540a603f1af" }, "downloads": -1, "filename": "quantuminspire-0.5.0.tar.gz", "has_sig": false, "md5_digest": "f22d3fff9de528775bba77a383b5baf6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 17602, "upload_time": "2019-02-12T11:51:39", "url": "https://files.pythonhosted.org/packages/10/5a/b4fc8e388898a2d1d274910ab63dea12d85c36f0c39534cfd7bfccd4751d/quantuminspire-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "f5640d9a8e0c4edde885e190250f5f05", "sha256": "8a7c97d6ab4dc61a68c4f3e8cfbad5ccdcb260be9792f3cd0fa41de1a1a36084" }, "downloads": -1, "filename": "quantuminspire-0.6.0.tar.gz", "has_sig": false, "md5_digest": "f5640d9a8e0c4edde885e190250f5f05", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 187509, "upload_time": "2019-03-26T12:13:04", "url": "https://files.pythonhosted.org/packages/f7/c4/15ab7639f5281f4c3b7e877ab9688257ad4c0fd19b4fd915ac7b1982fbeb/quantuminspire-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "99dee11572866c85a5bb2f5fcbaaa336", "sha256": "84f4a21e2b7e9f6ba9d6aae9c3f58d9127595f7fb8b3967f5b98aa4de69e103d" }, "downloads": -1, "filename": "quantuminspire-0.7.0.tar.gz", "has_sig": false, "md5_digest": "99dee11572866c85a5bb2f5fcbaaa336", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 195561, "upload_time": "2019-05-03T09:20:42", "url": "https://files.pythonhosted.org/packages/9a/04/84ccfd54be412e0fbee7d8779e0ced9ab5c54938d0c1307ebbcdde18d163/quantuminspire-0.7.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "979595ed3ff32a88a18ed62cf05e11a3", "sha256": "eef51f3e6988c0adff430364f7413f8215d4c2232be0d4a14a2b870ce3cc368b" }, "downloads": -1, "filename": "quantuminspire-1.0.0.tar.gz", "has_sig": false, "md5_digest": "979595ed3ff32a88a18ed62cf05e11a3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 617853, "upload_time": "2019-05-22T11:43:10", "url": "https://files.pythonhosted.org/packages/cc/15/d7db02dda02c54a2f1008c89f546fb1f9bfbb9de2f9b93eb3965228eac16/quantuminspire-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "ad786f97a03f8e72e0fb5a8184d0d84d", "sha256": "791d241452ac9ff282b6367e39a8074477031545dd7a85a020b17e32869702b1" }, "downloads": -1, "filename": "quantuminspire-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ad786f97a03f8e72e0fb5a8184d0d84d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 663032, "upload_time": "2019-08-27T07:06:59", "url": "https://files.pythonhosted.org/packages/c1/33/dbc906dba6bd6a4ba44bb738dc43d60bc7e7efcfd43c0d630fdc4ab28e6d/quantuminspire-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ad786f97a03f8e72e0fb5a8184d0d84d", "sha256": "791d241452ac9ff282b6367e39a8074477031545dd7a85a020b17e32869702b1" }, "downloads": -1, "filename": "quantuminspire-1.1.0.tar.gz", "has_sig": false, "md5_digest": "ad786f97a03f8e72e0fb5a8184d0d84d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 663032, "upload_time": "2019-08-27T07:06:59", "url": "https://files.pythonhosted.org/packages/c1/33/dbc906dba6bd6a4ba44bb738dc43d60bc7e7efcfd43c0d630fdc4ab28e6d/quantuminspire-1.1.0.tar.gz" } ] }