Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Sep 23, 2024
1 parent c92f49c commit a383ead
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/qibo/quantum_info/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,13 @@ def total_variation_distance(
For probabilities :math:`p` and :math:`q`, the total variation distance is defined as
.. math::
\\operatorname{TVD}(p, q) = \frac{1}{2} \\, \\norm{p - q}_{1}
= \\frac{1}{2} \\, \\sum_{x} \\, \\abs{p(x) - q(x)} \\, ,
\\begin{align}
\\operatorname{TVD}(p, \\, q) &= \\frac{1}{2} \\, \\|p - q\\|_{1}
&= \\frac{1}{2} \\, \\sum_{x} \\, \\left|{p(x) - q(x)\\right| \\, ,
\\end{align}
where :math:`\\|\\cdot\\|_{1}` detones the :math:`\\ell_{1}`-norm.
where :math:`\\norm{\\cdot}_{1}` detones the :math:`\\ell_{1}`-norm.
Args:
prob_dist_p (ndarray or list): discrete probability distribution :math:`p`.
Expand Down

0 comments on commit a383ead

Please sign in to comment.