{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Interoperability in the QLM\n", "\n", "\n", "MyQLM comes with bindings towards various python based frameworks:\n", "\n", "![here](recap.png)\n", "\n", "\n", "| Language | to QLM | From QLM |\n", "|:---------:|:-------:|:---------:|\n", "| Qiskit | Yes | Yes |\n", "| openqasm | Yes | No |\n", "| pyquil | Yes | Yes |\n", "| projectq | Yes | No |\n", "| cirq | Yes | Yes |\n", "\n", "\n", "This document presents some examples and explanations, for further information about\n", "usage, refer to the linked tutorials.\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "nbsphinx-toctree": {} }, "source": [ "## Tutorials\n", "\n", "- [Qiskit: interoperability](Qiskit.ipynb)\n", "- [Qiskit: connect to IBMQ backend](using_qiskit_qpus.ipynb)\n", "- [Pyquil (deprecated for python 3.6)](Pyquil.ipynb)\n", "- [Cirq](Cirq.ipynb)\n", "- [Projectq](Projectq.ipynb)\n", "- [Openqasm](Openqasm.ipynb)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Conventions\n", "\n", "### Code structure\n", "\n", "This is the structure of the library.\n", "\n", "```bash\n", "├── cirq\n", "│ ├── algorithms.py\n", "│ ├── converters.py\n", "│ └── providers.py\n", "│\n", "├── openqasm\n", "│ ├── oqasm_routine.py\n", "│ ├── qasm_lexer.py\n", "│ └── qasm_parser.py\n", "├── projectq\n", "│ ├── algorithms.py\n", "│ ├── converters.py\n", "│ └── providers.py\n", "├── pyquil\n", "│ ├── algorithms.py\n", "│ ├── converters.py\n", "│ └── providers.py \n", "└── qiskit\n", " ├── algorithms.py\n", " ├── converters.py\n", " └── providers.py\n", "```\n", "\n", "Besides openqasm which is different because it is just a compiler, the different libraries offer circuit conversions (`converters.py`), qpu and other wrappers for seamless integration (`providers.py`) and some ready to use algorithms mostly for testing purposes, generally taken from the corresponding library of each language (`algorithms.py`).\n", "\n", "Currently only pyquil and qiskit have providers, because they're the only ones who offer the possibility for implementing them.\n", "\n", "Also only pyquil has algorithms, since qiskit's have been removed and the others do not have such easily _plugable_ examples.\n", "\n", "### Naming conventions\n", "\n", "To make using these libraries even easier, we're using the same conventions for names as well :\n", "\n", "#### Circuit conversions\n", "\n", "To import any conversion function it's easy: \n", "In any conversion, two frameworks are involved, the QLM and another one, we'll call it framework of interest\n", "```python\n", "from qat.interop.<'framework of interest'>.converters import to_<'framework to which to convert'>_circ\n", "\n", "# e.g.\n", "\n", "from qat.interop.qiskit.converters import to_qlm_circ\n", "from qat.interop.cirq.converters import to_cirq_circ\n", "```\n", "\n", "The names of the frameworks are :\n", "\n", "\n", "- qlm\n", "- qiskit\n", "- cirq\n", "- projectq\n", "- pyquil\n" ] } ], "metadata": { "authors": [ "Simon Martiel", "Arnaud Gazda" ], "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.11" } }, "nbformat": 4, "nbformat_minor": 2 }