Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Nov 11, 2024
1 parent 9721577 commit 5741058
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/qibo/quantum_info/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,15 @@ def average_gate_fidelity(
Example::
from qibo import matrices
from qibo.quantum_info import average_gate_fidelity
from qibo.quantum_info import average_gate_fidelity, to_choi
# The import above is equivalent to
# from qibo.quantum_info.metrics import average_gate_fidelity
# from qibo.quantum_info.superoperator_transformations import to_choi
X = matrices.X
H = matrices.H
X_choi = to_choi(matrices.X)
H_choi = to_choi(matrices.H)
avf -
agf = average_gate_fidelity(X_choi, H_choi)
Args:
channel (ndarray): quantum channel :math:`\\mathcal{E}` in the Choi representation.
Expand Down Expand Up @@ -792,8 +795,10 @@ def expressibility(
order: Optional[Union[int, float, str]] = 2,
backend=None,
):
"""Returns the expressibility :math:`\\|A\\|` of a parametrized circuit,
where
"""Returns the expressibility of a parametrized circuit.
The expressibility of a parametrized circuits is defined as :math:`\\|A\\|`, where
.. math::
A = \\int_{\\text{Haar}} d\\psi \\, \\left(|\\psi\\rangle\\right.\\left.
Expand All @@ -806,7 +811,8 @@ def expressibility(
power_t (int): power that defines the :math:`t`-design.
samples (int): number of samples to estimate the integrals.
order (int or float or str, optional): order of the norm :math:`\\|A\\|`.
For specifications, see :meth:`qibo.backends.abstract.calculate_norm`.
For specifications, see
:meth:`qibo.backends.abstract.Backend.calculate_norm_density_matrix`.
Defaults to :math:`2`.
backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used
in the execution. If ``None``, it uses the current backend.
Expand Down

0 comments on commit 5741058

Please sign in to comment.