diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3494f3b5..075ccfb6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,4 +48,24 @@ jobs: pip install tox - name: Run styles check run: tox -elint - + docs: + name: Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + sudo apt-get update + sudo apt-get install -y pandoc + - name: Build Docs + run: tox -edocs + - uses: actions/upload-artifact@v3 + with: + name: html_docs + path: docs/_build/html diff --git a/MANIFEST.in b/MANIFEST.in index 5b7d79b9..054e0fa8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include LICENSE.txt +include requirements.txt # Include the tests files. #recursive-include test *.py diff --git a/docs/conf.py b/docs/conf.py index 316699ed..b593fd90 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,10 +34,9 @@ "sphinx.ext.mathjax", "sphinx.ext.viewcode", "sphinx.ext.extlinks", - "jupyter_sphinx", "sphinx_autodoc_typehints", - "reno.sphinxext", "nbsphinx", + "matplotlib.sphinxext.plot_directive", ] templates_path = ["_templates"] numfig = True diff --git a/docs/index.rst b/docs/index.rst index 9d6e4921..f6ffe5fc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,6 @@ Qiskit QEC is an open-source framework for developers, experimentalist and theor How-to Guides API References Discussions - Release Notes .. Hiding - Indices and tables :ref:`genindex` diff --git a/docs/release_notes.rst b/docs/release_notes.rst deleted file mode 100644 index ec77acc3..00000000 --- a/docs/release_notes.rst +++ /dev/null @@ -1 +0,0 @@ -.. release-notes:: Release Notes diff --git a/docs/tutorials/QEC_Framework_IEEE_2022.ipynb b/docs/tutorials/QEC_Framework_IEEE_2022.ipynb index 26023b7b..0b89fb11 100644 --- a/docs/tutorials/QEC_Framework_IEEE_2022.ipynb +++ b/docs/tutorials/QEC_Framework_IEEE_2022.ipynb @@ -118,8 +118,7 @@ "id": "4c797a9b-3e5b-421c-a377-241499ba3cb3", "metadata": {}, "source": [ - "Installation guide\n", - "==================\n", + "# Installation guide\n", "\n", "## Content\n", "* [Setting up python environment](#setting-up-python-environment)\n", @@ -248,7 +247,7 @@ "\n", "**Error correction** is a central topic in information theory and is concerned with the **detection** and **correction** of errors in information.\n", "\n", - "![image.png](attachment:d2c217dd-6426-4aad-a4fd-2b667fb7d53c.png)\n", + "![image2.png](attachment:d2c217dd-6426-4aad-a4fd-2b667fb7d53c.png)\n", "\n", "Here the bit flip channel is an error channel that flips individual bits independently with a given fixed probability. In this example we see that the funcdmental unit of storage is the bit - the two state space $\\mathbb{F}_2$. Here a message is therefore a string of bits and so an element of $\\mathbb{F}^n_2$ for some integer $n$." ] @@ -270,7 +269,7 @@ "id": "06a04858-2c82-4f72-a489-88c70d0209f9", "metadata": {}, "source": [ - "### Repitition Code (Classicial)\n", + "## Repitition Code (Classicial)\n", "\n", "The simplist approach to (classical) error correction is that of repitition: That is a 0 bit is replaced by a fixed number of 0 bits (say 3) 000 and a 1 bit is replaced by the same number of 1 bits 111. The then binary information before can be encoded as follows:\n", "\n", @@ -331,7 +330,7 @@ "\n", "In classical error correction the simplest fundamental unit is the bit ($\\mathbb{F}_2$) where as in the quantum world the simplest fundamental unit is the qubit ($\\mathbb{C}^2$). Consider the differences:\n", "\n", - "![image.png](attachment:5821844f-a69e-4b82-8b3e-a63b1da78c17.png)\n", + "![image3.png](attachment:5821844f-a69e-4b82-8b3e-a63b1da78c17.png)\n", "\n", "We consider $\\mathbb{C}^2$ as a complex Hilbert space (think complex vector space with an inner product $\\langle,\\rangle>$ such that the induced norm makes the space a complete metric space).\n", "\n" @@ -507,7 +506,7 @@ "\n", "$$X|0\\rangle = |1\\rangle, \\quad X|1\\rangle = |0\\rangle \\quad \\textrm{(Bit Flip)} \\qquad\\qquad Z|0\\rangle = |0\\rangle, \\quad Z|1\\rangle = -|1\\rangle \\quad \\textrm{(Phase Flip)}$$\n", "\n", - "![image.png](attachment:d84d4c58-c10c-42e3-ba94-1eac80ac53fc.png)" + "![image4.png](attachment:d84d4c58-c10c-42e3-ba94-1eac80ac53fc.png)" ] }, { @@ -1095,15 +1094,15 @@ "\n", "#### The Toric Code (Dual Representation - Qubits on edges)\n", "\n", - "![image.png](attachment:40af3476-0e19-4eb3-9af7-1af9c8a73e51.png)\n", + "![image5.png](attachment:40af3476-0e19-4eb3-9af7-1af9c8a73e51.png)\n", "\n", "#### The Toric Code (Face Representation Qubits on vertices)\n", "\n", - "![image.png](attachment:39fef1a3-8443-40ab-91a9-aa3e848a050f.png)\n", + "![image6.png](attachment:39fef1a3-8443-40ab-91a9-aa3e848a050f.png)\n", "\n", "#### Rorated Surface Code (Face Representation - Qubits on vertices)\n", "\n", - "![image.png](attachment:a6a7e099-4400-402e-abbf-1494e7756fb8.png)\n", + "![image7.png](attachment:a6a7e099-4400-402e-abbf-1494e7756fb8.png)\n", "\n", "\n", "\n", @@ -1922,7 +1921,7 @@ "id": "02e206b2-ac12-4cd3-a46f-d5aeb3153540", "metadata": {}, "source": [ - "![image.png](attachment:14b32718-5ccc-4bae-aa32-29ed41723b26.png)" + "![image8.png](attachment:14b32718-5ccc-4bae-aa32-29ed41723b26.png)" ] }, { @@ -2064,15 +2063,15 @@ "\n", "### The Toric Code (Dual Representation - Qubits on edges)\n", "\n", - "![image.png](attachment:aa883dea-3abf-4afc-ba62-82bd5a9bdcd1.png)\n", + "![image9.png](attachment:aa883dea-3abf-4afc-ba62-82bd5a9bdcd1.png)\n", "\n", "### The Toric Code (Face Representation Qubits on vertices)\n", "\n", - "![image.png](attachment:153ccb81-3281-42d9-8a39-1a9441777669.png)\n", + "![image10.png](attachment:153ccb81-3281-42d9-8a39-1a9441777669.png)\n", "\n", "### Rorated Surface Code (Face Representation - Qubits on vertices)\n", "\n", - "![image.png](attachment:10177f45-d543-4dfe-950a-f708a7c2785b.png)\n" + "![image11.png](attachment:10177f45-d543-4dfe-950a-f708a7c2785b.png)\n" ] }, { @@ -2092,9 +2091,9 @@ "\n", "The general concept that TileFactories uses relates to tiling/celluation of a region of some surface of which gauge operators are assigned to the cells inside the region along with the associated qubits. The operators/cells that are on the boundary are then modified according to some given appraoch to end up with a set of gauge group generators for a stabilizer subsystem code.\n", "\n", - "![image.png](attachment:76b2a019-704f-44c5-8c1e-f4502da91dd7.png)\n", + "![image12.png](attachment:76b2a019-704f-44c5-8c1e-f4502da91dd7.png)\n", "\n", - "![image.png](attachment:0e37e976-1396-41e9-9f73-d1be2788bc48.png)\n", + "![image13.png](attachment:0e37e976-1396-41e9-9f73-d1be2788bc48.png)\n", "\n", "\n", "TileFactories use a simplified approach where by the region on the surface is tiled using a choosen tile relative to a lattice on that region. For example the second tiling above used the four square tile bedlow with the regulat lattive $\\mathbb{Z}^2$:" @@ -2135,7 +2134,7 @@ "source": [ "A tile is a small collection of gauge operators layed out in a planar region that can be used to tile a region. The Tile contains data on the operators as well as geometric data.\n", "\n", - "![image.png](attachment:13de2438-058c-4d0f-a619-7b909f17399f.png)\n", + "![image14.png](attachment:13de2438-058c-4d0f-a619-7b909f17399f.png)\n", "\n", "
\n", " Update: The current structure for storing these geometries has been updated slightly to allow for collections of operators to create one larger single operator.\n", @@ -2985,7 +2984,7 @@ "\n", "Let's build a $YZX^2$ Hexagonal stabilizer code by Basudha Srivastava, Anton Frisk Kockum, and Mats Granath [https://doi.org/10.22331/q-2022-04-27-698]\n", "\n", - "![image.png](attachment:735545cb-5835-4ff4-b1fc-0c4537912337.png)" + "![image15.png](attachment:735545cb-5835-4ff4-b1fc-0c4537912337.png)" ] }, { @@ -3303,7 +3302,7 @@ "\n", "Let $\\mathcal{E}$ be a completely positive trace preserving (CPTP) linear map $\\mathcal{E}:D(\\mathcal{H})\\rightarrow D(\\mathcal{H})$ that is correctable with respect to the subsystem code $\\mathcal{H} = (A\\otimes{B})\\oplus{C}$. Then a set up for a simple quantum memory experiment would be as follows:\n", "\n", - "![image.png](attachment:c45c9495-da83-4720-be64-8c40d1dd9172.png)\n", + "![image16.png](attachment:c45c9495-da83-4720-be64-8c40d1dd9172.png)\n", "\n", "Here the signatures are eigenvalues for each of the stabilizer/gauge/check/flag/etc operators measured. For QEC experiments the eigenvalues are usually translated into 0s or 1s with a 0 indicating the the +1 eigenstate - i.e. no error detected and a 1 indicating the detection of an error. Ideal syndrome extraction in which no errors occur during the QEC cycle. The more general case is when errors can occur during the QEC cycle. \n", "\n", diff --git a/releasenotes/config.yaml b/releasenotes/config.yaml deleted file mode 100644 index 141d552c..00000000 --- a/releasenotes/config.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -encoding: utf8 -default_branch: main diff --git a/releasenotes/notes/example-d4b1c2dbc14a89bd.yaml b/releasenotes/notes/example-d4b1c2dbc14a89bd.yaml deleted file mode 100644 index 5e93448a..00000000 --- a/releasenotes/notes/example-d4b1c2dbc14a89bd.yaml +++ /dev/null @@ -1,65 +0,0 @@ ---- -prelude: > - Replace this text with content to appear at the top of the section for this - release. All of the prelude content is merged together and then rendered - separately from the items listed in other parts of the file, so the text - needs to be worded so that both the prelude and the other items make sense - when read independently. This may mean repeating some details. Not every - release note requires a prelude. Usually only notes describing major - features or adding release theme details should have a prelude. -features: - - | - List new features here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -issues: - - | - List known issues here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -upgrade: - - | - List upgrade notes here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -deprecations: - - | - List deprecations notes here, or remove this section. All of the list - items in this section are combined when the release notes are rendered, so - the text needs to be worded so that it does not depend on any information - only available in another section, such as the prelude. This may mean - repeating some details. -critical: - - | - Add critical notes here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -security: - - | - Add security notes here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -fixes: - - | - Add normal bug fixes here, or remove this section. All of the list items - in this section are combined when the release notes are rendered, so the - text needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. -other: - - | - Add other notes here, or remove this section. All of the list items in - this section are combined when the release notes are rendered, so the text - needs to be worded so that it does not depend on any information only - available in another section, such as the prelude. This may mean repeating - some details. diff --git a/requirements-dev.txt b/requirements-dev.txt index 3702faed..01be5d73 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,8 +3,6 @@ coverage==6.1.1 cmake!=3.17.1,!=3.17.0 qiskit-sphinx-theme>=1.6 sphinx-autodoc-typehints -jupyter-sphinx -reno>=3.4.0 nbsphinx ddt~=1.4.2 matplotlib>=3.3.0 diff --git a/src/qiskit_qec/linear/__init__.py b/src/qiskit_qec/linear/__init__.py index 6442cc4b..291e03f3 100644 --- a/src/qiskit_qec/linear/__init__.py +++ b/src/qiskit_qec/linear/__init__.py @@ -21,11 +21,6 @@ Linear module classes and functions =================================== -.. autosummary:: - :toctree: ../stubs/ - - Bit - SMatrix Linear matrix functions ======================= diff --git a/src/qiskit_qec/operators/pauli_list.py b/src/qiskit_qec/operators/pauli_list.py index 60661a2b..3f0fab58 100644 --- a/src/qiskit_qec/operators/pauli_list.py +++ b/src/qiskit_qec/operators/pauli_list.py @@ -534,7 +534,8 @@ def sort(self, weight=False, phase=False): Consider sorting all a random ordering of all 2-qubit Paulis - .. jupyter-execute:: + .. plot:: + :include-source: from numpy.random import shuffle from qiskit.quantum_info.operators import PauliList @@ -573,7 +574,8 @@ def unique(self, return_index=False, return_counts=False): **Example** - .. jupyter-execute:: + .. plot:: + :include-source: from qiskit.quantum_info.operators import PauliList diff --git a/src/qiskit_qec/utils/stim_tools.py b/src/qiskit_qec/utils/stim_tools.py index 17015ab4..5c8285ea 100644 --- a/src/qiskit_qec/utils/stim_tools.py +++ b/src/qiskit_qec/utils/stim_tools.py @@ -36,6 +36,7 @@ def get_stim_circuits(circuit_dict: Dict[int, QuantumCircuit]): """Converts compatible qiskit circuits to stim circuits. Dictionaries are not complete. For the stim definitions see: https://github.com/quantumlib/Stim/blob/main/doc/gates.md + Args: circuit_dict: Compatible gates are paulis, controlled paulis, h, s, and sdg, swap, reset, measure and barrier. Compatible noise operators diff --git a/tox.ini b/tox.ini index 958c0931..3a8d37d1 100644 --- a/tox.ini +++ b/tox.ini @@ -37,4 +37,4 @@ deps = jax jaxlib commands = - sphinx-build -b html -W {posargs} docs/ docs/_build/html \ No newline at end of file + sphinx-build -b html docs/ docs/_build/html \ No newline at end of file