{ "info": { "author": "Adrien Suau", "author_email": "adrien.suau@grenoble-inp.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: CeCILL-B Free Software License Agreement (CECILL-B)", "Programming Language :: Python :: 3 :: Only", "Topic :: Multimedia :: Graphics :: Graphics Conversion" ], "description": "\nqasm2image\n==========\n\nThe qasm2image repository provides functions to represent quantum circuits written following the `OpenQASM `_ specification.\n\nInstallation\n------------\n\nDependencies\n^^^^^^^^^^^^\n\nThe tool and all the dependencies are available via the PIP tool. See the installation instructions below.\n\nInstallation procedure\n^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: shell\n\n pip3 install cffi\n pip3 install qasm2image\n\nUsage\n-----\n\nIn a Python environnement\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n # Import the functions\n from qasm2image import qasm2svg\n from qasm2image import qasm2png\n # Generate your QASM string (either read from a file or generate a circuit and ask for its QASM).\n qasm_str = \"...\"\n # Define the basis used to represent the circuit\n basis = 'u1,u2,u3,U,cx'\n # Compute the SVG representation\n svg_str = qasm2svg(qasm_str, basis=basis, show_clbits=True)\n # Compute the PNG representation\n png_bytes = qasm2png(qasm_str, basis=basis, show_clbits=True)\n # Types of the outputs\n assert type(svg_str) is str\n assert type(png_bytes) is bytes\n # Write the result into files\n with open('circuit.svg', 'w') as svg_file:\n svg_file.write(svg_str)\n # Don't forget to write in *binary* mode for PNG\n with open('circuit.png', 'wb') as png_file:\n png_file.write(png_bytes)\n\nIn a shell environnement\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nA script is provided to change QASM code directly from the command line.\n\n.. code-block:: shell\n\n $ qasm2image -h\n usage: qasm2image [-h] [-b BASIS] [--hide-clbits] [-s SCALE]\n input_file output_file\n\n Transform a quantum circuit in QASM format to an image format.\n\n positional arguments:\n input_file the QASM file implementing the circuit to transform\n output_file the image file that will be generated by the tool\n\n optional arguments:\n -h, --help show this help message and exit\n -b BASIS, --basis BASIS\n a comma-separated list of gate names which represent\n the gate basis in which the circuit will be decomposed\n --hide-clbits if present, classical bits will not be represented\n -s SCALE, --scale SCALE\n scale of the PNG image. SVG output is not affected by\n this parameter\n\nLicense\n-------\n\nThis project is distributed under the `CeCILL-B `_ license. A copy of the whole license is included\nin the repository.\n\nIn order to use the work in this repository you have a strong obligation to cite (as stated in the license):\n\n\n#. \n The author of the work: Adrien Suau (see on my GitHub page or `mail me `_ if any doubt).\n\n#. \n The CERFACS (Centre Europ\u00e9en de Recherche et de Formation Avanc\u00e9e en Calcul Scientifique).\n\nOutput\n------\n\n`adder.qasm `_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/adder_simple.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/adder_simple.png\n :alt: adder.png\n\n\n`qft.qasm `_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/qft_simple.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/qft_simple.png\n :alt: qft.png\n\n\n`inverseqft1.qasm `_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/inverseqft1_simple.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/inverseqft1_simple.png\n :alt: inverseqft1.png\n\n\n`inverseqft2.qasm `_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/inverseqft2_simple.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/inverseqft2_simple.png\n :alt: inverseqft2.png\n\n\n`qec.qasm `_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/qec_simple.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/qec_simple.png\n :alt: qec.png\n\nThe same QASM code, but with the ``hide-clbits`` option set: ``qasm2image --hide-clbits qec.{qasm,png}``.\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/qec_no_clbits.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/qec_no_clbits.png\n :alt: qec\\_no\\_clbits.png\n\n\n`teleportv2.qasm `_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n.. image:: https://github.com/nelimeee/qasm2image/blob/master/images/teleportv2_simple.png\n :target: https://github.com/nelimeee/qasm2image/blob/master/images/teleportv2_simple.png\n :alt: teleportv2.png\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nelimeee/qasm2image", "keywords": "qasm svg png visualisation", "license": "", "maintainer": "", "maintainer_email": "", "name": "qasm2image", "package_url": "https://pypi.org/project/qasm2image/", "platform": "", "project_url": "https://pypi.org/project/qasm2image/", "project_urls": { "Homepage": "https://github.com/nelimeee/qasm2image" }, "release_url": "https://pypi.org/project/qasm2image/0.8.0/", "requires_dist": null, "requires_python": "", "summary": "An OpenQASM visualisation tool", "version": "0.8.0" }, "last_serial": 4356045, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "d9c16fc4473ddd483f61d6fd6c227cc7", "sha256": "3070eff77c82899278f915ead5b351f52a11953d0bc86019b0efc21977bae1fa" }, "downloads": -1, "filename": "qasm2image-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d9c16fc4473ddd483f61d6fd6c227cc7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 23796, "upload_time": "2018-03-16T13:04:51", "url": "https://files.pythonhosted.org/packages/e5/a7/586eea546a53069a11b51d373f390813f7f9fed0834ad4ca13799cc685d3/qasm2image-0.3-py3-none-any.whl" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "012ae3d64f0c9809239d4a4c916e5ea9", "sha256": "c648a8e33bdedd9392904692342c9c0180f853aab14f3c5b5c8b98b97273cdd7" }, "downloads": -1, "filename": "qasm2image-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "012ae3d64f0c9809239d4a4c916e5ea9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 23792, "upload_time": "2018-03-16T13:20:31", "url": "https://files.pythonhosted.org/packages/39/0b/5c849dd6147f9da09fca4abef8dc1a766573f56ee99eb3450c5f8c10a6f2/qasm2image-0.3.1-py3-none-any.whl" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "e9f604b3f454bc738d40145ea92a617b", "sha256": "06095c122bc62642f00ff9e8adbcf2ccf9103735a1be3f07f5057bc73d7d676f" }, "downloads": -1, "filename": "qasm2image-0.4.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e9f604b3f454bc738d40145ea92a617b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 24122, "upload_time": "2018-03-28T15:07:06", "url": "https://files.pythonhosted.org/packages/1a/1a/063a89dbb24e0e2b7fc2a7dbc44b6af201922893331744dc0f441a0a4952/qasm2image-0.4.0-py3-none-any.whl" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "a3d842334ddeeda139720ae7e6d3ae4f", "sha256": "caadb97565fc4aff72efad5d4ed0bae3fda521c88559f00969fe021b1d95654f" }, "downloads": -1, "filename": "qasm2image-0.4.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a3d842334ddeeda139720ae7e6d3ae4f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 24422, "upload_time": "2018-03-30T13:25:34", "url": "https://files.pythonhosted.org/packages/23/88/4eaa652107d7e21d326560117ecc8a2379010912550851932ff80d367e6a/qasm2image-0.4.1-py3-none-any.whl" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "717f493252e56f7ffdda6902b279ff45", "sha256": "b18f319d504ed035d67afb805b9bd43d15534542c6e15133dc810fe13c907d53" }, "downloads": -1, "filename": "qasm2image-0.4.2-py3-none-any.whl", "has_sig": false, "md5_digest": "717f493252e56f7ffdda6902b279ff45", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 25451, "upload_time": "2018-04-06T09:24:37", "url": "https://files.pythonhosted.org/packages/dd/77/d55fff44e86e36710976b82149d5b43476f5a423dc4b375a6498a0a8f935/qasm2image-0.4.2-py3-none-any.whl" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "2a89e1bd17d8d705280040518ae75e0c", "sha256": "5352a38974450b869c5f6ae53e0c87cf73826ff7c2f10da7fdd362408d7c90f9" }, "downloads": -1, "filename": "qasm2image-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2a89e1bd17d8d705280040518ae75e0c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 26456, "upload_time": "2018-04-09T09:07:30", "url": "https://files.pythonhosted.org/packages/a7/06/3c45dfc5d37aeb5ae75d4e853a4f82ca817ce06ac8bdb35d03aa3faa27cc/qasm2image-0.5.0-py3-none-any.whl" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "992b1638b5e3edec7e17f804c7113223", "sha256": "ad61a0d5de1ff4e9e6b262ebf3c6b6a508fab5923b4a407a5785ad7f2996f823" }, "downloads": -1, "filename": "qasm2image-0.6.0.tar.gz", "has_sig": false, "md5_digest": "992b1638b5e3edec7e17f804c7113223", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40217, "upload_time": "2018-05-17T15:08:23", "url": "https://files.pythonhosted.org/packages/7b/39/5dde4a7c5656b9edd9b637676fb467412a536cdb22b80cf36a2eb4fcb8d5/qasm2image-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "cef9b39e29fda8782665305e54cfc51c", "sha256": "8d424505e4bdcaaffe2ed6fc82d7ebccf3b57e57ddef9ff32fee81ba3350ac02" }, "downloads": -1, "filename": "qasm2image-0.7.0-py3-none-any.whl", "has_sig": false, "md5_digest": "cef9b39e29fda8782665305e54cfc51c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 29281, "upload_time": "2018-06-15T12:02:11", "url": "https://files.pythonhosted.org/packages/18/86/fe14bd68dc01cdbd06da8c56cc05a18683f37db80a48622062fe80496a54/qasm2image-0.7.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e92f22caf3210ac97b1b7476b34eca28", "sha256": "b711222eaa5149df797ade5e79946f389c06e98821e366c807999050be7e2450" }, "downloads": -1, "filename": "qasm2image-0.7.0.tar.gz", "has_sig": false, "md5_digest": "e92f22caf3210ac97b1b7476b34eca28", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 27459, "upload_time": "2018-10-09T14:24:06", "url": "https://files.pythonhosted.org/packages/77/8c/1020bf493228f4ad8de0f5c0bd87a221b04d6a55c43ec6abfe39cad91100/qasm2image-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "d0636fce1798c6d5cc5e633131774a11", "sha256": "582c2aad99c0bd6e073dc2ad2225d07bc4c04017d7acfe19afa5bd69e79a85e7" }, "downloads": -1, "filename": "qasm2image-0.8.0.tar.gz", "has_sig": false, "md5_digest": "d0636fce1798c6d5cc5e633131774a11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27459, "upload_time": "2018-10-09T14:25:53", "url": "https://files.pythonhosted.org/packages/98/2c/b83d975c729ce084d97cdedec5df5f2cecf1f61d122d56bd0d3c5d134b36/qasm2image-0.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0636fce1798c6d5cc5e633131774a11", "sha256": "582c2aad99c0bd6e073dc2ad2225d07bc4c04017d7acfe19afa5bd69e79a85e7" }, "downloads": -1, "filename": "qasm2image-0.8.0.tar.gz", "has_sig": false, "md5_digest": "d0636fce1798c6d5cc5e633131774a11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27459, "upload_time": "2018-10-09T14:25:53", "url": "https://files.pythonhosted.org/packages/98/2c/b83d975c729ce084d97cdedec5df5f2cecf1f61d122d56bd0d3c5d134b36/qasm2image-0.8.0.tar.gz" } ] }