Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Fix tox -e docs and build docs in CI #394

Merged
merged 13 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include LICENSE.txt
include requirements.txt

# Include the tests files.
#recursive-include test *.py
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Qiskit QEC is an open-source framework for developers, experimentalist and theor
How-to Guides <how_tos/index>
API References <apidocs/index>
Discussions <discussions/index>
Release Notes <release_notes>

.. Hiding - Indices and tables
:ref:`genindex`
Expand Down
1 change: 0 additions & 1 deletion docs/release_notes.rst

This file was deleted.

35 changes: 17 additions & 18 deletions docs/tutorials/QEC_Framework_IEEE_2022.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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$."
]
Expand All @@ -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",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -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"
]
},
{
Expand All @@ -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$:"
Expand Down Expand Up @@ -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",
"<div class=\"alert alert-block alert-warning\">\n",
" <b>Update:</b> The current structure for storing these geometries has been updated slightly to allow for collections of operators to create one larger single operator.\n",
Expand Down Expand Up @@ -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)"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions releasenotes/config.yaml

This file was deleted.

65 changes: 0 additions & 65 deletions releasenotes/notes/example-d4b1c2dbc14a89bd.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/qiskit_qec/linear/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
Linear module classes and functions
===================================

.. autosummary::
:toctree: ../stubs/

Bit
SMatrix

Linear matrix functions
=======================
Expand Down
6 changes: 4 additions & 2 deletions src/qiskit_qec/operators/pauli_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/qiskit_qec/utils/stim_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ deps =
jax
jaxlib
commands =
sphinx-build -b html -W {posargs} docs/ docs/_build/html
sphinx-build -b html docs/ docs/_build/html
Loading