diff --git a/docs/source/guide/lre-3-options.md b/docs/source/guide/lre-3-options.md index a58891c4a..e9894b0af 100644 --- a/docs/source/guide/lre-3-options.md +++ b/docs/source/guide/lre-3-options.md @@ -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, @@ -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 @@ -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 @@ -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) diff --git a/docs/source/guide/lre-4-low-level.md b/docs/source/guide/lre-4-low-level.md index e85805c35..07cdee8c4 100644 --- a/docs/source/guide/lre-4-low-level.md +++ b/docs/source/guide/lre-4-low-level.md @@ -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.