{ "info": { "author": "Zac Espinosa, Matt Radzihovsky", "author_email": "zespinosa97@gmail.com, mattradz@stanford.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# NetQuil: A quantum playground for distributed quantum computing simulations\n\nNetQuil is an open-source Python framework designed specifically for simulating quantum networks and distributed quantum protocol. Built on the already extensive quantum computing framework [pyQuil](https://github.com/rigetti/pyquil), by [Rigetti Computing](https://www.rigetti.com/), netQuil is perfect for extending your current quantum computing experiments and testing ideas in quantum network topology and distributed quantum protocol. NetQuil offers an extensible device simulator, quantum and classical noise modules, and a performant multi-threaded simulation manager. It also allows you to run multiple trials across your network, syncronize agents based on local and master clocks, and review traffic in real time with a network monitor. NetQuil is also optimized for distributed quantum protocol with its implementation of the primitive cat-entangler and cat-disentangler introduced by [Yimsiriwattana Lomonaco](https://arxiv.org/abs/quant-ph/0402148). This primitive protocols can be used to implement non-local CNOTs, non-local controlled gates, and teleportation, and should be the backbone of any distributed quantum protocol you create.\n\nNetQuil is a project by AT&T Foundry. NetQuil is a work in progress and contributions are encouraged.\n\n## Documentation\nExplore netQuil's [documentation center](https://att-innovate.github.io/netQuil/index.html) learn more about the framework and its use cases. If you are interested in learning about the state of distributed quantum computing (DQC) and netQuil's role as a framework in the field read the [whitepaper](https://github.com/att-innovate/netQuil), \"netQuil: A quantum playground for distributed quantum computing simulations\". \n\n## Installation\nYou can install netQuil directly using `pip`: \n\n```\npip install netquil\n```\n\n## netQuil Design\n![Overview of netQuil framework structure](https://github.com/att-innovate/netQuil/blob/gh-pages/_images/layout.png)\n\n## Demos\nCheckout netQuil in action in the [demos](https://github.com/att-innovate/netQuil/tree/master/demos) folder and at the [documentation center](https://att-innovate.github.io/netQuil/index.html): \n\n### Quantum Teleportation\n\nAs a simple demonstration of netQuil, let's imagine a scenario where Alice wants to send Bob the quantum state of an arbitrary qubit she possesses. \nSince Alice does not know the state of the qubit, and she cannot measure it, because measuring it would cause the state to collapse, Alice decides to use [quantum \nteleportation](https://en.wikipedia.org/wiki/Quantum_teleportation).\n\n![Quantum Teleportation Circuit](https://raw.githubusercontent.com/att-innovate/netQuil/blob/gh-pages/_images/teleportation.png)\n\n- Charlie creates a bell state pair and sends one qubit to Alice and the other to Bob.\n- Alice receives Charlie's qubit. Alice projects her arbitrary quantum state onto qubit A using a CNOT and Hadamard gate. \n- Alice measures her qubits and classically sends the results to Bob. As a result of the measurements Bob's state collapses to one of the four Bell States. \n- Bob recreate's Alice's arbitrary state based on Alice's measurements, namely applying a Pauli-X (X) gate if Alice's bell state pair is 1 and applying a Pauli-Z (Z) gate if the arbitrary state is measured to be 1. \n\nWe can implement quantum teleportation using netQuil in the following manner: \n```\nfrom pyquil import Program\nfrom pyquil.api import WavefunctionSimulator, QVMConnection\nfrom pyquil.gates import *\n\ndef printWF(p):\n '''\n Prints the wavefunction from simulating a program p\n '''\n wf_sim = WavefunctionSimulator()\n waveFunction = wf_sim.wavefunction(p)\n print(waveFunction)\n\n\nclass Charlie(Agent):\n '''\n Charlie sends Bell pairs to Alice and Bob\n '''\n def run(self):\n\n # Create Bell State Pair\n p = self.program\n p += H(0)\n p += CNOT(0,1)\n\n self.qsend(alice.name, [0])\n self.qsend(bob.name, [1])\n\nclass Alice(Agent): \n '''\n Alice projects her state on her Bell State Pair from Charlie\n '''\n def run(self): \n p = self.program\n\n # Define Alice's Qubits\n phi = self.qubits[0]\n qubitsCharlie = self.qrecv(charlie.name)\n a = qubitsCharlie[0]\n\n # Entangle Ancilla and Phi\n p += CNOT(phi, a)\n p += H(phi)\n\n # Measure Ancilla and Phi\n p += MEASURE(a, ro[0])\n p += MEASURE(phi, ro[1])\n\n\nclass Bob(Agent): \n '''\n Bob recreates Alice's state based on her measurements\n '''\n def run(self):\n p = self.program\n\n # Define Bob's qubits\n qubitsCharlie = self.qrecv(charlie.name)\n b = qubitsCharlie[0]\n\n # Prepare State Based on Measurements\n p.if_then(ro[0], X(b))\n p.if_then(ro[1], Z(b))\n\n\np = Program()\n\n# Prepare psi\np += H(2)\np += Z(2)\np += RZ(1.2, 2)\nprint(\"Initial Alice State: \")\nprintWF(p)\n\n# Create Classical Memory\nro = p.declare('ro', 'BIT', 3)\n\n# Create Alice, Bob, and Charlie. Give Alice qubit 2 (phi). Give Charlie qubits [0,1] (Bell State Pairs). \nalice = Alice(p, qubits=[2], name='alice')\nbob = Bob(p, name='bob')\ncharlie = Charlie(p, qubits=[0,1], name='charlie')\n\n# Connect agents to distribute qubits and report results\nQConnect(alice, charlie, bob)\nCConnect(alice, bob)\n\n# Run simulation\nSimulation(alice, bob, charlie).run(trials=1, agent_classes=[Alice, Bob, Charlie])\nqvm = QVMConnection()\nqvm.run(p)\nprint(\"Final Bob's State: \")\nprintWF(p)\n```\n\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/att-innovate/netQuil", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "netQuil", "package_url": "https://pypi.org/project/netQuil/", "platform": "", "project_url": "https://pypi.org/project/netQuil/", "project_urls": { "Homepage": "https://github.com/att-innovate/netQuil" }, "release_url": "https://pypi.org/project/netQuil/1.0.2/", "requires_dist": [ "numpy", "pyquil" ], "requires_python": "", "summary": "A Distributed Quantum Network Simulator", "version": "1.0.2" }, "last_serial": 5721735, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "5145d05c07fb0f3bf403eb11e19a081d", "sha256": "ddca2fe6223e7582603f6eae61964f09f8afff22e516514571450f2e9e7b8f55" }, "downloads": -1, "filename": "netQuil-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "5145d05c07fb0f3bf403eb11e19a081d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14544, "upload_time": "2019-08-13T21:35:24", "url": "https://files.pythonhosted.org/packages/a1/a7/5d068b119446af646790c3bb38043b63439e897018a98a3d1615f069152a/netQuil-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d2d7458739aecad622caa02de305476", "sha256": "dafc7319499dffb24c8b7dace91c8d92a1e8c22c37b43e3f9c4d5042b3dd5cfb" }, "downloads": -1, "filename": "netQuil-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9d2d7458739aecad622caa02de305476", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11304, "upload_time": "2019-08-13T21:35:27", "url": "https://files.pythonhosted.org/packages/7f/20/ea6c9b47d8aad209f04c8a1d6de7f947972f3918044cf28e1b712715c1a3/netQuil-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "800a5c29babfe768d0aa746bab714a31", "sha256": "0da6812e0e6ef068370716ce32df5e5b450a038a083efdba20990d00318aacc3" }, "downloads": -1, "filename": "netQuil-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "800a5c29babfe768d0aa746bab714a31", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14622, "upload_time": "2019-08-23T16:28:29", "url": "https://files.pythonhosted.org/packages/7a/73/014d6c8c9b66588ff8de8fdcf3ba436c6c91f115776f2f66a9682170d729/netQuil-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aa88212fb1ec1a2859c3879153621a0e", "sha256": "449c3f220bf17b7f65583cc4929909c5620e3bb64e1ed0323ee24097581fda00" }, "downloads": -1, "filename": "netQuil-1.0.1.tar.gz", "has_sig": false, "md5_digest": "aa88212fb1ec1a2859c3879153621a0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13225, "upload_time": "2019-08-23T16:28:31", "url": "https://files.pythonhosted.org/packages/79/5e/79235f577f9600db94a16c3d06bfd2b809abdb94a67b1dfb53e999b9d727/netQuil-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "a88d3fa38f569e674f1c4f8651c11ac2", "sha256": "4ea8450d141d8b1b0faaf8598f0c4b2f1f152a200b01c0dd99fba9bcf107e0f0" }, "downloads": -1, "filename": "netQuil-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a88d3fa38f569e674f1c4f8651c11ac2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16639, "upload_time": "2019-08-23T17:14:34", "url": "https://files.pythonhosted.org/packages/48/36/d06b548a4ec0b874adc2e59409a548fed82692ec3eb49176b6facf4e0948/netQuil-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a97920c7e61ad0ab0de60062d7f1dba", "sha256": "b988fa80eff15c14732d6867e2456eccad84497d92fba6180da1ddb79368d9ec" }, "downloads": -1, "filename": "netQuil-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0a97920c7e61ad0ab0de60062d7f1dba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15413, "upload_time": "2019-08-23T17:14:36", "url": "https://files.pythonhosted.org/packages/29/28/2bff6a5e756cf43b987bc584d0855768cdbf16c286e64139596e29370282/netQuil-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a88d3fa38f569e674f1c4f8651c11ac2", "sha256": "4ea8450d141d8b1b0faaf8598f0c4b2f1f152a200b01c0dd99fba9bcf107e0f0" }, "downloads": -1, "filename": "netQuil-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a88d3fa38f569e674f1c4f8651c11ac2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16639, "upload_time": "2019-08-23T17:14:34", "url": "https://files.pythonhosted.org/packages/48/36/d06b548a4ec0b874adc2e59409a548fed82692ec3eb49176b6facf4e0948/netQuil-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a97920c7e61ad0ab0de60062d7f1dba", "sha256": "b988fa80eff15c14732d6867e2456eccad84497d92fba6180da1ddb79368d9ec" }, "downloads": -1, "filename": "netQuil-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0a97920c7e61ad0ab0de60062d7f1dba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15413, "upload_time": "2019-08-23T17:14:36", "url": "https://files.pythonhosted.org/packages/29/28/2bff6a5e756cf43b987bc584d0855768cdbf16c286e64139596e29370282/netQuil-1.0.2.tar.gz" } ] }