Skip to content

Commit

Permalink
Merge pull request #1172 from qiboteam/entanglement_entropy
Browse files Browse the repository at this point in the history
Split `quantum_info.metrics` into `quantum_info.metric`, `quantum_info.entanglement`, and `quantum_info.entropies`
  • Loading branch information
renatomello authored Feb 7, 2024
2 parents 5d3f0f6 + 7d35585 commit 3a2e434
Show file tree
Hide file tree
Showing 11 changed files with 2,204 additions and 1,006 deletions.
180 changes: 121 additions & 59 deletions doc/source/api-reference/qibo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1616,22 +1616,10 @@ The destabilizers can be extracted analogously with :meth:`qibo.quantum_info.cli
:member-order: bysource


Metrics
^^^^^^^

Set of functions that are used to calculate metrics of states, (pseudo-)distance measures
between states, and distance measures between quantum channels.

Purity
""""""

.. autofunction:: qibo.quantum_info.purity


Impurity
""""""""
Entanglement measures
^^^^^^^^^^^^^^^^^^^^^

.. autofunction:: qibo.quantum_info.impurity
Set of functions to calculate entanglement measures.


Concurrence
Expand All @@ -1646,45 +1634,149 @@ Entanglement of formation
.. autofunction:: qibo.quantum_info.entanglement_of_formation


Entropy
"""""""
Entanglement fidelity
"""""""""""""""""""""

.. autofunction:: qibo.quantum_info.entanglement_fidelity


Meyer-Wallach entanglement
""""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.meyer_wallach_entanglement


.. autofunction:: qibo.quantum_info.entropy
Entanglement capability
"""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.entangling_capability


Entropy measures
^^^^^^^^^^^^^^^^

Set of functions to calculate entropy measures.


Shannon entropy
"""""""""""""""

.. autofunction:: qibo.quantum_info.shannon_entropy


Classical relative entropy
""""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.classical_relative_entropy


Classical Rényi entropy
"""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.classical_renyi_entropy


Classical Rényi relative entropy
""""""""""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.classical_relative_renyi_entropy


Classical Tsallis entropy
"""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.classical_tsallis_entropy


von Neumann entropy
"""""""""""""""""""

.. autofunction:: qibo.quantum_info.von_neumann_entropy

.. note::
``validate`` flag allows the user to choose if the function will check if input
``state`` is Hermitian or not. Default option is ``validate=False``, i.e. the
assumption of Hermiticity, because it is faster and, more importantly,
the functions are intended to be used on Hermitian inputs. When ``validate=True``
``check_hermitian`` flag allows the user to choose if the function will check if input
``state`` is Hermitian or not. Default option is ``check_hermitian=False``, i.e. the
assumption of Hermiticity. This is faster and, more importantly,
this function are intended to be used on Hermitian inputs. When ``check_hermitian=True``
and ``state`` is non-Hermitian, an error will be raised when using `cupy` backend.


Relative von Neumann entropy
""""""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.relative_von_neumann_entropy

.. note::
``check_hermitian`` flag allows the user to choose if the function will check if input
``state`` is Hermitian or not. Default option is ``check_hermitian=False``, i.e. the
assumption of Hermiticity. This is faster and, more importantly,
this function are intended to be used on Hermitian inputs. When ``check_hermitian=True``
and either ``state`` or ``target`` is non-Hermitian,
an error will be raised when using `cupy` backend.


Rényi entropy
"""""""""""""

.. autofunction:: qibo.quantum_info.renyi_entropy


Relative Rényi entropy
""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.relative_renyi_entropy


Tsallis entropy
"""""""""""""""

.. autofunction:: qibo.quantum_info.tsallis_entropy


Entanglement entropy
""""""""""""""""""""

.. autofunction:: qibo.quantum_info.entanglement_entropy

.. note::
``validate`` flag allows the user to choose if the function will check if
``check_hermitian`` flag allows the user to choose if the function will check if
the reduced density matrix resulting from tracing out ``bipartition`` from input
``state`` is Hermitian or not. Default option is ``validate=False``, i.e. the
assumption of Hermiticity, because it is faster and, more importantly,
the functions are intended to be used on Hermitian inputs. When ``validate=True``
``state`` is Hermitian or not. Default option is ``check_hermitian=False``, i.e. the
assumption of Hermiticity. This is faster and, more importantly,
this function are intended to be used on Hermitian inputs. When ``check_hermitian=True``
and the reduced density matrix is non-Hermitian, an error will be raised
when using `cupy` backend.


Metrics
^^^^^^^

Set of functions that are used to calculate metrics of states, (pseudo-)distance measures
between states, and distance measures between quantum channels.

Purity
""""""

.. autofunction:: qibo.quantum_info.purity


Impurity
""""""""

.. autofunction:: qibo.quantum_info.impurity


Trace distance
""""""""""""""

.. autofunction:: qibo.quantum_info.trace_distance

.. note::
``validate`` flag allows the user to choose if the function will check if difference
``check_hermitian`` flag allows the user to choose if the function will check if difference
between inputs, ``state - target``, is Hermitian or not. Default option is
``validate=False``, i.e. the assumption of Hermiticity, because it is faster and,
``check_hermitian=False``, i.e. the assumption of Hermiticity, because it is faster and,
more importantly, the functions are intended to be used on Hermitian inputs.
When ``validate=True`` and ``state - target`` is non-Hermitian, an error will be
When ``check_hermitian=True`` and ``state - target`` is non-Hermitian, an error will be
raised when using `cupy` backend.


Expand Down Expand Up @@ -1718,12 +1810,6 @@ Bures distance
.. autofunction:: qibo.quantum_info.bures_distance


Entanglement fidelity
"""""""""""""""""""""

.. autofunction:: qibo.quantum_info.entanglement_fidelity


Process fidelity
""""""""""""""""

Expand Down Expand Up @@ -1754,18 +1840,6 @@ Diamond Norm
.. autofunction:: qibo.quantum_info.diamond_norm


Meyer-Wallach entanglement
""""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.meyer_wallach_entanglement


Entanglement capability
"""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.entangling_capability


Expressibility of parameterized quantum circuits
""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down Expand Up @@ -2183,18 +2257,6 @@ Hadamard Transform
.. autofunction:: qibo.quantum_info.hadamard_transform


Shannon entropy
"""""""""""""""

.. autofunction:: qibo.quantum_info.shannon_entropy


Total Variation distance
""""""""""""""""""""""""

.. autofunction:: qibo.quantum_info.total_variation_distance


Hellinger distance
""""""""""""""""""

Expand Down
2 changes: 1 addition & 1 deletion src/qibo/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def nqubits(self, n: int):
]

def apply(self, backend, state):
from qibo.quantum_info.metrics import entanglement_entropy
from qibo.quantum_info.entropies import entanglement_entropy

entropy, spectrum = entanglement_entropy(
state,
Expand Down
2 changes: 2 additions & 0 deletions src/qibo/quantum_info/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from qibo.quantum_info.basis import *
from qibo.quantum_info.clifford import *
from qibo.quantum_info.entanglement import *
from qibo.quantum_info.entropies import *
from qibo.quantum_info.metrics import *
from qibo.quantum_info.quantum_networks import *
from qibo.quantum_info.random_ensembles import *
Expand Down
Loading

0 comments on commit 3a2e434

Please sign in to comment.