Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split quantum_info.metrics into quantum_info.metric, quantum_info.entanglement, and quantum_info.entropies #1172

Merged
merged 76 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
fef4cb5
create `entanglement.py`
renatomello Jan 28, 2024
e9bef50
create `entropies.py`
renatomello Jan 28, 2024
f989054
move functions to `entanglement.py` and `entropies.py`
renatomello Jan 28, 2024
a34e4cc
split tests
renatomello Jan 28, 2024
ed89806
split api reference
renatomello Jan 28, 2024
5991f62
fix import
renatomello Jan 28, 2024
8994079
update `__init__.py`
renatomello Jan 28, 2024
68967d9
fix import
renatomello Jan 28, 2024
5f7e7cf
Merge branch 'master' into entanglement_entropy
renatomello Jan 29, 2024
cbeb4e6
`shannon_entropy` from `utils` to `entropies`
renatomello Jan 30, 2024
44f9719
function
renatomello Jan 30, 2024
d004521
docstring
renatomello Jan 30, 2024
eaa1405
tests
renatomello Jan 30, 2024
75ec076
fix lint issues
renatomello Jan 30, 2024
e9ccdc2
Merge pull request #1176 from qiboteam/relative_entropy
renatomello Jan 30, 2024
bd88660
api ref
renatomello Jan 30, 2024
f951653
minor changes
renatomello Jan 30, 2024
3909820
function
renatomello Jan 30, 2024
373f81c
tests
renatomello Jan 30, 2024
8c0d875
docstring
renatomello Jan 30, 2024
8cc2ade
fix coverage
renatomello Jan 30, 2024
12ff0b0
Merge pull request #1177 from qiboteam/relative_entropy
renatomello Jan 30, 2024
1815adc
reorder functions
renatomello Jan 30, 2024
d7f885c
api ref
renatomello Jan 30, 2024
935d87f
classical renyi entropy
renatomello Jan 30, 2024
cb799bd
remove variable
renatomello Jan 30, 2024
e347490
test errors
renatomello Jan 30, 2024
f4a6b6a
test function
renatomello Jan 30, 2024
aa23dbc
add `alpha = 0`
renatomello Jan 30, 2024
36f9198
docstring
renatomello Jan 31, 2024
8e61e25
fix bug
renatomello Jan 31, 2024
6b7b1af
tests
renatomello Jan 31, 2024
b4f8a37
Merge pull request #1179 from qiboteam/renyi_entropies
renatomello Jan 31, 2024
1ed2b39
api ref
renatomello Jan 31, 2024
6d2fed8
calssical renyi relative entropy
renatomello Jan 31, 2024
dac736e
tests
renatomello Jan 31, 2024
5af2fe6
docstring
renatomello Jan 31, 2024
d9e95c7
rename function
renatomello Jan 31, 2024
39aadcd
relative renyi entropy
renatomello Jan 31, 2024
0c4b75a
tests
renatomello Jan 31, 2024
d044de2
Merge pull request #1180 from qiboteam/relative_renyi
renatomello Jan 31, 2024
c8608cd
Merge branch 'master' into entanglement_entropy
renatomello Jan 31, 2024
5fea3d1
docstring
renatomello Jan 31, 2024
4dfed1f
Merge branch 'master' into entanglement_entropy
renatomello Jan 31, 2024
fd5c1ea
fix test and coverage
renatomello Jan 31, 2024
37e9d6d
entropies and tests
renatomello Jan 31, 2024
c4a6bf1
api ref
renatomello Jan 31, 2024
9a0b315
fix doc bug
renatomello Jan 31, 2024
75d0d71
Merge pull request #1182 from qiboteam/tsallis
renatomello Jan 31, 2024
c627a1c
Merge branch 'master' into entanglement_entropy
renatomello Jan 31, 2024
7eab072
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 31, 2024
03b7d6d
fix multiple issues
renatomello Jan 31, 2024
d50888d
fix coverage
renatomello Feb 1, 2024
bd8f521
fix coverage
renatomello Feb 1, 2024
6d5e2cf
Merge branch 'master' into entanglement_entropy
renatomello Feb 2, 2024
0a706b2
Merge branch 'master' into entanglement_entropy
renatomello Feb 2, 2024
9168a87
Update src/qibo/quantum_info/entropies.py
renatomello Feb 3, 2024
0da8288
Merge branch 'master' into entanglement_entropy
renatomello Feb 3, 2024
ce78900
Alejandro suggestion
renatomello Feb 3, 2024
8ac8c6e
Alejandro suggestion
renatomello Feb 3, 2024
b8b9581
Update doc/source/api-reference/qibo.rst
renatomello Feb 3, 2024
2134a04
Merge branch 'master' into entanglement_entropy
renatomello Feb 3, 2024
230f585
Update src/qibo/quantum_info/entropies.py
renatomello Feb 3, 2024
9e761fb
Update src/qibo/quantum_info/entropies.py
renatomello Feb 3, 2024
7affba5
Merge branch 'master' into entanglement_entropy
renatomello Feb 5, 2024
b6aa706
Merge branch 'entanglement_entropy' of github.com:qiboteam/qibo into …
renatomello Feb 5, 2024
786fce0
Merge branch 'master' into entanglement_entropy
renatomello Feb 5, 2024
089dba4
Merge branch 'master' into entanglement_entropy
renatomello Feb 6, 2024
9283c99
Merge branch 'master' into entanglement_entropy
renatomello Feb 6, 2024
e25d89f
Merge branch 'master' into entanglement_entropy
renatomello Feb 7, 2024
7df8275
use backend helper function
renatomello Feb 7, 2024
2b63c80
reduce complexity
renatomello Feb 7, 2024
544efa2
Merge branch 'master' into entanglement_entropy
renatomello Feb 7, 2024
2726c15
Merge branch 'master' into entanglement_entropy
renatomello Feb 7, 2024
785d532
Merge branch 'master' into entanglement_entropy
renatomello Feb 7, 2024
7d35585
Merge branch 'master' into entanglement_entropy
renatomello Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
180 changes: 121 additions & 59 deletions doc/source/api-reference/qibo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1515,22 +1515,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 @@ -1545,45 +1533,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 @@ -1617,12 +1709,6 @@ Bures distance
.. autofunction:: qibo.quantum_info.bures_distance


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

.. autofunction:: qibo.quantum_info.entanglement_fidelity


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

Expand Down Expand Up @@ -1653,18 +1739,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 @@ -2075,18 +2149,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
Loading