From 796073760b9d43a69546dc259194139c47b02a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Silv=C3=A9rio?= <29920212+HGSilveri@users.noreply.github.com> Date: Wed, 11 Dec 2024 13:10:35 +0100 Subject: [PATCH] Converting the Conventions page to markdown (#777) * Setting up Markdown support * Convert Conventions page to markdown * Attempt to use auto-generated labels --- docs/requirements.txt | 1 + docs/source/conf.py | 20 ++ docs/source/conventions.md | 260 ++++++++++++++++++ docs/source/conventions.rst | 246 ----------------- .../State Preparation with the SLM Mask.ipynb | 2 +- 5 files changed, 282 insertions(+), 247 deletions(-) create mode 100644 docs/source/conventions.md delete mode 100644 docs/source/conventions.rst diff --git a/docs/requirements.txt b/docs/requirements.txt index 9a81cc89..5c9ef500 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,6 +5,7 @@ sphinx_autodoc_typehints == 1.21.3 nbsphinx nbsphinx-link ipython >= 8.10 # Avoids bug with code highlighting +myst-parser # Not on PyPI # pandoc diff --git a/docs/source/conf.py b/docs/source/conf.py index 507fb065..e40503e2 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -34,6 +34,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + "myst_parser", "nbsphinx", "nbsphinx_link", "sphinx.ext.autodoc", @@ -42,6 +43,25 @@ "sphinx_autodoc_typehints", ] +myst_enable_extensions = [ + "amsmath", + "attrs_inline", + "colon_fence", + "deflist", + "dollarmath", + # "fieldlist", + # "html_admonition", + "html_image", + # "linkify", + # "replacements", + # "smartquotes", + # "strikethrough", + # "substitution", + # "tasklist", +] + +myst_heading_anchors = 3 + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/docs/source/conventions.md b/docs/source/conventions.md new file mode 100644 index 00000000..73c7e3b3 --- /dev/null +++ b/docs/source/conventions.md @@ -0,0 +1,260 @@ +# Conventions + +## States and Bases + +### Bases + +A basis refers to a set of two eigenstates. The transition between +these two states is said to be addressed by a channel that targets that basis. Namely: + +```{eval-rst} +.. list-table:: + :align: center + :widths: 50 35 35 + :header-rows: 1 + + * - Basis + - Eigenstates + - ``Channel`` type + * - ``ground-rydberg`` + - :math:`|g\rangle,~|r\rangle` + - ``Rydberg`` + * - ``digital`` + - :math:`|g\rangle,~|h\rangle` + - ``Raman`` + * - ``XY`` + - :math:`|0\rangle,~|1\rangle` + - ``Microwave`` + + +``` + +### Qutrit state + +The qutrit state combines the basis states of the `ground-rydberg` and `digital` bases, +which share the same ground state, $|g\rangle$. This qutrit state comes into play +in the digital approach, where the qubit state is encoded in $|g\rangle$ and +$|h\rangle$ but then the Rydberg state $|r\rangle$ is accessed in multi-qubit +gates. + +The qutrit state's basis vectors are defined as: + +$$ +|r\rangle = (1, 0, 0)^T,~~|g\rangle = (0, 1, 0)^T, ~~|h\rangle = (0, 0, 1)^T. +$$ + +### Qubit states + +:::{caution} +There is no implicit relationship between a state's vector representation and its +associated measurement value. To see the measurement value of a state for each +measurement basis, see {ref}`spam-table` . +::: + +When using only the `ground-rydberg` or `digital` basis, the qutrit state is not +needed and is thus reduced to a qubit state. This reduction is made simply by tracing-out +the extra basis state, so we obtain + +- `ground-rydberg`: $|r\rangle = (1, 0)^T,~~|g\rangle = (0, 1)^T$ +- `digital`: $|g\rangle = (1, 0)^T,~~|h\rangle = (0, 1)^T$ + +On the other hand, the `XY` basis uses an independent set of qubit states that are +labelled $|0\rangle$ and $|1\rangle$ and follow the standard convention: + +- `XY`: $|0\rangle = (1, 0)^T,~~|1\rangle = (0, 1)^T$ + +### Multi-partite states + +The combined quantum state of multiple atoms respects their order in the `Register`. +For a register with ordered atoms `(q0, q1, q2, ..., qn)`, the full quantum state will be + +$$ +|q_0, q_1, q_2, ...\rangle = |q_0\rangle \otimes |q_1\rangle \otimes |q_2\rangle \otimes ... \otimes |q_n\rangle +$$ + +:::{note} +The atoms may be labelled arbitrarily without any inherent order, it's only the +order with which they are stored in the `Register` (as returned by +`Register.qubit_ids`) that matters . +::: + + +## State Preparation and Measurement + +```{eval-rst} +.. list-table:: Initial State and Measurement Conventions + :name: spam-table + :align: center + :widths: 60 40 75 + :header-rows: 1 + + * - Basis + - Initial state + - Measurement + * - ``ground-rydberg`` + - :math:`|g\rangle` + - | + | :math:`|r\rangle \rightarrow 1` + | :math:`|g\rangle,|h\rangle \rightarrow 0` + * - ``digital`` + - :math:`|g\rangle` + - | + | :math:`|h\rangle \rightarrow 1` + | :math:`|g\rangle,|r\rangle \rightarrow 0` + * - ``XY`` + - :math:`|0\rangle` + - | + | :math:`|1\rangle \rightarrow 1` + | :math:`|0\rangle \rightarrow 0` +``` + +### Measurement samples order + +Measurement samples are returned as a sequence of 0s and 1s, in +the same order as the atoms in the `Register` and in the multi-partite state. + +For example, a four-qutrit state $|q_0, q_1, q_2, q_3\rangle$ that's +projected onto $|g, r, h, r\rangle$ when measured will record a count to +sample + +- `0101`, if measured in the `ground-rydberg` basis +- `0010`, if measured in the `digital` basis + +## Hamiltonians + +Independently of the mode of operation, the Hamiltonian describing the system +can be written as + +$$ +H(t) = \sum_i \left (H^D_i(t) + \sum_{j