Skip to content

Commit

Permalink
Fix small typos and update explanantions (#88) (#92)
Browse files Browse the repository at this point in the history
* typo

* update explanations

* update remaining mentions of "canonical dual frame"

* simplify "ketbra" in explanations

* update explanations

(cherry picked from commit 83ffc87)

Co-authored-by: Timothée Dao <[email protected]>
  • Loading branch information
mergify[bot] and timmintam authored Aug 14, 2024
1 parent 8b27f2b commit 43b82e8
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/explanations/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ unitary :math:`U_i`, sampled from a set :math:`\mathcal{U}`, and then
performing a measurement in the computational basis. We show in the section :ref:`pm-simulable` that
this protocol is equivalent to performing the PM-simulable POVM
:math:`\mathbf{M} = \biguplus_i q_i \mathbf{P}_i = \{q_i P_{i,k}\}_{(i,k)}`,
where :math:`P_{i,k} = U_i^\dagger \ketbra{k} U_i` and the outcomes are labeled by
where :math:`P_{i,k} = U_i^\dagger \ketbra{k}{k} U_i` and the outcomes are labeled by
:math:`(i,k)`. It now appears that the measurement channel

.. math::
Expand Down
16 changes: 15 additions & 1 deletion docs/explanations/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Given such a decomposition of :math:`\mathcal{O}`, the expectation value
.. math::
:label: expectation_value_decomp
{\langle\mathcal{O}\rangle}_\rho = \mathrm{Tr}[\rho O] = \sum_k \omega_k \mathrm{Tr}[\rho M_k] = \mathbb{E}_{k \sim \{p_k\}}[\omega_k].
{\langle\mathcal{O}\rangle}_\rho = \mathrm{Tr}[\rho O] = \sum_k \omega_k \mathrm{Tr}[\rho M_k]
= \mathbb{E}_{k \sim \{p_k\}}[\omega_k].
In other words, :math:`{\langle\mathcal{O}\rangle}_\rho` can be expressed as the mean
value of the random variable :math:`\omega_k` over the probability
Expand All @@ -59,6 +60,19 @@ unbiased Monte-Carlo estimator of :math:`{\langle\mathcal{O}\rangle}_\rho` as
\hat{o} : \{k^{(1)},\dots, k^{(S)}\} \mapsto \frac{1}{S} \sum_{s=1}^{S} \omega_{k^{(s)}}.
The expected value of the estimator is given by :math:`\mathbb{E}[\hat{o}] = {\langle\mathcal{O}\rangle}_\rho`
and its variance is given by

.. math::
:label: estimator_variance
\mathrm{Var}[\hat{o}] = \frac{1}{S}\left(\sum_k p_k \omega_k^2 - ( \sum_k p_k \omega_k )^2\right)
\propto \sum_k p_k \omega_k^2 - {\langle\mathcal{O}\rangle}_\rho^2 \, ,
which depends on both the choice of the POVM :math:`\{M_k\}_{k}` and the decomposition weights
:math:`\{\omega_k\}_{k}`, when they are not unique. Ideally we would like to choose the POVM and the
decomposition weights that minimize the variance.

------------------
PM-simulable POVMs
------------------
Expand Down
42 changes: 24 additions & 18 deletions docs/how_tos/dual_optimizer.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions povm_toolbox/post_processor/median_of_means.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def __init__(
povm_sample: a result from a POVM sampler run.
dual: the Dual frame that will be used to obtain the decomposition weights of an
observable when computing its expectation value. For more details, refer to
:meth:`get_decomposition_weights`. When this is ``None``, the canonical Dual frame
will be constructed from the POVM stored in the ``povm_sample``'s
:attr:`.POVMPubResult.metadata`.
:meth:`get_decomposition_weights`. When this is ``None``, the default
"state-average" Dual frame will be constructed from the POVM stored in the
``povm_sample``'s :attr:`.POVMPubResult.metadata`.
num_batches: number of batches, i.e. number of samples means, used in the median-of-means
estimator. This value will be overridden if a ``delta_confidence`` argument is supplied.
upper_delta_confidence: an upper bound for the confidence parameter :math:`\delta` used to
Expand Down
6 changes: 3 additions & 3 deletions povm_toolbox/post_processor/povm_post_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ def __init__(
povm_sample: a result from a POVM sampler run.
dual: the Dual frame that will be used to obtain the decomposition weights of an
observable when computing its expectation value. For more details, refer to
:meth:`get_decomposition_weights`. When this is ``None``, the canonical Dual frame
will be constructed from the POVM stored in the ``povm_sample``'s
:attr:`.POVMPubResult.metadata`.
:meth:`get_decomposition_weights`. When this is ``None``, the standard
"state-average" Dual frame will be constructed from the POVM stored in the
``povm_sample``'s :attr:`.POVMPubResult.metadata`.
Raises:
ValueError: If the provided ``dual`` is not a dual frame to the POVM stored in the
Expand Down

0 comments on commit 43b82e8

Please sign in to comment.