Skip to content

Commit

Permalink
minor tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
natestemen committed Nov 7, 2024
1 parent 4fcaedb commit 0e157bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions docs/source/guide/lre-3-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ In [](lre-1-intro.md), {func}`.execute_with_lre` was used to calculated the erro
In this section, we will outline the optional arguments that can be used and adjusted with this technique.

```python
lre_value = mitiq.lre.execute_with_lre(
from mitiq import lre

lre_value = lre.execute_with_lre(
circuit,
executor,
degree,
Expand Down Expand Up @@ -62,8 +64,7 @@ Here, $\lambda_i$ refers to the folding factor for the $i$-th layer. The example

$$\{1, λ_1, λ_2, λ_3, λ_4, λ_1^2, λ_1 λ_2, λ_1 λ_3, λ_1 λ_4, λ_2^2, λ_2 λ_3, λ_2 λ_4, λ_3^2, λ_3 λ_4, λ_4^2\}$$

Each vector of scale factor vectors is given by $\boldsymbol{\lambda_i} = \boldsymbol{1} + 2 \boldsymbol{m_i}$ where $\boldsymbol{1} = (1, 1, \ldots)$ and $\boldsymbol{m_i}$ is a vector of non-negative integers
representing the number of times a layer is to be folded as dictated by the fold multiplier.
Each vector of scale factor vectors is given by $\boldsymbol{\lambda}_i = \boldsymbol{1} + 2 \boldsymbol{m}_i$ where $\boldsymbol{1} = (1, 1, \ldots, 1)$ and $\boldsymbol{m}_i$ is a vector of non-negative integers representing the number of times a layer is to be folded as dictated by the fold multiplier.

```{code-cell} ipython3
from mitiq.lre.multivariate_scaling import get_scale_factor_vectors
Expand Down Expand Up @@ -201,7 +202,8 @@ However, there are two other choices as well: {func}`.fold_all()` and {func}`.fo
`folding_method` parameter in {func}`.execute_with_lre`.

```{tip}
Note that the choice of folding method matters only when the layers in the circuit are altered by chunking multiple layers into fewer layers. Otherwise the noise scaled circuits created using either of the folding methods will look identical as they are created by scaling each layer as required.
The choice of folding method matters only when chunking is employed.
Otherwise the noise scaled circuits created using either of the folding methods will look identical as they are created by scaling each layer as required.
```

```{code-cell} ipython3
Expand Down Expand Up @@ -235,7 +237,7 @@ print(
global_fold_circ,
sep="\n",
)
```

This section showed in detail how to vary the default and non-default parameters required by the technique. An in-depth discussion on these is provided in [](lre-4-low-level.md)
This section showed in detail how to vary the default and non-default parameters required by the technique.
An in-depth discussion on these is provided in [](lre-4-low-level.md)
6 changes: 3 additions & 3 deletions docs/source/guide/lre-4-low-level.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ The diagram shows the workflow of the layerwise Richardson extrapolation (LRE) i

**The first step** involves generating and executing layerwise noise-scaled quantum circuits.

- The user provides a `QPROGRAM` i.e. a frontend supported quantum circuit .

- The user provides a `QPROGRAM` i.e. a frontend supported quantum circuit.
- Mitiq generates a set of layerwise noise-scaled circuits by applying unitary folding based on a set of pre-determined scale factor vectors.
- The noise-scaled circuits are executed on the noisy backend obtaining a set of noisy expectation values.

The noise-scaled circuits are then executed on a backend, obtaining a set of noisy expectation values.

**The second step** involves inferring the error mitigated expectation value from the measured results through multivariate richardson extrapolation.

Expand Down

0 comments on commit 0e157bb

Please sign in to comment.