From 09aaf293e87943cd8a2f0a2332cf3b5602596ba4 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 10 Nov 2023 07:58:51 -0600 Subject: [PATCH 01/40] change sphinx sphinx-rtd-theme --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6d3a49620..bd8c58807 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,8 +61,8 @@ coverage = "^5.5" mypy = "^1.3.0" coveralls = "^1.9" setuptools = ">65.5.1" -sphinx = "6.2.1" -sphinx_rtd_theme = "*" +sphinx = "7.2.6" +sphinx_rtd_theme = "1.3.0" [build-system] From 35b201c88eeb2416c492512e64519be26af8a890 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 10 Nov 2023 08:02:09 -0600 Subject: [PATCH 02/40] test autosummary additions --- ...trics.completely_bounded_spectral_norm.rst | 6 +++++ ..._metrics.completely_bounded_trace_norm.rst | 6 +++++ ...annel_metrics.fidelity_of_separability.rst | 6 +++++ docs/_autosummary/toqito.matrices.clock.rst | 6 +++++ docs/_autosummary/toqito.matrices.cnot.rst | 6 +++++ docs/_autosummary/toqito.matrices.fourier.rst | 6 +++++ .../toqito.matrices.gell_mann.rst | 6 +++++ .../toqito.matrices.gen_gell_mann.rst | 6 +++++ .../toqito.matrices.gen_pauli.rst | 6 +++++ .../_autosummary/toqito.matrices.hadamard.rst | 6 +++++ docs/_autosummary/toqito.matrices.iden.rst | 6 +++++ docs/_autosummary/toqito.matrices.pauli.rst | 6 +++++ docs/_autosummary/toqito.matrices.shift.rst | 6 +++++ .../toqito.matrices.standard_basis.rst | 6 +++++ .../toqito.matrix_ops.inner_product.rst | 6 +++++ .../toqito.matrix_ops.outer_product.rst | 6 +++++ .../_autosummary/toqito.matrix_ops.tensor.rst | 6 +++++ docs/_autosummary/toqito.matrix_ops.unvec.rst | 6 +++++ docs/_autosummary/toqito.matrix_ops.vec.rst | 6 +++++ ...to.matrix_ops.vectors_from_gram_matrix.rst | 6 +++++ ...qito.matrix_ops.vectors_to_gram_matrix.rst | 6 +++++ .../toqito.matrix_props.is_block_positive.rst | 6 +++++ .../toqito.matrix_props.is_circulant.rst | 6 +++++ .../toqito.matrix_props.is_commuting.rst | 6 +++++ .../toqito.matrix_props.is_density.rst | 6 +++++ .../toqito.matrix_props.is_diagonal.rst | 6 +++++ ...to.matrix_props.is_diagonally_dominant.rst | 6 +++++ .../toqito.matrix_props.is_hermitian.rst | 6 +++++ .../toqito.matrix_props.is_idempotent.rst | 6 +++++ .../toqito.matrix_props.is_identity.rst | 6 +++++ .../toqito.matrix_props.is_normal.rst | 6 +++++ .../toqito.matrix_props.is_orthonormal.rst | 6 +++++ .../toqito.matrix_props.is_permutation.rst | 6 +++++ ...qito.matrix_props.is_positive_definite.rst | 6 +++++ ....matrix_props.is_positive_semidefinite.rst | 6 +++++ .../toqito.matrix_props.is_projection.rst | 6 +++++ .../toqito.matrix_props.is_square.rst | 6 +++++ .../toqito.matrix_props.is_symmetric.rst | 6 +++++ .../toqito.matrix_props.is_unitary.rst | 6 +++++ .../toqito.matrix_props.majorizes.rst | 6 +++++ .../toqito.matrix_props.sk_operator_norm.rst | 6 +++++ .../toqito.matrix_props.trace_norm.rst | 6 +++++ .../toqito.state_metrics.bures_angle.rst | 4 +-- ...state_metrics.fidelity_of_separability.rst | 6 +++++ .../toqito.state_props.is_npt.rst | 6 +++++ .../toqito.state_props.is_separable.rst | 27 ++----------------- 46 files changed, 268 insertions(+), 27 deletions(-) create mode 100644 docs/_autosummary/toqito.channel_metrics.completely_bounded_spectral_norm.rst create mode 100644 docs/_autosummary/toqito.channel_metrics.completely_bounded_trace_norm.rst create mode 100644 docs/_autosummary/toqito.channel_metrics.fidelity_of_separability.rst create mode 100644 docs/_autosummary/toqito.matrices.clock.rst create mode 100644 docs/_autosummary/toqito.matrices.cnot.rst create mode 100644 docs/_autosummary/toqito.matrices.fourier.rst create mode 100644 docs/_autosummary/toqito.matrices.gell_mann.rst create mode 100644 docs/_autosummary/toqito.matrices.gen_gell_mann.rst create mode 100644 docs/_autosummary/toqito.matrices.gen_pauli.rst create mode 100644 docs/_autosummary/toqito.matrices.hadamard.rst create mode 100644 docs/_autosummary/toqito.matrices.iden.rst create mode 100644 docs/_autosummary/toqito.matrices.pauli.rst create mode 100644 docs/_autosummary/toqito.matrices.shift.rst create mode 100644 docs/_autosummary/toqito.matrices.standard_basis.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.inner_product.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.outer_product.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.tensor.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.unvec.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.vec.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.vectors_from_gram_matrix.rst create mode 100644 docs/_autosummary/toqito.matrix_ops.vectors_to_gram_matrix.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_block_positive.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_circulant.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_commuting.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_density.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_diagonal.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_diagonally_dominant.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_hermitian.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_idempotent.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_identity.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_normal.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_orthonormal.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_permutation.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_positive_definite.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_positive_semidefinite.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_projection.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_square.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_symmetric.rst create mode 100644 docs/_autosummary/toqito.matrix_props.is_unitary.rst create mode 100644 docs/_autosummary/toqito.matrix_props.majorizes.rst create mode 100644 docs/_autosummary/toqito.matrix_props.sk_operator_norm.rst create mode 100644 docs/_autosummary/toqito.matrix_props.trace_norm.rst create mode 100644 docs/_autosummary/toqito.state_metrics.fidelity_of_separability.rst create mode 100644 docs/_autosummary/toqito.state_props.is_npt.rst diff --git a/docs/_autosummary/toqito.channel_metrics.completely_bounded_spectral_norm.rst b/docs/_autosummary/toqito.channel_metrics.completely_bounded_spectral_norm.rst new file mode 100644 index 000000000..d7bd87bd9 --- /dev/null +++ b/docs/_autosummary/toqito.channel_metrics.completely_bounded_spectral_norm.rst @@ -0,0 +1,6 @@ +toqito.channel\_metrics.completely\_bounded\_spectral\_norm +=========================================================== + +.. currentmodule:: toqito.channel_metrics + +.. autofunction:: completely_bounded_spectral_norm \ No newline at end of file diff --git a/docs/_autosummary/toqito.channel_metrics.completely_bounded_trace_norm.rst b/docs/_autosummary/toqito.channel_metrics.completely_bounded_trace_norm.rst new file mode 100644 index 000000000..cc710966f --- /dev/null +++ b/docs/_autosummary/toqito.channel_metrics.completely_bounded_trace_norm.rst @@ -0,0 +1,6 @@ +toqito.channel\_metrics.completely\_bounded\_trace\_norm +======================================================== + +.. currentmodule:: toqito.channel_metrics + +.. autofunction:: completely_bounded_trace_norm \ No newline at end of file diff --git a/docs/_autosummary/toqito.channel_metrics.fidelity_of_separability.rst b/docs/_autosummary/toqito.channel_metrics.fidelity_of_separability.rst new file mode 100644 index 000000000..f217c2b7d --- /dev/null +++ b/docs/_autosummary/toqito.channel_metrics.fidelity_of_separability.rst @@ -0,0 +1,6 @@ +toqito.channel\_metrics.fidelity\_of\_separability +================================================== + +.. currentmodule:: toqito.channel_metrics + +.. autofunction:: fidelity_of_separability \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.clock.rst b/docs/_autosummary/toqito.matrices.clock.rst new file mode 100644 index 000000000..6d08adf29 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.clock.rst @@ -0,0 +1,6 @@ +toqito.matrices.clock +===================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: clock \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.cnot.rst b/docs/_autosummary/toqito.matrices.cnot.rst new file mode 100644 index 000000000..ec2002f57 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.cnot.rst @@ -0,0 +1,6 @@ +toqito.matrices.cnot +==================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: cnot \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.fourier.rst b/docs/_autosummary/toqito.matrices.fourier.rst new file mode 100644 index 000000000..46bac444a --- /dev/null +++ b/docs/_autosummary/toqito.matrices.fourier.rst @@ -0,0 +1,6 @@ +toqito.matrices.fourier +======================= + +.. currentmodule:: toqito.matrices + +.. autofunction:: fourier \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.gell_mann.rst b/docs/_autosummary/toqito.matrices.gell_mann.rst new file mode 100644 index 000000000..1cd00db2b --- /dev/null +++ b/docs/_autosummary/toqito.matrices.gell_mann.rst @@ -0,0 +1,6 @@ +toqito.matrices.gell\_mann +========================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: gell_mann \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.gen_gell_mann.rst b/docs/_autosummary/toqito.matrices.gen_gell_mann.rst new file mode 100644 index 000000000..7ecbe6e89 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.gen_gell_mann.rst @@ -0,0 +1,6 @@ +toqito.matrices.gen\_gell\_mann +=============================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: gen_gell_mann \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.gen_pauli.rst b/docs/_autosummary/toqito.matrices.gen_pauli.rst new file mode 100644 index 000000000..1b50fc77c --- /dev/null +++ b/docs/_autosummary/toqito.matrices.gen_pauli.rst @@ -0,0 +1,6 @@ +toqito.matrices.gen\_pauli +========================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: gen_pauli \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.hadamard.rst b/docs/_autosummary/toqito.matrices.hadamard.rst new file mode 100644 index 000000000..63e17372a --- /dev/null +++ b/docs/_autosummary/toqito.matrices.hadamard.rst @@ -0,0 +1,6 @@ +toqito.matrices.hadamard +======================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: hadamard \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.iden.rst b/docs/_autosummary/toqito.matrices.iden.rst new file mode 100644 index 000000000..aea42c8d9 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.iden.rst @@ -0,0 +1,6 @@ +toqito.matrices.iden +==================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: iden \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.pauli.rst b/docs/_autosummary/toqito.matrices.pauli.rst new file mode 100644 index 000000000..18cb4e904 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.pauli.rst @@ -0,0 +1,6 @@ +toqito.matrices.pauli +===================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: pauli \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.shift.rst b/docs/_autosummary/toqito.matrices.shift.rst new file mode 100644 index 000000000..e8a784d20 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.shift.rst @@ -0,0 +1,6 @@ +toqito.matrices.shift +===================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: shift \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrices.standard_basis.rst b/docs/_autosummary/toqito.matrices.standard_basis.rst new file mode 100644 index 000000000..fd0697722 --- /dev/null +++ b/docs/_autosummary/toqito.matrices.standard_basis.rst @@ -0,0 +1,6 @@ +toqito.matrices.standard\_basis +=============================== + +.. currentmodule:: toqito.matrices + +.. autofunction:: standard_basis \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.inner_product.rst b/docs/_autosummary/toqito.matrix_ops.inner_product.rst new file mode 100644 index 000000000..2089a2a96 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.inner_product.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.inner\_product +================================= + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: inner_product \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.outer_product.rst b/docs/_autosummary/toqito.matrix_ops.outer_product.rst new file mode 100644 index 000000000..9910dd901 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.outer_product.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.outer\_product +================================= + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: outer_product \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.tensor.rst b/docs/_autosummary/toqito.matrix_ops.tensor.rst new file mode 100644 index 000000000..5d4fcbb73 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.tensor.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.tensor +========================= + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: tensor \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.unvec.rst b/docs/_autosummary/toqito.matrix_ops.unvec.rst new file mode 100644 index 000000000..3739af71d --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.unvec.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.unvec +======================== + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: unvec \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.vec.rst b/docs/_autosummary/toqito.matrix_ops.vec.rst new file mode 100644 index 000000000..270db3212 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.vec.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.vec +====================== + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: vec \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.vectors_from_gram_matrix.rst b/docs/_autosummary/toqito.matrix_ops.vectors_from_gram_matrix.rst new file mode 100644 index 000000000..98a20b969 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.vectors_from_gram_matrix.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.vectors\_from\_gram\_matrix +============================================== + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: vectors_from_gram_matrix \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_ops.vectors_to_gram_matrix.rst b/docs/_autosummary/toqito.matrix_ops.vectors_to_gram_matrix.rst new file mode 100644 index 000000000..8b5122c72 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_ops.vectors_to_gram_matrix.rst @@ -0,0 +1,6 @@ +toqito.matrix\_ops.vectors\_to\_gram\_matrix +============================================ + +.. currentmodule:: toqito.matrix_ops + +.. autofunction:: vectors_to_gram_matrix \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_block_positive.rst b/docs/_autosummary/toqito.matrix_props.is_block_positive.rst new file mode 100644 index 000000000..e2decc0a9 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_block_positive.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_block\_positive +======================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_block_positive \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_circulant.rst b/docs/_autosummary/toqito.matrix_props.is_circulant.rst new file mode 100644 index 000000000..1bfc12876 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_circulant.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_circulant +================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_circulant \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_commuting.rst b/docs/_autosummary/toqito.matrix_props.is_commuting.rst new file mode 100644 index 000000000..bb7dac3ad --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_commuting.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_commuting +================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_commuting \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_density.rst b/docs/_autosummary/toqito.matrix_props.is_density.rst new file mode 100644 index 000000000..cdaa75728 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_density.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_density +================================ + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_density \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_diagonal.rst b/docs/_autosummary/toqito.matrix_props.is_diagonal.rst new file mode 100644 index 000000000..20ca1109c --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_diagonal.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_diagonal +================================= + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_diagonal \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_diagonally_dominant.rst b/docs/_autosummary/toqito.matrix_props.is_diagonally_dominant.rst new file mode 100644 index 000000000..e3245a440 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_diagonally_dominant.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_diagonally\_dominant +============================================= + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_diagonally_dominant \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_hermitian.rst b/docs/_autosummary/toqito.matrix_props.is_hermitian.rst new file mode 100644 index 000000000..f229fcc96 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_hermitian.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_hermitian +================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_hermitian \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_idempotent.rst b/docs/_autosummary/toqito.matrix_props.is_idempotent.rst new file mode 100644 index 000000000..96d84a9d2 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_idempotent.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_idempotent +=================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_idempotent \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_identity.rst b/docs/_autosummary/toqito.matrix_props.is_identity.rst new file mode 100644 index 000000000..ce2f2a501 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_identity.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_identity +================================= + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_identity \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_normal.rst b/docs/_autosummary/toqito.matrix_props.is_normal.rst new file mode 100644 index 000000000..a8eabc5fd --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_normal.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_normal +=============================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_normal \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_orthonormal.rst b/docs/_autosummary/toqito.matrix_props.is_orthonormal.rst new file mode 100644 index 000000000..67cbe2545 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_orthonormal.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_orthonormal +==================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_orthonormal \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_permutation.rst b/docs/_autosummary/toqito.matrix_props.is_permutation.rst new file mode 100644 index 000000000..a1a820292 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_permutation.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_permutation +==================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_permutation \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_positive_definite.rst b/docs/_autosummary/toqito.matrix_props.is_positive_definite.rst new file mode 100644 index 000000000..e7ae0cd97 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_positive_definite.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_positive\_definite +=========================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_positive_definite \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_positive_semidefinite.rst b/docs/_autosummary/toqito.matrix_props.is_positive_semidefinite.rst new file mode 100644 index 000000000..7a4501f0c --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_positive_semidefinite.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_positive\_semidefinite +=============================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_positive_semidefinite \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_projection.rst b/docs/_autosummary/toqito.matrix_props.is_projection.rst new file mode 100644 index 000000000..4f520c8cf --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_projection.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_projection +=================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_projection \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_square.rst b/docs/_autosummary/toqito.matrix_props.is_square.rst new file mode 100644 index 000000000..976d51a5f --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_square.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_square +=============================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_square \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_symmetric.rst b/docs/_autosummary/toqito.matrix_props.is_symmetric.rst new file mode 100644 index 000000000..4285984ed --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_symmetric.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_symmetric +================================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_symmetric \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.is_unitary.rst b/docs/_autosummary/toqito.matrix_props.is_unitary.rst new file mode 100644 index 000000000..93a12e216 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.is_unitary.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.is\_unitary +================================ + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: is_unitary \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.majorizes.rst b/docs/_autosummary/toqito.matrix_props.majorizes.rst new file mode 100644 index 000000000..f559d975a --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.majorizes.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.majorizes +============================== + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: majorizes \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.sk_operator_norm.rst b/docs/_autosummary/toqito.matrix_props.sk_operator_norm.rst new file mode 100644 index 000000000..57733899b --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.sk_operator_norm.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.sk\_operator\_norm +======================================= + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: sk_operator_norm \ No newline at end of file diff --git a/docs/_autosummary/toqito.matrix_props.trace_norm.rst b/docs/_autosummary/toqito.matrix_props.trace_norm.rst new file mode 100644 index 000000000..3ff0febe1 --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.trace_norm.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.trace\_norm +================================ + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: trace_norm \ No newline at end of file diff --git a/docs/_autosummary/toqito.state_metrics.bures_angle.rst b/docs/_autosummary/toqito.state_metrics.bures_angle.rst index 45d1e765c..1365e8494 100644 --- a/docs/_autosummary/toqito.state_metrics.bures_angle.rst +++ b/docs/_autosummary/toqito.state_metrics.bures_angle.rst @@ -1,5 +1,5 @@ -toqito.state\_metrics.bures\_angle -===================================== +toqito.state\_metrics.bures\_angle +================================== .. currentmodule:: toqito.state_metrics diff --git a/docs/_autosummary/toqito.state_metrics.fidelity_of_separability.rst b/docs/_autosummary/toqito.state_metrics.fidelity_of_separability.rst new file mode 100644 index 000000000..7aa7480ec --- /dev/null +++ b/docs/_autosummary/toqito.state_metrics.fidelity_of_separability.rst @@ -0,0 +1,6 @@ +toqito.state\_metrics.fidelity\_of\_separability +================================================ + +.. currentmodule:: toqito.state_metrics + +.. autofunction:: fidelity_of_separability \ No newline at end of file diff --git a/docs/_autosummary/toqito.state_props.is_npt.rst b/docs/_autosummary/toqito.state_props.is_npt.rst new file mode 100644 index 000000000..864e2f591 --- /dev/null +++ b/docs/_autosummary/toqito.state_props.is_npt.rst @@ -0,0 +1,6 @@ +toqito.state\_props.is\_npt +=========================== + +.. currentmodule:: toqito.state_props + +.. autofunction:: is_npt \ No newline at end of file diff --git a/docs/_autosummary/toqito.state_props.is_separable.rst b/docs/_autosummary/toqito.state_props.is_separable.rst index b9513e8c1..5975eba86 100644 --- a/docs/_autosummary/toqito.state_props.is_separable.rst +++ b/docs/_autosummary/toqito.state_props.is_separable.rst @@ -1,29 +1,6 @@ toqito.state\_props.is\_separable ================================= -.. automodule:: toqito.state_props.is_separable - - - - - - - - .. rubric:: Functions - - .. autosummary:: - - is_separable - - - - - - - - - - - - +.. currentmodule:: toqito.state_props +.. autofunction:: is_separable \ No newline at end of file From c8d667fcfd5e6c9fa0d4c063a34595de90dc5b2f Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 17 Nov 2023 08:31:57 -0600 Subject: [PATCH 03/40] bibtex scaffolding --- .../toqito.matrix_props.kp_norm.rst | 6 ++ docs/articles.bib | 63 +++++++++++++++++++ docs/books.bib | 57 +++++++++++++++++ docs/conf.py | 4 ++ docs/index.rst | 9 +++ docs/references.rst | 11 ++++ pyproject.toml | 5 +- toqito/state_metrics/bures_angle.py | 5 +- 8 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 docs/_autosummary/toqito.matrix_props.kp_norm.rst create mode 100644 docs/articles.bib create mode 100644 docs/books.bib create mode 100644 docs/references.rst diff --git a/docs/_autosummary/toqito.matrix_props.kp_norm.rst b/docs/_autosummary/toqito.matrix_props.kp_norm.rst new file mode 100644 index 000000000..7f0b08f1e --- /dev/null +++ b/docs/_autosummary/toqito.matrix_props.kp_norm.rst @@ -0,0 +1,6 @@ +toqito.matrix\_props.kp\_norm +============================= + +.. currentmodule:: toqito.matrix_props + +.. autofunction:: kp_norm \ No newline at end of file diff --git a/docs/articles.bib b/docs/articles.bib new file mode 100644 index 000000000..30d25501b --- /dev/null +++ b/docs/articles.bib @@ -0,0 +1,63 @@ +#File for all article, arxiv and other web references + +#Last name begins with A + + + + +#Last name begins with B + + +#Last name begins with C + +#Last name begins with D + +#Last name begins with E + +#Last name begins with F + +#Last name begins with G + +#Last name begins with H + +#Last name begins with I + +#Last name begins with J + +#Last name begins with K + +#Last name begins with L + +#Last name begins with M + +#Last name begins with N + +#Last name begins with O + +#Last name begins with P + +#Last name begins with Q + +#Last name begins with R + +#Last name begins with S + +#Last name begins with T + +#Last name begins with U + +#Last name begins with V + +#Last name begins with W +@misc{WikiBures, + author = "Wikipedia", + title = "Bures distance", + howpublished = "\url{https://en.wikipedia.org/wiki/Bures_metric#Bures_distance}" + +} + +#Last name begins with X + +#Last name begins with Y + +#Last name begins with Z \ No newline at end of file diff --git a/docs/books.bib b/docs/books.bib new file mode 100644 index 000000000..3876aeb65 --- /dev/null +++ b/docs/books.bib @@ -0,0 +1,57 @@ +#File for all book references + +#Last name begins with A + + + + +#Last name begins with B + + +#Last name begins with C + +#Last name begins with D + +#Last name begins with E + +#Last name begins with F + +#Last name begins with G + +#Last name begins with H + +#Last name begins with I + +#Last name begins with J + +#Last name begins with K + +#Last name begins with L + +#Last name begins with M + +#Last name begins with N + +#Last name begins with O + +#Last name begins with P + +#Last name begins with Q + +#Last name begins with R + +#Last name begins with S + +#Last name begins with T + +#Last name begins with U + +#Last name begins with V + +#Last name begins with W + +#Last name begins with X + +#Last name begins with Y + +#Last name begins with Z \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index c1cecadf4..e7800fc42 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,8 +41,12 @@ "sphinx.ext.viewcode", "sphinx.ext.githubpages", "sphinx.ext.napoleon", + "sphinxcontrib.bibtex", ] +bibtex_bibfiles = ["books.bib", "articles.bib"] +bibtex_default_style = "unsrt" + master_doc = "index" autosummary_generate = True autodoc_typehints = "none" diff --git a/docs/index.rst b/docs/index.rst index 861f3f3e6..b5033e710 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -72,3 +72,12 @@ User Documentation :caption: Tutorials tutorials + + +References +------------------ + +.. toctree:: + :maxdepth: 2 + + references diff --git a/docs/references.rst b/docs/references.rst new file mode 100644 index 000000000..7c0faa759 --- /dev/null +++ b/docs/references.rst @@ -0,0 +1,11 @@ +References +========== +.. rubric:: Articles +.. bibliography:: articles.bib + :all: + :list: enumerated + +.. rubric:: Books +.. bibliography:: books.bib + :all: + :list: enumerated \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index bd8c58807..49b32a2ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,8 +62,9 @@ mypy = "^1.3.0" coveralls = "^1.9" setuptools = ">65.5.1" sphinx = "7.2.6" -sphinx_rtd_theme = "1.3.0" - +sphinx_rtd_theme = "2.0.0rc4" # this version is temporary due to docutils version incompatibility with +# sphinx, sphinx_rtd_theme and sphinxcontrib-bibtex +sphinxcontrib-bibtex = "2.6.1" [build-system] requires = ["setuptools","poetry>=0.12"] diff --git a/toqito/state_metrics/bures_angle.py b/toqito/state_metrics/bures_angle.py index f77366ede..063e08596 100644 --- a/toqito/state_metrics/bures_angle.py +++ b/toqito/state_metrics/bures_angle.py @@ -6,7 +6,7 @@ def bures_angle(rho_1: np.ndarray, rho_2: np.ndarray, decimals: int = 10) -> float: r""" - Compute the Bures angle of two density matrices [WikBures]_. + Compute the Bures angle of two density matrices :cite:`WikiBures`. Calculate the Bures angle between two density matrices :code:`rho_1` and :code:`rho_2` defined by: @@ -55,8 +55,7 @@ def bures_angle(rho_1: np.ndarray, rho_2: np.ndarray, decimals: int = 10) -> flo References ========== - .. [WikBures] Wikipedia: Bures distance - https://en.wikipedia.org/wiki/Bures_metric#Bures_distance + .. bibliography:: :raises ValueError: If matrices are not of equal dimension. :param rho_1: Density operator. From 398ceaf834566825cbc129e4762b8053c4cfb7f0 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 17 Nov 2023 10:24:53 -0600 Subject: [PATCH 04/40] disable duplicate label key warnings --- docs/conf.py | 2 +- toqito/state_metrics/bures_angle.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index e7800fc42..6eaee192c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ bibtex_bibfiles = ["books.bib", "articles.bib"] bibtex_default_style = "unsrt" - +suppress_warnings = ["bibtex.duplicate_label", "bibtex.duplicate_citation", "bibtex.duplicate_id"] master_doc = "index" autosummary_generate = True autodoc_typehints = "none" diff --git a/toqito/state_metrics/bures_angle.py b/toqito/state_metrics/bures_angle.py index 063e08596..bd4084955 100644 --- a/toqito/state_metrics/bures_angle.py +++ b/toqito/state_metrics/bures_angle.py @@ -56,6 +56,7 @@ def bures_angle(rho_1: np.ndarray, rho_2: np.ndarray, decimals: int = 10) -> flo References ========== .. bibliography:: + :filter: docname in docnames :raises ValueError: If matrices are not of equal dimension. :param rho_1: Density operator. From cbcfb8acd5f0519e7da3dd065c6222a7c1f7288c Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Sun, 19 Nov 2023 13:11:43 -0600 Subject: [PATCH 05/40] ref: channel_metrics --- docs/articles.bib | 76 +++++++++++++++++++ docs/books.bib | 7 ++ toqito/channel_metrics/channel_fidelity.py | 10 +-- .../completely_bounded_spectral_norm.py | 14 +--- .../completely_bounded_trace_norm.py | 18 ++--- toqito/channel_metrics/diamond_norm.py | 12 +-- .../fidelity_of_separability.py | 32 +++----- 7 files changed, 112 insertions(+), 57 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 30d25501b..1864cdd3a 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -19,12 +19,49 @@ #Last name begins with G #Last name begins with H +@inproceedings{Hayden_2013, + title={Two-Message Quantum Interactive Proofs and the Quantum Separability Problem}, + url={http://dx.doi.org/10.1109/CCC.2013.24}, + DOI={10.1109/ccc.2013.24}, + booktitle={2013 IEEE Conference on Computational Complexity}, + publisher={IEEE}, + author={Hayden, Patrick and Milner, Kevin and Wilde, Mark M.}, + year={2013}, + month=jun } + #Last name begins with I #Last name begins with J +@misc{QETLAB_CB_norm, + author = {Johnston, Nathaniel}, + title = {{CB} norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/CBNorm.m} (Accessed: January 12, 2016)", + DOI ={10.5281/zenodo.44637} + +} + +@misc{QETLAB_Diamond_norm, + author = {Johnston, Nathaniel}, + title = {Diamond norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/DiamondNorm.m} (Accessed: January 12, 2016)", + DOI ={10.5281/zenodo.44637} + +} #Last name begins with K +@article{Katariya_2021, + title={Geometric distinguishability measures limit quantum channel estimation and discrimination}, + volume={20}, + ISSN={1573-1332}, + url={http://dx.doi.org/10.1007/s11128-021-02992-7}, + DOI={10.1007/s11128-021-02992-7}, + number={2}, + journal={Quantum Information Processing}, + publisher={Springer Science and Business Media LLC}, + author={Katariya, Vishal and Wilde, Mark M.}, + year={2021}, + month=feb } #Last name begins with L @@ -35,6 +72,27 @@ #Last name begins with O #Last name begins with P +@article{Peres_1996, + title={Separability Criterion for Density Matrices}, + volume={77}, + ISSN={1079-7114}, + url={http://dx.doi.org/10.1103/PhysRevLett.77.1413}, + DOI={10.1103/physrevlett.77.1413}, + number={8}, + journal={Physical Review Letters}, + publisher={American Physical Society (APS)}, + author={Peres, Asher}, + year={1996}, + month=aug, pages={1413-1415} } + +@misc{Philip2023schrodinger, + title={Schr\"odinger as a Quantum Programmer: Estimating Entanglement via Steering}, + author={Aby Philip and Soorya Rethinasamy and Vincent Russo and Mark M. Wilde}, + year={2023}, + eprint={2303.07911}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} #Last name begins with Q @@ -49,6 +107,24 @@ #Last name begins with V #Last name begins with W +@misc{Watrous_2009_semidefinite, + title={Semidefinite programs for completely bounded norms}, + author={John Watrous}, + year={2009}, + eprint={0901.4709}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + +@misc{watrous2012simpler, + title={Simpler semidefinite programs for completely bounded norms}, + author={John Watrous}, + year={2012}, + eprint={1207.5726}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + @misc{WikiBures, author = "Wikipedia", title = "Bures distance", diff --git a/docs/books.bib b/docs/books.bib index 3876aeb65..87288a94e 100644 --- a/docs/books.bib +++ b/docs/books.bib @@ -49,6 +49,13 @@ #Last name begins with V #Last name begins with W +@book{watrous_2018, +place={Cambridge}, +title={The Theory of Quantum Information}, +DOI={10.1017/9781316848142}, +publisher={Cambridge University Press}, +author={Watrous, John}, + year={2018}} #Last name begins with X diff --git a/toqito/channel_metrics/channel_fidelity.py b/toqito/channel_metrics/channel_fidelity.py index d61f52ce6..be935d400 100644 --- a/toqito/channel_metrics/channel_fidelity.py +++ b/toqito/channel_metrics/channel_fidelity.py @@ -7,7 +7,7 @@ def channel_fidelity(choi_1: np.ndarray, choi_2: np.ndarray) -> float: r""" - Compute the channel fidelity between two quantum channels [VW20]_. + Compute the channel fidelity between two quantum channels :cite:`Katariya_2021`. Let :math:`\Phi : \text{L}(\mathcal{Y}) \rightarrow \text{L}(\mathcal{X})` and :math:`\Psi: \text{L}(\mathcal{Y}) \rightarrow \text{L}(\mathcal{X})` be quantum channels. Then @@ -17,7 +17,7 @@ def channel_fidelity(choi_1: np.ndarray, choi_2: np.ndarray) -> float: \sqrt{F}(\Phi, \Psi) := \text{inf}_{\rho} \sqrt{F}(\Phi(\rho), \Psi(\rho)) where :math:`\rho \in \text{D}(\mathcal{Z} \otimes \mathcal{X})` can be calculated by means of - the following semidefinite program (Proposition 50) in [VW20]_, + the following semidefinite program (Proposition 50) in :cite:`Katariya_2021`, .. math:: \begin{align*} @@ -59,11 +59,11 @@ def channel_fidelity(choi_1: np.ndarray, choi_2: np.ndarray) -> float: >>> channel_fidelity(choi_1, choi_2) 0.5001368672503087 + References ========== - .. [VW20] Katariya, Vishal, and Mark M. Wilde. - "Geometric distinguishability measures limit quantum channel estimation and discrimination." - https://arxiv.org/abs/2004.10708 + .. bibliography:: + :filter: docname in docnames :raises ValueError: If matrices are not of equal dimension. :raises ValueError: If matrices are not square. diff --git a/toqito/channel_metrics/completely_bounded_spectral_norm.py b/toqito/channel_metrics/completely_bounded_spectral_norm.py index 653de2aba..3bcd99c09 100644 --- a/toqito/channel_metrics/completely_bounded_spectral_norm.py +++ b/toqito/channel_metrics/completely_bounded_spectral_norm.py @@ -7,19 +7,13 @@ def completely_bounded_spectral_norm(phi: np.ndarray) -> float: r""" - Compute the completely bounded spectral norm of a quantum channel. + Compute the completely bounded spectral norm of a quantum channel + :cite:`Watrous_2009_semidefinite, QETLAB_CB_norm`. References ========== - .. [WatSDP09]: Watrous, John. - "Semidefinite Programs for Completely Bounded Norms" - Theory of Computing, 2009 - http://theoryofcomputing.org/articles/v005a011/v005a011.pdf - - .. [NJ]: Nathaniel Johnston. QETLAB: - A MATLAB toolbox for quantum entanglement, version 0.9. - https://github.com/nathanieljohnston/QETLAB/blob/master/CBNorm.m - http://www.qetlab.com, January 12, 2016. doi:10.5281/zenodo.44637 + .. bibliography:: + :filter: docname in docnames :param phi: superoperator :return: The completely bounded spectral norm of the channel diff --git a/toqito/channel_metrics/completely_bounded_trace_norm.py b/toqito/channel_metrics/completely_bounded_trace_norm.py index c583a832d..6b277357a 100644 --- a/toqito/channel_metrics/completely_bounded_trace_norm.py +++ b/toqito/channel_metrics/completely_bounded_trace_norm.py @@ -12,23 +12,15 @@ def completely_bounded_trace_norm(phi: np.ndarray) -> float: Find the completely bounded trace norm of a quantum channel. Also known as the completely bounded diamond norm of a quantum - channel [WatCNorm18]_. The algorithm in p.11 of [WatSDP09] with - implementation in QETLAB [JohQET] is used. + channel (Section 3.3.2 of :cite:`watrous_2018`). The algorithm in p.11 of :cite:`watrous2012simpler` with + implementation in QETLAB :cite:`QETLAB_Diamond_norm` is used. + References ========== - .. [WatCNorm18] : Watrous, John. - “The theory of quantum information.” Section 3.3.2: “The completely bounded trace norm”. - Cambridge University Press, 2018. + .. bibliography:: + :filter: docname in docnames - .. [WatSDP09]: Watrous, John. - "Simpler semidefinite programs for completely bounded norms" - https://arxiv.org/pdf/1207.5726.pdf - - .. [JohQET]: Nathaniel Johnston. QETLAB: - A MATLAB toolbox for quantum entanglement, version 0.9. - https://github.com/nathanieljohnston/QETLAB/blob/master/DiamondNorm.m - http://www.qetlab.com, January 12, 2016. doi:10.5281/zenodo.44637 :raises ValueError: If matrix is not square. :param phi: superoperator as choi matrix diff --git a/toqito/channel_metrics/diamond_norm.py b/toqito/channel_metrics/diamond_norm.py index 0bd6b1997..5c894d66c 100644 --- a/toqito/channel_metrics/diamond_norm.py +++ b/toqito/channel_metrics/diamond_norm.py @@ -8,7 +8,7 @@ def diamond_norm(choi_1: np.ndarray, choi_2: np.ndarray) -> float: Return the diamond norm distance between two quantum channels. The calculation uses the simplified semidefinite program of Watrous in - [CBN]_. + :cite:`Watrous_2009_semidefinite`. This function has been adapted from: https://github.com/rigetti/forest-benchmarking @@ -16,11 +16,11 @@ def diamond_norm(choi_1: np.ndarray, choi_2: np.ndarray) -> float: .. note:: This calculation becomes very slow for 4 or more qubits. - .. [CBN] Semidefinite programs for completely bounded norms. - J. Watrous. - Theory of Computing 5, 11, pp. 217-238 (2009). - http://theoryofcomputing.org/articles/v005a011 - http://arxiv.org/abs/0901.4709 + References + ========== + .. bibliography:: + :filter: docname in docnames + :raises ValueError: If matrices are not of equal dimension. :raises ValueError: If matrices are not square. diff --git a/toqito/channel_metrics/fidelity_of_separability.py b/toqito/channel_metrics/fidelity_of_separability.py index 33660ed7b..9ae333bfc 100644 --- a/toqito/channel_metrics/fidelity_of_separability.py +++ b/toqito/channel_metrics/fidelity_of_separability.py @@ -21,12 +21,12 @@ def fidelity_of_separability( solver_option: str = "cvxopt", ) -> float: r""" - Define the first benchmark introduced in Appendix I of [Phil23.1]_ . + Define the first benchmark introduced in Appendix I of :cite:`Philip2023schrodinger` . If you would like to instead use the benchmark introduced in Appendix H, go to :obj:`toqito.state_metrics.fidelity_of_separability`. - In [Phil23.1]_ a variational quantum algorithm (VQA) is introduced to test + In :cite:`Philip2023schrodinger` a variational quantum algorithm (VQA) is introduced to test the separability of a general bipartite state. The algorithm utilizes quantum steering between two separated systems such that the separability of the state is quantified. @@ -35,13 +35,13 @@ def fidelity_of_separability( optimization semidefinite programs (SDP) benchmarks were introduced to maximize the fidelity of separability subject to some state constraints (Positive Partial Transpose (PPT), symmetric extensions (k-extendibility - ) [Hay12.1]_ ). Entangled states do not have k-symmetric extensions. If an + ) :cite:`Hayden_2013` ). Entangled states do not have k-symmetric extensions. If an extension exists, it cannot be assumed directly that the state is separable. This function approximites the fidelity of separability by maximizing over PPT channels & k-extendible entanglement breaking channels - i.e. an optimization problem over channels [TBWat18.1]_ . + i.e. an optimization problem over channels :cite:`watrous_2018` . - The following expression (Equation (I4) from [Phil23.1]_ ) defines the + The following expression (Equation (I4) from :cite:`Philip2023schrodinger` ) defines the constraints for approximating :math:`\frac{1}{2}(1+\widetilde{F}_s^2(\rho_{AB})) {:}=` @@ -72,7 +72,7 @@ def fidelity_of_separability( :math:`\mathcal{P}_{A^{\prime k}}` is the permutation operator over k-extensions :math:`A^{\prime k}`. - The other constraints are due to the PPT condition [Per96.1]_. + The other constraints are due to the PPT condition :cite:`Peres_1996`. Examples ========== @@ -100,24 +100,10 @@ def fidelity_of_separability( References ========== - .. [Hay12.1] Hayden, Patrick et.al. - "Two-message quantum interactive proofs and the quantum separability problem." - Proceedings of the 28th IEEE Conference on Computational Complexity, pages 156-167. - https://arxiv.org/abs/1211.6120 - - .. [Per96.1] Peres, Asher. - "Separability Criterion for Density Matrices" - https://arxiv.org/abs/quant-ph/9604005 - - .. [Phil23.1] Philip, Aby et.al. - "Quantum Steering Algorithm for Estimating Fidelity of Separability" - https://arxiv.org/abs/2303.07911 - - .. [TBWat18.1] Watrous, John. - “The Theory of Quantum Information” - Cambridge University Press, 2018 - + .. bibliography:: + :filter: docname in docnames + :param psi: the density matrix for the tripartite state of interest psi_{BAR} :param psi_dims: the dimensions of System A, B, & R in the input state density matrix. It is assumed that the first From f381bbc59195ca890ee56686c328a6454668668b Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Sun, 19 Nov 2023 13:29:17 -0600 Subject: [PATCH 06/40] random to rand --- docs/_autosummary/toqito.matrices.iden.rst | 6 ------ ...ity_matrix.rst => toqito.rand.random_density_matrix.rst} | 2 +- ...om.random_ginibre.rst => toqito.rand.random_ginibre.rst} | 2 +- ...o.random.random_povm.rst => toqito.rand.random_povm.rst} | 2 +- ...state_vector.rst => toqito.rand.random_state_vector.rst} | 2 +- ...om.random_unitary.rst => toqito.rand.random_unitary.rst} | 2 +- docs/index.rst | 2 +- 7 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 docs/_autosummary/toqito.matrices.iden.rst rename docs/_autosummary/{toqito.random.random_density_matrix.rst => toqito.rand.random_density_matrix.rst} (74%) rename docs/_autosummary/{toqito.random.random_ginibre.rst => toqito.rand.random_ginibre.rst} (76%) rename docs/_autosummary/{toqito.random.random_povm.rst => toqito.rand.random_povm.rst} (76%) rename docs/_autosummary/{toqito.random.random_state_vector.rst => toqito.rand.random_state_vector.rst} (74%) rename docs/_autosummary/{toqito.random.random_unitary.rst => toqito.rand.random_unitary.rst} (76%) diff --git a/docs/_autosummary/toqito.matrices.iden.rst b/docs/_autosummary/toqito.matrices.iden.rst deleted file mode 100644 index aea42c8d9..000000000 --- a/docs/_autosummary/toqito.matrices.iden.rst +++ /dev/null @@ -1,6 +0,0 @@ -toqito.matrices.iden -==================== - -.. currentmodule:: toqito.matrices - -.. autofunction:: iden \ No newline at end of file diff --git a/docs/_autosummary/toqito.random.random_density_matrix.rst b/docs/_autosummary/toqito.rand.random_density_matrix.rst similarity index 74% rename from docs/_autosummary/toqito.random.random_density_matrix.rst rename to docs/_autosummary/toqito.rand.random_density_matrix.rst index e2298fa79..186634a0f 100644 --- a/docs/_autosummary/toqito.random.random_density_matrix.rst +++ b/docs/_autosummary/toqito.rand.random_density_matrix.rst @@ -1,5 +1,5 @@ toqito.rand.random\_density\_matrix -===================================== +=================================== .. currentmodule:: toqito.rand diff --git a/docs/_autosummary/toqito.random.random_ginibre.rst b/docs/_autosummary/toqito.rand.random_ginibre.rst similarity index 76% rename from docs/_autosummary/toqito.random.random_ginibre.rst rename to docs/_autosummary/toqito.rand.random_ginibre.rst index 5536ac054..a081bbeeb 100644 --- a/docs/_autosummary/toqito.random.random_ginibre.rst +++ b/docs/_autosummary/toqito.rand.random_ginibre.rst @@ -1,5 +1,5 @@ toqito.rand.random\_ginibre -============================= +=========================== .. currentmodule:: toqito.rand diff --git a/docs/_autosummary/toqito.random.random_povm.rst b/docs/_autosummary/toqito.rand.random_povm.rst similarity index 76% rename from docs/_autosummary/toqito.random.random_povm.rst rename to docs/_autosummary/toqito.rand.random_povm.rst index 0df1cca2a..8c19da052 100644 --- a/docs/_autosummary/toqito.random.random_povm.rst +++ b/docs/_autosummary/toqito.rand.random_povm.rst @@ -1,5 +1,5 @@ toqito.rand.random\_povm -========================== +======================== .. currentmodule:: toqito.rand diff --git a/docs/_autosummary/toqito.random.random_state_vector.rst b/docs/_autosummary/toqito.rand.random_state_vector.rst similarity index 74% rename from docs/_autosummary/toqito.random.random_state_vector.rst rename to docs/_autosummary/toqito.rand.random_state_vector.rst index 1d440031e..c0b10fcc6 100644 --- a/docs/_autosummary/toqito.random.random_state_vector.rst +++ b/docs/_autosummary/toqito.rand.random_state_vector.rst @@ -1,5 +1,5 @@ toqito.rand.random\_state\_vector -=================================== +================================= .. currentmodule:: toqito.rand diff --git a/docs/_autosummary/toqito.random.random_unitary.rst b/docs/_autosummary/toqito.rand.random_unitary.rst similarity index 76% rename from docs/_autosummary/toqito.random.random_unitary.rst rename to docs/_autosummary/toqito.rand.random_unitary.rst index bddd4eda4..49ff910f8 100644 --- a/docs/_autosummary/toqito.random.random_unitary.rst +++ b/docs/_autosummary/toqito.rand.random_unitary.rst @@ -1,5 +1,5 @@ toqito.rand.random\_unitary -============================= +=========================== .. currentmodule:: toqito.rand diff --git a/docs/index.rst b/docs/index.rst index b5033e710..c4d92dd3b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -58,7 +58,7 @@ User Documentation :maxdepth: 2 :caption: Random Objects - random + rand .. toctree:: :maxdepth: 2 From 773af44cc55570c94965829fa548950ebb67393a Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Mon, 20 Nov 2023 09:06:09 -0600 Subject: [PATCH 07/40] all: docname in docnames --- docs/articles.bib | 9 +++++++++ toqito/channel_props/choi_rank.py | 2 ++ toqito/channel_props/is_completely_positive.py | 3 +++ toqito/channel_props/is_herm_preserving.py | 3 +++ toqito/channel_props/is_positive.py | 3 +++ toqito/channel_props/is_quantum_channel.py | 3 +++ toqito/channel_props/is_trace_preserving.py | 3 +++ toqito/channel_props/is_unital.py | 3 +++ toqito/channel_props/is_unitary.py | 3 +++ toqito/channels/choi.py | 3 +++ toqito/channels/dephasing.py | 3 +++ toqito/channels/depolarizing.py | 3 +++ toqito/channels/partial_trace.py | 3 +++ toqito/channels/partial_transpose.py | 3 +++ toqito/channels/realignment.py | 3 +++ toqito/channels/reduction.py | 6 ++++++ toqito/helper/channel_dim.py | 5 +++++ toqito/helper/cvx_kron.py | 5 +++++ toqito/helper/expr_as_np_array.py | 5 +++++ toqito/helper/np_array_as_expr.py | 5 +++++ toqito/helper/npa_hierarchy.py | 5 +++++ toqito/helper/update_odometer.py | 4 ++++ toqito/matrices/clock.py | 3 +++ toqito/matrices/cnot.py | 3 +++ toqito/matrices/fourier.py | 3 +++ toqito/matrices/gell_mann.py | 3 +++ toqito/matrices/gen_gell_mann.py | 3 +++ toqito/matrices/gen_pauli.py | 3 +++ toqito/matrices/hadamard.py | 3 +++ toqito/matrices/pauli.py | 3 +++ toqito/matrices/shift.py | 3 +++ toqito/matrices/standard_basis.py | 5 +++++ toqito/matrix_ops/inner_product.py | 3 +++ toqito/matrix_ops/outer_product.py | 3 +++ toqito/matrix_ops/tensor.py | 3 +++ toqito/matrix_ops/unvec.py | 5 ++++- toqito/matrix_ops/vec.py | 3 +++ toqito/matrix_ops/vectors_from_gram_matrix.py | 5 +++++ toqito/matrix_ops/vectors_to_gram_matrix.py | 7 ++++++- toqito/matrix_props/is_block_positive.py | 3 +++ toqito/matrix_props/is_circulant.py | 3 +++ toqito/matrix_props/is_commuting.py | 3 +++ toqito/matrix_props/is_density.py | 3 +++ toqito/matrix_props/is_diagonal.py | 3 +++ toqito/matrix_props/is_diagonally_dominant.py | 3 +++ toqito/matrix_props/is_hermitian.py | 3 +++ toqito/matrix_props/is_idempotent.py | 3 +++ toqito/matrix_props/is_identity.py | 3 +++ toqito/matrix_props/is_normal.py | 3 +++ toqito/matrix_props/is_orthonormal.py | 5 +++++ toqito/matrix_props/is_permutation.py | 3 +++ toqito/matrix_props/is_positive_definite.py | 3 +++ toqito/matrix_props/is_positive_semidefinite.py | 3 +++ toqito/matrix_props/is_projection.py | 3 +++ toqito/matrix_props/is_square.py | 3 +++ toqito/matrix_props/is_symmetric.py | 3 +++ toqito/matrix_props/is_unitary.py | 3 +++ toqito/matrix_props/kp_norm.py | 5 +++++ toqito/matrix_props/majorizes.py | 3 +++ toqito/matrix_props/sk_norm.py | 3 +++ toqito/matrix_props/trace_norm.py | 3 +++ toqito/measurement_ops/measure.py | 3 +++ toqito/measurement_props/is_povm.py | 3 +++ toqito/nonlocal_games/extended_nonlocal_game.py | 3 +++ toqito/nonlocal_games/nonlocal_game.py | 3 +++ toqito/nonlocal_games/quantum_hedging.py | 3 +++ toqito/nonlocal_games/xor_game.py | 3 +++ toqito/perms/antisymmetric_projection.py | 3 +++ toqito/perms/perfect_matchings.py | 5 +++++ toqito/perms/perm_sign.py | 3 +++ toqito/perms/permutation_operator.py | 5 +++++ toqito/perms/permute_systems.py | 5 +++++ toqito/perms/swap.py | 5 +++++ toqito/perms/swap_operator.py | 5 +++++ toqito/perms/symmetric_projection.py | 3 +++ toqito/perms/unique_perms.py | 5 +++++ toqito/rand/random_density_matrix.py | 5 +++++ toqito/rand/random_ginibre.py | 3 +++ toqito/rand/random_povm.py | 3 +++ toqito/rand/random_state_vector.py | 5 +++++ toqito/rand/random_unitary.py | 3 +++ toqito/state_metrics/bures_distance.py | 3 +++ toqito/state_metrics/fidelity.py | 3 +++ toqito/state_metrics/fidelity_of_separability.py | 3 +++ toqito/state_metrics/helstrom_holevo.py | 3 +++ toqito/state_metrics/hilbert_schmidt.py | 3 +++ toqito/state_metrics/hilbert_schmidt_inner_product.py | 3 +++ toqito/state_metrics/matsumoto_fidelity.py | 3 +++ toqito/state_metrics/sub_fidelity.py | 3 +++ toqito/state_metrics/trace_distance.py | 3 +++ toqito/state_ops/pure_to_mixed.py | 5 +++++ toqito/state_ops/schmidt_decomposition.py | 3 +++ toqito/state_opt/optimal_clone.py | 3 +++ toqito/state_opt/ppt_distinguishability.py | 3 +++ toqito/state_opt/state_distinguishability.py | 3 +++ toqito/state_opt/state_exclusion.py | 3 +++ toqito/state_opt/symmetric_extension_hierarchy.py | 3 +++ toqito/state_props/concurrence.py | 3 +++ toqito/state_props/entanglement_of_formation.py | 3 +++ toqito/state_props/has_symmetric_extension.py | 3 +++ toqito/state_props/in_separable_ball.py | 3 +++ toqito/state_props/is_ensemble.py | 3 +++ toqito/state_props/is_mixed.py | 3 +++ toqito/state_props/is_mutually_orthogonal.py | 3 +++ toqito/state_props/is_mutually_unbiased_basis.py | 3 +++ toqito/state_props/is_npt.py | 3 +++ toqito/state_props/is_ppt.py | 3 +++ toqito/state_props/is_product.py | 3 +++ toqito/state_props/is_pure.py | 3 +++ toqito/state_props/is_separable.py | 3 +++ toqito/state_props/l1_norm_coherence.py | 3 +++ toqito/state_props/log_negativity.py | 3 +++ toqito/state_props/negativity.py | 3 +++ toqito/state_props/purity.py | 3 +++ toqito/state_props/schmidt_rank.py | 3 +++ toqito/state_props/sk_vec_norm.py | 3 +++ toqito/state_props/von_neumann_entropy.py | 3 +++ toqito/states/basis.py | 3 +++ toqito/states/bell.py | 3 +++ toqito/states/brauer.py | 3 +++ toqito/states/breuer.py | 3 +++ toqito/states/chessboard.py | 3 +++ toqito/states/domino.py | 3 +++ toqito/states/gen_bell.py | 3 +++ toqito/states/ghz.py | 3 +++ toqito/states/gisin.py | 3 +++ toqito/states/horodecki.py | 3 +++ toqito/states/isotropic.py | 3 +++ toqito/states/max_entangled.py | 3 +++ toqito/states/max_mixed.py | 3 +++ toqito/states/singlet.py | 3 +++ toqito/states/tile.py | 3 +++ toqito/states/w_state.py | 3 +++ toqito/states/werner.py | 3 +++ 134 files changed, 451 insertions(+), 2 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 1864cdd3a..2ea589238 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -49,6 +49,15 @@ @misc{QETLAB_Diamond_norm } +@misc{QETLAB_Kraus_Operators, + author = {Johnston, Nathaniel}, + title = {KrausOperators from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/KrausOperators.m} (Accessed: January 12, 2016)", + DOI ={10.5281/zenodo.44637} + +} + + #Last name begins with K @article{Katariya_2021, title={Geometric distinguishability measures limit quantum channel estimation and discrimination}, diff --git a/toqito/channel_props/choi_rank.py b/toqito/channel_props/choi_rank.py index 58587205b..513c4022c 100644 --- a/toqito/channel_props/choi_rank.py +++ b/toqito/channel_props/choi_rank.py @@ -73,6 +73,8 @@ def choi_rank(phi: np.ndarray | list[list[np.ndarray]]) -> int: References ========== + .. bibliography:: + :filter: docname in docnames .. [WatChoiRank18] Watrous, John. "The Theory of Quantum Information." diff --git a/toqito/channel_props/is_completely_positive.py b/toqito/channel_props/is_completely_positive.py index aa4899b1d..9ab5bb0aa 100644 --- a/toqito/channel_props/is_completely_positive.py +++ b/toqito/channel_props/is_completely_positive.py @@ -75,6 +75,9 @@ def is_completely_positive( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatCP18] Watrous, John. "The Theory of Quantum Information." Section: "Linear maps of square operators". diff --git a/toqito/channel_props/is_herm_preserving.py b/toqito/channel_props/is_herm_preserving.py index 7ce9e06be..a4f563c51 100644 --- a/toqito/channel_props/is_herm_preserving.py +++ b/toqito/channel_props/is_herm_preserving.py @@ -61,6 +61,9 @@ def is_herm_preserving( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatH18] Watrous, John. "The theory of quantum information." Section: "Linear maps of square operators". diff --git a/toqito/channel_props/is_positive.py b/toqito/channel_props/is_positive.py index 495737a5e..c2f42e4b7 100644 --- a/toqito/channel_props/is_positive.py +++ b/toqito/channel_props/is_positive.py @@ -63,6 +63,9 @@ def is_positive( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatPM18] Watrous, John. "The theory of quantum information." Section: "Linear maps of square operators". diff --git a/toqito/channel_props/is_quantum_channel.py b/toqito/channel_props/is_quantum_channel.py index dc4a487ab..4f3d6a4a1 100644 --- a/toqito/channel_props/is_quantum_channel.py +++ b/toqito/channel_props/is_quantum_channel.py @@ -40,6 +40,9 @@ def is_quantum_channel( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatQC18] Watrous, John. "The Theory of Quantum Information." Section: "2.2.1 Definitions and basic notions concerning channels". diff --git a/toqito/channel_props/is_trace_preserving.py b/toqito/channel_props/is_trace_preserving.py index 1c0d1700c..192935e42 100644 --- a/toqito/channel_props/is_trace_preserving.py +++ b/toqito/channel_props/is_trace_preserving.py @@ -77,6 +77,9 @@ def is_trace_preserving( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatTP18] Watrous, John. "The theory of quantum information." Section: "Linear maps of square operators". diff --git a/toqito/channel_props/is_unital.py b/toqito/channel_props/is_unital.py index 3185dcea6..4ed0e888c 100644 --- a/toqito/channel_props/is_unital.py +++ b/toqito/channel_props/is_unital.py @@ -52,6 +52,9 @@ def is_unital( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatUnital18] Watrous, John. "The theory of quantum information." Chapter: Unital channels and majorization diff --git a/toqito/channel_props/is_unitary.py b/toqito/channel_props/is_unitary.py index 91ab2cad3..b693d5b63 100644 --- a/toqito/channel_props/is_unitary.py +++ b/toqito/channel_props/is_unitary.py @@ -58,6 +58,9 @@ def is_unitary(phi: np.ndarray | list[list[np.ndarray]]) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatIU18] Watrous, John. "The Theory of Quantum Information." Section: "2.2.1 Definitions and basic notions concerning channels". diff --git a/toqito/channels/choi.py b/toqito/channels/choi.py index 007368a6b..54f607cab 100644 --- a/toqito/channels/choi.py +++ b/toqito/channels/choi.py @@ -92,6 +92,9 @@ def choi(a_var: int = 1, b_var: int = 1, c_var: int = 0) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [Choi92] Cho, Sung Je, Seung-Hyeok Kye, and Sa Ge Lee. "Generalized Choi maps in three-dimensional matrix algebra." Linear algebra and its applications 171 (1992): 213-224. diff --git a/toqito/channels/dephasing.py b/toqito/channels/dephasing.py index ec173aafa..b0de9ebe6 100644 --- a/toqito/channels/dephasing.py +++ b/toqito/channels/dephasing.py @@ -73,6 +73,9 @@ def dephasing(dim: int, param_p: float = 0) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatDeph18] Watrous, John. "The theory of quantum information." Section: "The completely dephasing channel". diff --git a/toqito/channels/depolarizing.py b/toqito/channels/depolarizing.py index 7b56703f7..37eb3e46d 100644 --- a/toqito/channels/depolarizing.py +++ b/toqito/channels/depolarizing.py @@ -77,6 +77,9 @@ def depolarizing(dim: int, param_p: float = 0) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikDepo] Wikipedia: Quantum depolarizing channel https://en.wikipedia.org/wiki/Quantum_depolarizing_channel diff --git a/toqito/channels/partial_trace.py b/toqito/channels/partial_trace.py index 162b84ceb..2030758f1 100644 --- a/toqito/channels/partial_trace.py +++ b/toqito/channels/partial_trace.py @@ -120,6 +120,9 @@ def partial_trace( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPtrace] Wikipedia: Partial trace https://en.wikipedia.org/wiki/Partial_trace diff --git a/toqito/channels/partial_transpose.py b/toqito/channels/partial_transpose.py index 6eded4be5..738f3cfe6 100644 --- a/toqito/channels/partial_transpose.py +++ b/toqito/channels/partial_transpose.py @@ -104,6 +104,9 @@ def partial_transpose( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPtrans] Wikipedia: Partial transpose https://en.wikipedia.org/w/index.php?title=Partial_transpose :param rho: A matrix. diff --git a/toqito/channels/realignment.py b/toqito/channels/realignment.py index be8f9d71a..cec914bfd 100644 --- a/toqito/channels/realignment.py +++ b/toqito/channels/realignment.py @@ -43,6 +43,9 @@ def realignment(input_mat: np.ndarray, dim: int | list[int] = None) -> np.ndarra References ========== + .. bibliography:: + :filter: docname in docnames + .. [LAS08] Lupo, Cosmo, Paolo, Aniello, and Scardicchio, Antonello. "Bipartite quantum systems: on the realignment criterion and beyond." Journal of Physics A: Mathematical and Theoretical diff --git a/toqito/channels/reduction.py b/toqito/channels/reduction.py index 2a884cc06..5cc49dca4 100644 --- a/toqito/channels/reduction.py +++ b/toqito/channels/reduction.py @@ -37,6 +37,12 @@ def reduction(dim: int, k: int = 1) -> np.ndarray: [ 0., 0., 0., 0., 0., 0., 0., 1., 0.], [-1., 0., 0., 0., -1., 0., 0., 0., 0.]]) + + References + ========== + .. bibliography:: + :filter: docname in docnames + :param dim: A positive integer (the dimension of the reduction map). :param k: If this positive integer is provided, the script will instead return the Choi matrix of the following linear map: Phi(X) := K * Tr(X)I - X. diff --git a/toqito/helper/channel_dim.py b/toqito/helper/channel_dim.py index 70593ea3c..285bf7284 100644 --- a/toqito/helper/channel_dim.py +++ b/toqito/helper/channel_dim.py @@ -33,6 +33,11 @@ def channel_dim( This functions was adapted from QETLAB. + References + ========== + .. bibliography:: + :filter: docname in docnames + :param phi: A superoperator. It should be provided either as a Choi matrix, or as a (1d or 2d) list of numpy arrays whose entries are its Kraus operators. :param allow_rect: A flag indicating that the input and output spaces of PHI can be non-square (default True). diff --git a/toqito/helper/cvx_kron.py b/toqito/helper/cvx_kron.py index 1ebf25140..94684b44d 100644 --- a/toqito/helper/cvx_kron.py +++ b/toqito/helper/cvx_kron.py @@ -19,6 +19,11 @@ def cvx_kron(expr_1: np.ndarray | Expression, expr_2: np.ndarray | Expression) - Kudos to Riley J. Murray for this function: https://github.com/cvxgrp/cvxpy/issues/457 + References + ========== + .. bibliography:: + :filter: docname in docnames + :param expr_1: 2D numpy ndarray, or a CVXPY Variable with expr_1.ndim == 2 :param expr_2: 2D numpy ndarray, or a CVXPY Variable with expr_2.ndim == 2 :return: The tensor product of two CVXPY expressions. diff --git a/toqito/helper/expr_as_np_array.py b/toqito/helper/expr_as_np_array.py index 1fe1fab81..a9419014f 100644 --- a/toqito/helper/expr_as_np_array.py +++ b/toqito/helper/expr_as_np_array.py @@ -8,6 +8,11 @@ def expr_as_np_array(cvx_expr: Expression) -> np.ndarray: """ Convert cvxpy expression into a numpy array. + References + ========== + .. bibliography:: + :filter: docname in docnames + :param cvx_expr: The cvxpy expression to be converted. :return: The numpy array of the cvxpy expression. """ diff --git a/toqito/helper/np_array_as_expr.py b/toqito/helper/np_array_as_expr.py index 97595883e..72f925415 100644 --- a/toqito/helper/np_array_as_expr.py +++ b/toqito/helper/np_array_as_expr.py @@ -9,6 +9,11 @@ def np_array_as_expr(np_arr: [np.ndarray]) -> Expression: """ Convert numpy array into a cvxpy expression. + References + ========== + .. bibliography:: + :filter: docname in docnames + :param np_arr: The numpy array to be converted. :return: The cvxpy expression of the numpy array. """ diff --git a/toqito/helper/npa_hierarchy.py b/toqito/helper/npa_hierarchy.py index d2c010c3a..5d596b714 100644 --- a/toqito/helper/npa_hierarchy.py +++ b/toqito/helper/npa_hierarchy.py @@ -143,6 +143,11 @@ def npa_constraints( # pylint: disable=too-many-locals K_{xy}\Big(i + a \cdot dim_R, j + b \cdot dim_R \Big) = \langle i| \text{Tr}_{\mathcal{H}} \Big( \big( I_R \otimes A_a^x B_b^y \big) \sigma \Big) |j \rangle + + References + ========== + .. bibliography:: + :filter: docname in docnames :param assemblage: The commuting measurement assemblage operator. :param k: The level of the NPA hierarchy to use (default=1). diff --git a/toqito/helper/update_odometer.py b/toqito/helper/update_odometer.py index 36e4376e5..0d4cdf429 100644 --- a/toqito/helper/update_odometer.py +++ b/toqito/helper/update_odometer.py @@ -41,8 +41,12 @@ def update_odometer( [2 0] [2 1] + References ========== + .. bibliography:: + :filter: docname in docnames + .. [QETOD] QETLAB: Update odometer function. http://www.qetlab.com/update_odometer diff --git a/toqito/matrices/clock.py b/toqito/matrices/clock.py index a3267d0bf..058525bb1 100644 --- a/toqito/matrices/clock.py +++ b/toqito/matrices/clock.py @@ -45,6 +45,9 @@ def clock(dim: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikClock] Wikipedia: Generalizations of Pauli matrices, https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices diff --git a/toqito/matrices/cnot.py b/toqito/matrices/cnot.py index 6f8473f67..2509b2a28 100644 --- a/toqito/matrices/cnot.py +++ b/toqito/matrices/cnot.py @@ -29,6 +29,9 @@ def cnot() -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikCNOT] Wikipedia: Controlled NOT gate https://en.wikipedia.org/wiki/Controlled_NOT_gate diff --git a/toqito/matrices/fourier.py b/toqito/matrices/fourier.py index c65781112..0a8746b91 100644 --- a/toqito/matrices/fourier.py +++ b/toqito/matrices/fourier.py @@ -45,6 +45,9 @@ def fourier(dim: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikDFT] Wikipedia: DFT matrix, https://en.wikipedia.org/wiki/DFT_matrix diff --git a/toqito/matrices/gell_mann.py b/toqito/matrices/gell_mann.py index 2c3c9b358..a44806b5d 100644 --- a/toqito/matrices/gell_mann.py +++ b/toqito/matrices/gell_mann.py @@ -88,6 +88,9 @@ def gell_mann(ind: int, is_sparse: bool = False) -> np.ndarray | scipy.sparse.cs References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikGM] Wikipedia: Gell-Mann matrices, https://en.wikipedia.org/wiki/Gell-Mann_matrices diff --git a/toqito/matrices/gen_gell_mann.py b/toqito/matrices/gen_gell_mann.py index eaeb3da69..679aac531 100644 --- a/toqito/matrices/gen_gell_mann.py +++ b/toqito/matrices/gen_gell_mann.py @@ -59,6 +59,9 @@ def gen_gell_mann( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikGM2] Wikipedia: Gell-Mann matrices, https://en.wikipedia.org/wiki/Gell-Mann_matrices diff --git a/toqito/matrices/gen_pauli.py b/toqito/matrices/gen_pauli.py index d62ed7fe7..1e80026c5 100644 --- a/toqito/matrices/gen_pauli.py +++ b/toqito/matrices/gen_pauli.py @@ -61,6 +61,9 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikGenPaul] Wikipedia: Generalizations of Pauli matrices https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices diff --git a/toqito/matrices/hadamard.py b/toqito/matrices/hadamard.py index 0600ed76d..e48dfa731 100644 --- a/toqito/matrices/hadamard.py +++ b/toqito/matrices/hadamard.py @@ -34,6 +34,9 @@ def hadamard(n_param: int = 1) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikHad] Wikipedia: Hadamard transform https://en.wikipedia.org/wiki/Hadamard_transform diff --git a/toqito/matrices/pauli.py b/toqito/matrices/pauli.py index bb456e037..845f3b5e9 100644 --- a/toqito/matrices/pauli.py +++ b/toqito/matrices/pauli.py @@ -79,6 +79,9 @@ def pauli( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPauli] Wikipedia: Pauli matrices https://en.wikipedia.org/wiki/Pauli_matrices diff --git a/toqito/matrices/shift.py b/toqito/matrices/shift.py index 20304fb96..6a83721d4 100644 --- a/toqito/matrices/shift.py +++ b/toqito/matrices/shift.py @@ -43,6 +43,9 @@ def shift(dim: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikShift] Wikipedia: Generalizations of Pauli matrices (https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices. diff --git a/toqito/matrices/standard_basis.py b/toqito/matrices/standard_basis.py index 44ec16785..6c505e984 100644 --- a/toqito/matrices/standard_basis.py +++ b/toqito/matrices/standard_basis.py @@ -20,6 +20,11 @@ def standard_basis(dim: int, flatten: bool = False) -> list[np.ndarray]: This function was inspired by: https://github.com/akshayseshadri/minimax-fidelity-estimation + References + ========== + .. bibliography:: + :filter: docname in docnames + :param dim: The dimension of the basis. :param flatten: If True, the basis is returned as a flattened list. :return: A list of numpy.ndarray of shape (n, 1). diff --git a/toqito/matrix_ops/inner_product.py b/toqito/matrix_ops/inner_product.py index dde9210ac..f5d99f4c4 100644 --- a/toqito/matrix_ops/inner_product.py +++ b/toqito/matrix_ops/inner_product.py @@ -29,6 +29,9 @@ def inner_product(v1: np.ndarray, v2: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikInner] Wikipedia: Inner product space https://en.wikipedia.org/wiki/Inner_product_space diff --git a/toqito/matrix_ops/outer_product.py b/toqito/matrix_ops/outer_product.py index f73554f42..ab6e90d15 100644 --- a/toqito/matrix_ops/outer_product.py +++ b/toqito/matrix_ops/outer_product.py @@ -31,6 +31,9 @@ def outer_product(v1: np.ndarray, v2: np.ndarray) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikOuter] Wikipedia: Outer Product https://en.wikipedia.org/wiki/Outer_product diff --git a/toqito/matrix_ops/tensor.py b/toqito/matrix_ops/tensor.py index 2270a49dd..3214a7770 100644 --- a/toqito/matrix_ops/tensor.py +++ b/toqito/matrix_ops/tensor.py @@ -106,6 +106,9 @@ def tensor(*args) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikTensor] Wikipedia: Tensor product https://en.wikipedia.org/wiki/Tensor_product diff --git a/toqito/matrix_ops/unvec.py b/toqito/matrix_ops/unvec.py index 50a143b5e..a0f25f4a4 100644 --- a/toqito/matrix_ops/unvec.py +++ b/toqito/matrix_ops/unvec.py @@ -72,8 +72,11 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: ======== vec - References + References ========== + .. bibliography:: + :filter: docname in docnames + .. [Rigetti2020] Forest Benchmarking (Rigetti). https://github.com/rigetti/forest-benchmarking diff --git a/toqito/matrix_ops/vec.py b/toqito/matrix_ops/vec.py index e27ebf18b..dead67ce3 100644 --- a/toqito/matrix_ops/vec.py +++ b/toqito/matrix_ops/vec.py @@ -81,6 +81,9 @@ def vec(mat: np.ndarray) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WATVEC] Watrous, John. "The theory of quantum information." Section: "The operator-vector correspondence". diff --git a/toqito/matrix_ops/vectors_from_gram_matrix.py b/toqito/matrix_ops/vectors_from_gram_matrix.py index 1fb1f9993..0170b8972 100644 --- a/toqito/matrix_ops/vectors_from_gram_matrix.py +++ b/toqito/matrix_ops/vectors_from_gram_matrix.py @@ -5,6 +5,11 @@ def vectors_from_gram_matrix(gram: np.ndarray) -> list[np.ndarray]: """Obtain the corresponding ensemble of states from the Gram matrix. + References + ========== + .. bibliography:: + :filter: docname in docnames + :param gram: Input Gram matrix. :return: list of ensemble states """ diff --git a/toqito/matrix_ops/vectors_to_gram_matrix.py b/toqito/matrix_ops/vectors_to_gram_matrix.py index a72ac6b03..c80462ded 100644 --- a/toqito/matrix_ops/vectors_to_gram_matrix.py +++ b/toqito/matrix_ops/vectors_to_gram_matrix.py @@ -3,7 +3,12 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: - """Given a list of vectors, return the Gram matrix.""" + """Given a list of vectors, return the Gram matrix. + + References + ========== + .. bibliography:: + :filter: docname in docnames""" n = len(vectors) gram = np.zeros((n, n), dtype=complex) for i in range(n): diff --git a/toqito/matrix_props/is_block_positive.py b/toqito/matrix_props/is_block_positive.py index d88f27657..88893ee58 100644 --- a/toqito/matrix_props/is_block_positive.py +++ b/toqito/matrix_props/is_block_positive.py @@ -42,6 +42,9 @@ def is_block_positive( References ========== + .. bibliography:: + :filter: docname in docnames + .. [1] "N. Johnston. Norms and Cones in the Theory of Quantum Entanglement. PhD thesis" arXiv:1207.1479 diff --git a/toqito/matrix_props/is_circulant.py b/toqito/matrix_props/is_circulant.py index a54df1efe..164c9b23a 100644 --- a/toqito/matrix_props/is_circulant.py +++ b/toqito/matrix_props/is_circulant.py @@ -34,6 +34,9 @@ def is_circulant(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikCirc] Wikipedia: Circulant matrices https://en.wikipedia.org/wiki/Circulant_matrix diff --git a/toqito/matrix_props/is_commuting.py b/toqito/matrix_props/is_commuting.py index f1cb036ef..860cac4e0 100644 --- a/toqito/matrix_props/is_commuting.py +++ b/toqito/matrix_props/is_commuting.py @@ -66,6 +66,9 @@ def is_commuting(mat_1: np.ndarray, mat_2: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikCom] Wikipedia: Commuting matrices https://en.wikipedia.org/wiki/Commuting_matrices diff --git a/toqito/matrix_props/is_density.py b/toqito/matrix_props/is_density.py index 4383eb697..1e5fbcd50 100644 --- a/toqito/matrix_props/is_density.py +++ b/toqito/matrix_props/is_density.py @@ -61,6 +61,9 @@ def is_density(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikDensity] Wikipedia: Density matrix https://en.wikipedia.org/wiki/Density_matrix diff --git a/toqito/matrix_props/is_diagonal.py b/toqito/matrix_props/is_diagonal.py index ad641896a..44c14f2a2 100644 --- a/toqito/matrix_props/is_diagonal.py +++ b/toqito/matrix_props/is_diagonal.py @@ -61,6 +61,9 @@ def is_diagonal(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikDiag] Wikipedia: Diagonal matrix https://en.wikipedia.org/wiki/Diagonal_matrix diff --git a/toqito/matrix_props/is_diagonally_dominant.py b/toqito/matrix_props/is_diagonally_dominant.py index fc44f5e93..b277112e4 100644 --- a/toqito/matrix_props/is_diagonally_dominant.py +++ b/toqito/matrix_props/is_diagonally_dominant.py @@ -50,6 +50,9 @@ def is_diagonally_dominant(mat: np.ndarray, is_strict: bool = True) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikDD] Wikipedia: Diagonally dominant matrix. https://en.wikipedia.org/wiki/Diagonally_dominant_matrix diff --git a/toqito/matrix_props/is_hermitian.py b/toqito/matrix_props/is_hermitian.py index f609ae14a..863c9285f 100644 --- a/toqito/matrix_props/is_hermitian.py +++ b/toqito/matrix_props/is_hermitian.py @@ -52,6 +52,9 @@ def is_hermitian(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> b References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikHerm] Wikipedia: Hermitian matrix. https://en.wikipedia.org/wiki/Hermitian_matrix diff --git a/toqito/matrix_props/is_idempotent.py b/toqito/matrix_props/is_idempotent.py index 53b46777a..a53f48f1a 100644 --- a/toqito/matrix_props/is_idempotent.py +++ b/toqito/matrix_props/is_idempotent.py @@ -46,6 +46,9 @@ def is_idempotent(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-8) -> b References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikIdempotent] Wikipedia: Idempotent matrix https://en.wikipedia.org/wiki/Idempotent_matrix diff --git a/toqito/matrix_props/is_identity.py b/toqito/matrix_props/is_identity.py index 538a3e439..cc44a7193 100644 --- a/toqito/matrix_props/is_identity.py +++ b/toqito/matrix_props/is_identity.py @@ -60,6 +60,9 @@ def is_identity(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-8) -> boo References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikIdentity] Wikipedia: Identity matrix https://en.wikipedia.org/wiki/Identity_matrix diff --git a/toqito/matrix_props/is_normal.py b/toqito/matrix_props/is_normal.py index 58a60281d..ee046452b 100644 --- a/toqito/matrix_props/is_normal.py +++ b/toqito/matrix_props/is_normal.py @@ -62,6 +62,9 @@ def is_normal(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikNormal] Wikipedia: Normal matrix. https://en.wikipedia.org/wiki/Normal_matrix diff --git a/toqito/matrix_props/is_orthonormal.py b/toqito/matrix_props/is_orthonormal.py index ddcf764f4..6af6e381d 100644 --- a/toqito/matrix_props/is_orthonormal.py +++ b/toqito/matrix_props/is_orthonormal.py @@ -7,6 +7,11 @@ def is_orthonormal(vectors: list[np.ndarray]) -> bool: """Check if the vectors are orthonormal. + References + ========== + .. bibliography:: + :filter: docname in docnames + :param vectors: A list of `np.ndarray` 1-by-n vectors. :return: True if vectors are orthonormal; False otherwise. """ diff --git a/toqito/matrix_props/is_permutation.py b/toqito/matrix_props/is_permutation.py index 50223566c..18b9dfdaa 100644 --- a/toqito/matrix_props/is_permutation.py +++ b/toqito/matrix_props/is_permutation.py @@ -50,6 +50,9 @@ def is_permutation(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikiPermutation] Wikipedia: Permutation matrix. https://en.wikipedia.org/wiki/Permutation_matrix diff --git a/toqito/matrix_props/is_positive_definite.py b/toqito/matrix_props/is_positive_definite.py index 48f7fd46c..799aeb036 100644 --- a/toqito/matrix_props/is_positive_definite.py +++ b/toqito/matrix_props/is_positive_definite.py @@ -50,6 +50,9 @@ def is_positive_definite(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPD] Wikipedia: Definiteness of a matrix. https://en.wikipedia.org/wiki/Definiteness_of_a_matrix diff --git a/toqito/matrix_props/is_positive_semidefinite.py b/toqito/matrix_props/is_positive_semidefinite.py index eed8c5633..5573a13db 100644 --- a/toqito/matrix_props/is_positive_semidefinite.py +++ b/toqito/matrix_props/is_positive_semidefinite.py @@ -45,6 +45,9 @@ def is_positive_semidefinite(mat: np.ndarray, rtol: float = 1e-05, atol: float = References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPSD] Wikipedia: Definiteness of a matrix. https://en.wikipedia.org/wiki/Definiteness_of_a_matrix diff --git a/toqito/matrix_props/is_projection.py b/toqito/matrix_props/is_projection.py index b95adf58d..6cf0e7a51 100644 --- a/toqito/matrix_props/is_projection.py +++ b/toqito/matrix_props/is_projection.py @@ -54,6 +54,9 @@ def is_projection(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikProj] Wikipedia: Projection matrix. https://en.wikipedia.org/wiki/Projection_matrix diff --git a/toqito/matrix_props/is_square.py b/toqito/matrix_props/is_square.py index c24bdb503..838bc4e3c 100644 --- a/toqito/matrix_props/is_square.py +++ b/toqito/matrix_props/is_square.py @@ -46,6 +46,9 @@ def is_square(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikSquare] Wikipedia: Square matrix. https://en.wikipedia.org/wiki/Square_matrix diff --git a/toqito/matrix_props/is_symmetric.py b/toqito/matrix_props/is_symmetric.py index 9aca025d1..16716ac68 100644 --- a/toqito/matrix_props/is_symmetric.py +++ b/toqito/matrix_props/is_symmetric.py @@ -56,6 +56,9 @@ def is_symmetric(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> b References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikSym] Wikipedia: Symmetric matrix https://en.wikipedia.org/wiki/Symmetric_matrix diff --git a/toqito/matrix_props/is_unitary.py b/toqito/matrix_props/is_unitary.py index 57e7c02c9..c1105fd58 100644 --- a/toqito/matrix_props/is_unitary.py +++ b/toqito/matrix_props/is_unitary.py @@ -66,6 +66,9 @@ def is_unitary(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> boo References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikUnitary] Wikipedia: Unitary matrix. https://en.wikipedia.org/wiki/Unitary_matrix diff --git a/toqito/matrix_props/kp_norm.py b/toqito/matrix_props/kp_norm.py index 4dad10351..8848d301a 100644 --- a/toqito/matrix_props/kp_norm.py +++ b/toqito/matrix_props/kp_norm.py @@ -6,6 +6,11 @@ def kp_norm(mat: np.ndarray, k: int, p: int) -> float: """ Compute the p-norm of the vector or the k-largest singular values of a matrix. + References + ========== + .. bibliography:: + :filter: docname in docnames + :param mat: 2D numpy ndarray :param k: The number of singular values to take. :param p: The order of the norm. diff --git a/toqito/matrix_props/majorizes.py b/toqito/matrix_props/majorizes.py index ce49b8583..37840f15b 100644 --- a/toqito/matrix_props/majorizes.py +++ b/toqito/matrix_props/majorizes.py @@ -44,6 +44,9 @@ def majorizes(a_var: np.ndarray | list[int], b_var: np.ndarray | list[int]) -> b References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikMajorization] Wikipedia: Majorization https://en.wikipedia.org/wiki/Majorization diff --git a/toqito/matrix_props/sk_norm.py b/toqito/matrix_props/sk_norm.py index 923abc774..6ae080b58 100644 --- a/toqito/matrix_props/sk_norm.py +++ b/toqito/matrix_props/sk_norm.py @@ -64,6 +64,9 @@ def sk_operator_norm( # pylint: disable=too-many-locals References ========== + .. bibliography:: + :filter: docname in docnames + .. [1] "A Family of Norms With Applications In Quantum Information Theory" Nathaniel Johnston, David W. Kribs arXiv:0909.3907 diff --git a/toqito/matrix_props/trace_norm.py b/toqito/matrix_props/trace_norm.py index df7443f4e..48121b4b0 100644 --- a/toqito/matrix_props/trace_norm.py +++ b/toqito/matrix_props/trace_norm.py @@ -40,6 +40,9 @@ def trace_norm(rho: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikTn] Quantiki: Trace norm https://www.quantiki.org/wiki/trace-norm diff --git a/toqito/measurement_ops/measure.py b/toqito/measurement_ops/measure.py index 1828aeeb6..6d6bd0d25 100644 --- a/toqito/measurement_ops/measure.py +++ b/toqito/measurement_ops/measure.py @@ -63,6 +63,9 @@ def measure(measurement: np.ndarray, state: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikMeas] Wikipedia: Measurement in quantum mechanics https://en.wikipedia.org/wiki/Measurement_in_quantum_mechanics diff --git a/toqito/measurement_props/is_povm.py b/toqito/measurement_props/is_povm.py index fa898ee83..9780ec70f 100644 --- a/toqito/measurement_props/is_povm.py +++ b/toqito/measurement_props/is_povm.py @@ -85,6 +85,9 @@ def is_povm(mat_list: list[np.ndarray]) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPOVM] Wikipedia: POVM https://en.wikipedia.org/wiki/POVM diff --git a/toqito/nonlocal_games/extended_nonlocal_game.py b/toqito/nonlocal_games/extended_nonlocal_game.py index fa952b0e4..f429a663a 100644 --- a/toqito/nonlocal_games/extended_nonlocal_game.py +++ b/toqito/nonlocal_games/extended_nonlocal_game.py @@ -26,6 +26,9 @@ class ExtendedNonlocalGame: References ========== + .. bibliography:: + :filter: docname in docnames + .. [JMRW16] Nathaniel Johnston, Rajat Mittal, Vincent Russo, John Watrous "Extended non-local games and monogamy-of-entanglement games", Proceedings of the Royal Society A: Mathematical, Physical and diff --git a/toqito/nonlocal_games/nonlocal_game.py b/toqito/nonlocal_games/nonlocal_game.py index 0e0daaf8c..53842f179 100644 --- a/toqito/nonlocal_games/nonlocal_game.py +++ b/toqito/nonlocal_games/nonlocal_game.py @@ -24,6 +24,9 @@ class NonlocalGame: References ========== + .. bibliography:: + :filter: docname in docnames + .. [CHTW04_2] Cleve, Richard, Hoyer, Peter, Toner, Benjamin, and Watrous, John "Consequences and limits of nonlocal strategies" Computational Complexity 2004. Proceedings. 19th IEEE Annual Conference. diff --git a/toqito/nonlocal_games/quantum_hedging.py b/toqito/nonlocal_games/quantum_hedging.py index efa3213e5..ac3cf9326 100644 --- a/toqito/nonlocal_games/quantum_hedging.py +++ b/toqito/nonlocal_games/quantum_hedging.py @@ -57,6 +57,9 @@ class QuantumHedging: References ========== + .. bibliography:: + :filter: docname in docnames + .. [MW12] Molina, Abel, and Watrous, John. "Hedging bets with correlated quantum strategies." Proceedings of the Royal Society A: diff --git a/toqito/nonlocal_games/xor_game.py b/toqito/nonlocal_games/xor_game.py index eea9999ed..9ce38fcbe 100644 --- a/toqito/nonlocal_games/xor_game.py +++ b/toqito/nonlocal_games/xor_game.py @@ -112,6 +112,9 @@ class XORGame: References ========== + .. bibliography:: + :filter: docname in docnames + .. [CSUU08] Richard Cleve, William Slofstra, Falk Unger, Sarvagya Upadhyay "Strong parallel repetition theorem for quantum XOR proof systems", 2008, diff --git a/toqito/perms/antisymmetric_projection.py b/toqito/perms/antisymmetric_projection.py index 253c28c94..b1379cf54 100644 --- a/toqito/perms/antisymmetric_projection.py +++ b/toqito/perms/antisymmetric_projection.py @@ -72,6 +72,9 @@ def antisymmetric_projection( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikAsym] Wikipedia: Anti-symmetric operator https://en.wikipedia.org/wiki/Anti-symmetric_operator diff --git a/toqito/perms/perfect_matchings.py b/toqito/perms/perfect_matchings.py index ffef0e9a0..ec8dde92e 100644 --- a/toqito/perms/perfect_matchings.py +++ b/toqito/perms/perfect_matchings.py @@ -27,6 +27,11 @@ def perfect_matchings(num: list[int] | int | np.ndarray) -> np.ndarray: [1 3 2 4] [1 4 3 2]] + References + ========== + .. bibliography:: + :filter: docname in docnames + :param num: Either an even integer, indicating that you would like all perfect matchings of the integers 1,2, ... N, or a `list` or `np.array` containing an even number of distinct entries, indicating that you would like all perfect matchings of those entries. diff --git a/toqito/perms/perm_sign.py b/toqito/perms/perm_sign.py index ecf6426ec..2956c7aab 100644 --- a/toqito/perms/perm_sign.py +++ b/toqito/perms/perm_sign.py @@ -43,6 +43,9 @@ def perm_sign(perm: np.ndarray | list[int]) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikParPerm] Wikipedia: Parity of a permutation https://en.wikipedia.org/wiki/Parity_of_a_permutation diff --git a/toqito/perms/permutation_operator.py b/toqito/perms/permutation_operator.py index 2b79cae0b..756a7b2e3 100644 --- a/toqito/perms/permutation_operator.py +++ b/toqito/perms/permutation_operator.py @@ -46,6 +46,11 @@ def permutation_operator( [0., 0., 1., 0.], [0., 1., 0., 0.], [0., 0., 0., 1.]] + + References + ========== + .. bibliography:: + :filter: docname in docnames :param dim: The dimensions of the subsystems to be permuted. :param perm: A permutation vector. diff --git a/toqito/perms/permute_systems.py b/toqito/perms/permute_systems.py index 4b23acfbc..0fa798997 100644 --- a/toqito/perms/permute_systems.py +++ b/toqito/perms/permute_systems.py @@ -136,6 +136,11 @@ def permute_systems( [49 53 50 54 51 55 52 56] [25 29 26 30 27 31 28 32] [57 61 58 62 59 63 60 64]] + + References + ========== + .. bibliography:: + :filter: docname in docnames :raises ValueError: If dimension does not match the number of subsystems. :param input_mat: The vector or matrix. diff --git a/toqito/perms/swap.py b/toqito/perms/swap.py index a504355ae..b2bf7c491 100644 --- a/toqito/perms/swap.py +++ b/toqito/perms/swap.py @@ -100,6 +100,11 @@ def swap( >>> swap(test_vec) [1 3 2 4] + References + ========== + .. bibliography:: + :filter: docname in docnames + :raises ValueError: If dimension does not match the number of subsystems. :param rho: A vector or matrix to have its subsystems swapped. :param sys: Default: [1, 2] diff --git a/toqito/perms/swap_operator.py b/toqito/perms/swap_operator.py index c1ad47b97..1749b41e8 100644 --- a/toqito/perms/swap_operator.py +++ b/toqito/perms/swap_operator.py @@ -52,6 +52,11 @@ def swap_operator(dim: list[int] | int, is_sparse: bool = False) -> np.ndarray: [0., 0., 0., 0., 0., 1., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 1.]] + References + ========== + .. bibliography:: + :filter: docname in docnames + :param dim: The dimensions of the subsystems. :param is_sparse: Sparse if :code:`True` and non-sparse if :code:`False`. :return: The swap operator of dimension :code:`dim`. diff --git a/toqito/perms/symmetric_projection.py b/toqito/perms/symmetric_projection.py index 795bba722..464f0f7a1 100644 --- a/toqito/perms/symmetric_projection.py +++ b/toqito/perms/symmetric_projection.py @@ -71,6 +71,9 @@ def symmetric_projection( References ========== + .. bibliography:: + :filter: docname in docnames + .. [CJKLZ14] J. Chen, Z. Ji, D. Kribs, N. Lütkenhaus, and B. Zeng. "Symmetric extension of two-qubit states". Physical Review A 90.3 (2014): 032318. diff --git a/toqito/perms/unique_perms.py b/toqito/perms/unique_perms.py index 501ac05cc..3276a8313 100644 --- a/toqito/perms/unique_perms.py +++ b/toqito/perms/unique_perms.py @@ -30,6 +30,11 @@ def unique_perms(elements: list[int]): >>> len(list(unique_perms(vec_nums))) 4200 + References + ========== + .. bibliography:: + :filter: docname in docnames + :param elements: List of integers. :return: The number of possible permutations possible. """ diff --git a/toqito/rand/random_density_matrix.py b/toqito/rand/random_density_matrix.py index be6b11737..48a4e024e 100644 --- a/toqito/rand/random_density_matrix.py +++ b/toqito/rand/random_density_matrix.py @@ -76,6 +76,11 @@ def random_density_matrix( >>> is_density(bures_mat) True + References + ========== + .. bibliography:: + :filter: docname in docnames + :param dim: The number of rows (and columns) of the density matrix. :param is_real: Boolean denoting whether the returned matrix will have all real entries or not. diff --git a/toqito/rand/random_ginibre.py b/toqito/rand/random_ginibre.py index 254ada793..ba60d5a6e 100644 --- a/toqito/rand/random_ginibre.py +++ b/toqito/rand/random_ginibre.py @@ -28,6 +28,9 @@ def random_ginibre( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WIKCIRC] Wikipedia: Circular law https://en.wikipedia.org/wiki/Circular_law diff --git a/toqito/rand/random_povm.py b/toqito/rand/random_povm.py index c4ba06cd1..f68bc851e 100644 --- a/toqito/rand/random_povm.py +++ b/toqito/rand/random_povm.py @@ -38,6 +38,9 @@ def random_povm(dim: int, num_inputs: int, num_outputs: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WIKPOVM] Wikipedia: POVM https://en.wikipedia.org/wiki/POVM diff --git a/toqito/rand/random_state_vector.py b/toqito/rand/random_state_vector.py index 7e05f4d19..2b05aa0ce 100644 --- a/toqito/rand/random_state_vector.py +++ b/toqito/rand/random_state_vector.py @@ -32,6 +32,11 @@ def random_state_vector( >>> is_pure(dm) True + References + ========== + .. bibliography:: + :filter: docname in docnames + :param dim: The number of rows (and columns) of the unitary matrix. :param is_real: Boolean denoting whether the returned matrix has real entries or not. Default is :code:`False`. diff --git a/toqito/rand/random_unitary.py b/toqito/rand/random_unitary.py index 692951eb0..2d5a28250 100644 --- a/toqito/rand/random_unitary.py +++ b/toqito/rand/random_unitary.py @@ -63,6 +63,9 @@ def random_unitary(dim: list[int] | int, is_real: bool = False) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [MO09] How to generate a random unitary matrix, Maris Ozols March 16, 2009, diff --git a/toqito/state_metrics/bures_distance.py b/toqito/state_metrics/bures_distance.py index c7286e3d9..758c77b5c 100644 --- a/toqito/state_metrics/bures_distance.py +++ b/toqito/state_metrics/bures_distance.py @@ -54,6 +54,9 @@ def bures_distance(rho_1: np.ndarray, rho_2: np.ndarray, decimals: int = 10) -> References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikBures] Wikipedia: Bures metric https://en.wikipedia.org/wiki/Bures_metric diff --git a/toqito/state_metrics/fidelity.py b/toqito/state_metrics/fidelity.py index f951a9835..5b2cd8922 100644 --- a/toqito/state_metrics/fidelity.py +++ b/toqito/state_metrics/fidelity.py @@ -55,6 +55,9 @@ def fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikFid] Wikipedia: Fidelity of quantum states https://en.wikipedia.org/wiki/Fidelity_of_quantum_states diff --git a/toqito/state_metrics/fidelity_of_separability.py b/toqito/state_metrics/fidelity_of_separability.py index e7206b082..3e770a472 100644 --- a/toqito/state_metrics/fidelity_of_separability.py +++ b/toqito/state_metrics/fidelity_of_separability.py @@ -105,6 +105,9 @@ def fidelity_of_separability( References ========== + .. bibliography:: + :filter: docname in docnames + .. [Hay12] Hayden, Patrick et.al. "Two-message quantum interactive proofs and the quantum separability problem." Proceedings of the 28th IEEE Conference on Computational Complexity, pages 156-167. diff --git a/toqito/state_metrics/helstrom_holevo.py b/toqito/state_metrics/helstrom_holevo.py index 00e72f999..536310599 100644 --- a/toqito/state_metrics/helstrom_holevo.py +++ b/toqito/state_metrics/helstrom_holevo.py @@ -50,6 +50,9 @@ def helstrom_holevo(rho: np.ndarray, sigma: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikHeHo] Wikipedia: Holevo's theorem. https://en.wikipedia.org/wiki/Holevo%27s_theorem diff --git a/toqito/state_metrics/hilbert_schmidt.py b/toqito/state_metrics/hilbert_schmidt.py index 4a13211c1..f53fb9865 100644 --- a/toqito/state_metrics/hilbert_schmidt.py +++ b/toqito/state_metrics/hilbert_schmidt.py @@ -30,6 +30,9 @@ def hilbert_schmidt(rho: np.ndarray, sigma: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikHS] Wikipedia: Hilbert-Schmidt operator. https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator diff --git a/toqito/state_metrics/hilbert_schmidt_inner_product.py b/toqito/state_metrics/hilbert_schmidt_inner_product.py index 9868720cf..adf1fe194 100644 --- a/toqito/state_metrics/hilbert_schmidt_inner_product.py +++ b/toqito/state_metrics/hilbert_schmidt_inner_product.py @@ -32,6 +32,9 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> compl References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikHSO] Wikipedia: Hilbert-Schmidt operator. https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator .. [Rigetti21] Forest Benchmarking (Rigetti). diff --git a/toqito/state_metrics/matsumoto_fidelity.py b/toqito/state_metrics/matsumoto_fidelity.py index d24c63b4a..12124d64c 100644 --- a/toqito/state_metrics/matsumoto_fidelity.py +++ b/toqito/state_metrics/matsumoto_fidelity.py @@ -65,6 +65,9 @@ def matsumoto_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [Mat10] Keiji Matsumoto. "Reverse test and quantum analogue of classical fidelity and generalized fidelity" https://arxiv.org/abs/1006.0302 diff --git a/toqito/state_metrics/sub_fidelity.py b/toqito/state_metrics/sub_fidelity.py index 320bb491b..99d2729f6 100644 --- a/toqito/state_metrics/sub_fidelity.py +++ b/toqito/state_metrics/sub_fidelity.py @@ -54,6 +54,9 @@ def sub_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [MPHUZSub08] J. A. Miszczak, Z. Puchała, P. Horodecki, A. Uhlmann, K. Życzkowski "Sub--and super--fidelity as bounds for quantum fidelity." arXiv preprint arXiv:0805.2037 (2008). diff --git a/toqito/state_metrics/trace_distance.py b/toqito/state_metrics/trace_distance.py index 1291a0630..de6043274 100644 --- a/toqito/state_metrics/trace_distance.py +++ b/toqito/state_metrics/trace_distance.py @@ -46,6 +46,9 @@ def trace_distance(rho: np.ndarray, sigma: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WIKTD] Quantiki: Trace distance https://www.quantiki.org/wiki/trace-distance diff --git a/toqito/state_ops/pure_to_mixed.py b/toqito/state_ops/pure_to_mixed.py index 6331d783a..86aa8aa9b 100644 --- a/toqito/state_ops/pure_to_mixed.py +++ b/toqito/state_ops/pure_to_mixed.py @@ -47,6 +47,11 @@ def pure_to_mixed(phi: np.ndarray) -> np.ndarray: [0. , 0. , 0. , 0. ], [0.5, 0. , 0. , 0.5]]) + References + ========== + .. bibliography:: + :filter: docname in docnames + :raises ValueError: If matrix is not square. :param phi: A density matrix or a pure state vector. :return: density matrix representation of :code:`phi`, regardless of whether :code:`phi` is diff --git a/toqito/state_ops/schmidt_decomposition.py b/toqito/state_ops/schmidt_decomposition.py index 66f8da0e3..d1dd73ad7 100644 --- a/toqito/state_ops/schmidt_decomposition.py +++ b/toqito/state_ops/schmidt_decomposition.py @@ -55,6 +55,9 @@ def schmidt_decomposition( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikSD] Wikipedia: Schmidt decomposition https://en.wikipedia.org/wiki/Schmidt_decomposition diff --git a/toqito/state_opt/optimal_clone.py b/toqito/state_opt/optimal_clone.py index 2c419e981..09ee748fa 100644 --- a/toqito/state_opt/optimal_clone.py +++ b/toqito/state_opt/optimal_clone.py @@ -90,6 +90,9 @@ def optimal_clone( References ========== + .. bibliography:: + :filter: docname in docnames + .. [MVW12] Abel Molina, Thomas Vidick, and John Watrous. "Optimal counterfeiting attacks and generalizations for Wiesner’s quantum money." diff --git a/toqito/state_opt/ppt_distinguishability.py b/toqito/state_opt/ppt_distinguishability.py index f67bc9303..e0d3f364e 100644 --- a/toqito/state_opt/ppt_distinguishability.py +++ b/toqito/state_opt/ppt_distinguishability.py @@ -86,6 +86,9 @@ def ppt_distinguishability( References ========== + .. bibliography:: + :filter: docname in docnames + .. [COS13] Cosentino, Alessandro. "Positive-partial-transpose-indistinguishable states via semidefinite programming." diff --git a/toqito/state_opt/state_distinguishability.py b/toqito/state_opt/state_distinguishability.py index 1d1c04720..48d9c5356 100644 --- a/toqito/state_opt/state_distinguishability.py +++ b/toqito/state_opt/state_distinguishability.py @@ -75,6 +75,9 @@ def state_distinguishability( References ========== + .. bibliography:: + :filter: docname in docnames + .. [ELD03] Eldar, Yonina C. "A semidefinite programming approach to optimal unambiguous discrimination of quantum states." diff --git a/toqito/state_opt/state_exclusion.py b/toqito/state_opt/state_exclusion.py index ce1d8f008..4c031fd36 100644 --- a/toqito/state_opt/state_exclusion.py +++ b/toqito/state_opt/state_exclusion.py @@ -78,6 +78,9 @@ def state_exclusion( References ========== + .. bibliography:: + :filter: docname in docnames + .. [PBR12] "On the reality of the quantum state" Pusey, Matthew F., Barrett, Jonathan, and Rudolph, Terry. Nature Physics 8.6 (2012): 475-478. diff --git a/toqito/state_opt/symmetric_extension_hierarchy.py b/toqito/state_opt/symmetric_extension_hierarchy.py index 0d0937950..24044d9bf 100644 --- a/toqito/state_opt/symmetric_extension_hierarchy.py +++ b/toqito/state_opt/symmetric_extension_hierarchy.py @@ -128,6 +128,9 @@ def symmetric_extension_hierarchy( References ========== + .. bibliography:: + :filter: docname in docnames + .. [Nav08] Navascués, Miguel. "Pure state estimation and the characterization of entanglement." Physical review letters 100.7 (2008): 070503. diff --git a/toqito/state_props/concurrence.py b/toqito/state_props/concurrence.py index 814a1b4b0..319b14e7f 100644 --- a/toqito/state_props/concurrence.py +++ b/toqito/state_props/concurrence.py @@ -65,6 +65,9 @@ def concurrence(rho: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikCon] Wikipedia page for concurrence (quantum computing) https://en.wikipedia.org/wiki/Concurrence_(quantum_computing) diff --git a/toqito/state_props/entanglement_of_formation.py b/toqito/state_props/entanglement_of_formation.py index 585ed9572..91997f17d 100644 --- a/toqito/state_props/entanglement_of_formation.py +++ b/toqito/state_props/entanglement_of_formation.py @@ -46,6 +46,9 @@ def entanglement_of_formation(rho: np.ndarray, dim: list[int] | int = None) -> f References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikEOF] Quantiki: Entanglement-of-formation https://www.quantiki.org/wiki/entanglement-formation diff --git a/toqito/state_props/has_symmetric_extension.py b/toqito/state_props/has_symmetric_extension.py index e66a20d24..a20c7e945 100644 --- a/toqito/state_props/has_symmetric_extension.py +++ b/toqito/state_props/has_symmetric_extension.py @@ -82,6 +82,9 @@ def has_symmetric_extension( References ========== + .. bibliography:: + :filter: docname in docnames + .. [DPS02] Doherty, Andrew C., Pablo A. Parrilo, and Federico M. Spedalieri. "Distinguishing separable and entangled states." Physical Review Letters 88.18 (2002): 187904. diff --git a/toqito/state_props/in_separable_ball.py b/toqito/state_props/in_separable_ball.py index 315fc0bf6..efc6e7c76 100644 --- a/toqito/state_props/in_separable_ball.py +++ b/toqito/state_props/in_separable_ball.py @@ -52,6 +52,9 @@ def in_separable_ball(mat: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [GB02] Gurvits, Leonid, and Barnum, Howard. "Largest separable balls around the maximally mixed bipartite quantum state." Physical Review A 66.6 (2002): 062311. diff --git a/toqito/state_props/is_ensemble.py b/toqito/state_props/is_ensemble.py index 056c5a1f3..1ca9eb321 100644 --- a/toqito/state_props/is_ensemble.py +++ b/toqito/state_props/is_ensemble.py @@ -44,6 +44,9 @@ def is_ensemble(states: list[np.ndarray]) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WatEns18] Watrous, John. "The theory of quantum information." Section: "Ensemble of quantum states". diff --git a/toqito/state_props/is_mixed.py b/toqito/state_props/is_mixed.py index 3bfa7d6c1..daaca5c2e 100644 --- a/toqito/state_props/is_mixed.py +++ b/toqito/state_props/is_mixed.py @@ -33,6 +33,9 @@ def is_mixed(state: np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikMix] Wikipedia: Quantum state - Mixed states https://en.wikipedia.org/wiki/Quantum_state#Mixed_states diff --git a/toqito/state_props/is_mutually_orthogonal.py b/toqito/state_props/is_mutually_orthogonal.py index afe392830..de2765d3e 100644 --- a/toqito/state_props/is_mutually_orthogonal.py +++ b/toqito/state_props/is_mutually_orthogonal.py @@ -50,6 +50,9 @@ def is_mutually_orthogonal(vec_list: list[np.ndarray | list[float | Any]]) -> bo References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikOrthog] Wikipedia: Orthogonality https://en.wikipedia.org/wiki/Orthogonality diff --git a/toqito/state_props/is_mutually_unbiased_basis.py b/toqito/state_props/is_mutually_unbiased_basis.py index e705c9c94..1e6f4d484 100644 --- a/toqito/state_props/is_mutually_unbiased_basis.py +++ b/toqito/state_props/is_mutually_unbiased_basis.py @@ -72,6 +72,9 @@ def is_mutually_unbiased_basis(vec_list: list[np.ndarray | list[float | Any]]) - References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikMUB] Wikipedia: Mutually unbiased bases https://en.wikipedia.org/wiki/Mutually_unbiased_bases diff --git a/toqito/state_props/is_npt.py b/toqito/state_props/is_npt.py index 2cc947418..408e61420 100644 --- a/toqito/state_props/is_npt.py +++ b/toqito/state_props/is_npt.py @@ -19,6 +19,9 @@ def is_npt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: floa References ========== + .. bibliography:: + :filter: docname in docnames + .. [NPT] "Evidence for bound entangled states with negative partial transpose." Physical Review A 61.6 (2000): 062312. diff --git a/toqito/state_props/is_ppt.py b/toqito/state_props/is_ppt.py index f0154a0a0..9ac552a2f 100644 --- a/toqito/state_props/is_ppt.py +++ b/toqito/state_props/is_ppt.py @@ -65,6 +65,9 @@ def is_ppt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: floa References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPPT] Quantiki: Positive partial transpose https://www.quantiki.org/wiki/positive-partial-transpose diff --git a/toqito/state_props/is_product.py b/toqito/state_props/is_product.py index c2c0a09ee..7b657dd8c 100644 --- a/toqito/state_props/is_product.py +++ b/toqito/state_props/is_product.py @@ -46,6 +46,9 @@ def is_product(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> boo References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikProdState] Wikipedia: Product state https://en.wikipedia.org/wiki/Product_state :param rho: The vector or matrix to check. diff --git a/toqito/state_props/is_pure.py b/toqito/state_props/is_pure.py index 50a4d3f8e..0637f2550 100644 --- a/toqito/state_props/is_pure.py +++ b/toqito/state_props/is_pure.py @@ -59,6 +59,9 @@ def is_pure(state: list[np.ndarray] | np.ndarray) -> bool: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikIsPure] Wikipedia: Quantum state - Pure states https://en.wikipedia.org/wiki/Quantum_state#Pure_states diff --git a/toqito/state_props/is_separable.py b/toqito/state_props/is_separable.py index 059fbbb22..f2ddb4a13 100644 --- a/toqito/state_props/is_separable.py +++ b/toqito/state_props/is_separable.py @@ -54,6 +54,9 @@ def is_separable( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikSepState] Wikipedia: Separable state https://en.wikipedia.org/wiki/Separable_state diff --git a/toqito/state_props/l1_norm_coherence.py b/toqito/state_props/l1_norm_coherence.py index 8522d49f6..ab7cc0be3 100644 --- a/toqito/state_props/l1_norm_coherence.py +++ b/toqito/state_props/l1_norm_coherence.py @@ -41,6 +41,9 @@ def l1_norm_coherence(rho: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [RPWL17] "Logarithmic coherence: Operational interpretation of 1-norm coherence" Rana, Swapan, Parashar, Preeti, Winter, Andreas, Lewenstein, Maciej Physical Review A 96.5 (2017): 052336. diff --git a/toqito/state_props/log_negativity.py b/toqito/state_props/log_negativity.py index 100fe32fa..6d45211c8 100644 --- a/toqito/state_props/log_negativity.py +++ b/toqito/state_props/log_negativity.py @@ -38,6 +38,9 @@ def log_negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikLogNeg] Wikipedia page for negativity (quantum mechanics): https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics) diff --git a/toqito/state_props/negativity.py b/toqito/state_props/negativity.py index 3c8253d0f..27495505a 100644 --- a/toqito/state_props/negativity.py +++ b/toqito/state_props/negativity.py @@ -39,6 +39,9 @@ def negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikNeg] Wikipedia page for negativity (quantum mechanics): https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics) diff --git a/toqito/state_props/purity.py b/toqito/state_props/purity.py index 29a53e8dd..8e33921f0 100644 --- a/toqito/state_props/purity.py +++ b/toqito/state_props/purity.py @@ -46,6 +46,9 @@ def purity(rho: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikPurity] Wikipedia page for purity (quantum mechanics): https://en.wikipedia.org/wiki/Purity_(quantum_mechanics) diff --git a/toqito/state_props/schmidt_rank.py b/toqito/state_props/schmidt_rank.py index 21a4cbcb4..db3e7005d 100644 --- a/toqito/state_props/schmidt_rank.py +++ b/toqito/state_props/schmidt_rank.py @@ -74,6 +74,9 @@ def schmidt_rank(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> f References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikSR] Wikipedia: Schmidt rank https://en.wikipedia.org/wiki/Schmidt_decomposition#Schmidt_rank_and_entanglement diff --git a/toqito/state_props/sk_vec_norm.py b/toqito/state_props/sk_vec_norm.py index a79b1e580..26014400f 100644 --- a/toqito/state_props/sk_vec_norm.py +++ b/toqito/state_props/sk_vec_norm.py @@ -41,6 +41,9 @@ def sk_vector_norm(rho: np.ndarray, k: int = 1, dim: int | list[int] = None) -> References ========== + .. bibliography:: + :filter: docname in docnames + .. [NJDK09] "A Family of Norms With Applications In Quantum Information Theory" Nathaniel Johnston, David W. Kribs https://arxiv.org/abs/0909.3907 diff --git a/toqito/state_props/von_neumann_entropy.py b/toqito/state_props/von_neumann_entropy.py index 395052d9e..c58384c46 100644 --- a/toqito/state_props/von_neumann_entropy.py +++ b/toqito/state_props/von_neumann_entropy.py @@ -73,6 +73,9 @@ def von_neumann_entropy(rho: np.ndarray) -> float: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikVent] Wikipedia: Von Neumann entropy https://en.wikipedia.org/wiki/Von_Neumann_entropy diff --git a/toqito/states/basis.py b/toqito/states/basis.py index 43ec6b27d..e51dc021b 100644 --- a/toqito/states/basis.py +++ b/toqito/states/basis.py @@ -34,6 +34,9 @@ def basis(dim: int, pos: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikKet] Wikipedia page for bra–ket notation: https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation diff --git a/toqito/states/bell.py b/toqito/states/bell.py index 5fa5a1b9c..8cfecaf32 100644 --- a/toqito/states/bell.py +++ b/toqito/states/bell.py @@ -42,6 +42,9 @@ def bell(idx: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikBell] Wikipedia: Bell state https://en.wikipedia.org/wiki/Bell_state diff --git a/toqito/states/brauer.py b/toqito/states/brauer.py index 49299958c..025e81455 100644 --- a/toqito/states/brauer.py +++ b/toqito/states/brauer.py @@ -51,6 +51,9 @@ def brauer(dim: int, p_val: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikBrauer] Wikipedia: Brauer algebra https://en.wikipedia.org/wiki/Brauer_algebra diff --git a/toqito/states/breuer.py b/toqito/states/breuer.py index 7871846da..2a81920ab 100644 --- a/toqito/states/breuer.py +++ b/toqito/states/breuer.py @@ -31,6 +31,9 @@ def breuer(dim: int, lam: float) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [HPBreuer] H-P. Breuer. Optimal entanglement criterion for mixed quantum states. E-print: arXiv:quant-ph/0605036, 2006. diff --git a/toqito/states/chessboard.py b/toqito/states/chessboard.py index 3f2d84b9b..e0a977b5a 100644 --- a/toqito/states/chessboard.py +++ b/toqito/states/chessboard.py @@ -42,6 +42,9 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = References ========== + .. bibliography:: + :filter: docname in docnames + .. [BP00] Three qubits can be entangled in two inequivalent ways. D. Bruss and A. Peres Phys. Rev. A, 61:30301(R), 2000 diff --git a/toqito/states/domino.py b/toqito/states/domino.py index 7aaa63049..5eda6b4e6 100644 --- a/toqito/states/domino.py +++ b/toqito/states/domino.py @@ -73,6 +73,9 @@ def domino(idx: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [CBDOM99] Bennett, Charles H., et al. Quantum nonlocality without entanglement. Phys. Rev. A, 59:1070–1091, Feb 1999. diff --git a/toqito/states/gen_bell.py b/toqito/states/gen_bell.py index 138343c0f..beee2d92d 100644 --- a/toqito/states/gen_bell.py +++ b/toqito/states/gen_bell.py @@ -89,6 +89,9 @@ def gen_bell(k_1: int, k_2: int, dim: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [DL09] Sych, Denis, and Gerd Leuchs. "A complete basis of generalized Bell states." New Journal of Physics 11.1 (2009): 013006. diff --git a/toqito/states/ghz.py b/toqito/states/ghz.py index 605b8f075..e4ff3334a 100644 --- a/toqito/states/ghz.py +++ b/toqito/states/ghz.py @@ -61,6 +61,9 @@ def ghz(dim: int, num_qubits: int, coeff: list[int] = None) -> sparse: References ========== + .. bibliography:: + :filter: docname in docnames + .. [GHZ07] Going beyond Bell's theorem. D. Greenberger and M. Horne and A. Zeilinger. E-print: [quant-ph] arXiv:0712.0921. 2007. diff --git a/toqito/states/gisin.py b/toqito/states/gisin.py index e89694a7e..1be30e834 100644 --- a/toqito/states/gisin.py +++ b/toqito/states/gisin.py @@ -42,6 +42,9 @@ def gisin(lambda_var: float, theta: float) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [GIS96] N. Gisin. Hidden quantum nonlocality revealed by local filters. (http://dx.doi.org/10.1016/S0375-9601(96)80001-6). 1996. diff --git a/toqito/states/horodecki.py b/toqito/states/horodecki.py index 797ccccf1..8b566d659 100644 --- a/toqito/states/horodecki.py +++ b/toqito/states/horodecki.py @@ -107,6 +107,9 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [HOR] P. Horodecki. Separability criterion and inseparable mixed states with positive partial transpose. diff --git a/toqito/states/isotropic.py b/toqito/states/isotropic.py index daf252699..62dfd34bf 100644 --- a/toqito/states/isotropic.py +++ b/toqito/states/isotropic.py @@ -50,6 +50,9 @@ def isotropic(dim: int, alpha: float) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [HH99] Horodecki, Michał, and Paweł Horodecki. "Reduction criterion of separability and limits for a class of distillation protocols." Physical Review A 59.6 (1999): 4206. diff --git a/toqito/states/max_entangled.py b/toqito/states/max_entangled.py index cb17d22bd..e63bbaf89 100644 --- a/toqito/states/max_entangled.py +++ b/toqito/states/max_entangled.py @@ -47,6 +47,9 @@ def max_entangled( References ========== + .. bibliography:: + :filter: docname in docnames + .. [WikEnt] Wikipedia: Quantum entanglement https://en.wikipedia.org/wiki/Quantum_entanglement diff --git a/toqito/states/max_mixed.py b/toqito/states/max_mixed.py index e4e77c082..bc0c82ccb 100644 --- a/toqito/states/max_mixed.py +++ b/toqito/states/max_mixed.py @@ -58,6 +58,9 @@ def max_mixed(dim: int, is_sparse: bool = False) -> [np.ndarray, sparse.dia_matr References ========== + .. bibliography:: + :filter: docname in docnames + .. [AAR6] Scott Aaronson: Lecture 6, Thurs Feb 2: Mixed States https://www.scottaaronson.com/qclec/6.pdf diff --git a/toqito/states/singlet.py b/toqito/states/singlet.py index 53ee74a72..834e556b8 100644 --- a/toqito/states/singlet.py +++ b/toqito/states/singlet.py @@ -63,6 +63,9 @@ def singlet(dim: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [Gsinglet] Cabello, Adan, "N-particle N-level singlet states: Some properties and applications". Phys. Rev. Lett., 89 (2002): 100402. diff --git a/toqito/states/tile.py b/toqito/states/tile.py index d0af4b092..e677332e2 100644 --- a/toqito/states/tile.py +++ b/toqito/states/tile.py @@ -52,6 +52,9 @@ def tile(idx: int) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [UPBTile99] Bennett, Charles H., et al. "Unextendible product bases and bound entanglement." Physical Review Letters 82.26 (1999): 5385. diff --git a/toqito/states/w_state.py b/toqito/states/w_state.py index f518b7dff..40aefc86b 100644 --- a/toqito/states/w_state.py +++ b/toqito/states/w_state.py @@ -69,6 +69,9 @@ def w_state(num_qubits: int, coeff: list[int] = None) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [DVC00] Three qubits can be entangled in two inequivalent ways. W. Dur, G. Vidal, and J. I. Cirac. E-print: arXiv:quant-ph/0005115, 2000. diff --git a/toqito/states/werner.py b/toqito/states/werner.py index 1b194d1ec..88cbdbf11 100644 --- a/toqito/states/werner.py +++ b/toqito/states/werner.py @@ -85,6 +85,9 @@ def werner(dim: int, alpha: float | list[float]) -> np.ndarray: References ========== + .. bibliography:: + :filter: docname in docnames + .. [Wer89] R. F. Werner. Quantum states with Einstein-Podolsky-Rosen correlations admitting a hidden-variable model. Phys. Rev. A, 40(8):4277–4281. 1989 From 2eaa66c4c65285c12c6809b1bc0db293bdb874cf Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Mon, 20 Nov 2023 09:06:51 -0600 Subject: [PATCH 08/40] refs: channel_ops --- toqito/channel_ops/apply_channel.py | 10 +++++----- toqito/channel_ops/choi_to_kraus.py | 11 +++++++---- toqito/channel_ops/dual_channel.py | 10 +++++----- toqito/channel_ops/kraus_to_choi.py | 10 +++++----- toqito/channel_ops/partial_channel.py | 8 ++++---- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/toqito/channel_ops/apply_channel.py b/toqito/channel_ops/apply_channel.py index 967cf7080..a9a431ca4 100644 --- a/toqito/channel_ops/apply_channel.py +++ b/toqito/channel_ops/apply_channel.py @@ -11,7 +11,8 @@ def apply_channel(mat: np.ndarray, phi_op: np.ndarray | list[list[np.ndarray]]) -> np.ndarray: r""" - Apply a quantum channel to an operator [WatAChan18]_. + Apply a quantum channel to an operator (Section: Representations and Characterizations of Channels + of :cite:`watrous_2018`). Specifically, an application of the channel is defined as @@ -85,10 +86,9 @@ def apply_channel(mat: np.ndarray, phi_op: np.ndarray | list[list[np.ndarray]]) References ========== - .. [WatAChan18] Watrous, John. - The theory of quantum information. - Section: Representations and characterizations of channels. - Cambridge University Press, 2018. + .. bibliography:: + :filter: docname in docnames + :raises ValueError: If matrix is not Choi matrix. :param mat: A matrix. diff --git a/toqito/channel_ops/choi_to_kraus.py b/toqito/channel_ops/choi_to_kraus.py index 228436d88..9db0af7ed 100644 --- a/toqito/channel_ops/choi_to_kraus.py +++ b/toqito/channel_ops/choi_to_kraus.py @@ -12,7 +12,7 @@ def choi_to_kraus( choi_mat: np.ndarray, tol: float = 1e-9, dim: int | list[int] | np.ndarray = None ) -> list[np.ndarray] | list[list[np.ndarray]]: r""" - Compute a list of Kraus operators from the Choi matrix [Rigetti20]_. + Compute a list of Kraus operators from the Choi matrix from `Rigetti `__. Note that unlike the Choi or natural representation of operators, the Kraus representation is *not* unique. @@ -24,7 +24,8 @@ def choi_to_kraus( For completely positive maps the output is a single flat list of numpy arrays since the left and right Kraus maps are the same. - This function has been adapted from [Rigetti20]_ and QETLAB package. + This function has been adapted from `Rigetti `__ + and QETLAB :cite:`QETLAB_Kraus_Operators`. Examples ======== @@ -88,8 +89,10 @@ def choi_to_kraus( References ========== - .. [Rigetti20] Forest Benchmarking (Rigetti). - https://github.com/rigetti/forest-benchmarking + .. bibliography:: + :filter: docname in docnames + + :param choi_mat: A Choi matrix :param tol: optional threshold parameter for eigenvalues/kraus ops to be discarded diff --git a/toqito/channel_ops/dual_channel.py b/toqito/channel_ops/dual_channel.py index c645c5cbc..05b7ea409 100644 --- a/toqito/channel_ops/dual_channel.py +++ b/toqito/channel_ops/dual_channel.py @@ -11,7 +11,8 @@ def dual_channel( phi_op: np.ndarray | list[np.ndarray] | list[list[np.ndarray]], dims: list[int] = None ) -> np.ndarray | list[list[np.ndarray]]: r""" - Compute the dual of a map (quantum channel) [WatDChan18]_. + Compute the dual of a map (quantum channel) (Section: Representations and Characterizations of Channels + of :cite:`watrous_2018`). The map can be represented as a Choi matrix, with optional specification of input and output dimensions. If the input channel maps :math:`M_{r,c}` to :math:`M_{x,y}` @@ -36,10 +37,9 @@ def dual_channel( References ========== - .. [WatDChan18] Watrous, John. - The theory of quantum information. - Section: Representations and characterizations of channels. - Cambridge University Press, 2018. + .. bibliography:: + :filter: docname in docnames + :raises ValueError: If matrices are not Choi matrix. :param phi_op: A superoperator. It should be provided either as a Choi matrix, diff --git a/toqito/channel_ops/kraus_to_choi.py b/toqito/channel_ops/kraus_to_choi.py index 5bb04a66b..024ca369d 100644 --- a/toqito/channel_ops/kraus_to_choi.py +++ b/toqito/channel_ops/kraus_to_choi.py @@ -8,7 +8,8 @@ def kraus_to_choi(kraus_ops: list[list[np.ndarray]], sys: int = 2) -> np.ndarray: r""" - Compute the Choi matrix of a list of Kraus operators [WatKraus18]_. + Compute the Choi matrix of a list of Kraus operators (Section: Kraus Representations of + :cite:`watrous_2018`). The Choi matrix of the list of Kraus operators, :code:`kraus_ops`. The default convention is that the Choi matrix is the result of applying the map to the second subsystem of the @@ -53,10 +54,9 @@ def kraus_to_choi(kraus_ops: list[list[np.ndarray]], sys: int = 2) -> np.ndarray References ========== - .. [WatKraus18] Watrous, John. - "The theory of quantum information." - Section: "Kraus representations". - Cambridge University Press, 2018. + .. bibliography:: + :filter: docname in docnames + :param kraus_ops: A list of Kraus operators. :param sys: The dimension of the system (default is 2). diff --git a/toqito/channel_ops/partial_channel.py b/toqito/channel_ops/partial_channel.py index 8abd25abc..3789fa3f6 100644 --- a/toqito/channel_ops/partial_channel.py +++ b/toqito/channel_ops/partial_channel.py @@ -16,7 +16,7 @@ def partial_channel( sys: int = 2, dim: list[int] | np.ndarray = None, ) -> np.ndarray: - r"""Apply channel to a subsystem of an operator [WatPMap18]_. + r"""Apply channel to a subsystem of an operator :cite:`watrous_2018`. Applies the operator @@ -65,9 +65,9 @@ def partial_channel( References ========== - .. [WatPMap18] Watrous, John. - The theory of quantum information. - Cambridge University Press, 2018. + .. bibliography:: + :filter: docname in docnames + :raises ValueError: If Phi map is not provided as a Choi matrix or Kraus operators. From 0ca4473dd5044486f9309417968f2cea410fc855 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Mon, 20 Nov 2023 10:17:42 -0600 Subject: [PATCH 09/40] refs: channel_props --- toqito/channel_props/choi_rank.py | 8 ++------ toqito/channel_props/is_completely_positive.py | 7 ++----- toqito/channel_props/is_herm_preserving.py | 7 ++----- toqito/channel_props/is_positive.py | 7 ++----- toqito/channel_props/is_quantum_channel.py | 7 ++----- toqito/channel_props/is_trace_preserving.py | 6 +----- toqito/channel_props/is_unital.py | 6 +----- toqito/channel_props/is_unitary.py | 7 ++----- 8 files changed, 14 insertions(+), 41 deletions(-) diff --git a/toqito/channel_props/choi_rank.py b/toqito/channel_props/choi_rank.py index 513c4022c..f76cbf6a7 100644 --- a/toqito/channel_props/choi_rank.py +++ b/toqito/channel_props/choi_rank.py @@ -8,7 +8,8 @@ def choi_rank(phi: np.ndarray | list[list[np.ndarray]]) -> int: r""" - Calculate the rank of the Choi representation of a quantum channel [WatChoiRank18]_. + Calculate the rank of the Choi representation of a quantum channel (Section 2.2: Quantum Channels from + :cite:`watrous_2018`).. Examples ========== @@ -76,11 +77,6 @@ def choi_rank(phi: np.ndarray | list[list[np.ndarray]]) -> int: .. bibliography:: :filter: docname in docnames - .. [WatChoiRank18] Watrous, John. - "The Theory of Quantum Information." - Section: "2.2 Quantum Channels". - Cambridge University Press, 2018. - :raises ValueError: If matrix is not Choi. :param phi: Either a Choi matrix or a list of Kraus operators :return: The Choi rank of the provided channel representation. diff --git a/toqito/channel_props/is_completely_positive.py b/toqito/channel_props/is_completely_positive.py index 9ab5bb0aa..e3ec2c9d1 100644 --- a/toqito/channel_props/is_completely_positive.py +++ b/toqito/channel_props/is_completely_positive.py @@ -14,7 +14,8 @@ def is_completely_positive( atol: float = 1e-08, ) -> bool: r""" - Determine whether the given channel is completely positive [WatCP18]_. + Determine whether the given channel is completely positive (Section: Linear Maps Of Square Operators from + :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *completely positive* if it holds that @@ -78,10 +79,6 @@ def is_completely_positive( .. bibliography:: :filter: docname in docnames - .. [WatCP18] Watrous, John. - "The Theory of Quantum Information." - Section: "Linear maps of square operators". - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_herm_preserving.py b/toqito/channel_props/is_herm_preserving.py index a4f563c51..dc2365f14 100644 --- a/toqito/channel_props/is_herm_preserving.py +++ b/toqito/channel_props/is_herm_preserving.py @@ -13,7 +13,8 @@ def is_herm_preserving( atol: float = 1e-08, ) -> bool: r""" - Determine whether the given channel is Hermitian-preserving [WatH18]_. + Determine whether the given channel is Hermitian-preserving (Section: Linear Maps Of Square Operators from + :cite:`watrous_2018`).. A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *Hermitian-preserving* if it holds that @@ -64,10 +65,6 @@ def is_herm_preserving( .. bibliography:: :filter: docname in docnames - .. [WatH18] Watrous, John. - "The theory of quantum information." - Section: "Linear maps of square operators". - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_positive.py b/toqito/channel_props/is_positive.py index c2f42e4b7..b1b8eba76 100644 --- a/toqito/channel_props/is_positive.py +++ b/toqito/channel_props/is_positive.py @@ -13,7 +13,8 @@ def is_positive( atol: float = 1e-08, ) -> bool: r""" - Determine whether the given channel is positive [WatPM18]_. + Determine whether the given channel is positive (Section: Linear Maps Of Square Operators from + :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *positive* if it holds that @@ -66,10 +67,6 @@ def is_positive( .. bibliography:: :filter: docname in docnames - .. [WatPM18] Watrous, John. - "The theory of quantum information." - Section: "Linear maps of square operators". - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_quantum_channel.py b/toqito/channel_props/is_quantum_channel.py index 4f3d6a4a1..5cd0b3d28 100644 --- a/toqito/channel_props/is_quantum_channel.py +++ b/toqito/channel_props/is_quantum_channel.py @@ -13,7 +13,8 @@ def is_quantum_channel( atol: float = 1e-08, ) -> bool: r""" - Determine whether the given input is a quantum channel [WatQC18]_. + Determine whether the given input is a quantum channel (Section 2.2.1: + Definitions and Basic Notions Concerning Channels from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is a *quantum channel* for some choice of complex Euclidean spaces :math:`\mathcal{X}` @@ -43,10 +44,6 @@ def is_quantum_channel( .. bibliography:: :filter: docname in docnames - .. [WatQC18] Watrous, John. - "The Theory of Quantum Information." - Section: "2.2.1 Definitions and basic notions concerning channels". - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_trace_preserving.py b/toqito/channel_props/is_trace_preserving.py index 192935e42..b39226728 100644 --- a/toqito/channel_props/is_trace_preserving.py +++ b/toqito/channel_props/is_trace_preserving.py @@ -16,7 +16,7 @@ def is_trace_preserving( dim: list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is trace-preserving [WatTP18]_. + Determine whether the given channel is trace-preserving (Section: Linear Maps of Square Operators from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *trace-preserving* if it holds that @@ -80,10 +80,6 @@ def is_trace_preserving( .. bibliography:: :filter: docname in docnames - .. [WatTP18] Watrous, John. - "The theory of quantum information." - Section: "Linear maps of square operators". - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_unital.py b/toqito/channel_props/is_unital.py index 4ed0e888c..9fcc66af1 100644 --- a/toqito/channel_props/is_unital.py +++ b/toqito/channel_props/is_unital.py @@ -15,7 +15,7 @@ def is_unital( dim: int | list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is unital [WatUnital18]_. + Determine whether the given channel is unital (Chapter: Unital channels and Majorization from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *unital* if it holds that @@ -55,10 +55,6 @@ def is_unital( .. bibliography:: :filter: docname in docnames - .. [WatUnital18] Watrous, John. - "The theory of quantum information." - Chapter: Unital channels and majorization - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_unitary.py b/toqito/channel_props/is_unitary.py index b693d5b63..75406362c 100644 --- a/toqito/channel_props/is_unitary.py +++ b/toqito/channel_props/is_unitary.py @@ -9,7 +9,8 @@ def is_unitary(phi: np.ndarray | list[list[np.ndarray]]) -> bool: r""" - Given a quantum channel, determine if it is unitary [WatIU18]_. + Given a quantum channel, determine if it is unitary (Section 2.2.1: + Definitions and Basic Notions Concerning Channels from :cite:`watrous_2018`). Let :math:`\mathcal{X}` be a complex Euclidean space an let :math:`U \in U(\mathcal{X})` be a unitary operator. Then a unitary channel is defined as: @@ -61,10 +62,6 @@ def is_unitary(phi: np.ndarray | list[list[np.ndarray]]) -> bool: .. bibliography:: :filter: docname in docnames - .. [WatIU18] Watrous, John. - "The Theory of Quantum Information." - Section: "2.2.1 Definitions and basic notions concerning channels". - Cambridge University Press, 2018. :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :return: :code:`True` if the channel is a unitary channel, and :code:`False` otherwise. From 1de757b67201d2e873c45705228eff07120cda58 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 12:31:32 -0600 Subject: [PATCH 10/40] refs: channels --- docs/articles.bib | 54 ++++++++++++++++++++++++++++ toqito/channels/choi.py | 8 ++--- toqito/channels/dephasing.py | 7 ++-- toqito/channels/depolarizing.py | 13 +++---- toqito/channels/partial_trace.py | 4 +-- toqito/channels/partial_transpose.py | 5 ++- toqito/channels/realignment.py | 7 +--- toqito/channels/reduction.py | 2 +- 8 files changed, 67 insertions(+), 33 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 2ea589238..008851200 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -9,6 +9,18 @@ #Last name begins with C +@article{Choi_1992, +title = {Generalized Choi maps in three-dimensional matrix algebra}, +journal = {Linear Algebra and its Applications}, +volume = {171}, +pages = {213-224}, +year = {1992}, +issn = {0024-3795}, +doi = {https://doi.org/10.1016/0024-3795(92)90260-H}, +url = {https://www.sciencedirect.com/science/article/pii/002437959290260H}, +author = {Sung Je Cho and Seung-Hyeok Kye and Sa Ge Lee}, +abstract = {We consider a class of positive linear maps in the three-dimensional matrix algebra, which are generalizations of the positive linear map constructed by Choi in the relation with positive semidefinite biquadratic forms. We find conditions for which such maps are completely positive, completely copositive, decomposable, and two-positive.} +} #Last name begins with D @@ -73,6 +85,19 @@ @article{Katariya_2021 month=feb } #Last name begins with L +@article{Lupo_2008, + title={Bipartite quantum systems: on the realignment criterion and beyond}, + volume={41}, + ISSN={1751-8121}, + url={http://dx.doi.org/10.1088/1751-8113/41/41/415301}, + DOI={10.1088/1751-8113/41/41/415301}, + number={41}, + journal={Journal of Physics A: Mathematical and Theoretical}, + publisher={IOP Publishing}, + author={Lupo, Cosmo and Aniello, Paolo and Scardicchio, Antonello}, + year={2008}, + month=sep, pages={415301} } + #Last name begins with M @@ -141,6 +166,35 @@ @misc{WikiBures } +@misc{WikiDepo, + author = "Wikipedia", + title = "Quantum Depolarizing Channel", + howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_depolarizing_channel}" + +} + +@misc{WikiPartialTr, + author = "Wikipedia", + title = "Partial Trace", + howpublished = "\url{https://en.wikipedia.org/wiki/Partial_trace}" + +} + +@misc{WikiPeresHorodecki, + author = "Wikipedia", + title = "Peres-Horodecki criterion", + howpublished = "\url{https://en.wikipedia.org/wiki/Peres%E2%80%93Horodecki_criterion}" + +} + + +@misc{WikiReductionCrit, + author = "Wikipedia", + title = "Reduction Criterion", + howpublished = "\url{https://en.wikipedia.org/wiki/Reduction_criterion}" + +} + #Last name begins with X #Last name begins with Y diff --git a/toqito/channels/choi.py b/toqito/channels/choi.py index 54f607cab..fcfa68bf8 100644 --- a/toqito/channels/choi.py +++ b/toqito/channels/choi.py @@ -6,13 +6,13 @@ def choi(a_var: int = 1, b_var: int = 1, c_var: int = 0) -> np.ndarray: r""" - Produce the Choi channel or one of its generalizations [Choi92]_. + Produce the Choi channel or one of its generalizations :cite:`Choi_1992`. The *Choi channel* is a positive map on 3-by-3 matrices that is capable of detecting some entanglement that the transpose map is not. The standard Choi channel defined with :code:`a=1`, :code:`b=1`, and :code:`c=0` is the Choi - matrix of the positive map defined in [Choi92]_. Many of these maps are capable of detecting + matrix of the positive map defined in :cite:`Choi_1992`. Many of these maps are capable of detecting PPT entanglement. Examples @@ -95,10 +95,6 @@ def choi(a_var: int = 1, b_var: int = 1, c_var: int = 0) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [Choi92] Cho, Sung Je, Seung-Hyeok Kye, and Sa Ge Lee. - "Generalized Choi maps in three-dimensional matrix algebra." - Linear algebra and its applications 171 (1992): 213-224. - https://www.sciencedirect.com/science/article/pii/002437959290260H :param a_var: Default integer for standard Choi map. :param b_var: Default integer for standard Choi map. diff --git a/toqito/channels/dephasing.py b/toqito/channels/dephasing.py index b0de9ebe6..f57e37ec0 100644 --- a/toqito/channels/dephasing.py +++ b/toqito/channels/dephasing.py @@ -6,7 +6,8 @@ def dephasing(dim: int, param_p: float = 0) -> np.ndarray: r""" - Produce the partially dephasing channel [WatDeph18]_. + Produce the partially dephasing channel (Section: The completely dephasing channel from + :cite:`watrous_2018`). The Choi matrix of the completely dephasing channel that acts on :code:`dim`-by-:code:`dim` matrices. @@ -76,10 +77,6 @@ def dephasing(dim: int, param_p: float = 0) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WatDeph18] Watrous, John. - "The theory of quantum information." - Section: "The completely dephasing channel". - Cambridge University Press, 2018. :param dim: The dimensionality on which the channel acts. :param param_p: Default is 0. diff --git a/toqito/channels/depolarizing.py b/toqito/channels/depolarizing.py index 37eb3e46d..c143fb6aa 100644 --- a/toqito/channels/depolarizing.py +++ b/toqito/channels/depolarizing.py @@ -6,9 +6,10 @@ def depolarizing(dim: int, param_p: float = 0) -> np.ndarray: r""" - Produce the partially depolarizing channel [WikDepo]_, [WatDepo18]_. + Produce the partially depolarizing channel (Section: Replacement Channels and the Completely + Depolarizing Channel from :cite:`watrous_2018`). - The Choi matrix of the completely depolarizing channel that acts on + The Choi matrix of the completely depolarizing channel :cite:`WikiDepo` that acts on :code:`dim`-by-:code:`dim` matrices. The *completely depolarizing channel* is defined as @@ -80,14 +81,8 @@ def depolarizing(dim: int, param_p: float = 0) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikDepo] Wikipedia: Quantum depolarizing channel - https://en.wikipedia.org/wiki/Quantum_depolarizing_channel - - .. [WatDepo18] Watrous, John. - "The theory of quantum information." - Section: "Replacement channels and the completely depolarizing channel". - Cambridge University Press, 2018. + :param dim: The dimensionality on which the channel acts. :param param_p: Default 0. :return: The Choi matrix of the completely depolarizing channel. diff --git a/toqito/channels/partial_trace.py b/toqito/channels/partial_trace.py index 2030758f1..f7b5863fa 100644 --- a/toqito/channels/partial_trace.py +++ b/toqito/channels/partial_trace.py @@ -16,7 +16,7 @@ def partial_trace( dim: int | list[int] = None, ) -> np.ndarray | Expression: r""" - Compute the partial trace of a matrix [WikPtrace]_. + Compute the partial trace of a matrix :cite:`WikiPartialTr`. The *partial trace* is defined as @@ -123,8 +123,6 @@ def partial_trace( .. bibliography:: :filter: docname in docnames - .. [WikPtrace] Wikipedia: Partial trace - https://en.wikipedia.org/wiki/Partial_trace :raises ValueError: If matrix dimension is not equal to the number of subsystems. :param input_mat: A square matrix. diff --git a/toqito/channels/partial_transpose.py b/toqito/channels/partial_transpose.py index 738f3cfe6..d4b4791fc 100644 --- a/toqito/channels/partial_transpose.py +++ b/toqito/channels/partial_transpose.py @@ -15,7 +15,7 @@ def partial_transpose( sys: list[int] | np.ndarray | int = None, dim: list[int] | np.ndarray = None, ) -> np.ndarray | Expression: - r"""Compute the partial transpose of a matrix [WikPtrans]_. + r"""Compute the partial transpose of a matrix :cite:`WikiPeresHorodecki`. The *partial transpose* is defined as @@ -107,8 +107,7 @@ def partial_transpose( .. bibliography:: :filter: docname in docnames - .. [WikPtrans] Wikipedia: Partial transpose - https://en.wikipedia.org/w/index.php?title=Partial_transpose + :param rho: A matrix. :param sys: Scalar or vector specifying the size of the subsystems. :param dim: Dimension of the subsystems. If :code:`None`, all dimensions diff --git a/toqito/channels/realignment.py b/toqito/channels/realignment.py index cec914bfd..7460a5d42 100644 --- a/toqito/channels/realignment.py +++ b/toqito/channels/realignment.py @@ -9,7 +9,7 @@ def realignment(input_mat: np.ndarray, dim: int | list[int] = None) -> np.ndarray: r""" - Compute the realignment of a bipartite operator [LAS08]_. + Compute the realignment of a bipartite operator :cite:`Lupo_2008`. Gives the realignment of the matrix :code:`input_mat`, where it is assumed that the number of rows and columns of :code:`input_mat` are both perfect squares and both subsystems have @@ -46,11 +46,6 @@ def realignment(input_mat: np.ndarray, dim: int | list[int] = None) -> np.ndarra .. bibliography:: :filter: docname in docnames - .. [LAS08] Lupo, Cosmo, Paolo, Aniello, and Scardicchio, Antonello. - "Bipartite quantum systems: on the realignment criterion and beyond." - Journal of Physics A: Mathematical and Theoretical - 41.41 (2008): 415301. - https://arxiv.org/abs/0802.2019 :param input_mat: The input matrix. :param dim: Default has all equal dimensions. diff --git a/toqito/channels/reduction.py b/toqito/channels/reduction.py index 5cc49dca4..e560016f3 100644 --- a/toqito/channels/reduction.py +++ b/toqito/channels/reduction.py @@ -8,7 +8,7 @@ def reduction(dim: int, k: int = 1) -> np.ndarray: r""" - Produce the reduction map or reduction channel. + Produce the reduction map or reduction channel :cite:`WikiReductionCrit`. If :code:`k = 1`, this returns the Choi matrix of the reduction map which is a positive map on :code:`dim`-by-:code:`dim` matrices. For a different value of :code:`k`, this yields the From 45e91b3aea869f8ff1de3c3cca9f4b0612b38d9d Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 12:57:13 -0600 Subject: [PATCH 11/40] refs: helper --- docs/articles.bib | 35 +++++++++++++++++++++++++++++++ toqito/helper/channel_dim.py | 2 +- toqito/helper/cvx_kron.py | 3 +-- toqito/helper/expr_as_np_array.py | 5 +---- toqito/helper/np_array_as_expr.py | 6 +----- toqito/helper/npa_hierarchy.py | 2 +- toqito/helper/update_odometer.py | 4 +--- 7 files changed, 41 insertions(+), 16 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 008851200..0bfc58abb 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -22,6 +22,13 @@ @article{Choi_1992 abstract = {We consider a class of positive linear maps in the three-dimensional matrix algebra, which are generalizations of the positive linear map constructed by Choi in the relation with positive semidefinite biquadratic forms. We find conditions for which such maps are completely positive, completely copositive, decomposable, and two-positive.} } + +@misc{cvxpy_kron, + author = {Murray, Riley J}, + title = {{PR:} Have kron support non-constant expressions in either argument from {CXPY:} A Python-embedded modeling language for convex optimization problems}, + howpublished = "\url{https://github.com/cvxpy/cvxpy/issues/457#issue-309891424}"} + + #Last name begins with D #Last name begins with E @@ -69,7 +76,22 @@ @misc{QETLAB_Kraus_Operators } +@misc{QETLAB_Superoperator_Dim, + author = {Johnston, Nathaniel}, + title = {Superoperator dims from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/superoperator_dims.m}", + DOI ={10.5281/zenodo.44637} + +} + +@misc{QETLAB_Update_Odomoter, + author = {Johnston, Nathaniel}, + title = {Update Odometer from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/update_odometer.m}", + DOI ={10.5281/zenodo.44637} + +} #Last name begins with K @article{Katariya_2021, title={Geometric distinguishability measures limit quantum channel estimation and discrimination}, @@ -102,6 +124,19 @@ @article{Lupo_2008 #Last name begins with M #Last name begins with N +@article{Navascu_s_2008, + title={A convergent hierarchy of semidefinite programs characterizing the set of quantum correlations}, + volume={10}, + ISSN={1367-2630}, + url={http://dx.doi.org/10.1088/1367-2630/10/7/073013}, + DOI={10.1088/1367-2630/10/7/073013}, + number={7}, + journal={New Journal of Physics}, + publisher={IOP Publishing}, + author={Navascués, Miguel and Pironio, Stefano and Acín, Antonio}, + year={2008}, + month=jul, pages={073013} } + #Last name begins with O diff --git a/toqito/helper/channel_dim.py b/toqito/helper/channel_dim.py index 285bf7284..7439efb90 100644 --- a/toqito/helper/channel_dim.py +++ b/toqito/helper/channel_dim.py @@ -31,7 +31,7 @@ def channel_dim( instead of vectors. If COMPUTE_ENV_DIM is false and the PHI is a Choi matrix we avoid computing the rank of the Choi matrix. - This functions was adapted from QETLAB. + This functions was adapted from QETLAB :cite:`QETLAB_Superoperator_Dim`. References ========== diff --git a/toqito/helper/cvx_kron.py b/toqito/helper/cvx_kron.py index 94684b44d..f621fe452 100644 --- a/toqito/helper/cvx_kron.py +++ b/toqito/helper/cvx_kron.py @@ -16,8 +16,7 @@ def cvx_kron(expr_1: np.ndarray | Expression, expr_2: np.ndarray | Expression) - At most one of :code:`expr_1` and :code:`b` may be CVXPY Variable objects. - Kudos to Riley J. Murray for this function: - https://github.com/cvxgrp/cvxpy/issues/457 + Kudos to Riley J. Murray for this function :cite:`cvxpy_kron` References ========== diff --git a/toqito/helper/expr_as_np_array.py b/toqito/helper/expr_as_np_array.py index a9419014f..49d39f8a4 100644 --- a/toqito/helper/expr_as_np_array.py +++ b/toqito/helper/expr_as_np_array.py @@ -8,10 +8,7 @@ def expr_as_np_array(cvx_expr: Expression) -> np.ndarray: """ Convert cvxpy expression into a numpy array. - References - ========== - .. bibliography:: - :filter: docname in docnames + :param cvx_expr: The cvxpy expression to be converted. :return: The numpy array of the cvxpy expression. diff --git a/toqito/helper/np_array_as_expr.py b/toqito/helper/np_array_as_expr.py index 72f925415..530865f7a 100644 --- a/toqito/helper/np_array_as_expr.py +++ b/toqito/helper/np_array_as_expr.py @@ -9,11 +9,7 @@ def np_array_as_expr(np_arr: [np.ndarray]) -> Expression: """ Convert numpy array into a cvxpy expression. - References - ========== - .. bibliography:: - :filter: docname in docnames - + :param np_arr: The numpy array to be converted. :return: The cvxpy expression of the numpy array. """ diff --git a/toqito/helper/npa_hierarchy.py b/toqito/helper/npa_hierarchy.py index 5d596b714..6ce5d4309 100644 --- a/toqito/helper/npa_hierarchy.py +++ b/toqito/helper/npa_hierarchy.py @@ -128,7 +128,7 @@ def npa_constraints( # pylint: disable=too-many-locals assemblage: dict[tuple[int, int], cvxpy.Variable], k: int | str = 1, referee_dim: int = 1 ) -> list[cvxpy.constraints.constraint.Constraint]: r""" - Generate the constraints specified by the NPA hierarchy up to a finite level. + Generate the constraints specified by the NPA hierarchy up to a finite level :cite:`Navascu_s_2008`. You can determine the level of the hierarchy by a positive integer or a string of a form like "1+ab+aab", which indicates that an intermediate level of the hierarchy diff --git a/toqito/helper/update_odometer.py b/toqito/helper/update_odometer.py index 0d4cdf429..5aec8a556 100644 --- a/toqito/helper/update_odometer.py +++ b/toqito/helper/update_odometer.py @@ -23,7 +23,7 @@ def update_odometer( from 1 to 3, you could loop over a single variable going from 1 to 3^2 and set [i, j] = update_odometer([i, j], [3, 3]) at each step within the loop. - This function is adapted from QETLAB [QETOD]_. + This function is adapted from QETLAB :cite:`QETLAB_Update_Odomoter`. Examples ========== @@ -47,8 +47,6 @@ def update_odometer( .. bibliography:: :filter: docname in docnames - .. [QETOD] QETLAB: Update odometer function. - http://www.qetlab.com/update_odometer :param old_ind: The initial vector. :param upper_lim: The upper limit on which to increase the odometer to. From e232abce04ffeb7f881f5e8771ba37f80fd1a03f Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 13:18:41 -0600 Subject: [PATCH 12/40] refs: matrices --- docs/articles.bib | 87 +++++++++++++++++++++++++++++++ toqito/matrices/clock.py | 6 +-- toqito/matrices/cnot.py | 4 +- toqito/matrices/fourier.py | 6 +-- toqito/matrices/gell_mann.py | 5 +- toqito/matrices/gen_gell_mann.py | 4 +- toqito/matrices/gen_pauli.py | 9 +--- toqito/matrices/hadamard.py | 5 +- toqito/matrices/pauli.py | 5 +- toqito/matrices/shift.py | 6 +-- toqito/matrices/standard_basis.py | 3 +- 11 files changed, 103 insertions(+), 37 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 0bfc58abb..8ede1d920 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -168,6 +168,32 @@ @misc{Philip2023schrodinger #Last name begins with R #Last name begins with S +@misc{seshadri2021git, + author = "Wikipedia", + title = "Akshay Seshadri", + howpublished = "\url{https://github.com/akshayseshadri/minimax-fidelity-estimation}" + +} + +@misc{seshadri2021theory, + title={Theory of versatile fidelity estimation with confidence}, + author={Akshay Seshadri and Martin Ringbauer and Thomas Monz and Stephen Becker}, + year={2021}, + eprint={2112.07947}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + + +@misc{seshadri2021versatile, + title={Versatile fidelity estimation with confidence}, + author={Akshay Seshadri and Martin Ringbauer and Rainer Blatt and Thomas Monz and Stephen Becker}, + year={2021}, + eprint={2112.07925}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + #Last name begins with T @@ -185,6 +211,15 @@ @misc{Watrous_2009_semidefinite primaryClass={quant-ph} } + +@misc{Watrous_2011_lecture_notes, + title={Theory of Quantum Information Lecture Notes}, + author={John Watrous}, + year={2011}, + howpublished = "\url{https://cs.uwaterloo.ca/~watrous/TQI-notes/}" +} + + @misc{watrous2012simpler, title={Simpler semidefinite programs for completely bounded norms}, author={John Watrous}, @@ -201,6 +236,22 @@ @misc{WikiBures } + + +@misc{WikiClock, + author = "Wikipedia", + title = "Generalizations of Pauli matrices", + howpublished = "\url{https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices}" + +} + +@misc{WikiCNOT, + author = "Wikipedia", + title = "Controlled NOT gate", + howpublished = "\url{https://en.wikipedia.org/wiki/Controlled_NOT_gate}" + +} + @misc{WikiDepo, author = "Wikipedia", title = "Quantum Depolarizing Channel", @@ -208,6 +259,42 @@ @misc{WikiDepo } +@misc{WikiDFT, + author = "Wikipedia", + title = "{DFT} matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/DFT_matrix}" + +} + +@misc{WikiGellMann, + author = "Wikipedia", + title = "Gell-{M}ann matrices", + howpublished = "\url{https://en.wikipedia.org/wiki/Gell-Mann_matrices}" + +} + +@misc{WikiHadamard, + author = "Wikipedia", + title = "Hadamard transform", + howpublished = "\url{https://en.wikipedia.org/wiki/Hadamard_transform}" + +} + + +@misc{WikiPauli, + author = "Wikipedia", + title = "Pauli matrices", + howpublished = "\url{https://en.wikipedia.org/wiki/Pauli_matrices}" + +} + +@misc{WikiPauliGen, + author = "Wikipedia", + title = "Generalizations of {P}auli matrices", + howpublished = "\url{https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices}" + +} + @misc{WikiPartialTr, author = "Wikipedia", title = "Partial Trace", diff --git a/toqito/matrices/clock.py b/toqito/matrices/clock.py index 058525bb1..b363120fa 100644 --- a/toqito/matrices/clock.py +++ b/toqito/matrices/clock.py @@ -6,9 +6,9 @@ def clock(dim: int) -> np.ndarray: r""" - Produce clock matrix [WikClock]_. + Produce clock matrix :cite:`WikiClock`. - Returns the clock matrix of dimension :code:`dim` described in [WikClock]_. + Returns the clock matrix of dimension :code:`dim` described in :cite:`WikiClock`. The clock matrix generates the following :code:`dim`-by-:code:`dim` matrix .. math:: @@ -48,8 +48,6 @@ def clock(dim: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikClock] Wikipedia: Generalizations of Pauli matrices, - https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices :param dim: Dimension of the matrix. :return: :code:`dim`-by-:code:`dim` clock matrix. diff --git a/toqito/matrices/cnot.py b/toqito/matrices/cnot.py index 2509b2a28..8f5f69152 100644 --- a/toqito/matrices/cnot.py +++ b/toqito/matrices/cnot.py @@ -4,7 +4,7 @@ def cnot() -> np.ndarray: r""" - Produce the CNOT matrix [WikCNOT]_. + Produce the CNOT matrix :cite:`WikiCNOT`. The CNOT matrix is defined as @@ -32,8 +32,6 @@ def cnot() -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikCNOT] Wikipedia: Controlled NOT gate - https://en.wikipedia.org/wiki/Controlled_NOT_gate :return: The CNOT matrix. """ diff --git a/toqito/matrices/fourier.py b/toqito/matrices/fourier.py index 0a8746b91..730dd50b1 100644 --- a/toqito/matrices/fourier.py +++ b/toqito/matrices/fourier.py @@ -4,7 +4,7 @@ def fourier(dim: int) -> np.ndarray: r""" - Generate the Fourier transform matrix [WikDFT]_. + Generate the Fourier transform matrix :cite:`WikiDFT`. Generates the :code:`dim`-by-:code:`dim` unitary matrix that implements the quantum Fourier transform. @@ -48,9 +48,7 @@ def fourier(dim: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikDFT] Wikipedia: DFT matrix, - https://en.wikipedia.org/wiki/DFT_matrix - + :param dim: The size of the Fourier matrix. :return: The Fourier matrix of dimension :code:`dim`. """ diff --git a/toqito/matrices/gell_mann.py b/toqito/matrices/gell_mann.py index a44806b5d..1093e7b04 100644 --- a/toqito/matrices/gell_mann.py +++ b/toqito/matrices/gell_mann.py @@ -7,7 +7,7 @@ def gell_mann(ind: int, is_sparse: bool = False) -> np.ndarray | scipy.sparse.csr_matrix: r""" - Produce a Gell-Mann operator [WikGM]_. + Produce a Gell-Mann operator :cite:`WikiGellMann`. Generates the 3-by-3 Gell-Mann matrix indicated by the value of :code:`ind`. When :code:`ind = 0` gives the identity matrix, while values @@ -91,8 +91,7 @@ def gell_mann(ind: int, is_sparse: bool = False) -> np.ndarray | scipy.sparse.cs .. bibliography:: :filter: docname in docnames - .. [WikGM] Wikipedia: Gell-Mann matrices, - https://en.wikipedia.org/wiki/Gell-Mann_matrices + :raises ValueError: Indices must be integers between 0 and 8. :param ind: An integer between 0 and 8 (inclusive). diff --git a/toqito/matrices/gen_gell_mann.py b/toqito/matrices/gen_gell_mann.py index 679aac531..57cd4a6cd 100644 --- a/toqito/matrices/gen_gell_mann.py +++ b/toqito/matrices/gen_gell_mann.py @@ -10,7 +10,7 @@ def gen_gell_mann( ind_1: int, ind_2: int, dim: int, is_sparse: bool = False ) -> np.ndarray | sparse.lil_matrix: r""" - Produce a generalized Gell-Mann operator [WikGM2]_. + Produce a generalized Gell-Mann operator :cite:`WikiGellMann`. Construct a :code:`dim`-by-:code:`dim` Hermitian operator. These matrices span the entire space of :code:`dim`-by-:code:`dim` matrices as @@ -62,8 +62,6 @@ def gen_gell_mann( .. bibliography:: :filter: docname in docnames - .. [WikGM2] Wikipedia: Gell-Mann matrices, - https://en.wikipedia.org/wiki/Gell-Mann_matrices :param ind_1: A non-negative integer from 0 to :code:`dim-1` (inclusive). :param ind_2: A non-negative integer from 0 to :code:`dim-1` (inclusive). diff --git a/toqito/matrices/gen_pauli.py b/toqito/matrices/gen_pauli.py index 1e80026c5..78a8a7e70 100644 --- a/toqito/matrices/gen_pauli.py +++ b/toqito/matrices/gen_pauli.py @@ -6,7 +6,7 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: r""" - Produce generalized Pauli operator [WikGenPaul]_. + Produce generalized Pauli operator :cite:`WikiPauliGen`. Generates a :code:`dim`-by-:code:`dim` unitary operator. More specifically, it is the operator :math:`X^k_1 Z^k_2`, where :math:`X` and :math:`Z` are @@ -16,7 +16,7 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: from 0 to :code:`dim-1`, inclusive. Note that the generalized Pauli operators are also known by the name of - "discrete Weyl operators". [WatrousLec6]_ + "discrete Weyl operators". (Lecture 6: Further remarks on measurements and channels from :cite:`Watrous_2011_lecture_notes`) Examples ========== @@ -64,11 +64,6 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikGenPaul] Wikipedia: Generalizations of Pauli matrices - https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices - - .. [WatrousLec6] Lecture 6: Further remarks on measurements and channels - https://cs.uwaterloo.ca/~watrous/LectureNotes/CS766.Fall2011/06.pdf :param k_1: (a non-negative integer from 0 to :code:`dim-1` inclusive). :param k_2: (a non-negative integer from 0 to :code:`dim-1` inclusive). diff --git a/toqito/matrices/hadamard.py b/toqito/matrices/hadamard.py index e48dfa731..603b698ba 100644 --- a/toqito/matrices/hadamard.py +++ b/toqito/matrices/hadamard.py @@ -4,7 +4,7 @@ def hadamard(n_param: int = 1) -> np.ndarray: r""" - Produce a :code:`2^{n_param}` dimensional Hadamard matrix [WikHad]_. + Produce a :code:`2^{n_param}` dimensional Hadamard matrix :cite:`WikiHadamard`. The standard Hadamard matrix that is often used in quantum information as a two-qubit quantum gate is defined as @@ -37,8 +37,7 @@ def hadamard(n_param: int = 1) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikHad] Wikipedia: Hadamard transform - https://en.wikipedia.org/wiki/Hadamard_transform + :param n_param: A non-negative integer (default = 1). :return: The Hadamard matrix of dimension :code:`2^{n_param}`. diff --git a/toqito/matrices/pauli.py b/toqito/matrices/pauli.py index 845f3b5e9..cbffd3edb 100644 --- a/toqito/matrices/pauli.py +++ b/toqito/matrices/pauli.py @@ -12,7 +12,7 @@ def pauli( ind: int | str | list[int] | list[str], is_sparse: bool = False ) -> np.ndarray | sparse.csr_matrix: r""" - Produce a Pauli operator [WikPauli]_. + Produce a Pauli operator :cite:`WikiPauli`. Provides the 2-by-2 Pauli matrix indicated by the value of :code:`ind`. The variable :code:`ind = 1` gives the Pauli-X operator, :code:`ind = 2` gives @@ -82,9 +82,6 @@ def pauli( .. bibliography:: :filter: docname in docnames - .. [WikPauli] Wikipedia: Pauli matrices - https://en.wikipedia.org/wiki/Pauli_matrices - :param ind: The index to indicate which Pauli operator to generate. :param is_sparse: Returns a sparse matrix if set to True and a non-sparse matrix if set to False. diff --git a/toqito/matrices/shift.py b/toqito/matrices/shift.py index 6a83721d4..72deb84c7 100644 --- a/toqito/matrices/shift.py +++ b/toqito/matrices/shift.py @@ -4,9 +4,9 @@ def shift(dim: int) -> np.ndarray: r""" - Produce a :code:`dim`-by-:code:`dim` shift matrix [WikShift]_. + Produce a :code:`dim`-by-:code:`dim` shift matrix :cite:`WikiPauliGen`. - Returns the shift matrix of dimension :code:`dim` described in [WikShift]_. + Returns the shift matrix of dimension :code:`dim` described in :cite:`WikiPauliGen`. The shift matrix generates the following :code:`dim`-by-:code:`dim` matrix: .. math:: @@ -46,8 +46,6 @@ def shift(dim: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikShift] Wikipedia: Generalizations of Pauli matrices - (https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices. :param dim: Dimension of the matrix. :return: :code:`dim`-by-:code:`dim` shift matrix. diff --git a/toqito/matrices/standard_basis.py b/toqito/matrices/standard_basis.py index 6c505e984..c7f679133 100644 --- a/toqito/matrices/standard_basis.py +++ b/toqito/matrices/standard_basis.py @@ -17,8 +17,7 @@ def standard_basis(dim: int, flatten: bool = False) -> list[np.ndarray]: . |n> = (0, 0, 0, ..., 1)^T - This function was inspired by: - https://github.com/akshayseshadri/minimax-fidelity-estimation + This function was inspired by :cite:`seshadri2021git, seshadri2021theory, seshadri2021versatile` References ========== From 7533dfa927b17f750f9c7b47803b6e8b90a1f9f8 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 13:32:15 -0600 Subject: [PATCH 13/40] refs: matrix_ops --- docs/articles.bib | 26 +++++++++++++++++++ toqito/matrix_ops/inner_product.py | 6 ++--- toqito/matrix_ops/outer_product.py | 4 +-- toqito/matrix_ops/tensor.py | 4 +-- toqito/matrix_ops/unvec.py | 4 +-- toqito/matrix_ops/vec.py | 6 +---- toqito/matrix_ops/vectors_from_gram_matrix.py | 4 --- toqito/matrix_ops/vectors_to_gram_matrix.py | 6 ++--- 8 files changed, 34 insertions(+), 26 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 8ede1d920..758795a10 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -166,6 +166,12 @@ @misc{Philip2023schrodinger #Last name begins with Q #Last name begins with R +@misc{Rigetti_docs, + author = "Rigetti", + title = "Forest Benchmarking", + howpublished = "\url{https://github.com/rigetti/forest-benchmarking}" + +} #Last name begins with S @misc{seshadri2021git, @@ -280,6 +286,19 @@ @misc{WikiHadamard } +@misc{WikiInnerProd, + author = "Wikipedia", + title = "Inner product space", + howpublished = "\url{https://en.wikipedia.org/wiki/Inner_product_space}" + +} + +@misc{WikiOuterProd, + author = "Wikipedia", + title = "Outer product", + howpublished = "\url{https://en.wikipedia.org/wiki/Outer_product}" + +} @misc{WikiPauli, author = "Wikipedia", @@ -317,6 +336,13 @@ @misc{WikiReductionCrit } +@misc{WikiTensorProd, + author = "Wikipedia", + title = "Tensor product", + howpublished = "\url{https://en.wikipedia.org/wiki/Tensor_product}" + +} + #Last name begins with X #Last name begins with Y diff --git a/toqito/matrix_ops/inner_product.py b/toqito/matrix_ops/inner_product.py index f5d99f4c4..11ea09312 100644 --- a/toqito/matrix_ops/inner_product.py +++ b/toqito/matrix_ops/inner_product.py @@ -4,7 +4,7 @@ def inner_product(v1: np.ndarray, v2: np.ndarray) -> float: r""" - Compute the inner product :math:`\langle v_1|v_2\rangle` of two vectors [WikInner]_. + Compute the inner product :math:`\langle v_1|v_2\rangle` of two vectors :cite:`WikiInnerProd`. The inner product is calculated as follows: @@ -32,9 +32,7 @@ def inner_product(v1: np.ndarray, v2: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikInner] Wikipedia: Inner product space - https://en.wikipedia.org/wiki/Inner_product_space - + :raises ValueError: Vector dimensions are mismatched. :param v1: v1 and v2, both vectors of dimenstions :math:`(n,1)` where :math:`n>1`. :param v2: v1 and v2, both vectors of dimenstions :math:`(n,1)` where :math:`n>1`. diff --git a/toqito/matrix_ops/outer_product.py b/toqito/matrix_ops/outer_product.py index ab6e90d15..3a01e6fda 100644 --- a/toqito/matrix_ops/outer_product.py +++ b/toqito/matrix_ops/outer_product.py @@ -6,7 +6,7 @@ def outer_product(v1: np.ndarray, v2: np.ndarray) -> np.ndarray: r""" Compute the outer product :math:`|v_1\rangle\langle v_2|` of two vectors. - The outer product is calculated as follows [WikOuter]_: + The outer product is calculated as follows :cite:`WikiOuterProd` : .. math:: \left|\begin{pmatrix}a_1\\\vdots\\a_n\end{pmatrix}\right\rangle\left\langle\begin{pmatrix}b_1\\\vdots\\b_n\end{pmatrix}\right|=\begin{pmatrix}a_1\\\vdots\\a_n\end{pmatrix}\begin{pmatrix}b_1&\cdots&b_n\end{pmatrix}=\begin{pmatrix}a_1b_1&\cdots&a_1b_n\\\vdots&\ddots&\vdots\\a_1b_n&\cdots&a_nb_n\end{pmatrix} @@ -34,8 +34,6 @@ def outer_product(v1: np.ndarray, v2: np.ndarray) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikOuter] Wikipedia: Outer Product - https://en.wikipedia.org/wiki/Outer_product :raises ValueError: Vector dimensions are mismatched. :param v1: v1 and v2, both vectors of dimenstions :math:`(n,1)` where :math:`n>1`. diff --git a/toqito/matrix_ops/tensor.py b/toqito/matrix_ops/tensor.py index 3214a7770..6da826f16 100644 --- a/toqito/matrix_ops/tensor.py +++ b/toqito/matrix_ops/tensor.py @@ -4,7 +4,7 @@ def tensor(*args) -> np.ndarray: r""" - Compute the Kronecker tensor product [WikTensor]_. + Compute the Kronecker tensor product :cite:`WikiTensorProd`. Tensor two matrices or vectors together using the standard Kronecker operation provided from numpy. @@ -109,8 +109,6 @@ def tensor(*args) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikTensor] Wikipedia: Tensor product - https://en.wikipedia.org/wiki/Tensor_product :raises ValueError: Input must be a vector or matrix. :param args: Input to the tensor function is expected to be either: diff --git a/toqito/matrix_ops/unvec.py b/toqito/matrix_ops/unvec.py index a0f25f4a4..bbb9c4dbb 100644 --- a/toqito/matrix_ops/unvec.py +++ b/toqito/matrix_ops/unvec.py @@ -4,7 +4,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: r""" - Perform the unvec operation on a vector to obtain a matrix [Rigetti2020]_. + Perform the unvec operation on a vector to obtain a matrix :cite:`Rigetti_docs`. Takes a column vector and transforms it into a :code:`shape[0]`-by-:code:`shape[1]` matrix. This operation is the inverse of :code:`vec` operation in :code:`toqito`. @@ -77,8 +77,6 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [Rigetti2020] Forest Benchmarking (Rigetti). - https://github.com/rigetti/forest-benchmarking :param vector: A (:code:`shape[0] * shape[1]`)-by-1 numpy array. :param shape: The shape of the output matrix; by default, the matrix is assumed to be square. diff --git a/toqito/matrix_ops/vec.py b/toqito/matrix_ops/vec.py index dead67ce3..6b055a276 100644 --- a/toqito/matrix_ops/vec.py +++ b/toqito/matrix_ops/vec.py @@ -4,7 +4,7 @@ def vec(mat: np.ndarray) -> np.ndarray: r""" - Perform the vec operation on a matrix [WATVEC]_. + Perform the vec operation on a matrix ( Section: The Operator-Vector Correspondence from :cite:`watrous_2018`). Stacks the rows of the matrix on top of each other to obtain the "vec" representation of the matrix. @@ -84,10 +84,6 @@ def vec(mat: np.ndarray) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WATVEC] Watrous, John. - "The theory of quantum information." - Section: "The operator-vector correspondence". - Cambridge University Press, 2018. :param mat: The input matrix. :return: The vec representation of the matrix. diff --git a/toqito/matrix_ops/vectors_from_gram_matrix.py b/toqito/matrix_ops/vectors_from_gram_matrix.py index 0170b8972..8ef96c233 100644 --- a/toqito/matrix_ops/vectors_from_gram_matrix.py +++ b/toqito/matrix_ops/vectors_from_gram_matrix.py @@ -5,10 +5,6 @@ def vectors_from_gram_matrix(gram: np.ndarray) -> list[np.ndarray]: """Obtain the corresponding ensemble of states from the Gram matrix. - References - ========== - .. bibliography:: - :filter: docname in docnames :param gram: Input Gram matrix. :return: list of ensemble states diff --git a/toqito/matrix_ops/vectors_to_gram_matrix.py b/toqito/matrix_ops/vectors_to_gram_matrix.py index c80462ded..35025238e 100644 --- a/toqito/matrix_ops/vectors_to_gram_matrix.py +++ b/toqito/matrix_ops/vectors_to_gram_matrix.py @@ -5,10 +5,8 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: """Given a list of vectors, return the Gram matrix. - References - ========== - .. bibliography:: - :filter: docname in docnames""" + :param vectors: Input list of vectors. + :return: Gram matrix""" n = len(vectors) gram = np.zeros((n, n), dtype=complex) for i in range(n): From e44dc176819014f76cdfa302cb4b3d59e476533a Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 14:09:45 -0600 Subject: [PATCH 14/40] refs: matrix_props --- docs/articles.bib | 152 +++++++++++++++++- toqito/matrix_props/is_block_positive.py | 6 +- toqito/matrix_props/is_circulant.py | 4 +- toqito/matrix_props/is_commuting.py | 10 +- toqito/matrix_props/is_density.py | 5 +- toqito/matrix_props/is_diagonal.py | 10 +- toqito/matrix_props/is_diagonally_dominant.py | 4 +- toqito/matrix_props/is_hermitian.py | 5 +- toqito/matrix_props/is_idempotent.py | 4 +- toqito/matrix_props/is_identity.py | 4 +- toqito/matrix_props/is_normal.py | 4 +- toqito/matrix_props/is_orthonormal.py | 5 +- toqito/matrix_props/is_permutation.py | 4 +- toqito/matrix_props/is_positive_definite.py | 6 +- .../matrix_props/is_positive_semidefinite.py | 4 +- toqito/matrix_props/is_projection.py | 4 +- toqito/matrix_props/is_square.py | 4 +- toqito/matrix_props/is_symmetric.py | 4 +- toqito/matrix_props/is_unitary.py | 4 +- toqito/matrix_props/kp_norm.py | 4 - toqito/matrix_props/majorizes.py | 4 +- toqito/matrix_props/sk_norm.py | 9 +- toqito/matrix_props/trace_norm.py | 4 +- 23 files changed, 178 insertions(+), 86 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 758795a10..93b32503e 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -52,6 +52,30 @@ @inproceedings{Hayden_2013 #Last name begins with I #Last name begins with J +@article{Johnston_2010, + title={A family of norms with applications in quantum information theory}, + volume={51}, + ISSN={1089-7658}, + url={http://dx.doi.org/10.1063/1.3459068}, + DOI={10.1063/1.3459068}, + number={8}, + journal={Journal of Mathematical Physics}, + publisher={AIP Publishing}, + author={Johnston, Nathaniel and Kribs, David W.}, + year={2010}, + month=aug } + + +@misc{johnston2012norms, + title={Norms and Cones in the Theory of Quantum Entanglement}, + author={Nathaniel Johnston}, + year={2012}, + eprint={1207.1479}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + + @misc{QETLAB_CB_norm, author = {Johnston, Nathaniel}, title = {{CB} norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, @@ -164,6 +188,12 @@ @misc{Philip2023schrodinger } #Last name begins with Q +@misc{QuantikiTrNorm, + author = "Quantiki", + title = "Trace norm", + howpublished = "\url{https://www.quantiki.org/wiki/trace-norm}" + +} #Last name begins with R @misc{Rigetti_docs, @@ -200,6 +230,12 @@ @misc{seshadri2021versatile primaryClass={quant-ph} } +@misc{SO_43884189, + author = "Stack Overflow Post", + title = "Check if a large matrix is diagonal matrix in python", + howpublished = "\url{https://stackoverflow.com/questions/43884189/}" + +} #Last name begins with T @@ -242,7 +278,12 @@ @misc{WikiBures } - +@misc{WikiCirc, + author = "Wikipedia", + title = "Circulant matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Circulant_matrix}" + +} @misc{WikiClock, author = "Wikipedia", @@ -251,6 +292,13 @@ @misc{WikiClock } +@misc{WikiComm, + author = "Wikipedia", + title = "Commuting matrices", + howpublished = "\url{https://en.wikipedia.org/wiki/Commuting_matrices}" + +} + @misc{WikiCNOT, author = "Wikipedia", title = "Controlled NOT gate", @@ -258,6 +306,15 @@ @misc{WikiCNOT } +@misc{WikiDen, + author = "Wikipedia", + title = "Density Matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Density_matrix}" + +} + + + @misc{WikiDepo, author = "Wikipedia", title = "Quantum Depolarizing Channel", @@ -272,6 +329,20 @@ @misc{WikiDFT } +@misc{WikiDiag, + author = "Wikipedia", + title = "Diagonal matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Diagonal_matrix}" + +} + +@misc{WikiDiagDom, + author = "Wikipedia", + title = "Diagonally dominant matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Diagonally_dominant_matrix}" + +} + @misc{WikiGellMann, author = "Wikipedia", title = "Gell-{M}ann matrices", @@ -286,6 +357,28 @@ @misc{WikiHadamard } +@misc{WikiHerm, + author = "Wikipedia", + title = "Hermitian matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Hermitian_matrix}" + +} + +@misc{WikiIdemPot, + author = "Wikipedia", + title = "Idempotent matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Idempotent_matrix}" + +} + +@misc{WikiIden, + author = "Wikipedia", + title = "Identity matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Identity_matrix}" + +} + + @misc{WikiInnerProd, author = "Wikipedia", title = "Inner product space", @@ -293,9 +386,23 @@ @misc{WikiInnerProd } -@misc{WikiOuterProd, +@misc{WikiMajorization, + author = "Wikipedia", + title = "Majorization", + howpublished = "\url{https://en.wikipedia.org/wiki/Majorization}" + +} + +@misc{WikiNorm, author = "Wikipedia", title = "Outer product", + howpublished = "\url{https://en.wikipedia.org/wiki/Normal_matrix}" + +} + +@misc{WikiOuterProd, + author = "Wikipedia", + title = "Normal matrix", howpublished = "\url{https://en.wikipedia.org/wiki/Outer_product}" } @@ -328,6 +435,26 @@ @misc{WikiPeresHorodecki } +@misc{WikiPerm, + author = "Wikipedia", + title = "Permutation matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Permutation_matrix}" + +} + +@misc{WikiPosDef, + author = "Wikipedia", + title = "Definite matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Definite_matrix}" + +} + +@misc{WikiProjMat, + author = "Wikipedia", + title = "Projection matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Projection_matrix}" + +} @misc{WikiReductionCrit, author = "Wikipedia", @@ -336,6 +463,20 @@ @misc{WikiReductionCrit } +@misc{WikiSqMat, + author = "Wikipedia", + title = "Square matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Square_matrix}" + +} + +@misc{WikiSymMat, + author = "Wikipedia", + title = "Symmetric matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Symmetric_matrix}" + +} + @misc{WikiTensorProd, author = "Wikipedia", title = "Tensor product", @@ -343,6 +484,13 @@ @misc{WikiTensorProd } +@misc{WikiUniMat, + author = "Wikipedia", + title = "Unitary matrix", + howpublished = "\url{https://en.wikipedia.org/wiki/Unitary_matrix}" + +} + #Last name begins with X #Last name begins with Y diff --git a/toqito/matrix_props/is_block_positive.py b/toqito/matrix_props/is_block_positive.py index 88893ee58..b14958d4c 100644 --- a/toqito/matrix_props/is_block_positive.py +++ b/toqito/matrix_props/is_block_positive.py @@ -16,7 +16,7 @@ def is_block_positive( rtol: float = 1e-5, ) -> bool: r""" - Check if matrix is block positive [1]_. + Check if matrix is block positive :cite:`johnston2012norms`. Examples ========== @@ -45,8 +45,6 @@ def is_block_positive( .. bibliography:: :filter: docname in docnames - .. [1] "N. Johnston. Norms and Cones in the Theory of Quantum Entanglement. PhD thesis" - arXiv:1207.1479 :raises ValueError: Unable to determine block positive property. :param mat: A bipartite Hermitian operator. @@ -88,7 +86,7 @@ def is_block_positive( # We compute the S(k)-norm of this operator since # X k-block positive iff: # c >= S(k)-norm of(c*I - X) - # See Corollary 4.2.9. of [1]. + # See Corollary 4.2.9. of `:cite:`johnston2012norms`. c_mat = op_norm * np.eye(dim_xy) - mat lower_bound, upper_bound = sk_operator_norm(c_mat, k, dim, op_norm, effort) diff --git a/toqito/matrix_props/is_circulant.py b/toqito/matrix_props/is_circulant.py index 164c9b23a..776bdedc5 100644 --- a/toqito/matrix_props/is_circulant.py +++ b/toqito/matrix_props/is_circulant.py @@ -4,7 +4,7 @@ def is_circulant(mat: np.ndarray) -> bool: r""" - Determine if matrix is circulant [WikCirc]_. + Determine if matrix is circulant :cite:`WikiCirc`. A circulant matrix is a square matrix in which all row vectors are composed of the same elements and each row vector is rotated one element to the right @@ -37,8 +37,6 @@ def is_circulant(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikCirc] Wikipedia: Circulant matrices - https://en.wikipedia.org/wiki/Circulant_matrix :param mat: Matrix to check the circulancy of. :return: Return `True` if :code:`mat` is circulant; `False` otherwise. diff --git a/toqito/matrix_props/is_commuting.py b/toqito/matrix_props/is_commuting.py index 860cac4e0..e136fa6e9 100644 --- a/toqito/matrix_props/is_commuting.py +++ b/toqito/matrix_props/is_commuting.py @@ -4,7 +4,7 @@ def is_commuting(mat_1: np.ndarray, mat_2: np.ndarray) -> bool: r""" - Determine if two linear operators commute with each other [WikCom]_. + Determine if two linear operators commute with each other :cite:`WikiComm`. For any pair of operators :math:`X, Y \in \text{L}(\mathcal{X})`, the Lie bracket :math:`\left[X, Y\right] \in \text{L}(\mathcal{X})` is defined @@ -14,7 +14,7 @@ def is_commuting(mat_1: np.ndarray, mat_2: np.ndarray) -> bool: \left[X, Y\right] = XY - YX. It holds that :math:`\left[X,Y\right]=0` if and only if :math:`X` and - :math:`Y` commute [WatCom18]_. + :math:`Y` commute (Section: Lie Brackets and Commutants from :cite:`watrous_2018`). Examples ========== @@ -69,13 +69,7 @@ def is_commuting(mat_1: np.ndarray, mat_2: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikCom] Wikipedia: Commuting matrices - https://en.wikipedia.org/wiki/Commuting_matrices - .. [WatCom18] Watrous, John. - "The theory of quantum information." - Section: "Lie brackets and commutants". - Cambridge University Press, 2018. :param mat_1: First matrix to check. :param mat_2: Second matrix to check. diff --git a/toqito/matrix_props/is_density.py b/toqito/matrix_props/is_density.py index 1e5fbcd50..74ff64f73 100644 --- a/toqito/matrix_props/is_density.py +++ b/toqito/matrix_props/is_density.py @@ -6,7 +6,7 @@ def is_density(mat: np.ndarray) -> bool: r""" - Check if matrix is a density matrix [WikDensity]_. + Check if matrix is a density matrix :cite:`WikiDen`. A matrix is a density matrix if its trace is equal to one and it has the property of being positive semidefinite (PSD). @@ -64,9 +64,6 @@ def is_density(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikDensity] Wikipedia: Density matrix - https://en.wikipedia.org/wiki/Density_matrix - :param mat: Matrix to check. :return: Return :code:`True` if matrix is a density matrix, and :code:`False` otherwise. diff --git a/toqito/matrix_props/is_diagonal.py b/toqito/matrix_props/is_diagonal.py index 44c14f2a2..2fa5a9555 100644 --- a/toqito/matrix_props/is_diagonal.py +++ b/toqito/matrix_props/is_diagonal.py @@ -6,7 +6,7 @@ def is_diagonal(mat: np.ndarray) -> bool: r""" - Determine if a matrix is diagonal [WikDiag]_. + Determine if a matrix is diagonal :cite:`WikiDiag`. A matrix is diagonal if the matrix is square and if the diagonal of the matrix is non-zero, while the off-diagonal elements are all zero. @@ -22,7 +22,7 @@ def is_diagonal(mat: np.ndarray) -> bool: \end{pmatrix} \end{equation} - This quick implementation is given by Daniel F. from StackOverflow in [SODIA]_. + This quick implementation is given by Daniel F. from StackOverflow in :cite:`SO_43884189`. Examples ========== @@ -64,11 +64,7 @@ def is_diagonal(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikDiag] Wikipedia: Diagonal matrix - https://en.wikipedia.org/wiki/Diagonal_matrix - - .. [SODIA] StackOverflow post - https://stackoverflow.com/questions/43884189/ + :param mat: The matrix to check. :return: Returns :code:`True` if the matrix is diagonal diff --git a/toqito/matrix_props/is_diagonally_dominant.py b/toqito/matrix_props/is_diagonally_dominant.py index b277112e4..50735a1ce 100644 --- a/toqito/matrix_props/is_diagonally_dominant.py +++ b/toqito/matrix_props/is_diagonally_dominant.py @@ -6,7 +6,7 @@ def is_diagonally_dominant(mat: np.ndarray, is_strict: bool = True) -> bool: r""" - Check if matrix is diagnal dominant (DD) [WikDD]_. + Check if matrix is diagnal dominant (DD) :cite:`WikiDiagDom`. A matrix is diagonally dominant if the matrix is square and if for every row of the matrix, the magnitude of the diagonal entry in a row is greater @@ -53,8 +53,6 @@ def is_diagonally_dominant(mat: np.ndarray, is_strict: bool = True) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikDD] Wikipedia: Diagonally dominant matrix. - https://en.wikipedia.org/wiki/Diagonally_dominant_matrix :param mat: Matrix to check. :param is_strict: Whether the inequality is strict. diff --git a/toqito/matrix_props/is_hermitian.py b/toqito/matrix_props/is_hermitian.py index 863c9285f..81aafd319 100644 --- a/toqito/matrix_props/is_hermitian.py +++ b/toqito/matrix_props/is_hermitian.py @@ -6,7 +6,7 @@ def is_hermitian(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r""" - Check if matrix is Hermitian [WikHerm]_. + Check if matrix is Hermitian :cite:`WikiHerm`. A Hermitian matrix is a complex square matrix that is equal to its own conjugate transpose. @@ -55,8 +55,7 @@ def is_hermitian(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> b .. bibliography:: :filter: docname in docnames - .. [WikHerm] Wikipedia: Hermitian matrix. - https://en.wikipedia.org/wiki/Hermitian_matrix + :param mat: Matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_idempotent.py b/toqito/matrix_props/is_idempotent.py index a53f48f1a..f5ece7c09 100644 --- a/toqito/matrix_props/is_idempotent.py +++ b/toqito/matrix_props/is_idempotent.py @@ -6,7 +6,7 @@ def is_idempotent(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-8) -> bool: r""" - Check if matrix is the idempotent matrix [WikIdempotent]_. + Check if matrix is the idempotent matrix :cite:`WikiIdemPot`. An *idempotent matrix* is a square matrix, which, when multiplied by itself, yields itself. That is, the matrix :math:`A` is idempotent if and only if :math:`A^2 = A`. @@ -49,8 +49,6 @@ def is_idempotent(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-8) -> b .. bibliography:: :filter: docname in docnames - .. [WikIdempotent] Wikipedia: Idempotent matrix - https://en.wikipedia.org/wiki/Idempotent_matrix :param mat: Matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_identity.py b/toqito/matrix_props/is_identity.py index cc44a7193..47389bbc5 100644 --- a/toqito/matrix_props/is_identity.py +++ b/toqito/matrix_props/is_identity.py @@ -6,7 +6,7 @@ def is_identity(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-8) -> bool: r""" - Check if matrix is the identity matrix [WikIdentity]_. + Check if matrix is the identity matrix :cite:`WikiIden`. For dimension :math:`n`, the :math:`n \times n` identity matrix is defined as @@ -63,8 +63,6 @@ def is_identity(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-8) -> boo .. bibliography:: :filter: docname in docnames - .. [WikIdentity] Wikipedia: Identity matrix - https://en.wikipedia.org/wiki/Identity_matrix :param mat: Matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_normal.py b/toqito/matrix_props/is_normal.py index ee046452b..d2b6eb167 100644 --- a/toqito/matrix_props/is_normal.py +++ b/toqito/matrix_props/is_normal.py @@ -6,7 +6,7 @@ def is_normal(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r""" - Determine if a matrix is normal [WikNormal]_. + Determine if a matrix is normal :cite:`WikiNorm`. A matrix is normal if it commutes with its adjoint @@ -65,8 +65,6 @@ def is_normal(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool .. bibliography:: :filter: docname in docnames - .. [WikNormal] Wikipedia: Normal matrix. - https://en.wikipedia.org/wiki/Normal_matrix :param mat: The matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_orthonormal.py b/toqito/matrix_props/is_orthonormal.py index 6af6e381d..a60850d39 100644 --- a/toqito/matrix_props/is_orthonormal.py +++ b/toqito/matrix_props/is_orthonormal.py @@ -7,10 +7,7 @@ def is_orthonormal(vectors: list[np.ndarray]) -> bool: """Check if the vectors are orthonormal. - References - ========== - .. bibliography:: - :filter: docname in docnames + :param vectors: A list of `np.ndarray` 1-by-n vectors. :return: True if vectors are orthonormal; False otherwise. diff --git a/toqito/matrix_props/is_permutation.py b/toqito/matrix_props/is_permutation.py index 18b9dfdaa..bc01d5bd7 100644 --- a/toqito/matrix_props/is_permutation.py +++ b/toqito/matrix_props/is_permutation.py @@ -4,7 +4,7 @@ def is_permutation(mat: np.ndarray) -> bool: r""" - Determine if a matrix is a permutation matrix [WikiPermutation]_. + Determine if a matrix is a permutation matrix :cite:`WikiPerm`. A matrix is a permutation matrix if each row and column has a single element of 1 and all others are 0. @@ -53,8 +53,6 @@ def is_permutation(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikiPermutation] Wikipedia: Permutation matrix. - https://en.wikipedia.org/wiki/Permutation_matrix :param mat: The matrix to check. :return: Returns :code:`True` if the matrix is a permutation matrix and :code:`False` otherwise. diff --git a/toqito/matrix_props/is_positive_definite.py b/toqito/matrix_props/is_positive_definite.py index 799aeb036..f1b1c8d64 100644 --- a/toqito/matrix_props/is_positive_definite.py +++ b/toqito/matrix_props/is_positive_definite.py @@ -6,7 +6,7 @@ def is_positive_definite(mat: np.ndarray) -> bool: r""" - Check if matrix is positive definite (PD) [WikPD]_. + Check if matrix is positive definite (PD) :cite:`WikiPosDef`. Examples ========== @@ -53,9 +53,7 @@ def is_positive_definite(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikPD] Wikipedia: Definiteness of a matrix. - https://en.wikipedia.org/wiki/Definiteness_of_a_matrix - + :param mat: Matrix to check. :return: Return :code:`True` if matrix is positive definite, and :code:`False` otherwise. """ diff --git a/toqito/matrix_props/is_positive_semidefinite.py b/toqito/matrix_props/is_positive_semidefinite.py index 5573a13db..785655a95 100644 --- a/toqito/matrix_props/is_positive_semidefinite.py +++ b/toqito/matrix_props/is_positive_semidefinite.py @@ -6,7 +6,7 @@ def is_positive_semidefinite(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r""" - Check if matrix is positive semidefinite (PSD) [WikPSD]_. + Check if matrix is positive semidefinite (PSD) :cite:`WikiPosDef`. Examples ========== @@ -48,8 +48,6 @@ def is_positive_semidefinite(mat: np.ndarray, rtol: float = 1e-05, atol: float = .. bibliography:: :filter: docname in docnames - .. [WikPSD] Wikipedia: Definiteness of a matrix. - https://en.wikipedia.org/wiki/Definiteness_of_a_matrix :param mat: Matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_projection.py b/toqito/matrix_props/is_projection.py index 6cf0e7a51..e0a91f70e 100644 --- a/toqito/matrix_props/is_projection.py +++ b/toqito/matrix_props/is_projection.py @@ -6,7 +6,7 @@ def is_projection(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r""" - Check if matrix is a projection matrix [WikProj]_. + Check if matrix is a projection matrix :cite:`WikiProjMat`. A matrix is a projection matrix if it is positive semidefinite (PSD) and if @@ -57,8 +57,6 @@ def is_projection(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> .. bibliography:: :filter: docname in docnames - .. [WikProj] Wikipedia: Projection matrix. - https://en.wikipedia.org/wiki/Projection_matrix :param mat: Matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_square.py b/toqito/matrix_props/is_square.py index 838bc4e3c..70a5f5796 100644 --- a/toqito/matrix_props/is_square.py +++ b/toqito/matrix_props/is_square.py @@ -4,7 +4,7 @@ def is_square(mat: np.ndarray) -> bool: r""" - Determine if a matrix is square [WikSquare]_. + Determine if a matrix is square :cite:`WikiSqMat`. A matrix is square if the dimensions of the rows and columns are equivalent. @@ -49,8 +49,6 @@ def is_square(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikSquare] Wikipedia: Square matrix. - https://en.wikipedia.org/wiki/Square_matrix :raises ValueError: If variable is not a matrix. :param mat: The matrix to check. diff --git a/toqito/matrix_props/is_symmetric.py b/toqito/matrix_props/is_symmetric.py index 16716ac68..e6ab27b1c 100644 --- a/toqito/matrix_props/is_symmetric.py +++ b/toqito/matrix_props/is_symmetric.py @@ -6,7 +6,7 @@ def is_symmetric(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r""" - Determine if a matrix is symmetric [WikSym]_. + Determine if a matrix is symmetric :cite:`WikiSymMat`. The following 3x3 matrix is an example of a symmetric matrix: @@ -59,8 +59,6 @@ def is_symmetric(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> b .. bibliography:: :filter: docname in docnames - .. [WikSym] Wikipedia: Symmetric matrix - https://en.wikipedia.org/wiki/Symmetric_matrix :param mat: The matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/is_unitary.py b/toqito/matrix_props/is_unitary.py index c1105fd58..262c8f3da 100644 --- a/toqito/matrix_props/is_unitary.py +++ b/toqito/matrix_props/is_unitary.py @@ -6,7 +6,7 @@ def is_unitary(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r""" - Check if matrix is unitary [WikUnitary]_. + Check if matrix is unitary :cite:`WikiUniMat`. A matrix is unitary if its inverse is equal to its conjugate transpose. @@ -69,8 +69,6 @@ def is_unitary(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> boo .. bibliography:: :filter: docname in docnames - .. [WikUnitary] Wikipedia: Unitary matrix. - https://en.wikipedia.org/wiki/Unitary_matrix :param mat: Matrix to check. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/matrix_props/kp_norm.py b/toqito/matrix_props/kp_norm.py index 8848d301a..101fb2f86 100644 --- a/toqito/matrix_props/kp_norm.py +++ b/toqito/matrix_props/kp_norm.py @@ -6,10 +6,6 @@ def kp_norm(mat: np.ndarray, k: int, p: int) -> float: """ Compute the p-norm of the vector or the k-largest singular values of a matrix. - References - ========== - .. bibliography:: - :filter: docname in docnames :param mat: 2D numpy ndarray :param k: The number of singular values to take. diff --git a/toqito/matrix_props/majorizes.py b/toqito/matrix_props/majorizes.py index 37840f15b..37ecd946a 100644 --- a/toqito/matrix_props/majorizes.py +++ b/toqito/matrix_props/majorizes.py @@ -6,7 +6,7 @@ def majorizes(a_var: np.ndarray | list[int], b_var: np.ndarray | list[int]) -> bool: r""" - Determine if one vector or matrix majorizes another. [WikMajorization]_. + Determine if one vector or matrix majorizes another :cite:`WikiMajorization`. Given :math:`a, b \in \mathbb{R}^d`, we say that :math:`a` **weakly majorizes** (or dominates) :math:`b` from below if and only if @@ -47,8 +47,6 @@ def majorizes(a_var: np.ndarray | list[int], b_var: np.ndarray | list[int]) -> b .. bibliography:: :filter: docname in docnames - .. [WikMajorization] Wikipedia: Majorization - https://en.wikipedia.org/wiki/Majorization :param a_var: Matrix or vector provided as list or np.array. :param b_var: Matrix or vector provided as list or np.array. diff --git a/toqito/matrix_props/sk_norm.py b/toqito/matrix_props/sk_norm.py index 6ae080b58..5c49d2108 100644 --- a/toqito/matrix_props/sk_norm.py +++ b/toqito/matrix_props/sk_norm.py @@ -24,7 +24,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals effort: int = 2, ) -> float: r""" - Compute the S(k)-norm of a matrix [1]_. + Compute the S(k)-norm of a matrix :cite:`Johnston_2010`. The :math:`S(k)`-norm of of a matrix :math:`X` is defined as: @@ -36,7 +36,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals \text{Schmidt - rank}(|w\rangle) \leq k \Big\} - Since computing the exact value of S(k)-norm [2]_ is in the general case + Since computing the exact value of S(k)-norm :cite:`johnston2012norms` is in the general case an intractable problem, this function tries to find some good lower and upper bounds. You can control the amount of computation you want to devote to computing the bounds by `effort` input argument. Note that if @@ -67,11 +67,6 @@ def sk_operator_norm( # pylint: disable=too-many-locals .. bibliography:: :filter: docname in docnames - .. [1] "A Family of Norms With Applications In Quantum Information Theory" - Nathaniel Johnston, David W. Kribs - arXiv:0909.3907 - .. [2] "N. Johnston. Norms and Cones in the Theory of Quantum Entanglement. PhD thesis" - arXiv:1207.1479 :raises ValueError: If dimension of the input matrix is not specified. :param mat: A matrix. diff --git a/toqito/matrix_props/trace_norm.py b/toqito/matrix_props/trace_norm.py index 48121b4b0..84c97cfac 100644 --- a/toqito/matrix_props/trace_norm.py +++ b/toqito/matrix_props/trace_norm.py @@ -4,7 +4,7 @@ def trace_norm(rho: np.ndarray) -> float: r""" - Compute the trace norm of the state [WikTn]_. + Compute the trace norm of the state :cite:`QuantikiTrNorm`. Also computes the operator 1-norm when inputting an operator. @@ -43,8 +43,6 @@ def trace_norm(rho: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikTn] Quantiki: Trace norm - https://www.quantiki.org/wiki/trace-norm :param rho: Density operator. :return: The trace norm of :code:`rho`. From af126185b6ceb11a44d89ada306e8fc351228606 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 14:11:28 -0600 Subject: [PATCH 15/40] refs: measurement_ops --- docs/articles.bib | 7 +++++++ toqito/measurement_ops/measure.py | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 93b32503e..9887ab08d 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -456,6 +456,13 @@ @misc{WikiProjMat } +@misc{WikiQuantMeas, + author = "Wikipedia", + title = "Measurement in quantum mechanics", + howpublished = "\url{https://en.wikipedia.org/wiki/Measurement_in_quantum_mechanics}" + +} + @misc{WikiReductionCrit, author = "Wikipedia", title = "Reduction Criterion", diff --git a/toqito/measurement_ops/measure.py b/toqito/measurement_ops/measure.py index 6d6bd0d25..f6430db7e 100644 --- a/toqito/measurement_ops/measure.py +++ b/toqito/measurement_ops/measure.py @@ -17,7 +17,7 @@ def measure(measurement: np.ndarray, state: np.ndarray) -> float: .. math:: \sum_{a \in \Sigma} \mu(a) = \mathbb{I}_{\mathcal{X}}. - Further information can be found here [WikMeas]_. + Further information can be found here :cite:`WikiQuantMeas`. Examples ========== @@ -66,8 +66,6 @@ def measure(measurement: np.ndarray, state: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikMeas] Wikipedia: Measurement in quantum mechanics - https://en.wikipedia.org/wiki/Measurement_in_quantum_mechanics :param measurement: The measurement to apply. :param state: The state to apply the measurement to. From bd92169ce63f28717494d5d6e17e4ac9a6dd7e20 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 14:13:01 -0600 Subject: [PATCH 16/40] refs: measurement_props --- docs/articles.bib | 7 +++++++ toqito/measurement_props/is_povm.py | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 9887ab08d..9d40b0981 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -449,6 +449,13 @@ @misc{WikiPosDef } +@misc{WikiPOVM, + author = "Wikipedia", + title = "{POVM}", + howpublished = "\url{https://en.wikipedia.org/wiki/POVM}" + +} + @misc{WikiProjMat, author = "Wikipedia", title = "Projection matrix", diff --git a/toqito/measurement_props/is_povm.py b/toqito/measurement_props/is_povm.py index 9780ec70f..474457487 100644 --- a/toqito/measurement_props/is_povm.py +++ b/toqito/measurement_props/is_povm.py @@ -6,7 +6,7 @@ def is_povm(mat_list: list[np.ndarray]) -> bool: r""" - Determine if a list of matrices constitute a valid set of POVMs [WikPOVM]_. + Determine if a list of matrices constitute a valid set of POVMs :cite:`WikiPOVM`. A valid set of measurements are defined by a set of positive semidefinite operators @@ -88,8 +88,6 @@ def is_povm(mat_list: list[np.ndarray]) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikPOVM] Wikipedia: POVM - https://en.wikipedia.org/wiki/POVM :param mat_list: A list of matrices. :return: Return :code:`True` if set of matrices constitutes a set of From 51ef71992954701171b3ebc7ad8ce8a61b626be3 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 16:41:11 -0600 Subject: [PATCH 17/40] refs: nonlocal_games --- docs/articles.bib | 76 ++++++++++++++++++- .../nonlocal_games/extended_nonlocal_game.py | 21 ++--- toqito/nonlocal_games/nonlocal_game.py | 25 +++--- toqito/nonlocal_games/quantum_hedging.py | 14 +--- toqito/nonlocal_games/xor_game.py | 19 ++--- 5 files changed, 96 insertions(+), 59 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 9d40b0981..6e5bf003d 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -1,7 +1,14 @@ #File for all article, arxiv and other web references #Last name begins with A - +@misc{arunachalam2017quantum, + title={Quantum hedging in two-round prover-verifier interactions}, + author={Srinivasan Arunachalam and Abel Molina and Vincent Russo}, + year={2017}, + eprint={1310.7954}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} @@ -22,6 +29,23 @@ @article{Choi_1992 abstract = {We consider a class of positive linear maps in the three-dimensional matrix algebra, which are generalizations of the positive linear map constructed by Choi in the relation with positive semidefinite biquadratic forms. We find conditions for which such maps are completely positive, completely copositive, decomposable, and two-positive.} } +@misc{cleve2008strong, + title={Strong Parallel Repetition Theorem for Quantum XOR Proof Systems}, + author={Richard Cleve and William Slofstra and Falk Unger and Sarvagya Upadhyay}, + year={2008}, + eprint={quant-ph/0608146}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + +@misc{cleve2010consequences, + title={Consequences and Limits of Nonlocal Strategies}, + author={Richard Cleve and Peter Hoyer and Ben Toner and John Watrous}, + year={2010}, + eprint={quant-ph/0404076}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} @misc{cvxpy_kron, author = {Murray, Riley J}, @@ -75,6 +99,19 @@ @misc{johnston2012norms primaryClass={quant-ph} } +@article{Johnston_2016, + title={Extended non-local games and monogamy-of-entanglement games}, + volume={472}, + ISSN={1471-2946}, + url={http://dx.doi.org/10.1098/rspa.2016.0003}, + DOI={10.1098/rspa.2016.0003}, + number={2189}, + journal={Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences}, + publisher={The Royal Society}, + author={Johnston, Nathaniel and Mittal, Rajat and Russo, Vincent and Watrous, John}, + year={2016}, + month=may, pages={20160003} } + @misc{QETLAB_CB_norm, author = {Johnston, Nathaniel}, @@ -131,6 +168,20 @@ @article{Katariya_2021 month=feb } #Last name begins with L +@article{Liang_2007, + title={Bounds on quantum correlations in Bell-inequality experiments}, + volume={75}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.75.042103}, + DOI={10.1103/physreva.75.042103}, + number={4}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Liang, Yeong-Cherng and Doherty, Andrew C.}, + year={2007}, + month=apr } + + @article{Lupo_2008, title={Bipartite quantum systems: on the realignment criterion and beyond}, volume={41}, @@ -146,6 +197,18 @@ @article{Lupo_2008 #Last name begins with M +@article{Molina_2012, + title={Hedging bets with correlated quantum strategies}, + volume={468}, + ISSN={1471-2946}, + url={http://dx.doi.org/10.1098/rspa.2011.0621}, + DOI={10.1098/rspa.2011.0621}, + number={2145}, + journal={Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences}, + publisher={The Royal Society}, + author={Molina, Abel and Watrous, John}, + year={2012}, + month=apr, pages={2614-2629} } #Last name begins with N @article{Navascu_s_2008, @@ -203,6 +266,15 @@ @misc{Rigetti_docs } +@misc{russo2017extended, + title={Extended Nonlocal Games}, + author={Vincent Russo}, + year={2017}, + eprint={1704.07375}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + #Last name begins with S @misc{seshadri2021git, author = "Wikipedia", @@ -237,6 +309,8 @@ @misc{SO_43884189 } + + #Last name begins with T #Last name begins with U diff --git a/toqito/nonlocal_games/extended_nonlocal_game.py b/toqito/nonlocal_games/extended_nonlocal_game.py index f429a663a..7976a4530 100644 --- a/toqito/nonlocal_games/extended_nonlocal_game.py +++ b/toqito/nonlocal_games/extended_nonlocal_game.py @@ -21,23 +21,14 @@ class ExtendedNonlocalGame: made by the referee, on its part of the shared quantum state, in addition to Alice and Bob's answers to the questions sent by the referee. - Extended nonlocal games were initially defined in [JMRW16]_ and more - information on these games can be found in [Russo17]_. + Extended nonlocal games were initially defined in :cite:`Johnston_2016` and more + information on these games can be found in :cite:`russo2017extended`. References ========== .. bibliography:: :filter: docname in docnames - .. [JMRW16] Nathaniel Johnston, Rajat Mittal, Vincent Russo, John Watrous - "Extended non-local games and monogamy-of-entanglement games", - Proceedings of the Royal Society A: Mathematical, Physical and - Engineering Sciences 472.2189 (2016), - https://arxiv.org/abs/1510.02083 - - .. [Russo17] Vincent Russo - "Extended nonlocal games" - https://arxiv.org/abs/1704.07375 """ def __init__(self, prob_mat: np.ndarray, pred_mat: np.ndarray, reps: int = 1) -> None: @@ -440,7 +431,7 @@ def commuting_measurement_value_upper_bound(self, k: int | str = 1) -> float: Compute an upper bound on the commuting measurement value of an extended nonlocal game. This function calculates an upper bound on the commuting measurement value by - using k-levels of the NPA hierarchy [NPA]_. The NPA hierarchy is a uniform family + using k-levels of the NPA hierarchy :cite:`Navascu_s_2008`. The NPA hierarchy is a uniform family of semidefinite programs that converges to the commuting measurement value of any extended nonlocal game. @@ -451,10 +442,8 @@ def commuting_measurement_value_upper_bound(self, k: int | str = 1) -> float: References ========== - .. [NPA] Miguel Navascues, Stefano Pironio, Antonio Acin, - "A convergent hierarchy of semidefinite programs characterizing the - set of quantum correlations." - https://arxiv.org/abs/0803.4290 + .. bibliography:: + :filter: docname in docnames :param k: The level of the NPA hierarchy to use (default=1). :return: The upper bound on the commuting strategy value of an extended nonlocal game. diff --git a/toqito/nonlocal_games/nonlocal_game.py b/toqito/nonlocal_games/nonlocal_game.py index 53842f179..5787e14c5 100644 --- a/toqito/nonlocal_games/nonlocal_game.py +++ b/toqito/nonlocal_games/nonlocal_game.py @@ -20,17 +20,13 @@ class NonlocalGame: are not allowed to communicate with each other once the game has started and who play cooperative against an adversary referred to as the referee. - The nonlocal game framework was originally introduced in [CHTW04_2]_. + The nonlocal game framework was originally introduced in :cite:`cleve2010consequences`. References ========== .. bibliography:: :filter: docname in docnames - .. [CHTW04_2] Cleve, Richard, Hoyer, Peter, Toner, Benjamin, and Watrous, John - "Consequences and limits of nonlocal strategies" - Computational Complexity 2004. Proceedings. 19th IEEE Annual Conference. - https://arxiv.org/abs/quant-ph/0404076 """ def __init__(self, prob_mat: np.ndarray, pred_mat: np.ndarray, reps: int = 1) -> None: @@ -199,7 +195,7 @@ def quantum_value_lower_bound( tol: float = 10e-6, ): r""" - Compute a lower bound on the quantum value of a nonlocal game [LD07]_. + Compute a lower bound on the quantum value of a nonlocal game :cite:`Liang_2007`. Calculates a lower bound on the maximum value that the specified nonlocal game can take on in quantum mechanical settings where Alice and @@ -217,7 +213,7 @@ def quantum_value_lower_bound( number of times and keep the highest value obtained. The algorithm is based on the alternating projections algorithm as it - can be applied to Bell inequalities as shown in [LD07]_. + can be applied to Bell inequalities as shown in :cite:`Liang_2007`. The alternating projection algorithm has also been referred to as the "see-saw" algorithm as it goes back and forth between the following two @@ -322,10 +318,9 @@ def quantum_value_lower_bound( References ========== - .. [LD07] Liang, Yeong-Cherng, and Andrew C. Doherty. - "Bounds on quantum correlations in Bell-inequality experiments." - Physical Review A 75.4 (2007): 042103. - https://arxiv.org/abs/quant-ph/0608128 + .. bibliography:: + :filter: docname in docnames + :param dim: The dimension of the quantum system that Alice and Bob have access to (default = 2). @@ -591,7 +586,7 @@ def commuting_measurement_value_upper_bound(self, k: int | str = 1) -> float: Compute an upper bound on the commuting measurement value of the nonlocal game. This function calculates an upper bound on the commuting measurement value by - using k-levels of the NPA hierarchy [NPA]_. The NPA hierarchy is a uniform family + using k-levels of the NPA hierarchy :cite:`Navascu_s_2008`. The NPA hierarchy is a uniform family of semidefinite programs that converges to the commuting measurement value of any nonlocal game. @@ -602,10 +597,8 @@ def commuting_measurement_value_upper_bound(self, k: int | str = 1) -> float: References ========== - .. [NPA] Miguel Navascues, Stefano Pironio, Antonio Acin, - "A convergent hierarchy of semidefinite programs characterizing the - set of quantum correlations." - https://arxiv.org/abs/0803.4290 + .. bibliography:: + :filter: docname in docnames :param k: The level of the NPA hierarchy to use (default=1). :return: The upper bound on the commuting strategy value of a nonlocal game. diff --git a/toqito/nonlocal_games/quantum_hedging.py b/toqito/nonlocal_games/quantum_hedging.py index ac3cf9326..ca9e59b87 100644 --- a/toqito/nonlocal_games/quantum_hedging.py +++ b/toqito/nonlocal_games/quantum_hedging.py @@ -11,7 +11,7 @@ class QuantumHedging: Calculate optimal winning probabilities for hedging scenarios. Calculate the maximal and minimal winning probabilities for quantum - hedging to occur in certain two-party scenarios [MW12]_, [AMR13]_. + hedging to occur in certain two-party scenarios :cite:`arunachalam2017quantum, Molina_2012`. Examples ========== @@ -60,17 +60,7 @@ class QuantumHedging: .. bibliography:: :filter: docname in docnames - .. [MW12] Molina, Abel, and Watrous, John. - "Hedging bets with correlated quantum strategies." - Proceedings of the Royal Society A: - Mathematical, Physical and Engineering Sciences - 468.2145 (2012): 2614-2629. - https://arxiv.org/abs/1104.1140 - - .. [AMR13] Arunachalam, Srinivasan, Molina, Abel and Russo, Vincent. - "Quantum hedging in two-round prover-verifier interactions." - arXiv preprint arXiv:1310.7954 (2013). - https://arxiv.org/pdf/1310.7954.pdf + """ def __init__(self, q_a: np.ndarray, num_reps: int) -> None: diff --git a/toqito/nonlocal_games/xor_game.py b/toqito/nonlocal_games/xor_game.py index 9ce38fcbe..381a8a5ae 100644 --- a/toqito/nonlocal_games/xor_game.py +++ b/toqito/nonlocal_games/xor_game.py @@ -14,7 +14,7 @@ class XORGame: communicate during the game itself. The quantum value of an XOR game can be solved via the semidefinite program - from [CHTW04]_. + from :cite:`cleve2010consequences`. This function is adapted from the QETLAB package. @@ -24,7 +24,7 @@ class XORGame: The CHSH game The CHSH game is a two-player nonlocal game with the following probability - distribution and question and answer sets [CSUU08]_. + distribution and question and answer sets :cite:`cleve2008strong`. .. math:: \begin{equation} @@ -77,7 +77,7 @@ class XORGame: The odd cycle game - The odd cycle game is another XOR game [CHTW04]_. For this game, we can + The odd cycle game is another XOR game :cite:`cleve2010consequences`. For this game, we can specify the probability and predicate matrices as follows. >>> prob_mat = np.array( @@ -115,16 +115,7 @@ class XORGame: .. bibliography:: :filter: docname in docnames - .. [CSUU08] Richard Cleve, William Slofstra, Falk Unger, Sarvagya Upadhyay - "Strong parallel repetition theorem for quantum XOR proof systems", - 2008, - https://arxiv.org/abs/quant-ph/0608146 - - .. [CHTW04] Richard Cleve, Peter Hoyer, Ben Toner, John Watrous - "Consequences and limits of nonlocal strategies." - Proceedings. 19th IEEE Annual Conference on Computational Complexity, - IEEE, 2004. - https://arxiv.org/abs/quant-ph/0404076 + """ def __init__( @@ -182,7 +173,7 @@ def quantum_value(self) -> float: To obtain the quantum value of the XOR game, we calculate the following simplified dual problem of the semidefinite program from the set of - notes: https://cs.uwaterloo.ca/~watrous/CS867.Winter2017/Notes/06.pdf + notes: Lecture 6 of :cite:`Watrous_2011_lecture_notes` .. math:: \begin{equation} From 5413836a1318582a0aaad301a037769c848bee57 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 16:47:55 -0600 Subject: [PATCH 18/40] refs: perms --- docs/articles.bib | 27 ++++++++++++++++++++++++ toqito/perms/antisymmetric_projection.py | 4 +--- toqito/perms/perfect_matchings.py | 5 +---- toqito/perms/perm_sign.py | 4 +--- toqito/perms/permutation_operator.py | 4 ---- toqito/perms/permute_systems.py | 4 ---- toqito/perms/swap.py | 5 +---- toqito/perms/swap_operator.py | 4 ---- toqito/perms/symmetric_projection.py | 7 +----- toqito/perms/unique_perms.py | 5 +---- 10 files changed, 33 insertions(+), 36 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 6e5bf003d..4bba6a561 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -16,6 +16,19 @@ @misc{arunachalam2017quantum #Last name begins with C +@article{Chen_2014, + title={Symmetric extension of two-qubit states}, + volume={90}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.90.032318}, + DOI={10.1103/physreva.90.032318}, + number={3}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Chen, Jianxin and Ji, Zhengfeng and Kribs, David and Lütkenhaus, Norbert and Zeng, Bei}, + year={2014}, + month=sep } + @article{Choi_1992, title = {Generalized Choi maps in three-dimensional matrix algebra}, journal = {Linear Algebra and its Applications}, @@ -345,6 +358,13 @@ @misc{watrous2012simpler primaryClass={quant-ph} } +@misc{WikiAsymmOp, + author = "Wikipedia", + title = "Anti-symmetric operator", + howpublished = "\url{https://en.wikipedia.org/wiki/Anti-symmetric_operator}" + +} + @misc{WikiBures, author = "Wikipedia", title = "Bures distance", @@ -481,6 +501,13 @@ @misc{WikiOuterProd } +@misc{WikiParPerm, + author = "Wikipedia", + title = "Parity of a permutation", + howpublished = "\url{https://en.wikipedia.org/wiki/Parity_of_a_permutation}" + +} + @misc{WikiPauli, author = "Wikipedia", title = "Pauli matrices", diff --git a/toqito/perms/antisymmetric_projection.py b/toqito/perms/antisymmetric_projection.py index b1379cf54..a0a6c9b83 100644 --- a/toqito/perms/antisymmetric_projection.py +++ b/toqito/perms/antisymmetric_projection.py @@ -12,7 +12,7 @@ def antisymmetric_projection( dim: int, p_param: int = 2, partial: bool = False ) -> sparse.lil_matrix: r""" - Produce the projection onto the antisymmetric subspace [WikAsym]_. + Produce the projection onto the antisymmetric subspace :cite:`WikiAsymmOp`. Produces the orthogonal projection onto the anti-symmetric subspace of :code:`p_param` copies of :code:`dim`-dimensional space. If :code:`partial = True`, then the antisymmetric projection (PA) @@ -75,8 +75,6 @@ def antisymmetric_projection( .. bibliography:: :filter: docname in docnames - .. [WikAsym] Wikipedia: Anti-symmetric operator - https://en.wikipedia.org/wiki/Anti-symmetric_operator :param dim: The dimension of the local systems. :param p_param: Default value of 2. diff --git a/toqito/perms/perfect_matchings.py b/toqito/perms/perfect_matchings.py index ec8dde92e..690d3135d 100644 --- a/toqito/perms/perfect_matchings.py +++ b/toqito/perms/perfect_matchings.py @@ -27,10 +27,7 @@ def perfect_matchings(num: list[int] | int | np.ndarray) -> np.ndarray: [1 3 2 4] [1 4 3 2]] - References - ========== - .. bibliography:: - :filter: docname in docnames + :param num: Either an even integer, indicating that you would like all perfect matchings of the integers 1,2, ... N, or a `list` or `np.array` containing an even number of distinct diff --git a/toqito/perms/perm_sign.py b/toqito/perms/perm_sign.py index 2956c7aab..06a1b6042 100644 --- a/toqito/perms/perm_sign.py +++ b/toqito/perms/perm_sign.py @@ -8,7 +8,7 @@ def perm_sign(perm: np.ndarray | list[int]) -> float: """ - Compute the "sign" of a permutation [WikParPerm]_. + Compute the "sign" of a permutation :cite:`WikiParPerm`. The sign (either -1 or 1) of the permutation :code:`perm` is :code:`-1**`inv`, where :code:`inv` is the number of inversions contained @@ -46,8 +46,6 @@ def perm_sign(perm: np.ndarray | list[int]) -> float: .. bibliography:: :filter: docname in docnames - .. [WikParPerm] Wikipedia: Parity of a permutation - https://en.wikipedia.org/wiki/Parity_of_a_permutation :param perm: The permutation vector to be checked. :return: The value 1 if the permutation is of even length and the value of diff --git a/toqito/perms/permutation_operator.py b/toqito/perms/permutation_operator.py index 756a7b2e3..221616308 100644 --- a/toqito/perms/permutation_operator.py +++ b/toqito/perms/permutation_operator.py @@ -47,10 +47,6 @@ def permutation_operator( [0., 1., 0., 0.], [0., 0., 0., 1.]] - References - ========== - .. bibliography:: - :filter: docname in docnames :param dim: The dimensions of the subsystems to be permuted. :param perm: A permutation vector. diff --git a/toqito/perms/permute_systems.py b/toqito/perms/permute_systems.py index 0fa798997..4caed6d03 100644 --- a/toqito/perms/permute_systems.py +++ b/toqito/perms/permute_systems.py @@ -137,10 +137,6 @@ def permute_systems( [25 29 26 30 27 31 28 32] [57 61 58 62 59 63 60 64]] - References - ========== - .. bibliography:: - :filter: docname in docnames :raises ValueError: If dimension does not match the number of subsystems. :param input_mat: The vector or matrix. diff --git a/toqito/perms/swap.py b/toqito/perms/swap.py index b2bf7c491..61d35856c 100644 --- a/toqito/perms/swap.py +++ b/toqito/perms/swap.py @@ -100,10 +100,7 @@ def swap( >>> swap(test_vec) [1 3 2 4] - References - ========== - .. bibliography:: - :filter: docname in docnames + :raises ValueError: If dimension does not match the number of subsystems. :param rho: A vector or matrix to have its subsystems swapped. diff --git a/toqito/perms/swap_operator.py b/toqito/perms/swap_operator.py index 1749b41e8..49fe0df70 100644 --- a/toqito/perms/swap_operator.py +++ b/toqito/perms/swap_operator.py @@ -52,10 +52,6 @@ def swap_operator(dim: list[int] | int, is_sparse: bool = False) -> np.ndarray: [0., 0., 0., 0., 0., 1., 0., 0., 0.], [0., 0., 0., 0., 0., 0., 0., 0., 1.]] - References - ========== - .. bibliography:: - :filter: docname in docnames :param dim: The dimensions of the subsystems. :param is_sparse: Sparse if :code:`True` and non-sparse if :code:`False`. diff --git a/toqito/perms/symmetric_projection.py b/toqito/perms/symmetric_projection.py index 464f0f7a1..dd084fb6d 100644 --- a/toqito/perms/symmetric_projection.py +++ b/toqito/perms/symmetric_projection.py @@ -12,7 +12,7 @@ def symmetric_projection( dim: int, p_val: int = 2, partial: bool = False ) -> [np.ndarray, scipy.sparse.lil_matrix]: r""" - Produce the projection onto the symmetric subspace [CJKLZ14]_. + Produce the projection onto the symmetric subspace :cite:`Chen_2014`. For a complex Euclidean space :math:`\mathcal{X}` and a positive integer :math:`n`, the projection onto the symmetric subspace is given by @@ -74,11 +74,6 @@ def symmetric_projection( .. bibliography:: :filter: docname in docnames - .. [CJKLZ14] J. Chen, Z. Ji, D. Kribs, N. Lütkenhaus, and B. Zeng. - "Symmetric extension of two-qubit states". - Physical Review A 90.3 (2014): 032318. - https://arxiv.org/abs/1310.3530 - E-print: arXiv:1310.3530 [quant-ph] :param dim: The dimension of the local systems. :param p_val: Default value of 2. diff --git a/toqito/perms/unique_perms.py b/toqito/perms/unique_perms.py index 3276a8313..a5a5759fb 100644 --- a/toqito/perms/unique_perms.py +++ b/toqito/perms/unique_perms.py @@ -30,10 +30,7 @@ def unique_perms(elements: list[int]): >>> len(list(unique_perms(vec_nums))) 4200 - References - ========== - .. bibliography:: - :filter: docname in docnames + :param elements: List of integers. :return: The number of possible permutations possible. From d3ede6fd51754f2fc559e4fda975e3f95d2404ae Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 16:54:08 -0600 Subject: [PATCH 19/40] refs: rand --- docs/articles.bib | 26 +++++++++++++++++++++++++- toqito/rand/random_density_matrix.py | 4 ---- toqito/rand/random_ginibre.py | 11 ++--------- toqito/rand/random_povm.py | 5 ++--- toqito/rand/random_state_vector.py | 5 +---- toqito/rand/random_unitary.py | 6 +----- 6 files changed, 31 insertions(+), 26 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 4bba6a561..c4cf82214 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -85,7 +85,18 @@ @inproceedings{Hayden_2013 year={2013}, month=jun } - +@article{Heinosaari_2020, + title={Random positive operator valued measures}, + volume={61}, + ISSN={1089-7658}, + url={http://dx.doi.org/10.1063/1.5131028}, + DOI={10.1063/1.5131028}, + number={4}, + journal={Journal of Mathematical Physics}, + publisher={AIP Publishing}, + author={Heinosaari, Teiko and Jivulescu, Maria Anastasia and Nechita, Ion}, + year={2020}, + month=apr } #Last name begins with I #Last name begins with J @@ -239,6 +250,12 @@ @article{Navascu_s_2008 #Last name begins with O +@misc{OzolsRandU, + author = "Maris Ozols", + title = "How to generate a random unitary matrix", + howpublished = "\url{http://home.lu.lv/~sd20008/papers/essays/Random%20unitary%20[paper].pdf}" + +} #Last name begins with P @article{Peres_1996, @@ -379,6 +396,13 @@ @misc{WikiCirc } +@misc{WikiCircLaw, + author = "Wikipedia", + title = "Circular law", + howpublished = "\url{https://en.wikipedia.org/wiki/Circular_law}" + +} + @misc{WikiClock, author = "Wikipedia", title = "Generalizations of Pauli matrices", diff --git a/toqito/rand/random_density_matrix.py b/toqito/rand/random_density_matrix.py index 48a4e024e..5a85ad6fb 100644 --- a/toqito/rand/random_density_matrix.py +++ b/toqito/rand/random_density_matrix.py @@ -76,10 +76,6 @@ def random_density_matrix( >>> is_density(bures_mat) True - References - ========== - .. bibliography:: - :filter: docname in docnames :param dim: The number of rows (and columns) of the density matrix. :param is_real: Boolean denoting whether the returned matrix will have all diff --git a/toqito/rand/random_ginibre.py b/toqito/rand/random_ginibre.py index ba60d5a6e..06bd9ae46 100644 --- a/toqito/rand/random_ginibre.py +++ b/toqito/rand/random_ginibre.py @@ -7,14 +7,14 @@ def random_ginibre( dim_m: int, ) -> np.ndarray: r""" - Generate a Ginibre random matrix [WIKCIRC]_. + Generate a Ginibre random matrix :cite:`WikiCircLaw`. Generates a random :code:`dim_n`-by-:code:`dim_m` Ginibre matrix. A *Ginibre random matrix* is a matrix with independent and identically distributed complex standard Gaussian entries. - Ginibre random matrices are used in the construction of Wishart-random POVMs [HMN20]_. + Ginibre random matrices are used in the construction of Wishart-random POVMs :cite:`Heinosaari_2020`. Examples ========== @@ -32,13 +32,6 @@ def random_ginibre( :filter: docname in docnames - .. [WIKCIRC] Wikipedia: Circular law - https://en.wikipedia.org/wiki/Circular_law - - .. [HMN20] Heinosaari, Teiko, Maria Anastasia Jivulescu, and Ion Nechita. - "Random positive operator valued measures." - Journal of Mathematical Physics 61.4 (2020): 042202. - :param dim_n: The number of rows of the Ginibre random matrix. :param dim_m: The number of columns of the Ginibre random matrix. :return: A :code:`dim_n`-by-:code:`dim_m` Ginibre random density matrix. diff --git a/toqito/rand/random_povm.py b/toqito/rand/random_povm.py index f68bc851e..b7bf8a601 100644 --- a/toqito/rand/random_povm.py +++ b/toqito/rand/random_povm.py @@ -4,7 +4,7 @@ def random_povm(dim: int, num_inputs: int, num_outputs: int) -> np.ndarray: """ - Generate random positive operator valued measurements (POVMs) [WIKPOVM]_. + Generate random positive operator valued measurements (POVMs) :cite:`WikiPOVM`. Examples ========== @@ -41,8 +41,7 @@ def random_povm(dim: int, num_inputs: int, num_outputs: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WIKPOVM] Wikipedia: POVM - https://en.wikipedia.org/wiki/POVM + :param dim: The dimensions of the measurements. :param num_inputs: The number of inputs for the measurement. diff --git a/toqito/rand/random_state_vector.py b/toqito/rand/random_state_vector.py index 2b05aa0ce..6d5a6f50c 100644 --- a/toqito/rand/random_state_vector.py +++ b/toqito/rand/random_state_vector.py @@ -32,10 +32,7 @@ def random_state_vector( >>> is_pure(dm) True - References - ========== - .. bibliography:: - :filter: docname in docnames + :param dim: The number of rows (and columns) of the unitary matrix. :param is_real: Boolean denoting whether the returned matrix has real diff --git a/toqito/rand/random_unitary.py b/toqito/rand/random_unitary.py index 2d5a28250..a9eb7e94a 100644 --- a/toqito/rand/random_unitary.py +++ b/toqito/rand/random_unitary.py @@ -6,7 +6,7 @@ def random_unitary(dim: list[int] | int, is_real: bool = False) -> np.ndarray: """ - Generate a random unitary or orthogonal matrix [MO09]_. + Generate a random unitary or orthogonal matrix :cite:`OzolsRandU`. Calculates a random unitary matrix (if :code:`is_real = False`) or a random real orthogonal matrix (if :code:`is_real = True`), uniformly distributed according to the Haar measure. @@ -66,10 +66,6 @@ def random_unitary(dim: list[int] | int, is_real: bool = False) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [MO09] How to generate a random unitary matrix, - Maris Ozols - March 16, 2009, - home.lu.lv/~sd20008/papers/essays/Random%20unitary%20%5Bpaper%5D.pdf :param dim: The number of rows (and columns) of the unitary matrix. :param is_real: Boolean denoting whether the returned matrix has real From dd91a88b7d364bbf1a85491d10f7af3c0f4de183 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 18:38:36 -0600 Subject: [PATCH 20/40] refs: state_metrics --- docs/articles.bib | 48 +++++++++++++++++++ toqito/state_metrics/bures_distance.py | 4 +- toqito/state_metrics/fidelity.py | 4 +- .../state_metrics/fidelity_of_separability.py | 28 +++-------- toqito/state_metrics/helstrom_holevo.py | 6 +-- toqito/state_metrics/hilbert_schmidt.py | 5 +- .../hilbert_schmidt_inner_product.py | 10 ++-- toqito/state_metrics/matsumoto_fidelity.py | 5 +- toqito/state_metrics/sub_fidelity.py | 6 +-- toqito/state_metrics/trace_distance.py | 5 +- 10 files changed, 66 insertions(+), 55 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index c4cf82214..eb840a0d6 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -221,6 +221,24 @@ @article{Lupo_2008 #Last name begins with M +@misc{matsumoto2010reverse, + title={Reverse test and quantum analogue of classical fidelity and generalized fidelity}, + author={Keiji Matsumoto}, + year={2010}, + eprint={1006.0302}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + +@misc{miszczak2008sub, + title={Sub-- and super--fidelity as bounds for quantum fidelity}, + author={J. A. Miszczak and Z. Puchała and P. Horodecki and A. Uhlmann and K. Życzkowski}, + year={2008}, + eprint={0805.2037}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + @article{Molina_2012, title={Hedging bets with correlated quantum strategies}, volume={468}, @@ -288,6 +306,13 @@ @misc{QuantikiTrNorm } +@misc{QuantikiTrDist, + author = "Quantiki", + title = "Trace distance", + howpublished = "\url{https://www.quantiki.org/wiki/trace-distance}" + +} + #Last name begins with R @misc{Rigetti_docs, author = "Rigetti", @@ -461,6 +486,13 @@ @misc{WikiDiagDom } +@misc{WikiFidQuant, + author = "Wikipedia", + title = "Fidelity of quantum states", + howpublished = "\url{https://en.wikipedia.org/wiki/Fidelity_of_quantum_states}" + +} + @misc{WikiGellMann, author = "Wikipedia", title = "Gell-{M}ann matrices", @@ -482,6 +514,22 @@ @misc{WikiHerm } + +@misc{WikiHilbSchOp, + author = "Wikipedia", + title = "Hilbert-Schmidt operator", + howpublished = "\url{https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator}" + +} + + +@misc{WikiHolevo, + author = "Wikipedia", + title = "Holevo\'s Theorem", + howpublished = "\url{https://en.wikipedia.org/wiki/Holevo%27s_theorem}" + +} + @misc{WikiIdemPot, author = "Wikipedia", title = "Idempotent matrix", diff --git a/toqito/state_metrics/bures_distance.py b/toqito/state_metrics/bures_distance.py index 758c77b5c..e976bbf0c 100644 --- a/toqito/state_metrics/bures_distance.py +++ b/toqito/state_metrics/bures_distance.py @@ -6,7 +6,7 @@ def bures_distance(rho_1: np.ndarray, rho_2: np.ndarray, decimals: int = 10) -> float: r""" - Compute the Bures distance of two density matrices [WikBures]_. + Compute the Bures distance of two density matrices :cite:`WikiBures`. Calculate the Bures distance between two density matrices :code:`rho_1` and :code:`rho_2` defined by: @@ -57,8 +57,6 @@ def bures_distance(rho_1: np.ndarray, rho_2: np.ndarray, decimals: int = 10) -> .. bibliography:: :filter: docname in docnames - .. [WikBures] Wikipedia: Bures metric - https://en.wikipedia.org/wiki/Bures_metric :raises ValueError: If matrices are not of equal dimension. :param rho_1: Density operator. diff --git a/toqito/state_metrics/fidelity.py b/toqito/state_metrics/fidelity.py index 5b2cd8922..aac8aab88 100644 --- a/toqito/state_metrics/fidelity.py +++ b/toqito/state_metrics/fidelity.py @@ -8,7 +8,7 @@ def fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the fidelity of two density matrices [WikFid]_. + Compute the fidelity of two density matrices :cite:`WikiFidQuant`. Calculate the fidelity between the two density matrices :code:`rho` and :code:`sigma`, defined by: @@ -58,8 +58,6 @@ def fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikFid] Wikipedia: Fidelity of quantum states - https://en.wikipedia.org/wiki/Fidelity_of_quantum_states :raises ValueError: If matrices are not density operators. :param rho: Density operator. diff --git a/toqito/state_metrics/fidelity_of_separability.py b/toqito/state_metrics/fidelity_of_separability.py index 3e770a472..8ba60504b 100644 --- a/toqito/state_metrics/fidelity_of_separability.py +++ b/toqito/state_metrics/fidelity_of_separability.py @@ -20,12 +20,12 @@ def fidelity_of_separability( solver_option: str = "cvxopt", ) -> float: r""" - Define the first benchmark introduced in Appendix H of [Phil23]_. + Define the first benchmark introduced in Appendix H of :cite:`Philip2023schrodinger`. If you would like to instead use the benchmark introduced in Appendix I, go to :obj:`toqito.channel_metrics.fidelity_of_separability`. - In [Phil23]_ a variational quantum algorithm (VQA) is introduced to test + In :cite:`Philip2023schrodinger` a variational quantum algorithm (VQA) is introduced to test the separability of a general bipartite state. The algorithm utilizes quantum steering between two separated systems such that the separability of the state is quantified. @@ -34,11 +34,11 @@ def fidelity_of_separability( optimization semidefinite programs (SDP) benchmarks were introduced to maximize the fidelity of separability subject to some state constraints (Positive Partial Transpose (PPT), symmetric extensions (k-extendibility - ) [Hay12]_ ) This function approximites the fidelity of separability by + ) :cite:`Hayden_2013` ) This function approximites the fidelity of separability by maximizing over PPT states & k-extendible states i.e. an optimization - problem over states [TBWat18]_ . + problem over states :cite:`watrous_2018`. - The following expression (Equation (H2) from [Phil23]_ ) defines the + The following expression (Equation (H2) from :cite:`Philip2023schrodinger` ) defines the constraints for approxiamting :math:`\sqrt{\widetilde{F}_s^1}(\rho_{AB}) {:}=` @@ -76,7 +76,7 @@ def fidelity_of_separability( :math:`B_1, B_2, \ldots , B_{k}` which has no effect on the k-extended state :math:`\sigma_{AB^{k}}`. - The other constraints are due to the PPT condition [Per96]_. + The other constraints are due to the PPT condition :cite:`Peres_1996`. Examples ========== @@ -108,22 +108,6 @@ def fidelity_of_separability( .. bibliography:: :filter: docname in docnames - .. [Hay12] Hayden, Patrick et.al. - "Two-message quantum interactive proofs and the quantum separability problem." - Proceedings of the 28th IEEE Conference on Computational Complexity, pages 156-167. - https://arxiv.org/abs/1211.6120 - - .. [Per96] Peres, Asher. - "Separability Criterion for Density Matrices" - https://arxiv.org/abs/quant-ph/9604005 - - .. [Phil23] Philip, Aby et.al. - "Quantum Steering Algorithm for Estimating Fidelity of Separability" - https://arxiv.org/abs/2303.07911 - - .. [TBWat18] Watrous, John. - “The Theory of Quantum Information” - Cambridge University Press, 2018 :param input_state_rho: the density matrix for the bipartite state of interest. :param input_state_rho_dims: the dimensions of System A & B respectively in diff --git a/toqito/state_metrics/helstrom_holevo.py b/toqito/state_metrics/helstrom_holevo.py index 536310599..38bdcf6e8 100644 --- a/toqito/state_metrics/helstrom_holevo.py +++ b/toqito/state_metrics/helstrom_holevo.py @@ -6,10 +6,10 @@ def helstrom_holevo(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the Helstrom-Holevo distance between density matrices [WikHeHo]_. + Compute the Helstrom-Holevo distance between density matrices :cite:`WikiHolevo`. In general, the best success probability to discriminate two mixed states represented by - :math:`\rho` and :math:`\sigma` is given by [WikHeHo]_. + :math:`\rho` and :math:`\sigma` is given by :cite:`WikiHolevo`. .. math:: \frac{1}{2}+\frac{1}{2} \left(\frac{1}{2} \left|\rho - \sigma \right|_1\right). @@ -53,8 +53,6 @@ def helstrom_holevo(rho: np.ndarray, sigma: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikHeHo] Wikipedia: Holevo's theorem. - https://en.wikipedia.org/wiki/Holevo%27s_theorem :raises ValueError: If matrices are not density operators. :param rho: Density operator. diff --git a/toqito/state_metrics/hilbert_schmidt.py b/toqito/state_metrics/hilbert_schmidt.py index f53fb9865..d24471f26 100644 --- a/toqito/state_metrics/hilbert_schmidt.py +++ b/toqito/state_metrics/hilbert_schmidt.py @@ -6,7 +6,7 @@ def hilbert_schmidt(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the Hilbert-Schmidt distance between two states [WikHS]_. + Compute the Hilbert-Schmidt distance between two states :cite:`WikiHilbSchOp`. The Hilbert-Schmidt distance between density operators :math:`\rho` and :math:`\sigma` is defined as @@ -33,8 +33,7 @@ def hilbert_schmidt(rho: np.ndarray, sigma: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikHS] Wikipedia: Hilbert-Schmidt operator. - https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator + :raises ValueError: If matrices are not density operators. :param rho: An input matrix. diff --git a/toqito/state_metrics/hilbert_schmidt_inner_product.py b/toqito/state_metrics/hilbert_schmidt_inner_product.py index adf1fe194..90c136363 100644 --- a/toqito/state_metrics/hilbert_schmidt_inner_product.py +++ b/toqito/state_metrics/hilbert_schmidt_inner_product.py @@ -4,7 +4,7 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> complex: r""" - Compute the Hilbert-Schmidt inner product between two matrices [WikHSO]_. + Compute the Hilbert-Schmidt inner product between two matrices :cite:`WikiHilbSchOp`. The Hilbert-Schmidt inner product between :code:`a_mat` and :code:`b_mat` is defined as @@ -16,7 +16,7 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> compl where :math:`|B\rangle = \text{vec}(B)` and :math:`\langle A|` is the dual vector to :math:`|A \rangle`. - Note: This function has been adapted from [Rigetti21]_. + Note: This function has been adapted from :cite:`Rigetti_docs`. Examples ========== @@ -35,11 +35,7 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> compl .. bibliography:: :filter: docname in docnames - .. [WikHSO] Wikipedia: Hilbert-Schmidt operator. - https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator - .. [Rigetti21] Forest Benchmarking (Rigetti). - https://github.com/rigetti/forest-benchmarking - + :param a_mat: An input matrix provided as a numpy array. :param b_mat: An input matrix provided as a numpy array. :return: The Hilbert-Schmidt inner product between :code:`a_mat` and diff --git a/toqito/state_metrics/matsumoto_fidelity.py b/toqito/state_metrics/matsumoto_fidelity.py index 12124d64c..5ca2bb12e 100644 --- a/toqito/state_metrics/matsumoto_fidelity.py +++ b/toqito/state_metrics/matsumoto_fidelity.py @@ -8,7 +8,7 @@ def matsumoto_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the Matsumoto fidelity of two density matrices [Mat10]_. + Compute the Matsumoto fidelity of two density matrices :cite:`matsumoto2010reverse`. Calculate the Matsumoto fidelity between the two density matrices :code:`rho` and :code:`sigma`, defined by: @@ -68,9 +68,6 @@ def matsumoto_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [Mat10] Keiji Matsumoto. - "Reverse test and quantum analogue of classical fidelity and generalized fidelity" - https://arxiv.org/abs/1006.0302 :raises ValueError: If matrices are not of equal dimension. :param rho: Density operator. diff --git a/toqito/state_metrics/sub_fidelity.py b/toqito/state_metrics/sub_fidelity.py index 99d2729f6..8763182e1 100644 --- a/toqito/state_metrics/sub_fidelity.py +++ b/toqito/state_metrics/sub_fidelity.py @@ -6,7 +6,7 @@ def sub_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the sub fidelity of two density matrices [MPHUZSub08]_. + Compute the sub fidelity of two density matrices :cite:`miszczak2008sub`. The sub-fidelity is a measure of similarity between density operators. It is defined as @@ -57,10 +57,6 @@ def sub_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [MPHUZSub08] J. A. Miszczak, Z. Puchała, P. Horodecki, A. Uhlmann, K. Życzkowski - "Sub--and super--fidelity as bounds for quantum fidelity." - arXiv preprint arXiv:0805.2037 (2008). - https://arxiv.org/abs/0805.2037 :raises ValueError: If matrices are not of equal dimension. :param rho: Density operator. diff --git a/toqito/state_metrics/trace_distance.py b/toqito/state_metrics/trace_distance.py index de6043274..7d0f13713 100644 --- a/toqito/state_metrics/trace_distance.py +++ b/toqito/state_metrics/trace_distance.py @@ -14,7 +14,7 @@ def trace_distance(rho: np.ndarray, sigma: np.ndarray) -> float: \delta(\rho, \sigma) = \frac{1}{2} \left( \text{Tr}(\left| \rho - \sigma \right| \right). - More information on the trace distance can be found in [WIKTD]_. + More information on the trace distance can be found in :cite:`QuantikiTrDist`. Examples ========== @@ -49,9 +49,6 @@ def trace_distance(rho: np.ndarray, sigma: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WIKTD] Quantiki: Trace distance - https://www.quantiki.org/wiki/trace-distance - :raises ValueError: If matrices are not of density operators. :param rho: An input matrix. :param sigma: An input matrix. From 853a37fd446e10cd27b408354fdebeae7d715a09 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 18:40:56 -0600 Subject: [PATCH 21/40] refs: state_ops --- docs/articles.bib | 7 +++++++ toqito/state_ops/pure_to_mixed.py | 5 +---- toqito/state_ops/schmidt_decomposition.py | 4 +--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index eb840a0d6..95bbfc2ab 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -650,6 +650,13 @@ @misc{WikiReductionCrit } +@misc{WikiScmidtDecomp, + author = "Wikipedia", + title = "Schmidt decomposition", + howpublished = "\url{https://en.wikipedia.org/wiki/Schmidt_decomposition}" + +} + @misc{WikiSqMat, author = "Wikipedia", title = "Square matrix", diff --git a/toqito/state_ops/pure_to_mixed.py b/toqito/state_ops/pure_to_mixed.py index 86aa8aa9b..789ea5d0a 100644 --- a/toqito/state_ops/pure_to_mixed.py +++ b/toqito/state_ops/pure_to_mixed.py @@ -47,10 +47,7 @@ def pure_to_mixed(phi: np.ndarray) -> np.ndarray: [0. , 0. , 0. , 0. ], [0.5, 0. , 0. , 0.5]]) - References - ========== - .. bibliography:: - :filter: docname in docnames + :raises ValueError: If matrix is not square. :param phi: A density matrix or a pure state vector. diff --git a/toqito/state_ops/schmidt_decomposition.py b/toqito/state_ops/schmidt_decomposition.py index d1dd73ad7..601ae19d7 100644 --- a/toqito/state_ops/schmidt_decomposition.py +++ b/toqito/state_ops/schmidt_decomposition.py @@ -8,7 +8,7 @@ def schmidt_decomposition( rho: np.ndarray, dim: int | list[int] | np.ndarray = None, k_param: int = 0 ) -> tuple[np.ndarray, np.ndarray, np.ndarray]: r""" - Compute the Schmidt decomposition of a bipartite vector [WikSD]_. + Compute the Schmidt decomposition of a bipartite vector :cite:`WikiScmidtDecomp`. Examples ========== @@ -58,8 +58,6 @@ def schmidt_decomposition( .. bibliography:: :filter: docname in docnames - .. [WikSD] Wikipedia: Schmidt decomposition - https://en.wikipedia.org/wiki/Schmidt_decomposition :raises ValueError: If matrices are not of equal dimension. :param rho: A bipartite quantum state to compute the Schmidt decomposition of. From 3c69a1594fc8705cc69fbb4caf5210054eb2ee77 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 18:56:09 -0600 Subject: [PATCH 22/40] refs: state_opt --- docs/articles.bib | 112 ++++++++++++++++++ toqito/state_opt/optimal_clone.py | 15 +-- toqito/state_opt/ppt_distinguishability.py | 21 +--- toqito/state_opt/state_distinguishability.py | 7 +- toqito/state_opt/state_exclusion.py | 15 +-- .../symmetric_extension_hierarchy.py | 19 +-- 6 files changed, 128 insertions(+), 61 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 95bbfc2ab..6bad22892 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -13,6 +13,18 @@ @misc{arunachalam2017quantum #Last name begins with B +@article{Bandyopadhyay_2014, + title={Conclusive exclusion of quantum states}, + volume={89}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.89.022336}, + DOI={10.1103/physreva.89.022336}, + number={2}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Bandyopadhyay, Somshubhro and Jain, Rahul and Oppenheim, Jonathan and Perry, Christopher}, + year={2014}, + month=feb } #Last name begins with C @@ -60,6 +72,26 @@ @misc{cleve2010consequences primaryClass={quant-ph} } +@article{Cosentino_2013, + title={Positive-partial-transpose-indistinguishable states via semidefinite programming}, + volume={87}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.87.012321}, + DOI={10.1103/physreva.87.012321}, + number={1}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Cosentino, Alessandro}, + year={2013}, + month=jan } + +@misc{cosentino_2015, + title={Quantum State Local Distinguishability via Convex Optimization}, + author={Alessandro Cosentino}, + year={2015}, + howpublished = "\url{https://uwspace.uwaterloo.ca/handle/10012/9572}" +} + @misc{cvxpy_kron, author = {Murray, Riley J}, title = {{PR:} Have kron support non-constant expressions in either argument from {CXPY:} A Python-embedded modeling language for convex optimization problems}, @@ -69,6 +101,19 @@ @misc{cvxpy_kron #Last name begins with D #Last name begins with E +@article{Eldar_2003, + title={A semidefinite programming approach to optimal unambiguous discrimination of quantum states}, + volume={49}, + ISSN={0018-9448}, + url={http://dx.doi.org/10.1109/TIT.2002.807291}, + DOI={10.1109/tit.2002.807291}, + number={2}, + journal={IEEE Transactions on Information Theory}, + publisher={Institute of Electrical and Electronics Engineers (IEEE)}, + author={Eldar, Y.C.}, + year={2003}, + month=feb, pages={446-456} } + #Last name begins with F @@ -252,6 +297,15 @@ @article{Molina_2012 year={2012}, month=apr, pages={2614-2629} } +@misc{molina2012optimal, + title={Optimal counterfeiting attacks and generalizations for Wiesner's quantum money}, + author={Abel Molina and Thomas Vidick and John Watrous}, + year={2012}, + eprint={1202.4010}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + #Last name begins with N @article{Navascu_s_2008, title={A convergent hierarchy of semidefinite programs characterizing the set of quantum correlations}, @@ -266,6 +320,18 @@ @article{Navascu_s_2008 year={2008}, month=jul, pages={073013} } +@article{Navascu_s_2008p, + title={Pure State Estimation and the Characterization of Entanglement}, + volume={100}, + ISSN={1079-7114}, + url={http://dx.doi.org/10.1103/PhysRevLett.100.070503}, + DOI={10.1103/physrevlett.100.070503}, + number={7}, + journal={Physical Review Letters}, + publisher={American Physical Society (APS)}, + author={Navascués, Miguel}, + year={2008}, + month=feb } #Last name begins with O @misc{OzolsRandU, @@ -298,6 +364,19 @@ @misc{Philip2023schrodinger primaryClass={quant-ph} } +@article{Pusey_2012, + title={On the reality of the quantum state}, + volume={8}, + ISSN={1745-2481}, + url={http://dx.doi.org/10.1038/nphys2309}, + DOI={10.1038/nphys2309}, + number={6}, + journal={Nature Physics}, + publisher={Springer Science and Business Media LLC}, + author={Pusey, Matthew F. and Barrett, Jonathan and Rudolph, Terry}, + year={2012}, + month=may, pages={475-478} } + #Last name begins with Q @misc{QuantikiTrNorm, author = "Quantiki", @@ -400,6 +479,26 @@ @misc{watrous2012simpler primaryClass={quant-ph} } +@article{Wiesner_1983, +author = {Wiesner, Stephen}, +title = {Conjugate Coding}, +year = {1983}, +issue_date = {Winter-Spring 1983}, +publisher = {Association for Computing Machinery}, +address = {New York, NY, USA}, +volume = {15}, +number = {1}, +issn = {0163-5700}, +url = {https://doi.org/10.1145/1008908.1008920}, +doi = {10.1145/1008908.1008920}, +journal = {SIGACT News}, +month = {jan}, +pages = {78-88}, +numpages = {11} +} + + + @misc{WikiAsymmOp, author = "Wikipedia", title = "Anti-symmetric operator", @@ -688,5 +787,18 @@ @misc{WikiUniMat #Last name begins with X #Last name begins with Y +@article{Yu_2012, + title={Four Locally Indistinguishable Ququad-Ququad Orthogonal Maximally Entangled States}, + volume={109}, + ISSN={1079-7114}, + url={http://dx.doi.org/10.1103/PhysRevLett.109.020506}, + DOI={10.1103/physrevlett.109.020506}, + number={2}, + journal={Physical Review Letters}, + publisher={American Physical Society (APS)}, + author={Yu, Nengkun and Duan, Runyao and Ying, Mingsheng}, + year={2012}, + month=jul } + #Last name begins with Z \ No newline at end of file diff --git a/toqito/state_opt/optimal_clone.py b/toqito/state_opt/optimal_clone.py index 09ee748fa..cba4bfdc7 100644 --- a/toqito/state_opt/optimal_clone.py +++ b/toqito/state_opt/optimal_clone.py @@ -16,7 +16,7 @@ def optimal_clone( strategy: bool = False, ) -> float | np.ndarray: r""" - Compute probability of counterfeiting quantum money [MVW12]_. + Compute probability of counterfeiting quantum money :cite:`molina2012optimal`. The primal problem for the :math:`n`-fold parallel repetition is given as follows: @@ -52,7 +52,7 @@ def optimal_clone( Examples ========== - Wiesner's original quantum money scheme [Wies83]_ was shown in [MVW12]_ to have an optimal + Wiesner's original quantum money scheme :cite:`Wiesner_1983` was shown in :cite:`molina2012optimal` to have an optimal probability of 3/4 for succeeding a counterfeiting attack. Specifically, in the single-qubit case, Wiesner's quantum money scheme corresponds to the @@ -93,17 +93,6 @@ def optimal_clone( .. bibliography:: :filter: docname in docnames - .. [MVW12] Abel Molina, Thomas Vidick, and John Watrous. - "Optimal counterfeiting attacks and generalizations for Wiesner’s - quantum money." - Conference on Quantum Computation, Communication, and Cryptography. - Springer, Berlin, Heidelberg, 2012. - https://arxiv.org/abs/1202.4010 - - .. [Wies83] Stephen Wiesner - "Conjugate coding." - ACM Sigact News 15.1 (1983): 78-88. - https://dl.acm.org/doi/pdf/10.1145/1008908.1008920 :param states: A list of states provided as either matrices or vectors. :param probs: Respective list of probabilities each state is selected. diff --git a/toqito/state_opt/ppt_distinguishability.py b/toqito/state_opt/ppt_distinguishability.py index e0d3f364e..f9450ae16 100644 --- a/toqito/state_opt/ppt_distinguishability.py +++ b/toqito/state_opt/ppt_distinguishability.py @@ -14,12 +14,12 @@ def ppt_distinguishability( strategy: bool = False, ) -> float: r""" - Compute probability of optimally distinguishing a state via PPT measurements [COS13]_. + Compute probability of optimally distinguishing a state via PPT measurements :cite:`Cosentino_2013`. Implements the semidefinite program (SDP) whose optimal value is equal to the maximum probability of perfectly distinguishing orthogonal maximally entangled states using any PPT measurement; a measurement whose operators are positive under partial transpose. This SDP was - explicitly provided in [COS13]_. + explicitly provided in :cite:`Cosentino_2013`. One can specify the distinguishability method using the :code:`dist_method` argument. @@ -44,7 +44,7 @@ def ppt_distinguishability( \end{aligned} \end{equation} - It was illustrated in [YDY12]_ that for the following set of states + It was illustrated in :cite:`Yu_2012` that for the following set of states .. math:: \begin{equation} @@ -57,7 +57,7 @@ def ppt_distinguishability( \end{equation} that the optimal probability of distinguishing via a PPT measurement should yield - :math:`7/8 \approx 0.875` as was proved in [YDY12]_. + :math:`7/8 \approx 0.875` as was proved in :cite:`Yu_2012`. >>> from toqito.states import bell >>> from toqito.state_opt import ppt_distinguishability @@ -67,7 +67,7 @@ def ppt_distinguishability( >>> psi_2 = bell(3) >>> psi_3 = bell(1) >>> - >>> # YDY vectors from [YDY12]_. + >>> # YDY vectors from :cite:`Yu_2012`. >>> x_1 = np.kron(psi_0, psi_0) >>> x_2 = np.kron(psi_1, psi_3) >>> x_3 = np.kron(psi_2, psi_3) @@ -89,17 +89,6 @@ def ppt_distinguishability( .. bibliography:: :filter: docname in docnames - .. [COS13] Cosentino, Alessandro. - "Positive-partial-transpose-indistinguishable states via semidefinite - programming." - Physical Review A 87.1 (2013): 012321. - https://arxiv.org/abs/1205.1031 - - .. [YDY12] Yu, Nengkun, Runyao Duan, and Mingsheng Ying. - "Four locally indistinguishable ququad-ququad orthogonal - maximally entangled states." - Physical review letters 109.2 (2012): 020506. - https://arxiv.org/abs/1107.3224 :param states: A list of states provided as either matrices or vectors. :param dist_method: The method of distinguishing states. diff --git a/toqito/state_opt/state_distinguishability.py b/toqito/state_opt/state_distinguishability.py index 48d9c5356..a6c5d5f23 100644 --- a/toqito/state_opt/state_distinguishability.py +++ b/toqito/state_opt/state_distinguishability.py @@ -9,7 +9,7 @@ def state_distinguishability( states: list[np.ndarray], probs: list[float] = None, dist_method: str = "min-error" ) -> float: r""" - Compute probability of state distinguishability [ELD03]_. + Compute probability of state distinguishability :cite:`Eldar_2003`. The "quantum state distinguishability" problem involves a collection of :math:`n` quantum states @@ -78,11 +78,6 @@ def state_distinguishability( .. bibliography:: :filter: docname in docnames - .. [ELD03] Eldar, Yonina C. - "A semidefinite programming approach to optimal unambiguous - discrimination of quantum states." - IEEE Transactions on information theory 49.2 (2003): 446-456. - https://arxiv.org/abs/quant-ph/0206093 :param states: A list of states provided as either matrices or vectors. :param probs: Respective list of probabilities each state is selected. diff --git a/toqito/state_opt/state_exclusion.py b/toqito/state_opt/state_exclusion.py index 4c031fd36..50653fb53 100644 --- a/toqito/state_opt/state_exclusion.py +++ b/toqito/state_opt/state_exclusion.py @@ -46,8 +46,8 @@ def state_exclusion( \end{aligned} \end{equation} - The conclusive state exclusion SDP is written explicitly in [BJOP14]_. The problem of conclusive - state exclusion was also thought about under a different guise in [PBR12]_. + The conclusive state exclusion SDP is written explicitly in :cite:`Bandyopadhyay_2014`. The problem of conclusive + state exclusion was also thought about under a different guise in :cite:`Pusey_2012`. Examples ========== @@ -81,16 +81,7 @@ def state_exclusion( .. bibliography:: :filter: docname in docnames - .. [PBR12] "On the reality of the quantum state" - Pusey, Matthew F., Barrett, Jonathan, and Rudolph, Terry. - Nature Physics 8.6 (2012): 475-478. - arXiv:1111.3328 - - .. [BJOP14] "Conclusive exclusion of quantum states" - Bandyopadhyay, Somshubhro, Jain, Rahul, Oppenheim, Jonathan, - Perry, Christopher - Physical Review A 89.2 (2014): 022336. - arXiv:1306.4683 + :param vectors: A list of states provided as vectors. :param probs: Respective list of probabilities each state is selected. If no diff --git a/toqito/state_opt/symmetric_extension_hierarchy.py b/toqito/state_opt/symmetric_extension_hierarchy.py index 24044d9bf..ba43ee327 100644 --- a/toqito/state_opt/symmetric_extension_hierarchy.py +++ b/toqito/state_opt/symmetric_extension_hierarchy.py @@ -17,7 +17,7 @@ def symmetric_extension_hierarchy( dim: int | list[int] = None, ) -> float: r""" - Compute optimal value of the symmetric extension hierarchy SDP [Nav08]_. + Compute optimal value of the symmetric extension hierarchy SDP :cite:`Navascu_s_2008p`. The probability of distinguishing a given set of states via PPT measurements serves as a natural upper bound to the value of obtaining via separable measurements. Due to the nature of separable @@ -25,10 +25,10 @@ def symmetric_extension_hierarchy( programming techniques. We can, however, construct a hierarchy of semidefinite programs that attains closer and closer - approximations at the separable value via the techniques described in [Nav08]. + approximations at the separable value via the techniques described in :cite:`Navascu_s_2008p`. The mathematical form of this hierarchy implemented here is explicitly given from equation 4.55 - in [Cos15]_. + in :cite:`cosentino_2015`. .. math:: @@ -63,7 +63,7 @@ def symmetric_extension_hierarchy( Examples ========== - It is known from [Cos15]_ that distinguishing three Bell states along with a resource state + It is known from :cite:`cosentino_2015` that distinguishing three Bell states along with a resource state :math:`|\tau_{\epsilon}\rangle` via separable measurements has the following closed form .. math:: @@ -117,7 +117,7 @@ def symmetric_extension_hierarchy( >>> symmetric_extension_hierarchy(states=states, probs=None, level=2) 0.958305796189204 >>> - >>> # As proven in [Cos15]_, the true separable value of distinguishing the + >>> # As proven in :cite:`cosentino_2015`, the true separable value of distinguishing the >>> # three Bell states is: >>> 1/3 * (2 + np.sqrt(1 - eps**2)) 0.9553418012614794 @@ -131,15 +131,6 @@ def symmetric_extension_hierarchy( .. bibliography:: :filter: docname in docnames - .. [Nav08] Navascués, Miguel. - "Pure state estimation and the characterization of entanglement." - Physical review letters 100.7 (2008): 070503. - https://arxiv.org/abs/0707.4398 - - .. [Cos15] Cosentino, Alessandro. - "Quantum State Local Distinguishability via Convex Optimization" - The University of Waterloo, Ph.D. Dissertation, 2015. - https://uwspace.uwaterloo.ca/handle/10012/9572 :param states: A list of states provided as either matrices or vectors. :param probs: Respective list of probabilities each state is selected. From 8d33a5aaf6d95782e018cd6b1b5194e24d9287f7 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 19:30:45 -0600 Subject: [PATCH 23/40] refs: state_props --- docs/articles.bib | 133 +++++++++++++++++- toqito/state_props/concurrence.py | 5 +- .../state_props/entanglement_of_formation.py | 4 +- toqito/state_props/has_symmetric_extension.py | 13 +- toqito/state_props/in_separable_ball.py | 10 +- toqito/state_props/is_ensemble.py | 6 +- toqito/state_props/is_mixed.py | 4 +- toqito/state_props/is_mutually_orthogonal.py | 4 +- .../state_props/is_mutually_unbiased_basis.py | 5 +- toqito/state_props/is_npt.py | 6 +- toqito/state_props/is_ppt.py | 4 +- toqito/state_props/is_product.py | 5 +- toqito/state_props/is_pure.py | 4 +- toqito/state_props/is_separable.py | 4 +- toqito/state_props/l1_norm_coherence.py | 6 +- toqito/state_props/log_negativity.py | 4 +- toqito/state_props/negativity.py | 4 +- toqito/state_props/purity.py | 4 +- toqito/state_props/schmidt_rank.py | 4 +- toqito/state_props/sk_vec_norm.py | 5 +- toqito/state_props/von_neumann_entropy.py | 9 +- 21 files changed, 156 insertions(+), 87 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 6bad22892..6a2a474b2 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -99,6 +99,32 @@ @misc{cvxpy_kron #Last name begins with D +@article{DiVincenzo_2000, + title={Evidence for bound entangled states with negative partial transpose}, + volume={61}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.61.062312}, + DOI={10.1103/physreva.61.062312}, + number={6}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={DiVincenzo, David P. and Shor, Peter W. and Smolin, John A. and Terhal, Barbara M. and Thapliyal, Ashish V.}, + year={2000}, + month=may } + + +@article{Doherty_2002, + title={Distinguishing Separable and Entangled States}, + volume={88}, + ISSN={1079-7114}, + url={http://dx.doi.org/10.1103/PhysRevLett.88.187904}, + DOI={10.1103/physrevlett.88.187904}, + number={18}, + journal={Physical Review Letters}, + publisher={American Physical Society (APS)}, + author={Doherty, A. C. and Parrilo, Pablo A. and Spedalieri, Federico M.}, + year={2002}, + month=apr } #Last name begins with E @article{Eldar_2003, @@ -118,6 +144,19 @@ @article{Eldar_2003 #Last name begins with F #Last name begins with G +@article{Gurvits_2002, + title={Largest separable balls around the maximally mixed bipartite quantum state}, + volume={66}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.66.062311}, + DOI={10.1103/physreva.66.062311}, + number={6}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Gurvits, Leonid and Barnum, Howard}, + year={2002}, + month=dec } + #Last name begins with H @inproceedings{Hayden_2013, @@ -378,6 +417,13 @@ @article{Pusey_2012 month=may, pages={475-478} } #Last name begins with Q +@misc{QuantikiEOF, + author = "Quantiki", + title = "Entanglement of Formation", + howpublished = "\url{https://www.quantiki.org/wiki/entanglement-formation}" + +} + @misc{QuantikiTrNorm, author = "Quantiki", title = "Trace norm", @@ -393,6 +439,22 @@ @misc{QuantikiTrDist } #Last name begins with R +@article{PhysRevA.96.052336, + title = {Logarithmic coherence: Operational interpretation of ${\ensuremath{\ell}}_{1}$-norm coherence}, + author = {Rana, Swapan and Parashar, Preeti and Winter, Andreas and Lewenstein, Maciej}, + journal = {Phys. Rev. A}, + volume = {96}, + issue = {5}, + pages = {052336}, + numpages = {11}, + year = {2017}, + month = {Nov}, + publisher = {American Physical Society}, + doi = {10.1103/PhysRevA.96.052336}, + url = {https://link.aps.org/doi/10.1103/PhysRevA.96.052336} +} + + @misc{Rigetti_docs, author = "Rigetti", title = "Forest Benchmarking", @@ -534,6 +596,13 @@ @misc{WikiClock } +@misc{WikiCNOT, + author = "Wikipedia", + title = "Controlled NOT gate", + howpublished = "\url{https://en.wikipedia.org/wiki/Controlled_NOT_gate}" + +} + @misc{WikiComm, author = "Wikipedia", title = "Commuting matrices", @@ -541,10 +610,10 @@ @misc{WikiComm } -@misc{WikiCNOT, +@misc{WikiConcurrence, author = "Wikipedia", - title = "Controlled NOT gate", - howpublished = "\url{https://en.wikipedia.org/wiki/Controlled_NOT_gate}" + title = "Concurrence (quantum computing)", + howpublished = "\url{https://en.wikipedia.org/wiki/Concurrence_(quantum_computing)}" } @@ -651,6 +720,13 @@ @misc{WikiInnerProd } +@misc{WikiNeg, + author = "Wikipedia", + title = "Negativity", + howpublished = "\url{https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics)}" + +} + @misc{WikiMajorization, author = "Wikipedia", title = "Majorization", @@ -658,6 +734,20 @@ @misc{WikiMajorization } +@misc{WikiMixedSt, + author = "Wikipedia", + title = "Quantum State - Mixed States", + howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_state#Mixed_states}" + +} + +@misc{WikiMUB, + author = "Wikipedia", + title = "Mutually unbiased bases", + howpublished = "\url{hhttps://en.wikipedia.org/wiki/Mutually_unbiased_bases}" + +} + @misc{WikiNorm, author = "Wikipedia", title = "Outer product", @@ -665,6 +755,14 @@ @misc{WikiNorm } + +@misc{WikiOrthog, + author = "Wikipedia", + title = "Orthogonality", + howpublished = "\url{https://en.wikipedia.org/wiki/Orthogonality}" + +} + @misc{WikiOuterProd, author = "Wikipedia", title = "Normal matrix", @@ -728,6 +826,7 @@ @misc{WikiPOVM } + @misc{WikiProjMat, author = "Wikipedia", title = "Projection matrix", @@ -735,6 +834,20 @@ @misc{WikiProjMat } +@misc{WikiPureSt, + author = "Wikipedia", + title = "Quantum State - Pure States", + howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_state#Pure_states_of_wave_functions}" + +} + +@misc{WikiPurity, + author = "Wikipedia", + title = "Purity (quantum mechanics)", + howpublished = "\url{https://en.wikipedia.org/wiki/Purity_(quantum_mechanics)}" + +} + @misc{WikiQuantMeas, author = "Wikipedia", title = "Measurement in quantum mechanics", @@ -742,6 +855,7 @@ @misc{WikiQuantMeas } + @misc{WikiReductionCrit, author = "Wikipedia", title = "Reduction Criterion", @@ -756,6 +870,13 @@ @misc{WikiScmidtDecomp } +@misc{WikiSepSt, + author = "Wikipedia", + title = "Separable state", + howpublished = "\url{https://en.wikipedia.org/wiki/Separable_state}" + +} + @misc{WikiSqMat, author = "Wikipedia", title = "Square matrix", @@ -784,6 +905,12 @@ @misc{WikiUniMat } +@misc{WikiUVonNeumann, + author = "Wikipedia", + title = "Von Neumann entropy", + howpublished = "\url{https://en.wikipedia.org/wiki/Von_Neumann_entropy}" + +} #Last name begins with X #Last name begins with Y diff --git a/toqito/state_props/concurrence.py b/toqito/state_props/concurrence.py index 319b14e7f..3f92443ef 100644 --- a/toqito/state_props/concurrence.py +++ b/toqito/state_props/concurrence.py @@ -6,7 +6,7 @@ def concurrence(rho: np.ndarray) -> float: r""" - Calculate the concurrence of a bipartite state [WikCon]_. + Calculate the concurrence of a bipartite state :cite:`WikiConcurrence`. The concurrence of a bipartite state :math:`\rho` is defined as @@ -68,9 +68,6 @@ def concurrence(rho: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikCon] Wikipedia page for concurrence (quantum computing) - https://en.wikipedia.org/wiki/Concurrence_(quantum_computing) - :raises ValueError: If system is not bipartite. :param rho: The bipartite system specified as a matrix. :return: The concurrence of the bipartite state :math:`\rho`. diff --git a/toqito/state_props/entanglement_of_formation.py b/toqito/state_props/entanglement_of_formation.py index 91997f17d..16968cc45 100644 --- a/toqito/state_props/entanglement_of_formation.py +++ b/toqito/state_props/entanglement_of_formation.py @@ -9,7 +9,7 @@ def entanglement_of_formation(rho: np.ndarray, dim: list[int] | int = None) -> float: r""" - Compute entanglement-of-formation of a bipartite quantum state [WikEOF]_. + Compute entanglement-of-formation of a bipartite quantum state :cite:`QuantikiEOF`. Entanglement-of-formation is the entropy of formation of the bipartite quantum state :code:`rho`. Note that this function currently only supports @@ -49,8 +49,6 @@ def entanglement_of_formation(rho: np.ndarray, dim: list[int] | int = None) -> f .. bibliography:: :filter: docname in docnames - .. [WikEOF] Quantiki: Entanglement-of-formation - https://www.quantiki.org/wiki/entanglement-formation :raises ValueError: If matrices have improper dimension. :param rho: A matrix or vector. diff --git a/toqito/state_props/has_symmetric_extension.py b/toqito/state_props/has_symmetric_extension.py index a20c7e945..1d1a6fe69 100644 --- a/toqito/state_props/has_symmetric_extension.py +++ b/toqito/state_props/has_symmetric_extension.py @@ -18,7 +18,7 @@ def has_symmetric_extension( tol: float = 1e-4, ) -> bool: r""" - Determine whether there exists a symmetric extension for a given quantum state. [DPS02]_. + Determine whether there exists a symmetric extension for a given quantum state :cite:`Doherty_2002`. Determining whether an operator possesses a symmetric extension at some level :code:`level` can be used as a check to determine if the operator is entangled or not. @@ -30,7 +30,7 @@ def has_symmetric_extension( 2-qubit symmetric extension: - In [CJKLZB14]_, it was shown that a 2-qubit state :math:`\rho_{AB}` has a + In :cite:`Chen_2014`, it was shown that a 2-qubit state :math:`\rho_{AB}` has a symmetric extension if and only if .. math:: @@ -85,15 +85,6 @@ def has_symmetric_extension( .. bibliography:: :filter: docname in docnames - .. [DPS02] Doherty, Andrew C., Pablo A. Parrilo, and Federico M. Spedalieri. - "Distinguishing separable and entangled states." - Physical Review Letters 88.18 (2002): 187904. - https://arxiv.org/abs/quant-ph/0112007 - - .. [CJKLZB14] Chen, J., Ji, Z., Kribs, D., Lütkenhaus, N., & Zeng, B. - "Symmetric extension of two-qubit states." - Physical Review A 90.3 (2014): 032318. - https://arxiv.org/abs/1310.3530 :raises ValueError: If dimension does not evenly divide matrix length. :param rho: A matrix or vector. diff --git a/toqito/state_props/in_separable_ball.py b/toqito/state_props/in_separable_ball.py index efc6e7c76..725bcecbb 100644 --- a/toqito/state_props/in_separable_ball.py +++ b/toqito/state_props/in_separable_ball.py @@ -4,11 +4,11 @@ def in_separable_ball(mat: np.ndarray) -> bool: r""" - Check whether an operator is contained in ball of separability [GB02]_. + Check whether an operator is contained in ball of separability :cite:`Gurvits_2002`. Determines whether :code:`mat` is contained within the ball of separable operators centered at the identity matrix (i.e. the maximally-mixed state). The size of this ball was derived in - [GB02]_. + :cite:`Gurvits_2002`. This function can be used as a method for separability testing of states in certain scenarios. @@ -55,10 +55,6 @@ def in_separable_ball(mat: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [GB02] Gurvits, Leonid, and Barnum, Howard. - "Largest separable balls around the maximally mixed bipartite quantum state." - Physical Review A 66.6 (2002): 062311. - https://arxiv.org/pdf/quant-ph/0204159.pdf :param mat: A positive semidefinite matrix or a vector of the eigenvalues of a positive semidefinite matrix. @@ -83,5 +79,5 @@ def in_separable_ball(mat: np.ndarray) -> bool: mat = mat / np.trace(mat) # The following check relies on the fact that we scaled the matrix so that trace(mat) = 1. - # The following condition is then exactly the condition mentioned in [GB02]_. + # The following condition is then exactly the condition mentioned in :cite:`Gurvits_2002`. return np.linalg.norm(mat / np.linalg.norm(mat, "fro") ** 2 - np.eye(max_dim), "fro") <= 1 diff --git a/toqito/state_props/is_ensemble.py b/toqito/state_props/is_ensemble.py index 1ca9eb321..c6231ac37 100644 --- a/toqito/state_props/is_ensemble.py +++ b/toqito/state_props/is_ensemble.py @@ -6,7 +6,7 @@ def is_ensemble(states: list[np.ndarray]) -> bool: r""" - Determine if a set of states constitute an ensemble [WatEns18]_. + Determine if a set of states constitute an ensemble (Section: Ensemble Of Quantum States from cite:`watrous_2018`). An ensemble of quantum states is defined by a function @@ -47,10 +47,6 @@ def is_ensemble(states: list[np.ndarray]) -> bool: .. bibliography:: :filter: docname in docnames - .. [WatEns18] Watrous, John. - "The theory of quantum information." - Section: "Ensemble of quantum states". - Cambridge University Press, 2018. :param states: The list of states to check. :return: :code:`True` if states form an ensemble and :code:`False` otherwise. diff --git a/toqito/state_props/is_mixed.py b/toqito/state_props/is_mixed.py index daaca5c2e..38bb0be91 100644 --- a/toqito/state_props/is_mixed.py +++ b/toqito/state_props/is_mixed.py @@ -6,7 +6,7 @@ def is_mixed(state: np.ndarray) -> bool: r""" - Determine if a given quantum state is mixed [WikMix]_. + Determine if a given quantum state is mixed :cite:`WikiMixedSt`. A mixed state by definition is a state that is not pure. @@ -36,8 +36,6 @@ def is_mixed(state: np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikMix] Wikipedia: Quantum state - Mixed states - https://en.wikipedia.org/wiki/Quantum_state#Mixed_states :param state: The density matrix representing the quantum state. :return: :code:`True` if state is mixed and :code:`False` otherwise. diff --git a/toqito/state_props/is_mutually_orthogonal.py b/toqito/state_props/is_mutually_orthogonal.py index de2765d3e..dfba913e4 100644 --- a/toqito/state_props/is_mutually_orthogonal.py +++ b/toqito/state_props/is_mutually_orthogonal.py @@ -8,7 +8,7 @@ def is_mutually_orthogonal(vec_list: list[np.ndarray | list[float | Any]]) -> bool: r""" - Check if list of vectors are mutually orthogonal [WikOrthog]_. + Check if list of vectors are mutually orthogonal :cite:`WikiOrthog`. We say that two bases @@ -53,8 +53,6 @@ def is_mutually_orthogonal(vec_list: list[np.ndarray | list[float | Any]]) -> bo .. bibliography:: :filter: docname in docnames - .. [WikOrthog] Wikipedia: Orthogonality - https://en.wikipedia.org/wiki/Orthogonality :raises ValueError: If at least two vectors are not provided. :param vec_list: The list of vectors to check. diff --git a/toqito/state_props/is_mutually_unbiased_basis.py b/toqito/state_props/is_mutually_unbiased_basis.py index 1e6f4d484..7c69c8995 100644 --- a/toqito/state_props/is_mutually_unbiased_basis.py +++ b/toqito/state_props/is_mutually_unbiased_basis.py @@ -8,7 +8,7 @@ def is_mutually_unbiased_basis(vec_list: list[np.ndarray | list[float | Any]]) -> bool: r""" - Check if list of vectors constitute a mutually unbiased basis [WikMUB]_. + Check if list of vectors constitute a mutually unbiased basis :cite:`WikiMUB`. We say that two orthonormal bases @@ -75,8 +75,7 @@ def is_mutually_unbiased_basis(vec_list: list[np.ndarray | list[float | Any]]) - .. bibliography:: :filter: docname in docnames - .. [WikMUB] Wikipedia: Mutually unbiased bases - https://en.wikipedia.org/wiki/Mutually_unbiased_bases + :raises ValueError: If at least two vectors are not provided. :param vec_list: The list of vectors to check. diff --git a/toqito/state_props/is_npt.py b/toqito/state_props/is_npt.py index 408e61420..1ad70eb6c 100644 --- a/toqito/state_props/is_npt.py +++ b/toqito/state_props/is_npt.py @@ -8,11 +8,11 @@ def is_npt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: float = None) -> bool: r""" - Determine whether or not a matrix has negative partial transpose [WikPPT]_. + Determine whether or not a matrix has negative partial transpose :cite:`WikiPeresHorodecki`. Yields either :code:`True` or :code:`False`, indicating that :code:`mat` does or does not have negative partial transpose (within numerical error). The variable :code:`mat` is assumed to act - on bipartite space. [NPT]_ + on bipartite space. :cite:`DiVincenzo_2000` A state has negative partial transpose if it does not have positive partial transpose. @@ -22,8 +22,6 @@ def is_npt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: floa .. bibliography:: :filter: docname in docnames - .. [NPT] "Evidence for bound entangled states with negative partial transpose." - Physical Review A 61.6 (2000): 062312. :param mat: A square matrix. :param sys: Scalar or vector indicating which subsystems the transpose diff --git a/toqito/state_props/is_ppt.py b/toqito/state_props/is_ppt.py index 9ac552a2f..7cac07f32 100644 --- a/toqito/state_props/is_ppt.py +++ b/toqito/state_props/is_ppt.py @@ -9,7 +9,7 @@ def is_ppt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: float = None) -> bool: r""" - Determine whether or not a matrix has positive partial transpose [WikPPT]_. + Determine whether or not a matrix has positive partial transpose :cite:`WikiPeresHorodecki`. Yields either :code:`True` or :code:`False`, indicating that :code:`mat` does or does not have positive partial transpose (within numerical error). The variable :code:`mat` is assumed to act @@ -68,8 +68,6 @@ def is_ppt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: floa .. bibliography:: :filter: docname in docnames - .. [WikPPT] Quantiki: Positive partial transpose - https://www.quantiki.org/wiki/positive-partial-transpose :param mat: A square matrix. :param sys: Scalar or vector indicating which subsystems the transpose diff --git a/toqito/state_props/is_product.py b/toqito/state_props/is_product.py index 7b657dd8c..5682b8338 100644 --- a/toqito/state_props/is_product.py +++ b/toqito/state_props/is_product.py @@ -9,7 +9,7 @@ def is_product(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> bool | np.ndarray: r""" - Determine if a given vector is a product state [WikProdState]_. + Determine if a given vector is a product state :cite:`WikiSepSt`. If the input is deemed to be product, then the product decomposition is also returned. @@ -49,8 +49,7 @@ def is_product(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> boo .. bibliography:: :filter: docname in docnames - .. [WikProdState] Wikipedia: Product state - https://en.wikipedia.org/wiki/Product_state + :param rho: The vector or matrix to check. :param dim: The dimension of the input. :return: :code:`True` if :code:`rho` is a product vector and :code:`False` otherwise. diff --git a/toqito/state_props/is_pure.py b/toqito/state_props/is_pure.py index 0637f2550..9ec8feb55 100644 --- a/toqito/state_props/is_pure.py +++ b/toqito/state_props/is_pure.py @@ -6,7 +6,7 @@ def is_pure(state: list[np.ndarray] | np.ndarray) -> bool: r""" - Determine if a given state is pure or list of states are pure [WikIsPure]_. + Determine if a given state is pure or list of states are pure :cite:`WikiPureSt`. A state is said to be pure if it is a density matrix with rank equal to 1. Equivalently, the state :math:`\rho` is pure if there exists a unit vector :math:`u` such that: @@ -62,8 +62,6 @@ def is_pure(state: list[np.ndarray] | np.ndarray) -> bool: .. bibliography:: :filter: docname in docnames - .. [WikIsPure] Wikipedia: Quantum state - Pure states - https://en.wikipedia.org/wiki/Quantum_state#Pure_states :param state: The density matrix representing the quantum state or a list of density matrices representing quantum states. diff --git a/toqito/state_props/is_separable.py b/toqito/state_props/is_separable.py index f2ddb4a13..4ec66395c 100644 --- a/toqito/state_props/is_separable.py +++ b/toqito/state_props/is_separable.py @@ -16,7 +16,7 @@ def is_separable( state: np.ndarray, dim: None | int | list[int] = None, level: int = 2, tol: float = 1e-8 ) -> bool: r""" - Determine if a given state (given as a density matrix) is a separable state [WikSepState]_. + Determine if a given state (given as a density matrix) is a separable state :cite:`WikiSepSt`. Examples ========== @@ -57,8 +57,6 @@ def is_separable( .. bibliography:: :filter: docname in docnames - .. [WikSepState] Wikipedia: Separable state - https://en.wikipedia.org/wiki/Separable_state :raises ValueError: If dimension is not specified. :param state: The matrix to check. diff --git a/toqito/state_props/l1_norm_coherence.py b/toqito/state_props/l1_norm_coherence.py index ab7cc0be3..1e2e74b64 100644 --- a/toqito/state_props/l1_norm_coherence.py +++ b/toqito/state_props/l1_norm_coherence.py @@ -6,7 +6,7 @@ def l1_norm_coherence(rho: np.ndarray) -> float: r""" - Compute the l1-norm of coherence of a quantum state [RPWL17]_. + Compute the l1-norm of coherence of a quantum state :cite:`PhysRevA.96.052336`. The :math:`\ell_1`-norm of coherence of a quantum state :math:`\rho` is defined as @@ -44,10 +44,6 @@ def l1_norm_coherence(rho: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [RPWL17] "Logarithmic coherence: Operational interpretation of 1-norm coherence" - Rana, Swapan, Parashar, Preeti, Winter, Andreas, Lewenstein, Maciej - Physical Review A 96.5 (2017): 052336. - https://arxiv.org/pdf/1612.09234.pdf :param rho: A matrix or vector. :return: The l1-norm coherence of :code:`rho`. diff --git a/toqito/state_props/log_negativity.py b/toqito/state_props/log_negativity.py index 6d45211c8..e4a692df7 100644 --- a/toqito/state_props/log_negativity.py +++ b/toqito/state_props/log_negativity.py @@ -10,7 +10,7 @@ def log_negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: r""" - Compute the log-negativity of a bipartite quantum state [WikLogNeg]_. + Compute the log-negativity of a bipartite quantum state :cite:`WikiNeg`. The log-negativity of a subsystem can be defined in terms of a density matrix :math:`\rho`: @@ -41,8 +41,6 @@ def log_negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: .. bibliography:: :filter: docname in docnames - .. [WikLogNeg] Wikipedia page for negativity (quantum mechanics): - https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics) :raises ValueError: If the input matrix is not a density matrix. :param rho: A density matrix of a pure state vector. diff --git a/toqito/state_props/negativity.py b/toqito/state_props/negativity.py index 27495505a..22d3d1fe9 100644 --- a/toqito/state_props/negativity.py +++ b/toqito/state_props/negativity.py @@ -10,7 +10,7 @@ def negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: r""" - Compute the negativity of a bipartite quantum state [WikNeg]_. + Compute the negativity of a bipartite quantum state :cite:`WikiNeg`. The negativity of a subsystem can be defined in terms of a density matrix :math:`\rho`: @@ -42,8 +42,6 @@ def negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: .. bibliography:: :filter: docname in docnames - .. [WikNeg] Wikipedia page for negativity (quantum mechanics): - https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics) :raises ValueError: If dimension of matrix is invalid. :param rho: A density matrix of a pure state vector. diff --git a/toqito/state_props/purity.py b/toqito/state_props/purity.py index 8e33921f0..03f3cd753 100644 --- a/toqito/state_props/purity.py +++ b/toqito/state_props/purity.py @@ -6,7 +6,7 @@ def purity(rho: np.ndarray) -> float: r""" - Compute the purity of a quantum state [WikPurity]_. + Compute the purity of a quantum state :cite:`WikiPurity`. The negativity of a subsystem can be defined in terms of a density matrix :math:`\rho`: The purity of a quantum state :math:`\rho` is defined as @@ -49,8 +49,6 @@ def purity(rho: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikPurity] Wikipedia page for purity (quantum mechanics): - https://en.wikipedia.org/wiki/Purity_(quantum_mechanics) :raises ValueError: If matrix is not density operator. :param rho: A density matrix of a pure state vector. diff --git a/toqito/state_props/schmidt_rank.py b/toqito/state_props/schmidt_rank.py index db3e7005d..88b778bce 100644 --- a/toqito/state_props/schmidt_rank.py +++ b/toqito/state_props/schmidt_rank.py @@ -8,7 +8,7 @@ def schmidt_rank(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> float: r""" - Compute the Schmidt rank [WikSR]_. + Compute the Schmidt rank :cite:`WikiScmidtDecomp`. For complex Euclidean spaces :math:`\mathcal{X}` and :math:`\mathcal{Y}`, a pure state :math:`u \in \mathcal{X} \otimes \mathcal{Y}` possesses an expansion of the form: @@ -77,8 +77,6 @@ def schmidt_rank(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> f .. bibliography:: :filter: docname in docnames - .. [WikSR] Wikipedia: Schmidt rank - https://en.wikipedia.org/wiki/Schmidt_decomposition#Schmidt_rank_and_entanglement :param rho: A bipartite vector or matrix to have its Schmidt rank computed. :param dim: A 1-by-2 vector or matrix. diff --git a/toqito/state_props/sk_vec_norm.py b/toqito/state_props/sk_vec_norm.py index 26014400f..0d1bc5016 100644 --- a/toqito/state_props/sk_vec_norm.py +++ b/toqito/state_props/sk_vec_norm.py @@ -8,7 +8,7 @@ def sk_vector_norm(rho: np.ndarray, k: int = 1, dim: int | list[int] = None) -> float: r""" - Compute the S(k)-norm of a vector [NJDK09]_. + Compute the S(k)-norm of a vector :cite:`Johnston_2010`. The :math:`S(k)`-norm of of a vector :math:`|v \rangle` is defined as: @@ -44,9 +44,6 @@ def sk_vector_norm(rho: np.ndarray, k: int = 1, dim: int | list[int] = None) -> .. bibliography:: :filter: docname in docnames - .. [NJDK09] "A Family of Norms With Applications In Quantum Information Theory" - Nathaniel Johnston, David W. Kribs - https://arxiv.org/abs/0909.3907 :param rho: A vector. :param k: An int. diff --git a/toqito/state_props/von_neumann_entropy.py b/toqito/state_props/von_neumann_entropy.py index c58384c46..07e2eb659 100644 --- a/toqito/state_props/von_neumann_entropy.py +++ b/toqito/state_props/von_neumann_entropy.py @@ -6,7 +6,7 @@ def von_neumann_entropy(rho: np.ndarray) -> float: r""" - Compute the von Neumann entropy of a density matrix [WikVent]_. [WatVec]_. + Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, Section: "Definitions of quantum entropic functions" from :cite:`watrous_2018`). Let :math:`P \in \text{Pos}(\mathcal{X})` be a positive semidefinite operator, for a complex Euclidean space :math:`\mathcal{X}`. Then one defines the *von Neumann entropy* as @@ -76,13 +76,6 @@ def von_neumann_entropy(rho: np.ndarray) -> float: .. bibliography:: :filter: docname in docnames - .. [WikVent] Wikipedia: Von Neumann entropy - https://en.wikipedia.org/wiki/Von_Neumann_entropy - - .. [WatVec] Watrous, John. - "The theory of quantum information." - Section: "Definitions of quantum entropic functions". - Cambridge University Press, 2018. :param rho: Density operator. :return: The von Neumann entropy of :code:`rho`. From e5fe07e974d35078cf561de7aade4584cddd9620 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 21:08:09 -0600 Subject: [PATCH 24/40] refs: states --- docs/articles.bib | 191 ++++++++++++++++++++++++++++++++- toqito/states/basis.py | 4 +- toqito/states/bell.py | 5 +- toqito/states/brauer.py | 4 +- toqito/states/breuer.py | 6 +- toqito/states/chessboard.py | 12 +-- toqito/states/domino.py | 11 +- toqito/states/gen_bell.py | 5 +- toqito/states/ghz.py | 7 +- toqito/states/gisin.py | 7 +- toqito/states/horodecki.py | 17 +-- toqito/states/isotropic.py | 5 +- toqito/states/max_entangled.py | 4 +- toqito/states/max_mixed.py | 4 +- toqito/states/singlet.py | 6 +- toqito/states/tile.py | 6 +- toqito/states/w_state.py | 7 +- toqito/states/werner.py | 6 +- 18 files changed, 219 insertions(+), 88 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 6a2a474b2..46df55ee1 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -1,6 +1,14 @@ #File for all article, arxiv and other web references #Last name begins with A +@misc{AaronsonMaxMixed, + author = "Wikipedia", + title = "Lecture 6: {M}ixed {S}tates", + howpublished = "\url{https://www.scottaaronson.com/qclec/6.pdf}" + +} + + @misc{arunachalam2017quantum, title={Quantum hedging in two-round prover-verifier interactions}, author={Srinivasan Arunachalam and Abel Molina and Vincent Russo}, @@ -26,8 +34,64 @@ @article{Bandyopadhyay_2014 year={2014}, month=feb } +@article{Bennett_1999, + title={Quantum nonlocality without entanglement}, + volume={59}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.59.1070}, + DOI={10.1103/physreva.59.1070}, + number={2}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Bennett, Charles H. and DiVincenzo, David P. and Fuchs, Christopher A. and Mor, Tal and Rains, Eric and Shor, Peter W. and Smolin, John A. and Wootters, William K.}, + year={1999}, + month=feb, pages={1070-1091} } + +@article{Bennett_1999upb, + title={Unextendible Product Bases and Bound Entanglement}, + volume={82}, + ISSN={1079-7114}, + url={http://dx.doi.org/10.1103/PhysRevLett.82.5385}, + DOI={10.1103/physrevlett.82.5385}, + number={26}, + journal={Physical Review Letters}, + publisher={American Physical Society (APS)}, + author={Bennett, Charles H. and DiVincenzo, David P. and Mor, Tal and Shor, Peter W. and Smolin, John A. and Terhal, Barbara M.}, + year={1999}, + month=jun, pages={5385-5388} } + + +@article{Breuer_2006, + title={Optimal Entanglement Criterion for Mixed Quantum States}, + volume={97}, + ISSN={1079-7114}, + url={http://dx.doi.org/10.1103/PhysRevLett.97.080501}, + DOI={10.1103/physrevlett.97.080501}, + number={8}, + journal={Physical Review Letters}, + publisher={American Physical Society (APS)}, + author={Breuer, Heinz-Peter}, + year={2006}, + month=aug } + #Last name begins with C +@article{PhysRevLett.89.100402, + title = {$N$-Particle $N$-Level Singlet States: Some Properties and Applications}, + author = {Cabello, Ad\'an}, + journal = {Phys. Rev. Lett.}, + volume = {89}, + issue = {10}, + pages = {100402}, + numpages = {4}, + year = {2002}, + month = {Aug}, + publisher = {American Physical Society}, + doi = {10.1103/PhysRevLett.89.100402}, + url = {https://link.aps.org/doi/10.1103/PhysRevLett.89.100402} +} + + @article{Chen_2014, title={Symmetric extension of two-qubit states}, volume={90}, @@ -54,6 +118,19 @@ @article{Choi_1992 abstract = {We consider a class of positive linear maps in the three-dimensional matrix algebra, which are generalizations of the positive linear map constructed by Choi in the relation with positive semidefinite biquadratic forms. We find conditions for which such maps are completely positive, completely copositive, decomposable, and two-positive.} } +@article{Chru_ci_ski_2011, + title={On the symmetry of the seminal Horodecki state}, + volume={375}, + ISSN={0375-9601}, + url={http://dx.doi.org/10.1016/j.physleta.2010.11.069}, + DOI={10.1016/j.physleta.2010.11.069}, + number={3}, + journal={Physics Letters A}, + publisher={Elsevier BV}, + author={Chruściński, Dariusz and Kossakowski, Andrzej}, + year={2011}, + month=jan, pages={434-436} } + @misc{cleve2008strong, title={Strong Parallel Repetition Theorem for Quantum XOR Proof Systems}, author={Richard Cleve and William Slofstra and Falk Unger and Sarvagya Upadhyay}, @@ -126,6 +203,19 @@ @article{Doherty_2002 year={2002}, month=apr } +@article{D_r_2000, + title={Three qubits can be entangled in two inequivalent ways}, + volume={62}, + ISSN={1094-1622}, + url={http://dx.doi.org/10.1103/PhysRevA.62.062314}, + DOI={10.1103/physreva.62.062314}, + number={6}, + journal={Physical Review A}, + publisher={American Physical Society (APS)}, + author={Dür, W. and Vidal, G. and Cirac, J. I.}, + year={2000}, + month=nov } + #Last name begins with E @article{Eldar_2003, title={A semidefinite programming approach to optimal unambiguous discrimination of quantum states}, @@ -144,6 +234,28 @@ @article{Eldar_2003 #Last name begins with F #Last name begins with G +@misc{greenberger2007going, + title={Going Beyond Bell's Theorem}, + author={Daniel M. Greenberger and Michael A. Horne and Anton Zeilinger}, + year={2007}, + eprint={0712.0921}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} + +@article{GISIN1996151, +title = {Hidden quantum nonlocality revealed by local filters}, +journal = {Physics Letters A}, +volume = {210}, +number = {3}, +pages = {151-156}, +year = {1996}, +issn = {0375-9601}, +doi = {https://doi.org/10.1016/S0375-9601(96)80001-6}, +url = {https://www.sciencedirect.com/science/article/pii/S0375960196800016}, +author = {N. Gisin}, +} + @article{Gurvits_2002, title={Largest separable balls around the maximally mixed bipartite quantum state}, volume={66}, @@ -181,6 +293,28 @@ @article{Heinosaari_2020 author={Heinosaari, Teiko and Jivulescu, Maria Anastasia and Nechita, Ion}, year={2020}, month=apr } + +@article{Horodecki_1997, + title={Separability criterion and inseparable mixed states with positive partial transposition}, + volume={232}, + ISSN={0375-9601}, + url={http://dx.doi.org/10.1016/S0375-9601(97)00416-7}, + DOI={10.1016/s0375-9601(97)00416-7}, + number={5}, + journal={Physics Letters A}, + publisher={Elsevier BV}, + author={Horodecki, Pawel}, + year={1997}, + month=aug, pages={333-339} } + +@misc{horodecki1998reduction, + title={Reduction criterion of separability and limits for a class of protocols of entanglement distillation}, + author={Michal Horodecki and Pawel Horodecki}, + year={1998}, + eprint={quant-ph/9708015}, + archivePrefix={arXiv}, + primaryClass={quant-ph} +} #Last name begins with I #Last name begins with J @@ -453,6 +587,21 @@ @article{PhysRevA.96.052336 doi = {10.1103/PhysRevA.96.052336}, url = {https://link.aps.org/doi/10.1103/PhysRevA.96.052336} } +@article{PhysRevA.40.4277, + title = {Quantum states with Einstein-Podolsky-Rosen correlations admitting a hidden-variable model}, + author = {Werner, Reinhard F.}, + journal = {Phys. Rev. A}, + volume = {40}, + issue = {8}, + pages = {4277--4281}, + numpages = {0}, + year = {1989}, + month = {Oct}, + publisher = {American Physical Society}, + doi = {10.1103/PhysRevA.40.4277}, + url = {https://link.aps.org/doi/10.1103/PhysRevA.40.4277} +} + @misc{Rigetti_docs, @@ -505,7 +654,19 @@ @misc{SO_43884189 } - +@article{Sych_2009, +doi = {10.1088/1367-2630/11/1/013006}, +url = {https://dx.doi.org/10.1088/1367-2630/11/1/013006}, +year = {2009}, +month = {jan}, +publisher = {}, +volume = {11}, +number = {1}, +pages = {013006}, +author = {Denis Sych and Gerd Leuchs}, +title = {A complete basis of generalized Bell states}, +journal = {New Journal of Physics}, +} #Last name begins with T @@ -568,6 +729,27 @@ @misc{WikiAsymmOp } +@misc{WikiBellSt, + author = "Wikipedia", + title = "Bell State", + howpublished = "\url{https://en.wikipedia.org/wiki/Bell_state}" + +} + +@misc{WikiBraKet, + author = "Wikipedia", + title = "Bra-ket notation", + howpublished = "\url{https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation}" + +} + +@misc{WikiBrauer, + author = "Wikipedia", + title = "Brauer Algebra", + howpublished = "\url{https://en.wikipedia.org/wiki/Brauer_algebra}" + +} + @misc{WikiBures, author = "Wikipedia", title = "Bures distance", @@ -734,6 +916,13 @@ @misc{WikiMajorization } +@misc{WikiMaxEnt, + author = "Wikipedia", + title = "Quantum entanglement", + howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_entanglement}" + +} + @misc{WikiMixedSt, author = "Wikipedia", title = "Quantum State - Mixed States", diff --git a/toqito/states/basis.py b/toqito/states/basis.py index e51dc021b..47b309ac1 100644 --- a/toqito/states/basis.py +++ b/toqito/states/basis.py @@ -5,7 +5,7 @@ def basis(dim: int, pos: int) -> np.ndarray: r""" - Obtain the ket of dimension :code:`dim` [WikKet]_. + Obtain the ket of dimension :code:`dim` :cite:`WikiBraKet`. Examples ========== @@ -37,8 +37,6 @@ def basis(dim: int, pos: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikKet] Wikipedia page for bra–ket notation: - https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation :raises ValueError: If the input position is not in the range [0, dim - 1]. :param dim: The dimension of the column vector. diff --git a/toqito/states/bell.py b/toqito/states/bell.py index 8cfecaf32..b9e5ab056 100644 --- a/toqito/states/bell.py +++ b/toqito/states/bell.py @@ -6,7 +6,7 @@ def bell(idx: int) -> np.ndarray: r""" - Produce a Bell state [WikBell]_. + Produce a Bell state :cite:`WikiBellSt`. Returns one of the following four Bell states depending on the value of :code:`idx`: @@ -45,8 +45,7 @@ def bell(idx: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikBell] Wikipedia: Bell state - https://en.wikipedia.org/wiki/Bell_state + :raises ValueError: If :code:`idx` is not an integer. :param idx: A parameter in [0, 1, 2, 3] diff --git a/toqito/states/brauer.py b/toqito/states/brauer.py index 025e81455..1d14df2c7 100644 --- a/toqito/states/brauer.py +++ b/toqito/states/brauer.py @@ -8,7 +8,7 @@ def brauer(dim: int, p_val: int) -> np.ndarray: r""" - Produce all Brauer states [WikBrauer]_. + Produce all Brauer states :cite:`WikiBrauer`. Produce a matrix whose columns are all of the (unnormalized) "Brauer" states: states that are the :code:`p_val`-fold tensor product of the standard maximally-entangled pure state on @@ -54,8 +54,6 @@ def brauer(dim: int, p_val: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [WikBrauer] Wikipedia: Brauer algebra - https://en.wikipedia.org/wiki/Brauer_algebra :param dim: Dimension of each local subsystem :param p_val: Half of the number of parties (i.e., the state that this function computes will diff --git a/toqito/states/breuer.py b/toqito/states/breuer.py index 2a81920ab..14368dfd3 100644 --- a/toqito/states/breuer.py +++ b/toqito/states/breuer.py @@ -7,11 +7,11 @@ def breuer(dim: int, lam: float) -> np.ndarray: r""" - Produce a Breuer state [HPBreuer]_. + Produce a Breuer state :cite:`Breuer_2006`. Gives a Breuer bound entangled state for two qudits of local dimension :code:`dim`, with the :code:`lam` parameter describing the weight of the singlet component as described in - [HPBreuer]_. + :cite:`Breuer_2006`. This function was adapted from the QETLAB package. @@ -34,8 +34,6 @@ def breuer(dim: int, lam: float) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [HPBreuer] H-P. Breuer. Optimal entanglement criterion for mixed quantum states. - E-print: arXiv:quant-ph/0605036, 2006. :raises ValueError: Dimension must be greater than or equal to 1. :param dim: Dimension of the Breuer state. diff --git a/toqito/states/chessboard.py b/toqito/states/chessboard.py index e0a977b5a..76a0d7d68 100644 --- a/toqito/states/chessboard.py +++ b/toqito/states/chessboard.py @@ -4,9 +4,9 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = None) -> np.ndarray: r""" - Produce a chessboard state [BP00]_. + Produce a chessboard state :cite:`D_r_2000`. - Generates the chessboard state defined in [BP00]_. Note that, for certain choices of + Generates the chessboard state defined in :cite:`D_r_2000`. Note that, for certain choices of :code:`s_param` and :code:`t_param`, this state will not have positive partial transpose, and thus may not be bound entangled. @@ -43,13 +43,9 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = References ========== .. bibliography:: - :filter: docname in docnames + :filter: docname in docnames - .. [BP00] Three qubits can be entangled in two inequivalent ways. - D. Bruss and A. Peres - Phys. Rev. A, 61:30301(R), 2000 - arXiv: 991.1056 - + :param mat_params: Parameters of the chessboard state as defined in [BP00]_. :param s_param: Default is :code:`np.conj(mat_params[2]) / np.conj(mat_params[5])`. :param t_param: Default is :code:`t_param = mat_params[0] * mat_params[3] / mat_params[4]`. diff --git a/toqito/states/domino.py b/toqito/states/domino.py index 5eda6b4e6..1c9d4b141 100644 --- a/toqito/states/domino.py +++ b/toqito/states/domino.py @@ -6,7 +6,7 @@ def domino(idx: int) -> np.ndarray: r""" - Produce a domino state [CBDOM99]_, [UPB99]_. + Produce a domino state :cite:`Bennett_1999, Bennett_1999upb`. The orthonormal product basis of domino states is given as @@ -76,15 +76,6 @@ def domino(idx: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [CBDOM99] Bennett, Charles H., et al. - Quantum nonlocality without entanglement. - Phys. Rev. A, 59:1070–1091, Feb 1999. - https://arxiv.org/abs/quant-ph/9804053 - - .. [UPB99] Bennett, Charles H., et al. - "Unextendible product bases and bound entanglement." - Physical Review Letters 82.26 (1999): 5385. - https://arxiv.org/abs/quant-ph/9808030 :raises ValueError: Invalid value for :code:`idx`. :param idx: A parameter in [0, 1, 2, 3, 4, 5, 6, 7, 8] diff --git a/toqito/states/gen_bell.py b/toqito/states/gen_bell.py index beee2d92d..2dca5f7e9 100644 --- a/toqito/states/gen_bell.py +++ b/toqito/states/gen_bell.py @@ -7,7 +7,7 @@ def gen_bell(k_1: int, k_2: int, dim: int) -> np.ndarray: r""" - Produce a generalized Bell state [DL09]_. + Produce a generalized Bell state :cite:`Sych_2009`. Produces a generalized Bell state. Note that the standard Bell states can be recovered as: @@ -92,9 +92,6 @@ def gen_bell(k_1: int, k_2: int, dim: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [DL09] Sych, Denis, and Gerd Leuchs. - "A complete basis of generalized Bell states." - New Journal of Physics 11.1 (2009): 013006. :param k_1: An integer 0 <= k_1 <= n. :param k_2: An integer 0 <= k_2 <= n. diff --git a/toqito/states/ghz.py b/toqito/states/ghz.py index e4ff3334a..79e621040 100644 --- a/toqito/states/ghz.py +++ b/toqito/states/ghz.py @@ -6,10 +6,10 @@ def ghz(dim: int, num_qubits: int, coeff: list[int] = None) -> sparse: r""" - Generate a (generalized) GHZ state [GHZ07]_. + Generate a (generalized) GHZ state :cite:`greenberger2007going`. Returns a :code:`num_qubits`-partite GHZ state acting on :code:`dim` local dimensions, described - in [GHZ07]_. For example, :code:`ghz(2, 3)` returns the standard 3-qubit GHZ state on qubits. + in :cite:`greenberger2007going`. For example, :code:`ghz(2, 3)` returns the standard 3-qubit GHZ state on qubits. The output of this function is sparse. For a system of :code:`num_qubits` qubits (i.e., :code:`dim = 2`), the GHZ state can be written @@ -64,9 +64,6 @@ def ghz(dim: int, num_qubits: int, coeff: list[int] = None) -> sparse: .. bibliography:: :filter: docname in docnames - .. [GHZ07] Going beyond Bell's theorem. - D. Greenberger and M. Horne and A. Zeilinger. - E-print: [quant-ph] arXiv:0712.0921. 2007. :raises ValueError: Number of qubits is not a positive integer. :param dim: The local dimension. diff --git a/toqito/states/gisin.py b/toqito/states/gisin.py index 1be30e834..71b383670 100644 --- a/toqito/states/gisin.py +++ b/toqito/states/gisin.py @@ -4,9 +4,9 @@ def gisin(lambda_var: float, theta: float) -> np.ndarray: r""" - Produce a Gisin state [GIS96]_. + Produce a Gisin state :cite:`GISIN1996151`. - Returns the Gisin state described in [GIS96]_. Specifically, the Gisin state can be defined as: + Returns the Gisin state described in :cite:`GISIN1996151`. Specifically, the Gisin state can be defined as: .. math:: \begin{equation} @@ -45,9 +45,6 @@ def gisin(lambda_var: float, theta: float) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [GIS96] N. Gisin. - Hidden quantum nonlocality revealed by local filters. - (http://dx.doi.org/10.1016/S0375-9601(96)80001-6). 1996. :raises ValueError: If :code:`lambda_var` is not a real number. :param lambda_var: A real parameter in [0, 1]. diff --git a/toqito/states/horodecki.py b/toqito/states/horodecki.py index 8b566d659..e4291bf7f 100644 --- a/toqito/states/horodecki.py +++ b/toqito/states/horodecki.py @@ -4,7 +4,7 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: r""" - Produce a Horodecki state [HOR]_, [CHR]_. + Produce a Horodecki state :cite:`Horodecki_1997, Chru_ci_ski_2011`. Returns the Horodecki state in either :math:`(3 \otimes 3)`-dimensional space or :math:`(2 \otimes 4)`-dimensional space, depending on the dimensions in the 1-by-2 vector @@ -53,9 +53,9 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: \end{equation} .. note:: - Refer to [CHR]_ (specifically equations (1) and (2)) for more information on this state - and its properties. The 3x3 Horodecki state is defined explicitly in Section 4.1 of [HOR]_ - and the 2x4 Horodecki state is defined explicitly in Section 4.2 of [HOR]_. + Refer to :cite:`Chru_ci_ski_2011` (specifically equations (1) and (2)) for more information on this state + and its properties. The 3x3 Horodecki state is defined explicitly in Section 4.1 of :cite:`Horodecki_1997` + and the 2x4 Horodecki state is defined explicitly in Section 4.2 of :cite:`Horodecki_1997`. Examples ========== @@ -110,14 +110,7 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [HOR] P. Horodecki. - Separability criterion and inseparable mixed states with positive - partial transpose. - arXiv: 970.3004. - - .. [CHR] K. Chruscinski. - On the symmetry of the seminal Horodecki state. - arXiv: 1009.4385. + """ if a_param < 0 or a_param > 1: raise ValueError("Invalid: Argument A_PARAM must be in the interval [0, 1].") diff --git a/toqito/states/isotropic.py b/toqito/states/isotropic.py index 62dfd34bf..096b049fb 100644 --- a/toqito/states/isotropic.py +++ b/toqito/states/isotropic.py @@ -6,7 +6,7 @@ def isotropic(dim: int, alpha: float) -> np.ndarray: r""" - Produce a isotropic state [HH99]_. + Produce a isotropic state :cite:`horodecki1998reduction`. Returns the isotropic state with parameter :code:`alpha` acting on (:code:`dim`-by-:code:`dim`)-dimensional space. The isotropic state has the following form @@ -53,9 +53,6 @@ def isotropic(dim: int, alpha: float) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [HH99] Horodecki, Michał, and Paweł Horodecki. - "Reduction criterion of separability and limits for a class of - distillation protocols." Physical Review A 59.6 (1999): 4206. :param dim: The local dimension. :param alpha: The parameter of the isotropic state. diff --git a/toqito/states/max_entangled.py b/toqito/states/max_entangled.py index e63bbaf89..992967838 100644 --- a/toqito/states/max_entangled.py +++ b/toqito/states/max_entangled.py @@ -7,7 +7,7 @@ def max_entangled( dim: int, is_sparse: bool = False, is_normalized: bool = True ) -> [np.ndarray, sp.sparse.dia_matrix]: r""" - Produce a maximally entangled bipartite pure state [WikEnt]_. + Produce a maximally entangled bipartite pure state :cite:`WikiMaxEnt`. Produces a maximally entangled pure state as above that is sparse if :code:`is_sparse = True` and is full if :code:`is_sparse = False`. The pure state is normalized to have Euclidean norm 1 @@ -50,8 +50,6 @@ def max_entangled( .. bibliography:: :filter: docname in docnames - .. [WikEnt] Wikipedia: Quantum entanglement - https://en.wikipedia.org/wiki/Quantum_entanglement :param dim: Dimension of the entangled state. :param is_sparse: `True` if vector is spare and `False` otherwise. diff --git a/toqito/states/max_mixed.py b/toqito/states/max_mixed.py index bc0c82ccb..8ce3c103f 100644 --- a/toqito/states/max_mixed.py +++ b/toqito/states/max_mixed.py @@ -6,7 +6,7 @@ def max_mixed(dim: int, is_sparse: bool = False) -> [np.ndarray, sparse.dia_matrix]: r""" - Produce the maximally mixed state [AAR6]_. + Produce the maximally mixed state :cite:`AaronsonMaxMixed`. Produces the maximally mixed state on of :code:`dim` dimensions. The maximally mixed state is defined as @@ -61,8 +61,6 @@ def max_mixed(dim: int, is_sparse: bool = False) -> [np.ndarray, sparse.dia_matr .. bibliography:: :filter: docname in docnames - .. [AAR6] Scott Aaronson: Lecture 6, Thurs Feb 2: Mixed States - https://www.scottaaronson.com/qclec/6.pdf :param dim: Dimension of the entangled state. :param is_sparse: `True` if vector is spare and `False` otherwise. diff --git a/toqito/states/singlet.py b/toqito/states/singlet.py index 834e556b8..50a2c025b 100644 --- a/toqito/states/singlet.py +++ b/toqito/states/singlet.py @@ -6,7 +6,7 @@ def singlet(dim: int) -> np.ndarray: r""" - Produce a generalized singlet state acting on two n-dimensional systems [Gsinglet]_. + Produce a generalized singlet state acting on two n-dimensional systems :cite:`PhysRevLett.89.100402`. Examples ========== @@ -66,10 +66,6 @@ def singlet(dim: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [Gsinglet] Cabello, Adan, - "N-particle N-level singlet states: Some properties and applications". - Phys. Rev. Lett., 89 (2002): 100402. - :param dim: The dimension of the generalized singlet state. :return: The singlet state of dimension `dim`. """ diff --git a/toqito/states/tile.py b/toqito/states/tile.py index e677332e2..da8ac95e5 100644 --- a/toqito/states/tile.py +++ b/toqito/states/tile.py @@ -6,7 +6,7 @@ def tile(idx: int) -> np.ndarray: r""" - Produce a Tile state [UPBTile99]_. + Produce a Tile state :cite:`Bennett_1999upb`. The Tile states constitute five states on 3-by-3 dimensional space that form a UPB (unextendible product basis). @@ -55,10 +55,6 @@ def tile(idx: int) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [UPBTile99] Bennett, Charles H., et al. - "Unextendible product bases and bound entanglement." - Physical Review Letters 82.26 (1999): 5385. - https://arxiv.org/abs/quant-ph/9808030 :raises ValueError: Invalid value for :code:`idx`. :param idx: A parameter in [0, 1, 2, 3, 4] diff --git a/toqito/states/w_state.py b/toqito/states/w_state.py index 40aefc86b..454155156 100644 --- a/toqito/states/w_state.py +++ b/toqito/states/w_state.py @@ -6,9 +6,9 @@ def w_state(num_qubits: int, coeff: list[int] = None) -> np.ndarray: r""" - Produce a W-state [DVC00]_. + Produce a W-state :cite:`D_r_2000`. - Returns the W-state described in [DVC00]. The W-state on `num_qubits` qubits is defined by: + Returns the W-state described in :cite:`D_r_2000`. The W-state on `num_qubits` qubits is defined by: .. math:: |W \rangle = \frac{1}{\sqrt{num\_qubits}} @@ -72,9 +72,6 @@ def w_state(num_qubits: int, coeff: list[int] = None) -> np.ndarray: .. bibliography:: :filter: docname in docnames - .. [DVC00] Three qubits can be entangled in two inequivalent ways. - W. Dur, G. Vidal, and J. I. Cirac. - E-print: arXiv:quant-ph/0005115, 2000. :raises ValueError: The number of qubits must be greater than or equal to 1. :param num_qubits: An integer representing the number of qubits. diff --git a/toqito/states/werner.py b/toqito/states/werner.py index 88cbdbf11..74d845c67 100644 --- a/toqito/states/werner.py +++ b/toqito/states/werner.py @@ -10,7 +10,7 @@ def werner(dim: int, alpha: float | list[float]) -> np.ndarray: r""" - Produce a Werner state [Wer89]_. + Produce a Werner state :cite:`PhysRevA.40.4277`. A Werner state is a state of the following form @@ -87,10 +87,6 @@ def werner(dim: int, alpha: float | list[float]) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - - .. [Wer89] R. F. Werner. - Quantum states with Einstein-Podolsky-Rosen correlations admitting a - hidden-variable model. Phys. Rev. A, 40(8):4277–4281. 1989 :raises ValueError: Alpha vector does not have the correct length. :param dim: The dimension of the Werner state. From b6ce85aff93dbb7f8dc17a038bbea6e1fc205aeb Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 21:14:16 -0600 Subject: [PATCH 25/40] build errors --- toqito/matrix_ops/unvec.py | 4 ++-- toqito/states/gen_bell.py | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/toqito/matrix_ops/unvec.py b/toqito/matrix_ops/unvec.py index bbb9c4dbb..25d244f39 100644 --- a/toqito/matrix_ops/unvec.py +++ b/toqito/matrix_ops/unvec.py @@ -46,7 +46,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: for all :math:`a` and :math:`b`. - This function has been adapted from [Rigetti20]_. + This function has been adapted from :cite:`Rigetti_docs`. Examples ========== @@ -72,7 +72,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: ======== vec - References + References ========== .. bibliography:: :filter: docname in docnames diff --git a/toqito/states/gen_bell.py b/toqito/states/gen_bell.py index 2dca5f7e9..24fd003fc 100644 --- a/toqito/states/gen_bell.py +++ b/toqito/states/gen_bell.py @@ -11,15 +11,17 @@ def gen_bell(k_1: int, k_2: int, dim: int) -> np.ndarray: Produces a generalized Bell state. Note that the standard Bell states can be recovered as: - ```py - bell(0) : gen_bell(0, 0, 2) + .. code-block:: python + :linenos: + + bell(0) : gen_bell(0, 0, 2) - bell(1) : gen_bell(0, 1, 2) + bell(1) : gen_bell(0, 1, 2) - bell(2) : gen_bell(1, 0, 2) + bell(2) : gen_bell(1, 0, 2) - bell(3) : gen_bell(1, 1, 2) - ``` + bell(3) : gen_bell(1, 1, 2) + Examples ========== From c68623c082ecca43d7589e89149918497d5f1513 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Tue, 21 Nov 2023 21:24:20 -0600 Subject: [PATCH 26/40] linter --- setup.py | 12 +++- .../completely_bounded_spectral_norm.py | 2 +- .../completely_bounded_trace_norm.py | 2 +- toqito/channel_metrics/diamond_norm.py | 2 +- .../fidelity_of_separability.py | 2 +- toqito/channel_ops/dual_channel.py | 2 +- toqito/channel_ops/kraus_to_choi.py | 2 +- toqito/channel_ops/partial_channel.py | 2 +- toqito/channel_props/is_unital.py | 2 +- toqito/channels/depolarizing.py | 2 +- toqito/channels/realignment.py | 2 +- toqito/channels/reduction.py | 4 +- toqito/helper/expr_as_np_array.py | 2 +- toqito/helper/np_array_as_expr.py | 2 +- toqito/helper/npa_hierarchy.py | 2 +- toqito/helper/tests/test_npa_constraints.py | 2 - toqito/helper/update_odometer.py | 4 +- toqito/matrices/gell_mann.py | 2 +- toqito/matrices/hadamard.py | 4 +- toqito/matrix_ops/inner_product.py | 4 +- toqito/matrix_ops/outer_product.py | 2 +- toqito/matrix_ops/tensor.py | 2 +- toqito/matrix_ops/vectors_from_gram_matrix.py | 2 +- toqito/matrix_ops/vectors_to_gram_matrix.py | 2 +- toqito/matrix_props/__init__.py | 1 - toqito/matrix_props/is_block_positive.py | 2 +- toqito/matrix_props/is_orthonormal.py | 2 +- toqito/matrix_props/kp_norm.py | 2 +- toqito/matrix_props/majorizes.py | 2 +- toqito/matrix_props/sk_norm.py | 10 +-- toqito/measurement_ops/measure.py | 2 +- .../nonlocal_games/extended_nonlocal_game.py | 18 +++--- toqito/nonlocal_games/nonlocal_game.py | 20 +++--- toqito/nonlocal_games/quantum_hedging.py | 22 +++---- .../tests/test_extended_nonlocal_game.py | 10 +-- .../tests/test_quantum_hedging.py | 6 +- toqito/nonlocal_games/xor_game.py | 6 +- toqito/perms/antisymmetric_projection.py | 2 +- toqito/perms/perfect_matchings.py | 4 +- toqito/perms/perm_sign.py | 2 +- toqito/perms/symmetric_projection.py | 2 +- toqito/perms/unique_perms.py | 4 +- toqito/rand/random_density_matrix.py | 2 +- toqito/rand/random_ginibre.py | 2 +- toqito/rand/random_povm.py | 4 +- toqito/rand/random_state_vector.py | 4 +- toqito/rand/random_unitary.py | 2 +- .../state_metrics/fidelity_of_separability.py | 4 +- toqito/state_metrics/hilbert_schmidt.py | 4 +- .../hilbert_schmidt_inner_product.py | 4 +- toqito/state_metrics/sub_fidelity.py | 2 +- toqito/state_ops/schmidt_decomposition.py | 2 +- toqito/state_opt/optimal_clone.py | 8 +-- .../tests/test_ppt_distinguishability.py | 2 +- .../test_symmetric_extension_hierarchy.py | 4 +- toqito/state_props/concurrence.py | 2 +- .../state_props/entanglement_of_formation.py | 4 +- toqito/state_props/in_separable_ball.py | 2 +- toqito/state_props/is_ensemble.py | 2 +- toqito/state_props/is_mutually_orthogonal.py | 2 +- toqito/state_props/is_npt.py | 2 +- toqito/state_props/is_separable.py | 6 +- toqito/state_props/l1_norm_coherence.py | 2 +- toqito/state_props/log_negativity.py | 2 +- toqito/state_props/negativity.py | 2 +- toqito/state_props/schmidt_rank.py | 2 +- toqito/state_props/sk_vec_norm.py | 2 +- toqito/state_props/tests/test_concurrence.py | 26 +++++--- .../tests/test_entanglement_of_formation.py | 34 +++++----- .../tests/test_has_symmetric_extension.py | 56 ++++++++++------- .../tests/test_in_separable_ball.py | 29 ++++++--- toqito/state_props/tests/test_is_ensemble.py | 15 +++-- toqito/state_props/tests/test_is_mixed.py | 11 ++-- .../tests/test_is_mutually_orthogonal.py | 62 ++++++++++--------- .../tests/test_is_mutually_unbiased_basis.py | 58 ++++++++--------- toqito/state_props/tests/test_is_npt.py | 31 +++++----- toqito/state_props/tests/test_is_ppt.py | 27 ++++---- toqito/state_props/tests/test_is_product.py | 43 +++++++------ toqito/state_props/tests/test_is_pure.py | 29 ++++++--- toqito/state_props/tests/test_is_separable.py | 8 +-- .../state_props/tests/test_log_negativity.py | 37 +++++++---- toqito/state_props/tests/test_negativity.py | 41 ++++++++---- toqito/state_props/tests/test_purity.py | 26 +++++--- toqito/state_props/tests/test_schmidt_rank.py | 60 ++++++++++-------- .../tests/test_von_neumann_entropy.py | 26 +++++--- toqito/states/basis.py | 2 +- toqito/states/brauer.py | 2 +- toqito/states/breuer.py | 2 +- toqito/states/chessboard.py | 4 +- toqito/states/ghz.py | 6 +- toqito/states/horodecki.py | 4 +- toqito/states/isotropic.py | 4 +- toqito/states/max_entangled.py | 4 +- toqito/states/singlet.py | 2 +- toqito/states/tests/test_basis.py | 19 +++--- toqito/states/tests/test_bell.py | 38 +++++++----- toqito/states/tests/test_brauer.py | 11 ++-- toqito/states/tests/test_breuer.py | 22 ++++--- toqito/states/tests/test_domino.py | 43 +++++++------ toqito/states/tests/test_gen_bell.py | 24 +++---- toqito/states/tests/test_ghz.py | 30 +++++---- toqito/states/tests/test_horodecki.py | 19 +++--- toqito/states/tests/test_isotropic.py | 25 ++++---- toqito/states/tests/test_max_entangled.py | 15 +++-- toqito/states/tests/test_tile.py | 40 +++++++----- toqito/states/tests/test_w_state.py | 15 +++-- toqito/states/w_state.py | 6 +- toqito/states/werner.py | 4 +- 108 files changed, 696 insertions(+), 521 deletions(-) diff --git a/setup.py b/setup.py index 2c5039dcb..c24d5210b 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,17 @@ with open("README.md", "r") as fh: long_description = fh.read() -requirements = ["cvx", "cvxpy", "cvxopt", "numpy", "picos", "scipy", "scikit-image", "pytest", "pytest-cov"] +requirements = [ + "cvx", + "cvxpy", + "cvxopt", + "numpy", + "picos", + "scipy", + "scikit-image", + "pytest", + "pytest-cov", +] setuptools.setup( name="toqito", diff --git a/toqito/channel_metrics/completely_bounded_spectral_norm.py b/toqito/channel_metrics/completely_bounded_spectral_norm.py index 3bcd99c09..4bb835669 100644 --- a/toqito/channel_metrics/completely_bounded_spectral_norm.py +++ b/toqito/channel_metrics/completely_bounded_spectral_norm.py @@ -7,7 +7,7 @@ def completely_bounded_spectral_norm(phi: np.ndarray) -> float: r""" - Compute the completely bounded spectral norm of a quantum channel + Compute the completely bounded spectral norm of a quantum channel :cite:`Watrous_2009_semidefinite, QETLAB_CB_norm`. References diff --git a/toqito/channel_metrics/completely_bounded_trace_norm.py b/toqito/channel_metrics/completely_bounded_trace_norm.py index 6b277357a..7d654b331 100644 --- a/toqito/channel_metrics/completely_bounded_trace_norm.py +++ b/toqito/channel_metrics/completely_bounded_trace_norm.py @@ -15,7 +15,7 @@ def completely_bounded_trace_norm(phi: np.ndarray) -> float: channel (Section 3.3.2 of :cite:`watrous_2018`). The algorithm in p.11 of :cite:`watrous2012simpler` with implementation in QETLAB :cite:`QETLAB_Diamond_norm` is used. - + References ========== .. bibliography:: diff --git a/toqito/channel_metrics/diamond_norm.py b/toqito/channel_metrics/diamond_norm.py index 5c894d66c..8af0ffabc 100644 --- a/toqito/channel_metrics/diamond_norm.py +++ b/toqito/channel_metrics/diamond_norm.py @@ -20,7 +20,7 @@ def diamond_norm(choi_1: np.ndarray, choi_2: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If matrices are not of equal dimension. :raises ValueError: If matrices are not square. diff --git a/toqito/channel_metrics/fidelity_of_separability.py b/toqito/channel_metrics/fidelity_of_separability.py index 9ae333bfc..2c7e85d52 100644 --- a/toqito/channel_metrics/fidelity_of_separability.py +++ b/toqito/channel_metrics/fidelity_of_separability.py @@ -143,7 +143,7 @@ def fidelity_of_separability( # List of extenstion systems and dimension of the Choi matrix. sys_ext = list(range(2, 2 + k - 1)) - dim_choi = dim_r * (dim_a**k) + dim_choi = dim_r * (dim_a ** k) # Projection onto symmetric subspace on AA'. pi_sym = symmetric_projection(dim_a, 2) diff --git a/toqito/channel_ops/dual_channel.py b/toqito/channel_ops/dual_channel.py index 05b7ea409..d587166aa 100644 --- a/toqito/channel_ops/dual_channel.py +++ b/toqito/channel_ops/dual_channel.py @@ -39,7 +39,7 @@ def dual_channel( ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If matrices are not Choi matrix. :param phi_op: A superoperator. It should be provided either as a Choi matrix, diff --git a/toqito/channel_ops/kraus_to_choi.py b/toqito/channel_ops/kraus_to_choi.py index 024ca369d..885039576 100644 --- a/toqito/channel_ops/kraus_to_choi.py +++ b/toqito/channel_ops/kraus_to_choi.py @@ -56,7 +56,7 @@ def kraus_to_choi(kraus_ops: list[list[np.ndarray]], sys: int = 2) -> np.ndarray ========== .. bibliography:: :filter: docname in docnames - + :param kraus_ops: A list of Kraus operators. :param sys: The dimension of the system (default is 2). diff --git a/toqito/channel_ops/partial_channel.py b/toqito/channel_ops/partial_channel.py index 3789fa3f6..c89180cb3 100644 --- a/toqito/channel_ops/partial_channel.py +++ b/toqito/channel_ops/partial_channel.py @@ -67,7 +67,7 @@ def partial_channel( ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If Phi map is not provided as a Choi matrix or Kraus operators. diff --git a/toqito/channel_props/is_unital.py b/toqito/channel_props/is_unital.py index 9fcc66af1..abc9714e5 100644 --- a/toqito/channel_props/is_unital.py +++ b/toqito/channel_props/is_unital.py @@ -54,7 +54,7 @@ def is_unital( ========== .. bibliography:: :filter: docname in docnames - + :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channels/depolarizing.py b/toqito/channels/depolarizing.py index c143fb6aa..1398f7883 100644 --- a/toqito/channels/depolarizing.py +++ b/toqito/channels/depolarizing.py @@ -91,4 +91,4 @@ def depolarizing(dim: int, param_p: float = 0) -> np.ndarray: # Gives a sparse non-normalized state. psi = max_entangled(dim=dim, is_sparse=False, is_normalized=False) - return (1 - param_p) * np.identity(dim**2) / dim + param_p * (psi * psi.conj().T) + return (1 - param_p) * np.identity(dim ** 2) / dim + param_p * (psi * psi.conj().T) diff --git a/toqito/channels/realignment.py b/toqito/channels/realignment.py index 7460a5d42..ca62ae84d 100644 --- a/toqito/channels/realignment.py +++ b/toqito/channels/realignment.py @@ -45,7 +45,7 @@ def realignment(input_mat: np.ndarray, dim: int | list[int] = None) -> np.ndarra ========== .. bibliography:: :filter: docname in docnames - + :param input_mat: The input matrix. :param dim: Default has all equal dimensions. diff --git a/toqito/channels/reduction.py b/toqito/channels/reduction.py index e560016f3..958784909 100644 --- a/toqito/channels/reduction.py +++ b/toqito/channels/reduction.py @@ -37,7 +37,7 @@ def reduction(dim: int, k: int = 1) -> np.ndarray: [ 0., 0., 0., 0., 0., 0., 0., 1., 0.], [-1., 0., 0., 0., -1., 0., 0., 0., 0.]]) - + References ========== .. bibliography:: @@ -49,4 +49,4 @@ def reduction(dim: int, k: int = 1) -> np.ndarray: :return: The reduction map. """ psi = max_entangled(dim, False, False) - return k * identity(dim**2) - psi * psi.conj().T + return k * identity(dim ** 2) - psi * psi.conj().T diff --git a/toqito/helper/expr_as_np_array.py b/toqito/helper/expr_as_np_array.py index 49d39f8a4..201c0a052 100644 --- a/toqito/helper/expr_as_np_array.py +++ b/toqito/helper/expr_as_np_array.py @@ -8,7 +8,7 @@ def expr_as_np_array(cvx_expr: Expression) -> np.ndarray: """ Convert cvxpy expression into a numpy array. - + :param cvx_expr: The cvxpy expression to be converted. :return: The numpy array of the cvxpy expression. diff --git a/toqito/helper/np_array_as_expr.py b/toqito/helper/np_array_as_expr.py index 530865f7a..97fd7536a 100644 --- a/toqito/helper/np_array_as_expr.py +++ b/toqito/helper/np_array_as_expr.py @@ -9,7 +9,7 @@ def np_array_as_expr(np_arr: [np.ndarray]) -> Expression: """ Convert numpy array into a cvxpy expression. - + :param np_arr: The numpy array to be converted. :return: The cvxpy expression of the numpy array. """ diff --git a/toqito/helper/npa_hierarchy.py b/toqito/helper/npa_hierarchy.py index 6ce5d4309..a33a3912d 100644 --- a/toqito/helper/npa_hierarchy.py +++ b/toqito/helper/npa_hierarchy.py @@ -143,7 +143,7 @@ def npa_constraints( # pylint: disable=too-many-locals K_{xy}\Big(i + a \cdot dim_R, j + b \cdot dim_R \Big) = \langle i| \text{Tr}_{\mathcal{H}} \Big( \big( I_R \otimes A_a^x B_b^y \big) \sigma \Big) |j \rangle - + References ========== .. bibliography:: diff --git a/toqito/helper/tests/test_npa_constraints.py b/toqito/helper/tests/test_npa_constraints.py index 12651aced..a89bbe21d 100644 --- a/toqito/helper/tests/test_npa_constraints.py +++ b/toqito/helper/tests/test_npa_constraints.py @@ -48,7 +48,6 @@ def cglmp_inequality(dim: int) -> tuple[dict[tuple[int, int], cvxpy.Variable], c return mat, i_b - @pytest.mark.parametrize("k", [2, "1+ab+aab+baa"]) def test_cglmp_inequality(k): """Test Collins-Gisin-Linden-Massar-Popescu inequality. @@ -62,7 +61,6 @@ def test_cglmp_inequality(k): np.testing.assert_equal(np.allclose(val, 2.914, atol=1e-3), True) - @pytest.mark.parametrize("k, expected_size", [("1+a", 9), ("1+ab", 25)]) def test_cglmp_dimension(k, expected_size): """Test matrix size in Collins-Gisin-Linden-Massar-Popescu inequality. diff --git a/toqito/helper/update_odometer.py b/toqito/helper/update_odometer.py index 5aec8a556..ebdad99f7 100644 --- a/toqito/helper/update_odometer.py +++ b/toqito/helper/update_odometer.py @@ -41,12 +41,12 @@ def update_odometer( [2 0] [2 1] - + References ========== .. bibliography:: :filter: docname in docnames - + :param old_ind: The initial vector. :param upper_lim: The upper limit on which to increase the odometer to. diff --git a/toqito/matrices/gell_mann.py b/toqito/matrices/gell_mann.py index 1093e7b04..47b9d718c 100644 --- a/toqito/matrices/gell_mann.py +++ b/toqito/matrices/gell_mann.py @@ -121,5 +121,5 @@ def gell_mann(ind: int, is_sparse: bool = False) -> np.ndarray | scipy.sparse.cs if is_sparse: gm_op_out = scipy.sparse.csr_matrix(gm_op) return gm_op_out - + return gm_op diff --git a/toqito/matrices/hadamard.py b/toqito/matrices/hadamard.py index 603b698ba..90b302adb 100644 --- a/toqito/matrices/hadamard.py +++ b/toqito/matrices/hadamard.py @@ -44,8 +44,8 @@ def hadamard(n_param: int = 1) -> np.ndarray: """ return 2 ** (-n_param / 2) * np.array( [ - [(-1) ** _hamming_distance(i & j) for i in range(2**n_param)] - for j in range(2**n_param) + [(-1) ** _hamming_distance(i & j) for i in range(2 ** n_param)] + for j in range(2 ** n_param) ] ) diff --git a/toqito/matrix_ops/inner_product.py b/toqito/matrix_ops/inner_product.py index 11ea09312..c52953634 100644 --- a/toqito/matrix_ops/inner_product.py +++ b/toqito/matrix_ops/inner_product.py @@ -31,8 +31,8 @@ def inner_product(v1: np.ndarray, v2: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - - + + :raises ValueError: Vector dimensions are mismatched. :param v1: v1 and v2, both vectors of dimenstions :math:`(n,1)` where :math:`n>1`. :param v2: v1 and v2, both vectors of dimenstions :math:`(n,1)` where :math:`n>1`. diff --git a/toqito/matrix_ops/outer_product.py b/toqito/matrix_ops/outer_product.py index 3a01e6fda..b7a6fef77 100644 --- a/toqito/matrix_ops/outer_product.py +++ b/toqito/matrix_ops/outer_product.py @@ -33,7 +33,7 @@ def outer_product(v1: np.ndarray, v2: np.ndarray) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: Vector dimensions are mismatched. :param v1: v1 and v2, both vectors of dimenstions :math:`(n,1)` where :math:`n>1`. diff --git a/toqito/matrix_ops/tensor.py b/toqito/matrix_ops/tensor.py index 6da826f16..612eac48a 100644 --- a/toqito/matrix_ops/tensor.py +++ b/toqito/matrix_ops/tensor.py @@ -108,7 +108,7 @@ def tensor(*args) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: Input must be a vector or matrix. :param args: Input to the tensor function is expected to be either: diff --git a/toqito/matrix_ops/vectors_from_gram_matrix.py b/toqito/matrix_ops/vectors_from_gram_matrix.py index 8ef96c233..9ee346796 100644 --- a/toqito/matrix_ops/vectors_from_gram_matrix.py +++ b/toqito/matrix_ops/vectors_from_gram_matrix.py @@ -5,7 +5,7 @@ def vectors_from_gram_matrix(gram: np.ndarray) -> list[np.ndarray]: """Obtain the corresponding ensemble of states from the Gram matrix. - + :param gram: Input Gram matrix. :return: list of ensemble states """ diff --git a/toqito/matrix_ops/vectors_to_gram_matrix.py b/toqito/matrix_ops/vectors_to_gram_matrix.py index 35025238e..6eb462a96 100644 --- a/toqito/matrix_ops/vectors_to_gram_matrix.py +++ b/toqito/matrix_ops/vectors_to_gram_matrix.py @@ -4,7 +4,7 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: """Given a list of vectors, return the Gram matrix. - + :param vectors: Input list of vectors. :return: Gram matrix""" n = len(vectors) diff --git a/toqito/matrix_props/__init__.py b/toqito/matrix_props/__init__.py index d856187cb..e82073f0f 100644 --- a/toqito/matrix_props/__init__.py +++ b/toqito/matrix_props/__init__.py @@ -21,4 +21,3 @@ from toqito.matrix_props.is_block_positive import is_block_positive from toqito.matrix_props.trace_norm import trace_norm from toqito.matrix_props.is_diagonally_dominant import is_diagonally_dominant - diff --git a/toqito/matrix_props/is_block_positive.py b/toqito/matrix_props/is_block_positive.py index b14958d4c..055319eae 100644 --- a/toqito/matrix_props/is_block_positive.py +++ b/toqito/matrix_props/is_block_positive.py @@ -44,7 +44,7 @@ def is_block_positive( ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: Unable to determine block positive property. :param mat: A bipartite Hermitian operator. diff --git a/toqito/matrix_props/is_orthonormal.py b/toqito/matrix_props/is_orthonormal.py index a60850d39..12196411a 100644 --- a/toqito/matrix_props/is_orthonormal.py +++ b/toqito/matrix_props/is_orthonormal.py @@ -7,7 +7,7 @@ def is_orthonormal(vectors: list[np.ndarray]) -> bool: """Check if the vectors are orthonormal. - + :param vectors: A list of `np.ndarray` 1-by-n vectors. :return: True if vectors are orthonormal; False otherwise. diff --git a/toqito/matrix_props/kp_norm.py b/toqito/matrix_props/kp_norm.py index 101fb2f86..8b369f18f 100644 --- a/toqito/matrix_props/kp_norm.py +++ b/toqito/matrix_props/kp_norm.py @@ -6,7 +6,7 @@ def kp_norm(mat: np.ndarray, k: int, p: int) -> float: """ Compute the p-norm of the vector or the k-largest singular values of a matrix. - + :param mat: 2D numpy ndarray :param k: The number of singular values to take. :param p: The order of the norm. diff --git a/toqito/matrix_props/majorizes.py b/toqito/matrix_props/majorizes.py index 37ecd946a..ead7560de 100644 --- a/toqito/matrix_props/majorizes.py +++ b/toqito/matrix_props/majorizes.py @@ -46,7 +46,7 @@ def majorizes(a_var: np.ndarray | list[int], b_var: np.ndarray | list[int]) -> b ========== .. bibliography:: :filter: docname in docnames - + :param a_var: Matrix or vector provided as list or np.array. :param b_var: Matrix or vector provided as list or np.array. diff --git a/toqito/matrix_props/sk_norm.py b/toqito/matrix_props/sk_norm.py index 5c49d2108..8e9995ad9 100644 --- a/toqito/matrix_props/sk_norm.py +++ b/toqito/matrix_props/sk_norm.py @@ -66,7 +66,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If dimension of the input matrix is not specified. :param mat: A matrix. @@ -184,7 +184,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals ) # Use the upper bound of Proposition 4.2.11 of [3]. - upper_bound = min(upper_bound, kp_norm(realignment(mat, dim), k**2, 2)) + upper_bound = min(upper_bound, kp_norm(realignment(mat, dim), k ** 2, 2)) # Use the lower bound of Theorem 4.2.17 of [3]. if is_projection: @@ -202,7 +202,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals lower_bound = max( lower_bound, (min(dim) - k) - * (rank + np.sqrt((prod_dim * rank - rank**2) / (prod_dim - 1))) + * (rank + np.sqrt((prod_dim * rank - rank ** 2) / (prod_dim - 1))) / (prod_dim * (min(dim) - 1)) + (k - 1) / (min(dim) - 1), ) @@ -213,10 +213,10 @@ def sk_operator_norm( # pylint: disable=too-many-locals # Use a randomized iterative method to try to improve the lower bound. if is_positive: - for _ in range(5**effort): + for _ in range(5 ** effort): lower_bound = max( lower_bound, - __lower_bound_sk_norm_randomized(mat, k, dim, tol**2), + __lower_bound_sk_norm_randomized(mat, k, dim, tol ** 2), ) # break out of the function if the target value has already been met diff --git a/toqito/measurement_ops/measure.py b/toqito/measurement_ops/measure.py index f6430db7e..5456feac5 100644 --- a/toqito/measurement_ops/measure.py +++ b/toqito/measurement_ops/measure.py @@ -65,7 +65,7 @@ def measure(measurement: np.ndarray, state: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - + :param measurement: The measurement to apply. :param state: The state to apply the measurement to. diff --git a/toqito/nonlocal_games/extended_nonlocal_game.py b/toqito/nonlocal_games/extended_nonlocal_game.py index 7976a4530..74530a104 100644 --- a/toqito/nonlocal_games/extended_nonlocal_game.py +++ b/toqito/nonlocal_games/extended_nonlocal_game.py @@ -28,7 +28,7 @@ class ExtendedNonlocalGame: ========== .. bibliography:: :filter: docname in docnames - + """ def __init__(self, prob_mat: np.ndarray, pred_mat: np.ndarray, reps: int = 1) -> None: @@ -59,18 +59,18 @@ def __init__(self, prob_mat: np.ndarray, pred_mat: np.ndarray, reps: int = 1) -> pred_mat2 = np.zeros( ( - dim_x**reps, - dim_y**reps, - num_alice_out**reps, - num_bob_out**reps, - num_alice_in**reps, - num_bob_in**reps, + dim_x ** reps, + dim_y ** reps, + num_alice_out ** reps, + num_bob_out ** reps, + num_alice_in ** reps, + num_bob_in ** reps, ) ) i_ind = np.zeros(reps, dtype=int) j_ind = np.zeros(reps, dtype=int) - for i in range(num_alice_in**reps): - for j in range(num_bob_in**reps): + for i in range(num_alice_in ** reps): + for j in range(num_bob_in ** reps): to_tensor = np.empty([reps, dim_x, dim_y, num_alice_out, num_bob_out]) for k in range(reps - 1, -1, -1): to_tensor[k] = pred_mat[:, :, :, :, i_ind[k], j_ind[k]] diff --git a/toqito/nonlocal_games/nonlocal_game.py b/toqito/nonlocal_games/nonlocal_game.py index 5787e14c5..c8ecfdc7b 100644 --- a/toqito/nonlocal_games/nonlocal_game.py +++ b/toqito/nonlocal_games/nonlocal_game.py @@ -26,7 +26,7 @@ class NonlocalGame: ========== .. bibliography:: :filter: docname in docnames - + """ def __init__(self, prob_mat: np.ndarray, pred_mat: np.ndarray, reps: int = 1) -> None: @@ -52,16 +52,16 @@ def __init__(self, prob_mat: np.ndarray, pred_mat: np.ndarray, reps: int = 1) -> pred_mat2 = np.zeros( ( - num_alice_out**reps, - num_bob_out**reps, - num_alice_in**reps, - num_bob_in**reps, + num_alice_out ** reps, + num_bob_out ** reps, + num_alice_in ** reps, + num_bob_in ** reps, ) ) i_ind = np.zeros(reps, dtype=int) j_ind = np.zeros(reps, dtype=int) - for i in range(num_alice_in**reps): - for j in range(num_bob_in**reps): + for i in range(num_alice_in ** reps): + for j in range(num_bob_in ** reps): to_tensor = np.empty([reps, num_alice_out, num_bob_out]) for k in range(reps - 1, -1, -1): to_tensor[k] = pred_mat[:, :, i_ind[k], j_ind[k]] @@ -114,7 +114,7 @@ def from_bcs_game(cls, constraints: list[np.ndarray], reps: int = 1) -> "Nonloca # Compute prediction matrix of outcomes given questions and answer pairs: # a: Alice's truth assignment to all variables in `c_x` # b: Bob's truth assignment for `v_y` in `c_x` - pred_mat = np.zeros((2**num_variables, 2, num_constraints, num_variables)) + pred_mat = np.zeros((2 ** num_variables, 2, num_constraints, num_variables)) for x_ques in range(num_constraints): for a_ans in range(pred_mat.shape[0]): # Convert to binary representation @@ -155,7 +155,7 @@ def classical_value(self) -> float: self.prob_mat[x_alice_in, y_bob_in] * self.pred_mat[:, :, x_alice_in, y_bob_in] ) p_win = float("-inf") - if num_alice_outputs**num_alice_inputs < num_bob_outputs**num_bob_inputs: + if num_alice_outputs ** num_alice_inputs < num_bob_outputs ** num_bob_inputs: self.pred_mat = np.transpose(self.pred_mat, (1, 0, 3, 2)) ( num_alice_outputs, @@ -171,7 +171,7 @@ def classical_value(self) -> float: # else: # parallel_threads = 5 - for i in range(num_alice_outputs**num_bob_inputs): + for i in range(num_alice_outputs ** num_bob_inputs): # Convert :code:`number` to the base :code:`base` with digits :code:`digits`. number = i base = num_bob_outputs diff --git a/toqito/nonlocal_games/quantum_hedging.py b/toqito/nonlocal_games/quantum_hedging.py index ca9e59b87..9f714a907 100644 --- a/toqito/nonlocal_games/quantum_hedging.py +++ b/toqito/nonlocal_games/quantum_hedging.py @@ -59,8 +59,8 @@ class QuantumHedging: ========== .. bibliography:: :filter: docname in docnames - - + + """ def __init__(self, q_a: np.ndarray, num_reps: int) -> None: @@ -84,7 +84,7 @@ def __init__(self, q_a: np.ndarray, num_reps: int) -> None: # π(y1 ⊗ y2 ⊗ x1 ⊗ x2) = y1 ⊗ x1 ⊗ y2 ⊗ x2 # for all y1 ∈ Y1, y2 ∈ Y2, x1 ∈ X1, x2 ∈ X2.). l_1 = list(range(1, self._num_reps + 1)) - l_2 = list(range(self._num_reps + 1, self._num_reps**2 + 1)) + l_2 = list(range(self._num_reps + 1, self._num_reps ** 2 + 1)) if self._num_reps == 1: self._pperm = np.array([1]) else: @@ -116,10 +116,10 @@ def max_prob_outcome_a_primal(self) -> float: :return: The optimal maximal probability for obtaining outcome "a". """ - x_var = cvxpy.Variable((4**self._num_reps, 4**self._num_reps), PSD=True) + x_var = cvxpy.Variable((4 ** self._num_reps, 4 ** self._num_reps), PSD=True) objective = cvxpy.Maximize(cvxpy.trace(self._q_a.conj().T @ x_var)) constraints = [ - partial_trace(x_var, self._sys, self._dim) == np.identity(2**self._num_reps) + partial_trace(x_var, self._sys, self._dim) == np.identity(2 ** self._num_reps) ] problem = cvxpy.Problem(objective, constraints) @@ -146,10 +146,10 @@ def max_prob_outcome_a_dual(self) -> float: :return: The optimal maximal probability for obtaining outcome "a". """ - y_var = cvxpy.Variable((2**self._num_reps, 2**self._num_reps), hermitian=True) + y_var = cvxpy.Variable((2 ** self._num_reps, 2 ** self._num_reps), hermitian=True) objective = cvxpy.Minimize(cvxpy.trace(cvxpy.real(y_var))) - kron_var = cvxpy.kron(np.eye(2**self._num_reps), y_var) + kron_var = cvxpy.kron(np.eye(2 ** self._num_reps), y_var) if self._num_reps == 1: u_var = cvxpy.multiply(cvxpy.multiply(self._pperm, kron_var), self._pperm.conj().T) constraints = [cvxpy.real(u_var) >> self._q_a] @@ -184,10 +184,10 @@ def min_prob_outcome_a_primal(self) -> float: :return: The optimal minimal probability for obtaining outcome "a". """ - x_var = cvxpy.Variable((4**self._num_reps, 4**self._num_reps), PSD=True) + x_var = cvxpy.Variable((4 ** self._num_reps, 4 ** self._num_reps), PSD=True) objective = cvxpy.Minimize(cvxpy.trace(self._q_a.conj().T @ x_var)) constraints = [ - partial_trace(x_var, self._sys, self._dim) == np.identity(2**self._num_reps) + partial_trace(x_var, self._sys, self._dim) == np.identity(2 ** self._num_reps) ] problem = cvxpy.Problem(objective, constraints) @@ -214,10 +214,10 @@ def min_prob_outcome_a_dual(self) -> float: :return: The optimal minimal probability for obtaining outcome "a". """ - y_var = cvxpy.Variable((2**self._num_reps, 2**self._num_reps), hermitian=True) + y_var = cvxpy.Variable((2 ** self._num_reps, 2 ** self._num_reps), hermitian=True) objective = cvxpy.Maximize(cvxpy.trace(cvxpy.real(y_var))) - kron_var = cvxpy.kron(np.eye(2**self._num_reps), y_var) + kron_var = cvxpy.kron(np.eye(2 ** self._num_reps), y_var) if self._num_reps == 1: u_var = cvxpy.multiply(cvxpy.multiply(self._pperm, kron_var), self._pperm.conj().T) diff --git a/toqito/nonlocal_games/tests/test_extended_nonlocal_game.py b/toqito/nonlocal_games/tests/test_extended_nonlocal_game.py index c17bde21c..8f2a4298f 100644 --- a/toqito/nonlocal_games/tests/test_extended_nonlocal_game.py +++ b/toqito/nonlocal_games/tests/test_extended_nonlocal_game.py @@ -66,17 +66,17 @@ def moe_mub_4_in_3_out_game(): mub_0 = [e_0, e_1, e_2] mub_1 = [ (e_0 + e_1 + e_2) / np.sqrt(3), - (e_0 + eta**2 * e_1 + eta * e_2) / np.sqrt(3), - (e_0 + eta * e_1 + eta**2 * e_2) / np.sqrt(3), + (e_0 + eta ** 2 * e_1 + eta * e_2) / np.sqrt(3), + (e_0 + eta * e_1 + eta ** 2 * e_2) / np.sqrt(3), ] mub_2 = [ (e_0 + e_1 + eta * e_2) / np.sqrt(3), - (e_0 + eta**2 * e_1 + eta**2 * e_2) / np.sqrt(3), + (e_0 + eta ** 2 * e_1 + eta ** 2 * e_2) / np.sqrt(3), (e_0 + eta * e_1 + e_2) / np.sqrt(3), ] mub_3 = [ - (e_0 + e_1 + eta**2 * e_2) / np.sqrt(3), - (e_0 + eta**2 * e_1 + e_2) / np.sqrt(3), + (e_0 + e_1 + eta ** 2 * e_2) / np.sqrt(3), + (e_0 + eta ** 2 * e_1 + e_2) / np.sqrt(3), (e_0 + eta * e_1 + eta * e_2) / np.sqrt(3), ] diff --git a/toqito/nonlocal_games/tests/test_quantum_hedging.py b/toqito/nonlocal_games/tests/test_quantum_hedging.py index 043a19849..8bdb9a6fc 100644 --- a/toqito/nonlocal_games/tests/test_quantum_hedging.py +++ b/toqito/nonlocal_games/tests/test_quantum_hedging.py @@ -17,13 +17,13 @@ class TestQuantumHedging(unittest.TestCase): alpha = 1 / sqrt(2) theta = pi / 8 - w_var = alpha * cos(theta) * e_00 + sqrt(1 - alpha**2) * sin(theta) * e_11 + w_var = alpha * cos(theta) * e_00 + sqrt(1 - alpha ** 2) * sin(theta) * e_11 - l_1 = -alpha * sin(theta) * e_00 + sqrt(1 - alpha**2) * cos(theta) * e_11 + l_1 = -alpha * sin(theta) * e_00 + sqrt(1 - alpha ** 2) * cos(theta) * e_11 l_2 = alpha * sin(theta) * e_10 - l_3 = sqrt(1 - alpha**2) * cos(theta) * e_01 + l_3 = sqrt(1 - alpha ** 2) * cos(theta) * e_01 q_1 = w_var * w_var.conj().T q_0 = l_1 * l_1.conj().T + l_2 * l_2.conj().T + l_3 * l_3.conj().T diff --git a/toqito/nonlocal_games/xor_game.py b/toqito/nonlocal_games/xor_game.py index 381a8a5ae..df3ebca92 100644 --- a/toqito/nonlocal_games/xor_game.py +++ b/toqito/nonlocal_games/xor_game.py @@ -114,8 +114,8 @@ class XORGame: ========== .. bibliography:: :filter: docname in docnames - - + + """ def __init__( @@ -144,7 +144,7 @@ def __init__( q_0, q_1 = self.prob_mat.shape if tol is None: - self.tol = np.finfo(float).eps * q_0**2 * q_1**2 + self.tol = np.finfo(float).eps * q_0 ** 2 * q_1 ** 2 else: self.tol = tol diff --git a/toqito/perms/antisymmetric_projection.py b/toqito/perms/antisymmetric_projection.py index a0a6c9b83..e49d62473 100644 --- a/toqito/perms/antisymmetric_projection.py +++ b/toqito/perms/antisymmetric_projection.py @@ -81,7 +81,7 @@ def antisymmetric_projection( :param partial: Default value of 0. :return: Projection onto the antisymmetric subspace. """ - dimp = dim**p_param + dimp = dim ** p_param if p_param == 1: return sparse.eye(dim) diff --git a/toqito/perms/perfect_matchings.py b/toqito/perms/perfect_matchings.py index 690d3135d..2bdba2246 100644 --- a/toqito/perms/perfect_matchings.py +++ b/toqito/perms/perfect_matchings.py @@ -27,8 +27,8 @@ def perfect_matchings(num: list[int] | int | np.ndarray) -> np.ndarray: [1 3 2 4] [1 4 3 2]] - - + + :param num: Either an even integer, indicating that you would like all perfect matchings of the integers 1,2, ... N, or a `list` or `np.array` containing an even number of distinct entries, indicating that you would like all perfect matchings of those entries. diff --git a/toqito/perms/perm_sign.py b/toqito/perms/perm_sign.py index 06a1b6042..8e5a2e72c 100644 --- a/toqito/perms/perm_sign.py +++ b/toqito/perms/perm_sign.py @@ -45,7 +45,7 @@ def perm_sign(perm: np.ndarray | list[int]) -> float: ========== .. bibliography:: :filter: docname in docnames - + :param perm: The permutation vector to be checked. :return: The value 1 if the permutation is of even length and the value of diff --git a/toqito/perms/symmetric_projection.py b/toqito/perms/symmetric_projection.py index dd084fb6d..bd3c6918d 100644 --- a/toqito/perms/symmetric_projection.py +++ b/toqito/perms/symmetric_projection.py @@ -80,7 +80,7 @@ def symmetric_projection( :param partial: Default value of 0. :return: Projection onto the symmetric subspace. """ - dimp = dim**p_val + dimp = dim ** p_val if p_val == 1: return np.eye(dim) diff --git a/toqito/perms/unique_perms.py b/toqito/perms/unique_perms.py index a5a5759fb..6a52f5b62 100644 --- a/toqito/perms/unique_perms.py +++ b/toqito/perms/unique_perms.py @@ -30,8 +30,8 @@ def unique_perms(elements: list[int]): >>> len(list(unique_perms(vec_nums))) 4200 - - + + :param elements: List of integers. :return: The number of possible permutations possible. """ diff --git a/toqito/rand/random_density_matrix.py b/toqito/rand/random_density_matrix.py index 5a85ad6fb..1ed684749 100644 --- a/toqito/rand/random_density_matrix.py +++ b/toqito/rand/random_density_matrix.py @@ -76,7 +76,7 @@ def random_density_matrix( >>> is_density(bures_mat) True - + :param dim: The number of rows (and columns) of the density matrix. :param is_real: Boolean denoting whether the returned matrix will have all real entries or not. diff --git a/toqito/rand/random_ginibre.py b/toqito/rand/random_ginibre.py index 06bd9ae46..1f02d3c6c 100644 --- a/toqito/rand/random_ginibre.py +++ b/toqito/rand/random_ginibre.py @@ -30,7 +30,7 @@ def random_ginibre( ========== .. bibliography:: :filter: docname in docnames - + :param dim_n: The number of rows of the Ginibre random matrix. :param dim_m: The number of columns of the Ginibre random matrix. diff --git a/toqito/rand/random_povm.py b/toqito/rand/random_povm.py index b7bf8a601..b6f40a4d7 100644 --- a/toqito/rand/random_povm.py +++ b/toqito/rand/random_povm.py @@ -40,8 +40,8 @@ def random_povm(dim: int, num_inputs: int, num_outputs: int) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - - + + :param dim: The dimensions of the measurements. :param num_inputs: The number of inputs for the measurement. diff --git a/toqito/rand/random_state_vector.py b/toqito/rand/random_state_vector.py index 6d5a6f50c..8735ec770 100644 --- a/toqito/rand/random_state_vector.py +++ b/toqito/rand/random_state_vector.py @@ -32,8 +32,8 @@ def random_state_vector( >>> is_pure(dm) True - - + + :param dim: The number of rows (and columns) of the unitary matrix. :param is_real: Boolean denoting whether the returned matrix has real entries or not. Default is :code:`False`. diff --git a/toqito/rand/random_unitary.py b/toqito/rand/random_unitary.py index a9eb7e94a..cd0d02297 100644 --- a/toqito/rand/random_unitary.py +++ b/toqito/rand/random_unitary.py @@ -65,7 +65,7 @@ def random_unitary(dim: list[int] | int, is_real: bool = False) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :param dim: The number of rows (and columns) of the unitary matrix. :param is_real: Boolean denoting whether the returned matrix has real diff --git a/toqito/state_metrics/fidelity_of_separability.py b/toqito/state_metrics/fidelity_of_separability.py index 8ba60504b..af6f1e44e 100644 --- a/toqito/state_metrics/fidelity_of_separability.py +++ b/toqito/state_metrics/fidelity_of_separability.py @@ -146,7 +146,7 @@ def fidelity_of_separability( # new dims for AB with k-extendibility in subsystem B dim_direct_sum_ab_k = [dim_a] + [dim_b] * (k) # new dims for a linear op acting on the space of sigma_ab_k - dim_op_sigma_ab_k = dim_a * dim_b**k + dim_op_sigma_ab_k = dim_a * dim_b ** k # A list of the symmetrically extended subsystems based on the level `k`. sub_sys_ext = list(range(2, 2 + k - 1)) @@ -185,4 +185,4 @@ def fidelity_of_separability( problem.add_constraint(picos.partial_transpose(sigma_ab_k, sys, dim_direct_sum_ab_k) >> 0) solution = problem.solve(solver=solver_option) - return solution.value**2 + return solution.value ** 2 diff --git a/toqito/state_metrics/hilbert_schmidt.py b/toqito/state_metrics/hilbert_schmidt.py index d24471f26..e9fd81352 100644 --- a/toqito/state_metrics/hilbert_schmidt.py +++ b/toqito/state_metrics/hilbert_schmidt.py @@ -32,8 +32,8 @@ def hilbert_schmidt(rho: np.ndarray, sigma: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - - + + :raises ValueError: If matrices are not density operators. :param rho: An input matrix. diff --git a/toqito/state_metrics/hilbert_schmidt_inner_product.py b/toqito/state_metrics/hilbert_schmidt_inner_product.py index 90c136363..2999189e3 100644 --- a/toqito/state_metrics/hilbert_schmidt_inner_product.py +++ b/toqito/state_metrics/hilbert_schmidt_inner_product.py @@ -34,8 +34,8 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> compl ========== .. bibliography:: :filter: docname in docnames - - + + :param a_mat: An input matrix provided as a numpy array. :param b_mat: An input matrix provided as a numpy array. :return: The Hilbert-Schmidt inner product between :code:`a_mat` and diff --git a/toqito/state_metrics/sub_fidelity.py b/toqito/state_metrics/sub_fidelity.py index 8763182e1..bde2a9891 100644 --- a/toqito/state_metrics/sub_fidelity.py +++ b/toqito/state_metrics/sub_fidelity.py @@ -56,7 +56,7 @@ def sub_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If matrices are not of equal dimension. :param rho: Density operator. diff --git a/toqito/state_ops/schmidt_decomposition.py b/toqito/state_ops/schmidt_decomposition.py index 601ae19d7..c780ecbbd 100644 --- a/toqito/state_ops/schmidt_decomposition.py +++ b/toqito/state_ops/schmidt_decomposition.py @@ -57,7 +57,7 @@ def schmidt_decomposition( ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If matrices are not of equal dimension. :param rho: A bipartite quantum state to compute the Schmidt decomposition of. diff --git a/toqito/state_opt/optimal_clone.py b/toqito/state_opt/optimal_clone.py index cba4bfdc7..1f5f2212f 100644 --- a/toqito/state_opt/optimal_clone.py +++ b/toqito/state_opt/optimal_clone.py @@ -159,7 +159,7 @@ def primal_problem(q_a: np.ndarray, pperm: np.ndarray, num_reps: int) -> float: dim = 2 * np.ones((1, num_spaces * num_reps)).astype(int).flatten() dim = dim.tolist() - x_var = cvxpy.Variable((8**num_reps, 8**num_reps), hermitian=True) + x_var = cvxpy.Variable((8 ** num_reps, 8 ** num_reps), hermitian=True) if num_reps == 1: objective = cvxpy.Maximize(cvxpy.trace(cvxpy.real(q_a.conj().T @ x_var))) else: @@ -167,7 +167,7 @@ def primal_problem(q_a: np.ndarray, pperm: np.ndarray, num_reps: int) -> float: cvxpy.trace(cvxpy.real(pperm @ q_a.conj().T @ pperm.conj().T @ x_var)) ) constraints = [ - partial_trace(x_var, sys, dim) == np.identity(2**num_reps), + partial_trace(x_var, sys, dim) == np.identity(2 ** num_reps), x_var >> 0, ] problem = cvxpy.Problem(objective, constraints) @@ -181,10 +181,10 @@ def dual_problem(q_a: np.ndarray, pperm: np.ndarray, num_reps: int) -> float: :return: The optimal value of performing a counterfeit attack. """ - y_var = cvxpy.Variable((2**num_reps, 2**num_reps), hermitian=True) + y_var = cvxpy.Variable((2 ** num_reps, 2 ** num_reps), hermitian=True) objective = cvxpy.Minimize(cvxpy.trace(cvxpy.real(y_var))) - kron_var = cvxpy.kron(cvxpy.kron(np.eye(2**num_reps), np.eye(2**num_reps)), y_var) + kron_var = cvxpy.kron(cvxpy.kron(np.eye(2 ** num_reps), np.eye(2 ** num_reps)), y_var) if num_reps == 1: constraints = [cvxpy.real(kron_var) >> q_a] diff --git a/toqito/state_opt/tests/test_ppt_distinguishability.py b/toqito/state_opt/tests/test_ppt_distinguishability.py index 88ed9c417..c630a39eb 100644 --- a/toqito/state_opt/tests/test_ppt_distinguishability.py +++ b/toqito/state_opt/tests/test_ppt_distinguishability.py @@ -250,7 +250,7 @@ def test_ppt_distinguishability_four_bell_states(): ] probs = [1 / 4, 1 / 4, 1 / 4, 1 / 4] - exp_res = 1 / 2 * (1 + np.sqrt(1 - eps**2)) + exp_res = 1 / 2 * (1 + np.sqrt(1 - eps ** 2)) primal_res = ppt_distinguishability(states, probs=probs, dist_method="min-error", strategy=True) dual_res = ppt_distinguishability(states, probs=probs, dist_method="min-error", strategy=False) diff --git a/toqito/state_opt/tests/test_symmetric_extension_hierarchy.py b/toqito/state_opt/tests/test_symmetric_extension_hierarchy.py index a25f86192..fdc0a34c6 100644 --- a/toqito/state_opt/tests/test_symmetric_extension_hierarchy.py +++ b/toqito/state_opt/tests/test_symmetric_extension_hierarchy.py @@ -53,7 +53,7 @@ def test_symmetric_extension_hierarchy_four_bell_with_resource_state_lvl_1(): # Level 1 of the hierarchy should be identical to the known PPT value # for this case. res = symmetric_extension_hierarchy(states=states, probs=None, level=1) - exp_res = 1 / 2 * (1 + np.sqrt(1 - eps**2)) + exp_res = 1 / 2 * (1 + np.sqrt(1 - eps ** 2)) np.testing.assert_equal(np.isclose(res, exp_res), True) @@ -84,7 +84,7 @@ def test_symmetric_extension_hierarchy_four_bell_with_resource_state(): ] res = symmetric_extension_hierarchy(states=states, probs=None, level=2) - exp_res = 1 / 2 * (1 + np.sqrt(1 - eps**2)) + exp_res = 1 / 2 * (1 + np.sqrt(1 - eps ** 2)) np.testing.assert_equal(np.isclose(res, exp_res), True) diff --git a/toqito/state_props/concurrence.py b/toqito/state_props/concurrence.py index 3f92443ef..a79d8355c 100644 --- a/toqito/state_props/concurrence.py +++ b/toqito/state_props/concurrence.py @@ -67,7 +67,7 @@ def concurrence(rho: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If system is not bipartite. :param rho: The bipartite system specified as a matrix. :return: The concurrence of the bipartite state :math:`\rho`. diff --git a/toqito/state_props/entanglement_of_formation.py b/toqito/state_props/entanglement_of_formation.py index 16968cc45..05843b01e 100644 --- a/toqito/state_props/entanglement_of_formation.py +++ b/toqito/state_props/entanglement_of_formation.py @@ -99,8 +99,8 @@ def entanglement_of_formation(rho: np.ndarray, dim: list[int] | int = None) -> f if dim_x == 4: rho_c = concurrence(rho) - rho_c1 = (1 + np.sqrt(1 - rho_c**2)) / 2 - rho_c2 = (1 - np.sqrt(1 - rho_c**2)) / 2 + rho_c1 = (1 + np.sqrt(1 - rho_c ** 2)) / 2 + rho_c2 = (1 - np.sqrt(1 - rho_c ** 2)) / 2 rho_c1_log2 = 0 if rho_c1 == 0 else np.log2(rho_c1) rho_c2_log2 = 0 if rho_c2 == 0 else np.log2(rho_c2) diff --git a/toqito/state_props/in_separable_ball.py b/toqito/state_props/in_separable_ball.py index 725bcecbb..02bbb8af8 100644 --- a/toqito/state_props/in_separable_ball.py +++ b/toqito/state_props/in_separable_ball.py @@ -54,7 +54,7 @@ def in_separable_ball(mat: np.ndarray) -> bool: ========== .. bibliography:: :filter: docname in docnames - + :param mat: A positive semidefinite matrix or a vector of the eigenvalues of a positive semidefinite matrix. diff --git a/toqito/state_props/is_ensemble.py b/toqito/state_props/is_ensemble.py index c6231ac37..709fa3c72 100644 --- a/toqito/state_props/is_ensemble.py +++ b/toqito/state_props/is_ensemble.py @@ -46,7 +46,7 @@ def is_ensemble(states: list[np.ndarray]) -> bool: ========== .. bibliography:: :filter: docname in docnames - + :param states: The list of states to check. :return: :code:`True` if states form an ensemble and :code:`False` otherwise. diff --git a/toqito/state_props/is_mutually_orthogonal.py b/toqito/state_props/is_mutually_orthogonal.py index dfba913e4..05cd5dc3e 100644 --- a/toqito/state_props/is_mutually_orthogonal.py +++ b/toqito/state_props/is_mutually_orthogonal.py @@ -52,7 +52,7 @@ def is_mutually_orthogonal(vec_list: list[np.ndarray | list[float | Any]]) -> bo ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If at least two vectors are not provided. :param vec_list: The list of vectors to check. diff --git a/toqito/state_props/is_npt.py b/toqito/state_props/is_npt.py index 1ad70eb6c..98e938b13 100644 --- a/toqito/state_props/is_npt.py +++ b/toqito/state_props/is_npt.py @@ -21,7 +21,7 @@ def is_npt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: floa ========== .. bibliography:: :filter: docname in docnames - + :param mat: A square matrix. :param sys: Scalar or vector indicating which subsystems the transpose diff --git a/toqito/state_props/is_separable.py b/toqito/state_props/is_separable.py index 4ec66395c..b1a2bc2aa 100644 --- a/toqito/state_props/is_separable.py +++ b/toqito/state_props/is_separable.py @@ -136,7 +136,7 @@ def is_separable( # Another test that is strictly stronger than the realignment criterion. if trace_norm(realignment(state - np.kron(pt_state_alice, pt_state_bob), dim)) > np.sqrt( - 1 - np.trace(pt_state_alice**2 @ pt_state_bob**2) + 1 - np.trace(pt_state_alice ** 2 @ pt_state_bob ** 2) ): # Determined to be entangled by using Theorem 1 of reference. # C.-J. Zhang, Y.-S. Zhang, S. Zhang, and G.-C. Guo. @@ -153,7 +153,7 @@ def is_separable( # Check if X is separable from spectrum. if (lam[0] - lam[2 * max_dim - 1]) ** 2 <= 4 * lam[2 * max_dim - 2] * lam[ 2 * max_dim - ] + tol**2: + ] + tol ** 2: print("Determined to be separable by inspecting its eigenvalues.") print( "N. Johnston. Separability from spectrum for qubit-qudit states. Phys. Rev. A, 88:062330, 2013." @@ -177,7 +177,7 @@ def is_separable( # Check if X is a rank-1 perturbation of the identity, which is # necessarily separable if it's PPT, which we have already checked. - if lam[1] - lam[prod_dim - 1] < tol**2: + if lam[1] - lam[prod_dim - 1] < tol ** 2: # Determined to be separable by being a small rank-1 perturbation of the maximally-mixed state. # G. Vidal and R. Tarrach. Robustness of entanglement. # Phys. Rev. A, 59:141-155, 1999. diff --git a/toqito/state_props/l1_norm_coherence.py b/toqito/state_props/l1_norm_coherence.py index 1e2e74b64..f500871a0 100644 --- a/toqito/state_props/l1_norm_coherence.py +++ b/toqito/state_props/l1_norm_coherence.py @@ -43,7 +43,7 @@ def l1_norm_coherence(rho: np.ndarray) -> float: ========== .. bibliography:: :filter: docname in docnames - + :param rho: A matrix or vector. :return: The l1-norm coherence of :code:`rho`. diff --git a/toqito/state_props/log_negativity.py b/toqito/state_props/log_negativity.py index e4a692df7..843fe231d 100644 --- a/toqito/state_props/log_negativity.py +++ b/toqito/state_props/log_negativity.py @@ -40,7 +40,7 @@ def log_negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If the input matrix is not a density matrix. :param rho: A density matrix of a pure state vector. diff --git a/toqito/state_props/negativity.py b/toqito/state_props/negativity.py index 22d3d1fe9..f3922583e 100644 --- a/toqito/state_props/negativity.py +++ b/toqito/state_props/negativity.py @@ -41,7 +41,7 @@ def negativity(rho: np.ndarray, dim: list[int] | int = None) -> float: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If dimension of matrix is invalid. :param rho: A density matrix of a pure state vector. diff --git a/toqito/state_props/schmidt_rank.py b/toqito/state_props/schmidt_rank.py index 88b778bce..7a5171ad0 100644 --- a/toqito/state_props/schmidt_rank.py +++ b/toqito/state_props/schmidt_rank.py @@ -76,7 +76,7 @@ def schmidt_rank(rho: np.ndarray, dim: int | list[int] | np.ndarray = None) -> f ========== .. bibliography:: :filter: docname in docnames - + :param rho: A bipartite vector or matrix to have its Schmidt rank computed. :param dim: A 1-by-2 vector or matrix. diff --git a/toqito/state_props/sk_vec_norm.py b/toqito/state_props/sk_vec_norm.py index 0d1bc5016..b52d0f49c 100644 --- a/toqito/state_props/sk_vec_norm.py +++ b/toqito/state_props/sk_vec_norm.py @@ -43,7 +43,7 @@ def sk_vector_norm(rho: np.ndarray, k: int = 1, dim: int | list[int] = None) -> ========== .. bibliography:: :filter: docname in docnames - + :param rho: A vector. :param k: An int. diff --git a/toqito/state_props/tests/test_concurrence.py b/toqito/state_props/tests/test_concurrence.py index c19e18788..17409c2d8 100644 --- a/toqito/state_props/tests/test_concurrence.py +++ b/toqito/state_props/tests/test_concurrence.py @@ -9,21 +9,27 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("rho, expected_result", [ - # Concurrence of maximally entangled Bell state. - (bell(0) @ bell(0).conj().T, 1), - # Concurrence of a product state is zero. - (np.kron(e_0, e_1) @ np.kron(e_0, e_1).conj().T, 0), -]) +@pytest.mark.parametrize( + "rho, expected_result", + [ + # Concurrence of maximally entangled Bell state. + (bell(0) @ bell(0).conj().T, 1), + # Concurrence of a product state is zero. + (np.kron(e_0, e_1) @ np.kron(e_0, e_1).conj().T, 0), + ], +) def test_concurrence(rho, expected_result): res = concurrence(rho) np.testing.assert_equal(np.isclose(res, expected_result), True) -@pytest.mark.parametrize("rho", [ - # Tests for invalid dimension inputs. - (np.identity(5)), -]) +@pytest.mark.parametrize( + "rho", + [ + # Tests for invalid dimension inputs. + (np.identity(5)), + ], +) def test_concurrence_invalid_input(rho): with np.testing.assert_raises(ValueError): concurrence(rho) diff --git a/toqito/state_props/tests/test_entanglement_of_formation.py b/toqito/state_props/tests/test_entanglement_of_formation.py index e95b7bad5..1652f904e 100644 --- a/toqito/state_props/tests/test_entanglement_of_formation.py +++ b/toqito/state_props/tests/test_entanglement_of_formation.py @@ -9,24 +9,30 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("rho, dim, expected_result", [ - # The entanglement-of-formation on a Bell state. - (bell(0) @ bell(0).conj().T, None, 1), - # The entanglement-of-formation on a maximally mixed. - (max_mixed(4, False) @ max_mixed(4, False).conj().T, None, 0), -]) +@pytest.mark.parametrize( + "rho, dim, expected_result", + [ + # The entanglement-of-formation on a Bell state. + (bell(0) @ bell(0).conj().T, None, 1), + # The entanglement-of-formation on a maximally mixed. + (max_mixed(4, False) @ max_mixed(4, False).conj().T, None, 0), + ], +) def test_entanglement_of_formation(rho, dim, expected_result): np.testing.assert_equal(np.isclose(entanglement_of_formation(rho, dim), expected_result), True) -@pytest.mark.parametrize("rho, dim", [ - # Invalid local dimension for entanglement_of_formation. - (np.identity(4), 3), - # Not presently known how to calculate for mixed states. - (3 / 4 * e_0 * e_0.conj().T + 1 / 4 * e_1 * e_1.conj().T, None), - # Invalid non-square matrix for entanglement_of_formation. - (np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]), None), -]) +@pytest.mark.parametrize( + "rho, dim", + [ + # Invalid local dimension for entanglement_of_formation. + (np.identity(4), 3), + # Not presently known how to calculate for mixed states. + (3 / 4 * e_0 * e_0.conj().T + 1 / 4 * e_1 * e_1.conj().T, None), + # Invalid non-square matrix for entanglement_of_formation. + (np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]), None), + ], +) def test_entanglement_of_formation_invalid(rho, dim): """Ensures that an integer above 4 is error-checked.""" with np.testing.assert_raises(ValueError): diff --git a/toqito/state_props/tests/test_has_symmetric_extension.py b/toqito/state_props/tests/test_has_symmetric_extension.py index fd9cc4b80..9c54c9759 100644 --- a/toqito/state_props/tests/test_has_symmetric_extension.py +++ b/toqito/state_props/tests/test_has_symmetric_extension.py @@ -6,30 +6,44 @@ from toqito.states import bell -@pytest.mark.parametrize("rho, level, dim, ppt, expected_result", [ - # Check whether 2-qubit state has a symmetric extension. - (np.array([[1, 0, 0, -1], [0, 1, 1 / 2, 0], [0, 1 / 2, 1, 0], [-1, 0, 0, 1]]), 2, None, True, True), - # Check whether state has level-1 symmetric extension.""" - (np.identity(4), 1, None, False, True), - # Entangled state should not have symmetric extension for some level.""" - (bell(0) @ bell(0).conj().T, 1, None, True, False), - # Entangled state should not have symmetric extension for some level (level-2). - (bell(0) @ bell(0).conj().T, 2, None, True, False), - # Provide dimension of system as list. - (bell(0) @ bell(0).conj().T, 2, [2, 2], True, False), - # Entangled state should not have non-PPT-symmetric extension for some level (level-2). - (bell(0) @ bell(0).conj().T, 2, 2, False, False), - # Entangled state should not have PPT-symmetric extension for some level (level-2).""" - (bell(0) @ bell(0).conj().T, 2, 2, True, False), -]) +@pytest.mark.parametrize( + "rho, level, dim, ppt, expected_result", + [ + # Check whether 2-qubit state has a symmetric extension. + ( + np.array([[1, 0, 0, -1], [0, 1, 1 / 2, 0], [0, 1 / 2, 1, 0], [-1, 0, 0, 1]]), + 2, + None, + True, + True, + ), + # Check whether state has level-1 symmetric extension.""" + (np.identity(4), 1, None, False, True), + # Entangled state should not have symmetric extension for some level.""" + (bell(0) @ bell(0).conj().T, 1, None, True, False), + # Entangled state should not have symmetric extension for some level (level-2). + (bell(0) @ bell(0).conj().T, 2, None, True, False), + # Provide dimension of system as list. + (bell(0) @ bell(0).conj().T, 2, [2, 2], True, False), + # Entangled state should not have non-PPT-symmetric extension for some level (level-2). + (bell(0) @ bell(0).conj().T, 2, 2, False, False), + # Entangled state should not have PPT-symmetric extension for some level (level-2).""" + (bell(0) @ bell(0).conj().T, 2, 2, True, False), + ], +) def test_has_symmetric_extension(rho, level, dim, ppt, expected_result): - np.testing.assert_equal(has_symmetric_extension(rho=rho, level=level, dim=dim, ppt=ppt), expected_result) + np.testing.assert_equal( + has_symmetric_extension(rho=rho, level=level, dim=dim, ppt=ppt), expected_result + ) -@pytest.mark.parametrize("rho, level, dim, ppt", [ - # Check whether 2-qubit state has a symmetric extension. - (np.identity(6), 1, 4, True), -]) +@pytest.mark.parametrize( + "rho, level, dim, ppt", + [ + # Check whether 2-qubit state has a symmetric extension. + (np.identity(6), 1, 4, True), + ], +) def test_has_symmetric_extension_invalid_dim(rho, level, dim, ppt): """Tests for invalid dimension inputs.""" with np.testing.assert_raises(ValueError): diff --git a/toqito/state_props/tests/test_in_separable_ball.py b/toqito/state_props/tests/test_in_separable_ball.py index cd3bad7be..99d0b5215 100644 --- a/toqito/state_props/tests/test_in_separable_ball.py +++ b/toqito/state_props/tests/test_in_separable_ball.py @@ -7,15 +7,24 @@ random_u_mat = random_unitary(4) -@pytest.mark.parametrize("rho, expected_result", [ - # Test matrix in separable ball returns True. - (random_u_mat @ np.diag(np.array([1, 1, 1, 0])) / 3 @ random_u_mat.conj().T, True), - # Test matrix not in separable ball returns False. - (random_u_mat @ np.diag(np.array([1.01, 1, 0.99, 0])) / 3 @ random_u_mat.conj().T, False), - # Test for case when trace of matrix is less than the largest dim.""" - (np.zeros((4, 4)), False), - # Test eigenvalues of matrix not in separable ball returns False. - (np.linalg.eigvalsh(random_u_mat @ np.diag(np.array([1.01, 1, 0.99, 0])) / 3 @ random_u_mat.conj().T), False), -]) + +@pytest.mark.parametrize( + "rho, expected_result", + [ + # Test matrix in separable ball returns True. + (random_u_mat @ np.diag(np.array([1, 1, 1, 0])) / 3 @ random_u_mat.conj().T, True), + # Test matrix not in separable ball returns False. + (random_u_mat @ np.diag(np.array([1.01, 1, 0.99, 0])) / 3 @ random_u_mat.conj().T, False), + # Test for case when trace of matrix is less than the largest dim.""" + (np.zeros((4, 4)), False), + # Test eigenvalues of matrix not in separable ball returns False. + ( + np.linalg.eigvalsh( + random_u_mat @ np.diag(np.array([1.01, 1, 0.99, 0])) / 3 @ random_u_mat.conj().T + ), + False, + ), + ], +) def test_in_separable_ball(rho, expected_result): np.testing.assert_equal(in_separable_ball(rho), expected_result) diff --git a/toqito/state_props/tests/test_is_ensemble.py b/toqito/state_props/tests/test_is_ensemble.py index d04a80c97..e231daf0f 100644 --- a/toqito/state_props/tests/test_is_ensemble.py +++ b/toqito/state_props/tests/test_is_ensemble.py @@ -5,11 +5,14 @@ from toqito.state_props import is_ensemble -@pytest.mark.parametrize("states, expected_result", [ - # Test if valid ensemble returns True. - ([np.array([[0.5, 0], [0, 0]]), np.array([[0, 0], [0, 0.5]])], True), - # Test if non-valid (non-PSD) ensemble returns False. - ([np.array([[0.5, 0], [0, 0]]), np.array([[-1, -1], [-1, -1]])], False), -]) +@pytest.mark.parametrize( + "states, expected_result", + [ + # Test if valid ensemble returns True. + ([np.array([[0.5, 0], [0, 0]]), np.array([[0, 0], [0, 0.5]])], True), + # Test if non-valid (non-PSD) ensemble returns False. + ([np.array([[0.5, 0], [0, 0]]), np.array([[-1, -1], [-1, -1]])], False), + ], +) def test_is_ensemble(states, expected_result): np.testing.assert_equal(is_ensemble(states), expected_result) diff --git a/toqito/state_props/tests/test_is_mixed.py b/toqito/state_props/tests/test_is_mixed.py index d459dc867..f1dc95a6f 100644 --- a/toqito/state_props/tests/test_is_mixed.py +++ b/toqito/state_props/tests/test_is_mixed.py @@ -8,9 +8,12 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("states, expected_result", [ - # Return True for mixed quantum state. - (3/4 * e_0 @ e_0.conj().T + 1/4 * e_1 @ e_1.conj().T, True), -]) +@pytest.mark.parametrize( + "states, expected_result", + [ + # Return True for mixed quantum state. + (3 / 4 * e_0 @ e_0.conj().T + 1 / 4 * e_1 @ e_1.conj().T, True), + ], +) def test_is_mixed(states, expected_result): np.testing.assert_equal(is_mixed(states), expected_result) diff --git a/toqito/state_props/tests/test_is_mutually_orthogonal.py b/toqito/state_props/tests/test_is_mutually_orthogonal.py index 241ca794b..f5ec487c5 100644 --- a/toqito/state_props/tests/test_is_mutually_orthogonal.py +++ b/toqito/state_props/tests/test_is_mutually_orthogonal.py @@ -6,38 +6,44 @@ from toqito.states import bell -@pytest.mark.parametrize("states, expected_result", [ - # Return True for orthogonal Bell vectors. - ([bell(0), bell(1), bell(2), bell(3)], True), - # Return False for non-orthogonal vectors. - ([np.array([1, 0]), np.array([1, 1])], False), - # Orthogonal vectors in R^2 - ([np.array([1, 0]), np.array([0, 1])], True), - # Orthogonal vectors in R^2 - ([np.array([1, 0, 0]), np.array([0, 1, 0]), np.array([0, 0, 1])], True), - # Orthogonal complex-valued vectors - ([np.array([[1], [1j]]), np.array([[1j], [1]])], True), - # Vectors with zero elements. - ([np.array([[0], [0]]), np.array([[1], [0]])], True), - # Colinear vectors. - ([np.array([[1], [2]]), np.array([2, 4])], False), - # Vectors that are theoretically orthogonal but due to numerical precision issues might not be exactly orthogonal. - ([np.array([[1], [np.sqrt(2)]]), np.array([[-np.sqrt(2)], [1]])], True), -]) +@pytest.mark.parametrize( + "states, expected_result", + [ + # Return True for orthogonal Bell vectors. + ([bell(0), bell(1), bell(2), bell(3)], True), + # Return False for non-orthogonal vectors. + ([np.array([1, 0]), np.array([1, 1])], False), + # Orthogonal vectors in R^2 + ([np.array([1, 0]), np.array([0, 1])], True), + # Orthogonal vectors in R^2 + ([np.array([1, 0, 0]), np.array([0, 1, 0]), np.array([0, 0, 1])], True), + # Orthogonal complex-valued vectors + ([np.array([[1], [1j]]), np.array([[1j], [1]])], True), + # Vectors with zero elements. + ([np.array([[0], [0]]), np.array([[1], [0]])], True), + # Colinear vectors. + ([np.array([[1], [2]]), np.array([2, 4])], False), + # Vectors that are theoretically orthogonal but due to numerical precision issues might not be exactly orthogonal. + ([np.array([[1], [np.sqrt(2)]]), np.array([[-np.sqrt(2)], [1]])], True), + ], +) def test_is_mutually_orthogonal(states, expected_result): np.testing.assert_equal(is_mutually_orthogonal(states), expected_result) -@pytest.mark.parametrize("states", [ - # Tests for invalid input len. - ([np.array([1, 0])]), - # Single vector should raise error. - ([np.array([[1], [2], [3]])]), - # Vectors of differing lengths. - ([np.array([[1], [0]]), np.array([[1], [0], [1]])]), - # Empty vector. - ([]), -]) +@pytest.mark.parametrize( + "states", + [ + # Tests for invalid input len. + ([np.array([1, 0])]), + # Single vector should raise error. + ([np.array([[1], [2], [3]])]), + # Vectors of differing lengths. + ([np.array([[1], [0]]), np.array([[1], [0], [1]])]), + # Empty vector. + ([]), + ], +) def test_is_mutually_orthogonal_basis_invalid_input(states): with np.testing.assert_raises(ValueError): is_mutually_orthogonal(states) diff --git a/toqito/state_props/tests/test_is_mutually_unbiased_basis.py b/toqito/state_props/tests/test_is_mutually_unbiased_basis.py index 0997ae123..0d9af0642 100644 --- a/toqito/state_props/tests/test_is_mutually_unbiased_basis.py +++ b/toqito/state_props/tests/test_is_mutually_unbiased_basis.py @@ -8,38 +8,40 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("states, expected_result", [ - # Return True for MUB of dimension 2. - ( - [ - [e_0, e_1], - [1 / np.sqrt(2) * (e_0 + e_1), 1 / np.sqrt(2) * (e_0 - e_1)], - [1 / np.sqrt(2) * (e_0 + 1j * e_1), 1 / np.sqrt(2) * (e_0 - 1j * e_1)], - ], - True - ), - # Return False for non-MUB of dimension 2. - ( - [ - [e_0, e_1], - [1 / np.sqrt(2) * (e_0 + e_1), e_1], - [1 / np.sqrt(2) * (e_0 + 1j * e_1), e_0], - ], - False - ), -]) +@pytest.mark.parametrize( + "states, expected_result", + [ + # Return True for MUB of dimension 2. + ( + [ + [e_0, e_1], + [1 / np.sqrt(2) * (e_0 + e_1), 1 / np.sqrt(2) * (e_0 - e_1)], + [1 / np.sqrt(2) * (e_0 + 1j * e_1), 1 / np.sqrt(2) * (e_0 - 1j * e_1)], + ], + True, + ), + # Return False for non-MUB of dimension 2. + ( + [ + [e_0, e_1], + [1 / np.sqrt(2) * (e_0 + e_1), e_1], + [1 / np.sqrt(2) * (e_0 + 1j * e_1), e_0], + ], + False, + ), + ], +) def test_is_mutually_unbiased(states, expected_result): np.testing.assert_equal(is_mutually_unbiased_basis(states), expected_result) -@pytest.mark.parametrize("states", [ - # Invalid input length. - ( - [ - np.array([1, 0]) - ] - ), -]) +@pytest.mark.parametrize( + "states", + [ + # Invalid input length. + ([np.array([1, 0])]), + ], +) def test_is_mutually_unbiased_basis_invalid_input(states): with np.testing.assert_raises(ValueError): is_mutually_unbiased_basis(states) diff --git a/toqito/state_props/tests/test_is_npt.py b/toqito/state_props/tests/test_is_npt.py index e704b2f24..7531e6330 100644 --- a/toqito/state_props/tests/test_is_npt.py +++ b/toqito/state_props/tests/test_is_npt.py @@ -6,19 +6,22 @@ from toqito.states import bell, horodecki -@pytest.mark.parametrize("mat, sys, dim, tol, expected_result", [ - # Check that non-NPT matrix returns False with sys specified. - (np.identity(9), 2, None, None, False), - # Check that non-NPT matrix returns False with dim and sys specified. - (np.identity(9), 2, np.round(np.sqrt(9)), None, False), - # Check that non-NPT matrix returns False. - (np.identity(9), 2, np.round(np.sqrt(9)), None, False), - # Check that non-NPT matrix with tolerance returns False. - (np.identity(9), 2, np.round(np.sqrt(9)), 1e-10, False), - # Entangled state of dimension 2 will violate NPT criterion. - (bell(2) @ bell(2).conj().T, 2, None, None, True), - # Horodecki state is an example of an entangled NPT state. - (horodecki(0.5, [3, 3]), 2, None, None, False), -]) +@pytest.mark.parametrize( + "mat, sys, dim, tol, expected_result", + [ + # Check that non-NPT matrix returns False with sys specified. + (np.identity(9), 2, None, None, False), + # Check that non-NPT matrix returns False with dim and sys specified. + (np.identity(9), 2, np.round(np.sqrt(9)), None, False), + # Check that non-NPT matrix returns False. + (np.identity(9), 2, np.round(np.sqrt(9)), None, False), + # Check that non-NPT matrix with tolerance returns False. + (np.identity(9), 2, np.round(np.sqrt(9)), 1e-10, False), + # Entangled state of dimension 2 will violate NPT criterion. + (bell(2) @ bell(2).conj().T, 2, None, None, True), + # Horodecki state is an example of an entangled NPT state. + (horodecki(0.5, [3, 3]), 2, None, None, False), + ], +) def test_is_npt(mat, sys, dim, tol, expected_result): np.testing.assert_equal(is_npt(mat=mat, sys=sys, dim=dim, tol=tol), expected_result) diff --git a/toqito/state_props/tests/test_is_ppt.py b/toqito/state_props/tests/test_is_ppt.py index a2893f2e7..70950b6b6 100644 --- a/toqito/state_props/tests/test_is_ppt.py +++ b/toqito/state_props/tests/test_is_ppt.py @@ -6,17 +6,20 @@ from toqito.states import bell, horodecki -@pytest.mark.parametrize("mat, sys, dim, tol, expected_result", [ - # Check that PPT matrix returns True. - (np.identity(9), 2, None, None, True), - # Check that PPT matrix returns True with dim and sys specified. - (np.identity(9), 2, [3], None, True), - # Check that PPT matrix returns True. - (np.identity(9), 2, [3], 1e-10, True), - # Entangled state of dimension 2 will violate PPT criterion. - (bell(2) @ bell(2).conj().T, 2, None, None, False), - # Horodecki state is an example of an entangled PPT state. - (horodecki(0.5, [3, 3]), 2, None, None, True) -]) +@pytest.mark.parametrize( + "mat, sys, dim, tol, expected_result", + [ + # Check that PPT matrix returns True. + (np.identity(9), 2, None, None, True), + # Check that PPT matrix returns True with dim and sys specified. + (np.identity(9), 2, [3], None, True), + # Check that PPT matrix returns True. + (np.identity(9), 2, [3], 1e-10, True), + # Entangled state of dimension 2 will violate PPT criterion. + (bell(2) @ bell(2).conj().T, 2, None, None, False), + # Horodecki state is an example of an entangled PPT state. + (horodecki(0.5, [3, 3]), 2, None, None, True), + ], +) def test_is_ppt(mat, sys, dim, tol, expected_result): np.testing.assert_equal(is_ppt(mat=mat, sys=sys, dim=dim, tol=tol), expected_result) diff --git a/toqito/state_props/tests/test_is_product.py b/toqito/state_props/tests/test_is_product.py index 79694d186..2ec471e51 100644 --- a/toqito/state_props/tests/test_is_product.py +++ b/toqito/state_props/tests/test_is_product.py @@ -9,24 +9,31 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("rho, dim, expected_result", [ - # Check that is_product_vector returns False for an entangled state. - (max_entangled(3), None, False), - # Check that dimension argument as list is supported. - (max_entangled(4), [4, 4], False), - # Check that dimension argument as list is supported. - (max_entangled(4), [2, 2, 2, 2], False), - # Check that is_product_vector returns True for a separable state. - (1 / 2 * (np.kron(e_0, e_0) - np.kron(e_0, e_1) - np.kron(e_1, e_0) + np.kron(e_1, e_1)), None, True), - # Check to ensure that pure state living in C^2 x C^2 x C^2 is product. - (1 / np.sqrt(2) * np.array([1, 0, 0, 0, 1, 0, 0, 0]), [2, 2, 2], True), - # Check to ensure that a separable density matrix is product. - (np.identity(4), None, True), - # Check to ensure that an entangled density matrix is not product. - (bell(0) @ bell(0).conj().T, None, False), - # Check to ensure that an entangled density matrix is not product (with dimension). - (bell(0) @ bell(0).conj().T, [2, 2], False), -]) +@pytest.mark.parametrize( + "rho, dim, expected_result", + [ + # Check that is_product_vector returns False for an entangled state. + (max_entangled(3), None, False), + # Check that dimension argument as list is supported. + (max_entangled(4), [4, 4], False), + # Check that dimension argument as list is supported. + (max_entangled(4), [2, 2, 2, 2], False), + # Check that is_product_vector returns True for a separable state. + ( + 1 / 2 * (np.kron(e_0, e_0) - np.kron(e_0, e_1) - np.kron(e_1, e_0) + np.kron(e_1, e_1)), + None, + True, + ), + # Check to ensure that pure state living in C^2 x C^2 x C^2 is product. + (1 / np.sqrt(2) * np.array([1, 0, 0, 0, 1, 0, 0, 0]), [2, 2, 2], True), + # Check to ensure that a separable density matrix is product. + (np.identity(4), None, True), + # Check to ensure that an entangled density matrix is not product. + (bell(0) @ bell(0).conj().T, None, False), + # Check to ensure that an entangled density matrix is not product (with dimension). + (bell(0) @ bell(0).conj().T, [2, 2], False), + ], +) def test_is_product(rho, dim, expected_result): ipv, _ = is_product(rho=rho, dim=dim) np.testing.assert_equal(ipv, expected_result) diff --git a/toqito/state_props/tests/test_is_pure.py b/toqito/state_props/tests/test_is_pure.py index 6fe9d66fc..bad127a33 100644 --- a/toqito/state_props/tests/test_is_pure.py +++ b/toqito/state_props/tests/test_is_pure.py @@ -9,15 +9,24 @@ e_0, e_1, e_2 = np.array([[1], [0], [0]]), np.array([[0], [1], [0]]), np.array([[0], [0], [1]]) -@pytest.mark.parametrize("state, expected_result", [ - # Ensure that pure Bell state returns True. - (bell(0) @ bell(0).conj().T, True), - # Check that list of pure states returns True. - ([e_0 @ e_0.conj().T, e_1 @ e_1.conj().T, e_2 @ e_2.conj().T], True), - # Check that non-pure state returns False. - (np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), False), - # Check that list of non-pure states return False. - ([np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), np.array([[1, 2, 3], [10, 11, 12], [7, 8, 9]])], False), -]) +@pytest.mark.parametrize( + "state, expected_result", + [ + # Ensure that pure Bell state returns True. + (bell(0) @ bell(0).conj().T, True), + # Check that list of pure states returns True. + ([e_0 @ e_0.conj().T, e_1 @ e_1.conj().T, e_2 @ e_2.conj().T], True), + # Check that non-pure state returns False. + (np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), False), + # Check that list of non-pure states return False. + ( + [ + np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), + np.array([[1, 2, 3], [10, 11, 12], [7, 8, 9]]), + ], + False, + ), + ], +) def test_is_pure_state(state, expected_result): np.testing.assert_equal(is_pure(state), expected_result) diff --git a/toqito/state_props/tests/test_is_separable.py b/toqito/state_props/tests/test_is_separable.py index c06624ed3..9984c249c 100644 --- a/toqito/state_props/tests/test_is_separable.py +++ b/toqito/state_props/tests/test_is_separable.py @@ -83,10 +83,10 @@ def test_entangled_cross_norm_realignment_criterion(): p_var, a_var, b_var = 0.4, 0.8, 0.64 rho = np.array( [ - [p_var * a_var**2, 0, 0, p_var * a_var * b_var], - [0, (1 - p_var) * a_var**2, (1 - p_var) * a_var * b_var, 0], - [0, (1 - p_var) * a_var * b_var, (1 - p_var) * a_var**2, 0], - [p_var * a_var * b_var, 0, 0, p_var * a_var**2], + [p_var * a_var ** 2, 0, 0, p_var * a_var * b_var], + [0, (1 - p_var) * a_var ** 2, (1 - p_var) * a_var * b_var, 0], + [0, (1 - p_var) * a_var * b_var, (1 - p_var) * a_var ** 2, 0], + [p_var * a_var * b_var, 0, 0, p_var * a_var ** 2], ] ) np.testing.assert_equal(is_separable(rho), False) diff --git a/toqito/state_props/tests/test_log_negativity.py b/toqito/state_props/tests/test_log_negativity.py index 4ebeef804..cc1b81857 100644 --- a/toqito/state_props/tests/test_log_negativity.py +++ b/toqito/state_props/tests/test_log_negativity.py @@ -5,22 +5,35 @@ from toqito.state_props import log_negativity -@pytest.mark.parametrize("rho, dim, expected_result", [ - # Test for log_negativity on rho. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), None, 1), - # Test for log_negativity on rho (with dimension). - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 2, 1), -]) +@pytest.mark.parametrize( + "rho, dim, expected_result", + [ + # Test for log_negativity on rho. + ( + np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), + None, + 1, + ), + # Test for log_negativity on rho (with dimension). + (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 2, 1), + ], +) def test_log_negativity(rho, dim, expected_result): np.testing.assert_allclose(log_negativity(rho, dim), expected_result) -@pytest.mark.parametrize("rho, dim", [ - # Invalid dim parameters. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 5), - # Invalid dim parameters as list. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), [2, 5]), -]) +@pytest.mark.parametrize( + "rho, dim", + [ + # Invalid dim parameters. + (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 5), + # Invalid dim parameters as list. + ( + np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), + [2, 5], + ), + ], +) def test_log_negativity_invalid_input(rho, dim): with np.testing.assert_raises(ValueError): log_negativity(rho, dim) diff --git a/toqito/state_props/tests/test_negativity.py b/toqito/state_props/tests/test_negativity.py index b3f0d64d0..8347d5055 100644 --- a/toqito/state_props/tests/test_negativity.py +++ b/toqito/state_props/tests/test_negativity.py @@ -5,22 +5,39 @@ from toqito.state_props import negativity -@pytest.mark.parametrize("rho, dim, expected_result", [ - # Test for log_negativity on rho. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), None, 1 / 2), - # Test for negativity on rho for dimension as integer. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 2, 1 / 2), -]) +@pytest.mark.parametrize( + "rho, dim, expected_result", + [ + # Test for log_negativity on rho. + ( + np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), + None, + 1 / 2, + ), + # Test for negativity on rho for dimension as integer. + ( + np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), + 2, + 1 / 2, + ), + ], +) def test_negativity(rho, dim, expected_result): np.testing.assert_allclose(negativity(rho, dim), expected_result) -@pytest.mark.parametrize("rho, dim", [ - # Invalid dim parameters. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 5), - # Invalid dim parameters as list. - (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), [2, 5]), -]) +@pytest.mark.parametrize( + "rho, dim", + [ + # Invalid dim parameters. + (np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), 5), + # Invalid dim parameters as list. + ( + np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]), + [2, 5], + ), + ], +) def test_negativity_invalid_input(rho, dim): with np.testing.assert_raises(ValueError): negativity(rho, dim) diff --git a/toqito/state_props/tests/test_purity.py b/toqito/state_props/tests/test_purity.py index e45a59880..9b28a700b 100644 --- a/toqito/state_props/tests/test_purity.py +++ b/toqito/state_props/tests/test_purity.py @@ -6,20 +6,26 @@ from toqito.states import werner -@pytest.mark.parametrize("rho, expected_result", [ - # Test for identity matrix. - (np.identity(4) / 4, 1 / 4), - # Test purity of mixed Werner state. - (werner(2, 1 / 4), 0.2653), -]) +@pytest.mark.parametrize( + "rho, expected_result", + [ + # Test for identity matrix. + (np.identity(4) / 4, 1 / 4), + # Test purity of mixed Werner state. + (werner(2, 1 / 4), 0.2653), + ], +) def test_purity(rho, expected_result): np.testing.assert_allclose(purity(rho), expected_result, atol=4) -@pytest.mark.parametrize("rho", [ - # Test purity on non-density matrix. - (np.array([[1, 2], [3, 4]])), -]) +@pytest.mark.parametrize( + "rho", + [ + # Test purity on non-density matrix. + (np.array([[1, 2], [3, 4]])), + ], +) def test_purity_invalid(rho): with np.testing.assert_raises(ValueError): purity(rho) diff --git a/toqito/state_props/tests/test_schmidt_rank.py b/toqito/state_props/tests/test_schmidt_rank.py index 5c792b0ee..e9a71c2e3 100644 --- a/toqito/state_props/tests/test_schmidt_rank.py +++ b/toqito/state_props/tests/test_schmidt_rank.py @@ -9,32 +9,39 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("rho, dim, expected_result", [ - # Computing the Schmidt rank of the entangled Bell state should yield a value greater than 1. - (bell(0), None, 2), - # Computing the Schmidt rank of Bell state with dim 1. - (bell(0), 1, 1), - # Computing the Schmidt rank of Bell state with list as argument for dims. - (bell(0), [2, 2], 2), - # Computing the Schmidt rank of a separable state should yield a value equal to 1. - (1 / 2 * (np.kron(e_0, e_0) - np.kron(e_0, e_1) - np.kron(e_1, e_0) + np.kron(e_1, e_1)), None, 1), - # Computing Schmidt rank of separable density matrix should be 1. - (np.identity(4), None, 1), - # Computing Schmidt rank of separable density matrix should be 1. - (np.identity(16), None, 1), - # Computing Schmidt rank of first Bell density matrices should be 4. - (bell(0) @ bell(0).conj().T, None, 4), - # Computing Schmidt rank of second Bell density matrices should be 4. - (bell(1) @ bell(1).conj().T, None, 4), - # Computing Schmidt rank of third Bell density matrices should be 4. - (bell(2) @ bell(2).conj().T, None, 4), - # Computing Schmidt rank of fourth Bell density matrices should be 4. - (bell(3) @ bell(3).conj().T, None, 4), - # Computing Schmidt rank of first Bell density matrices should be 4 (dimension as integer). - (bell(0) @ bell(0).conj().T, 2, 4), - # Computing Schmidt rank of first Bell density matrices should be 4 (dimension as list). - (bell(0) @ bell(0).conj().T, [2, 2], 4), -]) +@pytest.mark.parametrize( + "rho, dim, expected_result", + [ + # Computing the Schmidt rank of the entangled Bell state should yield a value greater than 1. + (bell(0), None, 2), + # Computing the Schmidt rank of Bell state with dim 1. + (bell(0), 1, 1), + # Computing the Schmidt rank of Bell state with list as argument for dims. + (bell(0), [2, 2], 2), + # Computing the Schmidt rank of a separable state should yield a value equal to 1. + ( + 1 / 2 * (np.kron(e_0, e_0) - np.kron(e_0, e_1) - np.kron(e_1, e_0) + np.kron(e_1, e_1)), + None, + 1, + ), + # Computing Schmidt rank of separable density matrix should be 1. + (np.identity(4), None, 1), + # Computing Schmidt rank of separable density matrix should be 1. + (np.identity(16), None, 1), + # Computing Schmidt rank of first Bell density matrices should be 4. + (bell(0) @ bell(0).conj().T, None, 4), + # Computing Schmidt rank of second Bell density matrices should be 4. + (bell(1) @ bell(1).conj().T, None, 4), + # Computing Schmidt rank of third Bell density matrices should be 4. + (bell(2) @ bell(2).conj().T, None, 4), + # Computing Schmidt rank of fourth Bell density matrices should be 4. + (bell(3) @ bell(3).conj().T, None, 4), + # Computing Schmidt rank of first Bell density matrices should be 4 (dimension as integer). + (bell(0) @ bell(0).conj().T, 2, 4), + # Computing Schmidt rank of first Bell density matrices should be 4 (dimension as list). + (bell(0) @ bell(0).conj().T, [2, 2], 4), + ], +) def test_schmidt_rank_bell_state(rho, dim, expected_result): np.testing.assert_allclose(schmidt_rank(rho, dim), expected_result) @@ -49,6 +56,7 @@ def test_schmidt_rank_entangled_state(): ) np.testing.assert_equal(schmidt_rank(phi) == 2, True) + def test_schmidt_rank_singlet_state(): """ Computing the Schmidt rank of the entangled singlet state should yield diff --git a/toqito/state_props/tests/test_von_neumann_entropy.py b/toqito/state_props/tests/test_von_neumann_entropy.py index c1be71c87..0de5d0b4c 100644 --- a/toqito/state_props/tests/test_von_neumann_entropy.py +++ b/toqito/state_props/tests/test_von_neumann_entropy.py @@ -6,20 +6,26 @@ from toqito.states import bell, max_mixed -@pytest.mark.parametrize("rho, expected_result", [ - # Entangled state von Neumann entropy should be zero. - (bell(0) @ bell(0).conj().T, 0), - # Von Neumann entropy of the maximally mixed state should be one. - (max_mixed(2, is_sparse=False), 1), -]) +@pytest.mark.parametrize( + "rho, expected_result", + [ + # Entangled state von Neumann entropy should be zero. + (bell(0) @ bell(0).conj().T, 0), + # Von Neumann entropy of the maximally mixed state should be one. + (max_mixed(2, is_sparse=False), 1), + ], +) def test_von_neumann_entropy(rho, expected_result): np.testing.assert_allclose(von_neumann_entropy(rho), expected_result, atol=1e-5) -@pytest.mark.parametrize("rho", [ - # Test von Neumann entropy on non-density matrix. - (np.array([[1, 2], [3, 4]])), -]) +@pytest.mark.parametrize( + "rho", + [ + # Test von Neumann entropy on non-density matrix. + (np.array([[1, 2], [3, 4]])), + ], +) def test_von_neumann_invalid_input(rho): with np.testing.assert_raises(ValueError): von_neumann_entropy(rho) diff --git a/toqito/states/basis.py b/toqito/states/basis.py index 47b309ac1..36abe8bc6 100644 --- a/toqito/states/basis.py +++ b/toqito/states/basis.py @@ -36,7 +36,7 @@ def basis(dim: int, pos: int) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: If the input position is not in the range [0, dim - 1]. :param dim: The dimension of the column vector. diff --git a/toqito/states/brauer.py b/toqito/states/brauer.py index 1d14df2c7..2711102df 100644 --- a/toqito/states/brauer.py +++ b/toqito/states/brauer.py @@ -53,7 +53,7 @@ def brauer(dim: int, p_val: int) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :param dim: Dimension of each local subsystem :param p_val: Half of the number of parties (i.e., the state that this function computes will diff --git a/toqito/states/breuer.py b/toqito/states/breuer.py index 14368dfd3..30f661253 100644 --- a/toqito/states/breuer.py +++ b/toqito/states/breuer.py @@ -33,7 +33,7 @@ def breuer(dim: int, lam: float) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: Dimension must be greater than or equal to 1. :param dim: Dimension of the Breuer state. diff --git a/toqito/states/chessboard.py b/toqito/states/chessboard.py index 76a0d7d68..bf6843c41 100644 --- a/toqito/states/chessboard.py +++ b/toqito/states/chessboard.py @@ -44,8 +44,8 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = ========== .. bibliography:: :filter: docname in docnames - - + + :param mat_params: Parameters of the chessboard state as defined in [BP00]_. :param s_param: Default is :code:`np.conj(mat_params[2]) / np.conj(mat_params[5])`. :param t_param: Default is :code:`t_param = mat_params[0] * mat_params[3] / mat_params[4]`. diff --git a/toqito/states/ghz.py b/toqito/states/ghz.py index 79e621040..6bce0735d 100644 --- a/toqito/states/ghz.py +++ b/toqito/states/ghz.py @@ -63,7 +63,7 @@ def ghz(dim: int, num_qubits: int, coeff: list[int] = None) -> sparse: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: Number of qubits is not a positive integer. :param dim: The local dimension. @@ -89,9 +89,9 @@ def ghz(dim: int, num_qubits: int, coeff: list[int] = None) -> sparse: # than naively tensoring things together. dim_sum = 1 for i in range(1, num_qubits): - dim_sum += dim**i + dim_sum += dim ** i - ret_ghz_state = sparse.lil_matrix((dim**num_qubits, 1)) + ret_ghz_state = sparse.lil_matrix((dim ** num_qubits, 1)) for i in range(1, dim + 1): ret_ghz_state[(i - 1) * dim_sum] = coeff[i - 1] return ret_ghz_state diff --git a/toqito/states/horodecki.py b/toqito/states/horodecki.py index e4291bf7f..a6805fdfd 100644 --- a/toqito/states/horodecki.py +++ b/toqito/states/horodecki.py @@ -121,7 +121,7 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: if np.array_equal(dim, np.array([3, 3])): n_a_param = 1 / (8 * a_param + 1) b_param = (1 + a_param) / 2 - c_param = np.sqrt(1 - a_param**2) / 2 + c_param = np.sqrt(1 - a_param ** 2) / 2 horo_state = n_a_param * np.array( [ @@ -141,7 +141,7 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: if np.array_equal(dim, np.array([2, 4])): n_a_param = 1 / (7 * a_param + 1) b_param = (1 + a_param) / 2 - c_param = np.sqrt(1 - a_param**2) / 2 + c_param = np.sqrt(1 - a_param ** 2) / 2 horo_state = n_a_param * np.array( [ diff --git a/toqito/states/isotropic.py b/toqito/states/isotropic.py index 096b049fb..ff92d4274 100644 --- a/toqito/states/isotropic.py +++ b/toqito/states/isotropic.py @@ -52,11 +52,11 @@ def isotropic(dim: int, alpha: float) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :param dim: The local dimension. :param alpha: The parameter of the isotropic state. :return: Isotropic state of dimension :code:`dim`. """ psi = max_entangled(dim, False, False) - return (1 - alpha) * np.identity(dim**2) / dim**2 + alpha * psi * psi.conj().T / dim + return (1 - alpha) * np.identity(dim ** 2) / dim ** 2 + alpha * psi * psi.conj().T / dim diff --git a/toqito/states/max_entangled.py b/toqito/states/max_entangled.py index 992967838..e039e4d8d 100644 --- a/toqito/states/max_entangled.py +++ b/toqito/states/max_entangled.py @@ -49,7 +49,7 @@ def max_entangled( ========== .. bibliography:: :filter: docname in docnames - + :param dim: Dimension of the entangled state. :param is_sparse: `True` if vector is spare and `False` otherwise. @@ -57,7 +57,7 @@ def max_entangled( :return: The maximally entangled state of dimension :code:`dim`. """ mat = sp.sparse.identity(dim) if is_sparse else np.identity(dim) - psi = np.reshape(mat, (dim**2, 1)) + psi = np.reshape(mat, (dim ** 2, 1)) if is_normalized: psi = psi / np.sqrt(dim) return psi diff --git a/toqito/states/singlet.py b/toqito/states/singlet.py index 50a2c025b..a5e0e87ce 100644 --- a/toqito/states/singlet.py +++ b/toqito/states/singlet.py @@ -69,4 +69,4 @@ def singlet(dim: int) -> np.ndarray: :param dim: The dimension of the generalized singlet state. :return: The singlet state of dimension `dim`. """ - return (np.identity(dim**2) - swap_operator([dim, dim])) / ((dim**2) - dim) + return (np.identity(dim ** 2) - swap_operator([dim, dim])) / ((dim ** 2) - dim) diff --git a/toqito/states/tests/test_basis.py b/toqito/states/tests/test_basis.py index 97b486209..67152f783 100644 --- a/toqito/states/tests/test_basis.py +++ b/toqito/states/tests/test_basis.py @@ -5,14 +5,17 @@ from toqito.states import basis -@pytest.mark.parametrize("dim, pos, expected_result", [ - # Test for `|0>`. - (2, 0, np.array([[1], [0]])), - # Test for `|1>`. - (2, 1, np.array([[0], [1]])), - # Test for `|0000>`. - (4, 0, np.array([[1], [0], [0], [0]])), -]) +@pytest.mark.parametrize( + "dim, pos, expected_result", + [ + # Test for `|0>`. + (2, 0, np.array([[1], [0]])), + # Test for `|1>`. + (2, 1, np.array([[0], [1]])), + # Test for `|0000>`. + (4, 0, np.array([[1], [0], [0], [0]])), + ], +) def test_basis(dim, pos, expected_result): np.testing.assert_array_equal(basis(dim, pos), expected_result) diff --git a/toqito/states/tests/test_bell.py b/toqito/states/tests/test_bell.py index cd6447163..74c017d2f 100644 --- a/toqito/states/tests/test_bell.py +++ b/toqito/states/tests/test_bell.py @@ -7,26 +7,32 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("bell_idx, expected_result", [ - # 1/sqrt(2) * (|00> + |11>) - (0, 1 / np.sqrt(2) * (np.kron(e_0, e_0) + np.kron(e_1, e_1))), - # 1/sqrt(2) * (|00> - |11>) - (1, 1 / np.sqrt(2) * (np.kron(e_0, e_0) - np.kron(e_1, e_1))), - # 1/sqrt(2) * (|01> + |10>) - (2, 1 / np.sqrt(2) * (np.kron(e_0, e_1) + np.kron(e_1, e_0))), - # 1/sqrt(2) * (|01> - |10>) - (3, 1 / np.sqrt(2) * (np.kron(e_0, e_1) - np.kron(e_1, e_0))), -]) +@pytest.mark.parametrize( + "bell_idx, expected_result", + [ + # 1/sqrt(2) * (|00> + |11>) + (0, 1 / np.sqrt(2) * (np.kron(e_0, e_0) + np.kron(e_1, e_1))), + # 1/sqrt(2) * (|00> - |11>) + (1, 1 / np.sqrt(2) * (np.kron(e_0, e_0) - np.kron(e_1, e_1))), + # 1/sqrt(2) * (|01> + |10>) + (2, 1 / np.sqrt(2) * (np.kron(e_0, e_1) + np.kron(e_1, e_0))), + # 1/sqrt(2) * (|01> - |10>) + (3, 1 / np.sqrt(2) * (np.kron(e_0, e_1) - np.kron(e_1, e_0))), + ], +) def test_bell(bell_idx, expected_result): np.testing.assert_array_equal(bell(bell_idx), expected_result) -@pytest.mark.parametrize("bell_idx", [ - # Invalid index. - (4), - # Invalid index. - (10), -]) +@pytest.mark.parametrize( + "bell_idx", + [ + # Invalid index. + (4), + # Invalid index. + (10), + ], +) def test_bell_invalid(bell_idx): """Ensures that an integer above 3 is error-checked.""" with np.testing.assert_raises(ValueError): diff --git a/toqito/states/tests/test_brauer.py b/toqito/states/tests/test_brauer.py index be75de0f7..e5c22a9f0 100644 --- a/toqito/states/tests/test_brauer.py +++ b/toqito/states/tests/test_brauer.py @@ -26,9 +26,12 @@ ) -@pytest.mark.parametrize("dim, p_val, expected_result", [ - # Generate Brauer states on 4 qubits. - (2, 2, brauer_2_2), -]) +@pytest.mark.parametrize( + "dim, p_val, expected_result", + [ + # Generate Brauer states on 4 qubits. + (2, 2, brauer_2_2), + ], +) def test_brauer(dim, p_val, expected_result): np.testing.assert_array_equal(brauer(dim, p_val), expected_result) diff --git a/toqito/states/tests/test_breuer.py b/toqito/states/tests/test_breuer.py index c0db8c2d5..1065f82f7 100644 --- a/toqito/states/tests/test_breuer.py +++ b/toqito/states/tests/test_breuer.py @@ -5,18 +5,24 @@ from toqito.states import breuer -@pytest.mark.parametrize("dim, lam, expected_result", [ - # Generate Breuer state of dimension 4 with weight 0.1. - (2, 0.1, np.array([[0.3, 0, 0, 0], [0, 0.2, 0.1, 0], [0, 0.1, 0.2, 0], [0, 0, 0, 0.3]])), -]) +@pytest.mark.parametrize( + "dim, lam, expected_result", + [ + # Generate Breuer state of dimension 4 with weight 0.1. + (2, 0.1, np.array([[0.3, 0, 0, 0], [0, 0.2, 0.1, 0], [0, 0.1, 0.2, 0], [0, 0, 0, 0.3]])), + ], +) def test_breuer(dim, lam, expected_result): np.testing.assert_allclose(breuer(dim, lam), expected_result) -@pytest.mark.parametrize("dim, lam", [ - # Ensures that an odd dimension if not accepted. - (3, 0.1) -]) +@pytest.mark.parametrize( + "dim, lam", + [ + # Ensures that an odd dimension if not accepted. + (3, 0.1) + ], +) def test_breuer_invalid(dim, lam): with np.testing.assert_raises(ValueError): breuer(dim, lam) diff --git a/toqito/states/tests/test_domino.py b/toqito/states/tests/test_domino.py index 6e9d21b1f..fd77b3ea0 100644 --- a/toqito/states/tests/test_domino.py +++ b/toqito/states/tests/test_domino.py @@ -7,26 +7,29 @@ e_0, e_1, e_2 = np.array([[1], [0], [0]]), np.array([[0], [1], [0]]), np.array([[0], [0], [1]]) -@pytest.mark.parametrize("idx, expected_result", [ - # Domino with index = 0. - (0, np.kron(e_1, e_1)), - # Domino with index = 1. - (1, np.kron(e_0, 1 / np.sqrt(2) * (e_0 + e_1))), - # Domino with index = 2. - (2, np.kron(e_0, 1 / np.sqrt(2) * (e_0 - e_1))), - # Domino with index = 3. - (3, np.kron(e_2, 1 / np.sqrt(2) * (e_1 + e_2))), - # Domino with index = 4. - (4, np.kron(e_2, 1 / np.sqrt(2) * (e_1 - e_2))), - # Domino with index = 5. - (5, np.kron(1 / np.sqrt(2) * (e_1 + e_2), e_0)), - # Domino with index = 6. - (6, np.kron(1 / np.sqrt(2) * (e_1 - e_2), e_0)), - # Domino with index = 7. - (7, np.kron(1 / np.sqrt(2) * (e_0 + e_1), e_2)), - # Domino with index = 8. - (8, np.kron(1 / np.sqrt(2) * (e_0 - e_1), e_2)), -]) +@pytest.mark.parametrize( + "idx, expected_result", + [ + # Domino with index = 0. + (0, np.kron(e_1, e_1)), + # Domino with index = 1. + (1, np.kron(e_0, 1 / np.sqrt(2) * (e_0 + e_1))), + # Domino with index = 2. + (2, np.kron(e_0, 1 / np.sqrt(2) * (e_0 - e_1))), + # Domino with index = 3. + (3, np.kron(e_2, 1 / np.sqrt(2) * (e_1 + e_2))), + # Domino with index = 4. + (4, np.kron(e_2, 1 / np.sqrt(2) * (e_1 - e_2))), + # Domino with index = 5. + (5, np.kron(1 / np.sqrt(2) * (e_1 + e_2), e_0)), + # Domino with index = 6. + (6, np.kron(1 / np.sqrt(2) * (e_1 - e_2), e_0)), + # Domino with index = 7. + (7, np.kron(1 / np.sqrt(2) * (e_0 + e_1), e_2)), + # Domino with index = 8. + (8, np.kron(1 / np.sqrt(2) * (e_0 - e_1), e_2)), + ], +) def test_domino(idx, expected_result): np.testing.assert_array_equal(domino(idx), expected_result) diff --git a/toqito/states/tests/test_gen_bell.py b/toqito/states/tests/test_gen_bell.py index 3196ddf5d..3c4a69536 100644 --- a/toqito/states/tests/test_gen_bell.py +++ b/toqito/states/tests/test_gen_bell.py @@ -5,16 +5,18 @@ from toqito.states import bell, gen_bell -@pytest.mark.parametrize("k_1, k_2, dim, expected_result", [ - # Generalized Bell state for k_1 = k_2 = 0 and dim = 2. - (0, 0, 2, bell(0) @ bell(0).conj().T), - # Generalized Bell state for k_1 = 0, k_2 = 1 and dim = 2. - (0, 1, 2, bell(1) @ bell(1).conj().T), - # Generalized Bell state for k_1 = 1, k_2 = 0 and dim = 2. - (1, 0, 2, bell(2) @ bell(2).conj().T), - # Generalized Bell state for k_1 = 1, k_2 = 1 and dim = 2. - (1, 1, 2, bell(3) @ bell(3).conj().T), - -]) +@pytest.mark.parametrize( + "k_1, k_2, dim, expected_result", + [ + # Generalized Bell state for k_1 = k_2 = 0 and dim = 2. + (0, 0, 2, bell(0) @ bell(0).conj().T), + # Generalized Bell state for k_1 = 0, k_2 = 1 and dim = 2. + (0, 1, 2, bell(1) @ bell(1).conj().T), + # Generalized Bell state for k_1 = 1, k_2 = 0 and dim = 2. + (1, 0, 2, bell(2) @ bell(2).conj().T), + # Generalized Bell state for k_1 = 1, k_2 = 1 and dim = 2. + (1, 1, 2, bell(3) @ bell(3).conj().T), + ], +) def test_gen_bell(k_1, k_2, dim, expected_result): np.testing.assert_allclose(gen_bell(k_1, k_2, dim), expected_result) diff --git a/toqito/states/tests/test_ghz.py b/toqito/states/tests/test_ghz.py index 95fcb32ff..956a12b26 100644 --- a/toqito/states/tests/test_ghz.py +++ b/toqito/states/tests/test_ghz.py @@ -10,10 +10,13 @@ ghz_2_3 = 1 / np.sqrt(2) * (tensor(e_0, e_0, e_0) + tensor(e_1, e_1, e_1)) -@pytest.mark.parametrize("dim, num_qubits, coeff, expected_res", [ - # Produces the 3-qubit GHZ state: `1/sqrt(2) * (|000> + |111>)`. - (2, 3, None, ghz_2_3), -]) +@pytest.mark.parametrize( + "dim, num_qubits, coeff, expected_res", + [ + # Produces the 3-qubit GHZ state: `1/sqrt(2) * (|000> + |111>)`. + (2, 3, None, ghz_2_3), + ], +) def test_ghz(dim, num_qubits, coeff, expected_res): res = ghz(dim, num_qubits, coeff).toarray() np.testing.assert_allclose(res, expected_res) @@ -45,14 +48,17 @@ def test_ghz_4_7(): np.testing.assert_allclose(res, expected_res) -@pytest.mark.parametrize("dim, num_qubits, coeff", [ - # Invalid dimensions. - (0, 2, None), - # Invalid qubits. - (2, 0, None), - # Invalid coefficients. - (2, 3, [1, 2, 3, 4, 5]), -]) +@pytest.mark.parametrize( + "dim, num_qubits, coeff", + [ + # Invalid dimensions. + (0, 2, None), + # Invalid qubits. + (2, 0, None), + # Invalid coefficients. + (2, 3, [1, 2, 3, 4, 5]), + ], +) def test_ghz_invalid_input(dim, num_qubits, coeff): """Tests for invalid dimensions.""" with np.testing.assert_raises(ValueError): diff --git a/toqito/states/tests/test_horodecki.py b/toqito/states/tests/test_horodecki.py index 4e9e86fd4..0d124e7a6 100644 --- a/toqito/states/tests/test_horodecki.py +++ b/toqito/states/tests/test_horodecki.py @@ -64,14 +64,17 @@ def test_horodecki_state_2_4(): np.testing.assert_allclose(res, expected_res, atol=0.2) -@pytest.mark.parametrize("a_param, dim", [ - # Invalid a_param (negative).""" - (-5, None), - # Invalid a_param.""" - (5, None), - # Tests for invalid dimension inputs. - (0.5, [3, 4]), -]) +@pytest.mark.parametrize( + "a_param, dim", + [ + # Invalid a_param (negative).""" + (-5, None), + # Invalid a_param.""" + (5, None), + # Tests for invalid dimension inputs. + (0.5, [3, 4]), + ], +) def test_horodecki_invalid(a_param, dim): """Tests for invalid a_param and dimension inputs.""" with np.testing.assert_raises(ValueError): diff --git a/toqito/states/tests/test_isotropic.py b/toqito/states/tests/test_isotropic.py index 9fe553af2..03514c7f8 100644 --- a/toqito/states/tests/test_isotropic.py +++ b/toqito/states/tests/test_isotropic.py @@ -3,17 +3,20 @@ from toqito.states import isotropic -iso_dim_3_alpha_half = np.array([ - [0.22222222, 0, 0, 0, 0.16666667, 0, 0, 0, 0.16666667], - [0, 0.05555556, 0, 0, 0, 0, 0, 0, 0], - [0, 0, 0.05555556, 0, 0, 0, 0, 0, 0], - [0, 0, 0, 0.05555556, 0, 0, 0, 0, 0], - [0.16666667, 0, 0, 0, 0.22222222, 0, 0, 0, 0.16666667], - [0, 0, 0, 0, 0, 0.05555556, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0.05555556, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0.05555556, 0], - [0.16666667, 0, 0, 0, 0.16666667, 0, 0, 0, 0.22222222], -]) +iso_dim_3_alpha_half = np.array( + [ + [0.22222222, 0, 0, 0, 0.16666667, 0, 0, 0, 0.16666667], + [0, 0.05555556, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0.05555556, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0.05555556, 0, 0, 0, 0, 0], + [0.16666667, 0, 0, 0, 0.22222222, 0, 0, 0, 0.16666667], + [0, 0, 0, 0, 0, 0.05555556, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0.05555556, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0.05555556, 0], + [0.16666667, 0, 0, 0, 0.16666667, 0, 0, 0, 0.22222222], + ] +) + def test_isotropic_qutrit(): """Generate a qutrit isotropic state with `alpha` = 1/2.""" diff --git a/toqito/states/tests/test_max_entangled.py b/toqito/states/tests/test_max_entangled.py index 051a41166..087276a77 100644 --- a/toqito/states/tests/test_max_entangled.py +++ b/toqito/states/tests/test_max_entangled.py @@ -8,12 +8,15 @@ e_0, e_1 = np.array([[1], [0]]), np.array([[0], [1]]) -@pytest.mark.parametrize("dim, is_sparse, is_normalized, expected_res", [ - # Generate maximally entangled state: `1/sqrt(2) * (|00> + |11>)`.""" - (2, False, True, 1 / np.sqrt(2) * (np.kron(e_0, e_0) + np.kron(e_1, e_1))), - # Generate maximally entangled state: `|00> + |11>`. - (2, False, False, 1 * (np.kron(e_0, e_0) + np.kron(e_1, e_1))), -]) +@pytest.mark.parametrize( + "dim, is_sparse, is_normalized, expected_res", + [ + # Generate maximally entangled state: `1/sqrt(2) * (|00> + |11>)`.""" + (2, False, True, 1 / np.sqrt(2) * (np.kron(e_0, e_0) + np.kron(e_1, e_1))), + # Generate maximally entangled state: `|00> + |11>`. + (2, False, False, 1 * (np.kron(e_0, e_0) + np.kron(e_1, e_1))), + ], +) def test_max_entangled(dim, is_sparse, is_normalized, expected_res): res = max_entangled(dim=dim, is_sparse=is_sparse, is_normalized=is_normalized) np.testing.assert_allclose(res, expected_res) diff --git a/toqito/states/tests/test_tile.py b/toqito/states/tests/test_tile.py index 187ba6ee6..3de5fd380 100644 --- a/toqito/states/tests/test_tile.py +++ b/toqito/states/tests/test_tile.py @@ -8,27 +8,33 @@ e_0, e_1, e_2 = np.array([[1], [0], [0]]), np.array([[0], [1], [0]]), np.array([[0], [0], [1]]) -@pytest.mark.parametrize("tile_idx, expected_result", [ - # |\psi_0 \rangle = \frac{1}{\sqrt{2}} |0 \rangle \left(|0\rangle - |1\rangle \right). - (0, 1 / np.sqrt(2) * np.kron(e_0, (e_0 - e_1))), - # |\psi_1\rangle = \frac{1}{\sqrt{2}} \left(|0\rangle - |1\rangle \right) |2\rangle - (1, 1 / np.sqrt(2) * np.kron((e_0 - e_1), e_2)), - # |\psi_2\rangle = \frac{1}{\sqrt{2}} |2\rangle \left(|1\rangle - |2\rangle \right) - (2, 1 / np.sqrt(2) * np.kron(e_2, (e_1 - e_2))), - # |\psi_3\rangle = \frac{1}{\sqrt{2}} \left(|1\rangle - |2\rangle \right) |0\rangle - (3, 1 / np.sqrt(2) * np.kron((e_1 - e_2), e_0)), - # |\psi_4\rangle = \frac{1}{3} \left(|0\rangle + |1\rangle + - # |2\rangle)\right) \left(|0\rangle + |1\rangle + |2\rangle. - (4, 1 / 3 * np.kron((e_0 + e_1 + e_2), (e_0 + e_1 + e_2))), -]) +@pytest.mark.parametrize( + "tile_idx, expected_result", + [ + # |\psi_0 \rangle = \frac{1}{\sqrt{2}} |0 \rangle \left(|0\rangle - |1\rangle \right). + (0, 1 / np.sqrt(2) * np.kron(e_0, (e_0 - e_1))), + # |\psi_1\rangle = \frac{1}{\sqrt{2}} \left(|0\rangle - |1\rangle \right) |2\rangle + (1, 1 / np.sqrt(2) * np.kron((e_0 - e_1), e_2)), + # |\psi_2\rangle = \frac{1}{\sqrt{2}} |2\rangle \left(|1\rangle - |2\rangle \right) + (2, 1 / np.sqrt(2) * np.kron(e_2, (e_1 - e_2))), + # |\psi_3\rangle = \frac{1}{\sqrt{2}} \left(|1\rangle - |2\rangle \right) |0\rangle + (3, 1 / np.sqrt(2) * np.kron((e_1 - e_2), e_0)), + # |\psi_4\rangle = \frac{1}{3} \left(|0\rangle + |1\rangle + + # |2\rangle)\right) \left(|0\rangle + |1\rangle + |2\rangle. + (4, 1 / 3 * np.kron((e_0 + e_1 + e_2), (e_0 + e_1 + e_2))), + ], +) def test_tile(tile_idx, expected_result): np.testing.assert_array_equal(tile(tile_idx), expected_result) -@pytest.mark.parametrize("tile_idx", [ - # Invalid idx. - (5, 1 / np.sqrt(2) * np.kron(e_0, (e_0 - e_1))), -]) +@pytest.mark.parametrize( + "tile_idx", + [ + # Invalid idx. + (5, 1 / np.sqrt(2) * np.kron(e_0, (e_0 - e_1))), + ], +) def test_tile_invalid(tile_idx): """Ensures that an integer above 4 is error-checked.""" with np.testing.assert_raises(ValueError): diff --git a/toqito/states/tests/test_w_state.py b/toqito/states/tests/test_w_state.py index ddfc77a21..314909706 100644 --- a/toqito/states/tests/test_w_state.py +++ b/toqito/states/tests/test_w_state.py @@ -36,12 +36,15 @@ def test_w_state_generalized(): np.testing.assert_allclose(res, expected_res, atol=0.2) -@pytest.mark.parametrize("idx, coeff", [ - # Number of qubits needs to be greater than 2. - (1, None), - # Length of coefficient list needs to be equal to number of qubits. - (4, [1, 2, 3]), -]) +@pytest.mark.parametrize( + "idx, coeff", + [ + # Number of qubits needs to be greater than 2. + (1, None), + # Length of coefficient list needs to be equal to number of qubits. + (4, [1, 2, 3]), + ], +) def test_w_state_invalid(idx, coeff): with np.testing.assert_raises(ValueError): w_state(idx, coeff) diff --git a/toqito/states/w_state.py b/toqito/states/w_state.py index 454155156..8a8b28c12 100644 --- a/toqito/states/w_state.py +++ b/toqito/states/w_state.py @@ -71,7 +71,7 @@ def w_state(num_qubits: int, coeff: list[int] = None) -> np.ndarray: ========== .. bibliography:: :filter: docname in docnames - + :raises ValueError: The number of qubits must be greater than or equal to 1. :param num_qubits: An integer representing the number of qubits. @@ -89,9 +89,9 @@ def w_state(num_qubits: int, coeff: list[int] = None) -> np.ndarray: "of length equal to `num_qubits`." ) - ret_w_state = sparse.csr_matrix((2**num_qubits, 1)).toarray() + ret_w_state = sparse.csr_matrix((2 ** num_qubits, 1)).toarray() for i in range(num_qubits): - ret_w_state[2**i] = coeff[num_qubits - i - 1] + ret_w_state[2 ** i] = coeff[num_qubits - i - 1] return np.around(ret_w_state, 4) diff --git a/toqito/states/werner.py b/toqito/states/werner.py index 74d845c67..ae7b58426 100644 --- a/toqito/states/werner.py +++ b/toqito/states/werner.py @@ -120,10 +120,10 @@ def werner(dim: int, alpha: float | list[float]) -> np.ndarray: sorted_perms = np.argsort(perms, axis=1) + 1 for i in range(2, n_fac): - rho = np.identity(dim**n_var) - alpha[i - 1] * permutation_operator( + rho = np.identity(dim ** n_var) - alpha[i - 1] * permutation_operator( dim, sorted_perms[i, :], False, True ) rho = rho / np.trace(rho) return rho # Bipartite Werner state. - return (np.identity(dim**2) - alpha * swap_operator(dim, True)) / (dim * (dim - alpha)) + return (np.identity(dim ** 2) - alpha * swap_operator(dim, True)) / (dim * (dim - alpha)) From c9727f0d1eb91812c123f7e0cad042b223eb0318 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Wed, 22 Nov 2023 20:43:56 -0600 Subject: [PATCH 27/40] bibtex error --- docs/articles.bib | 196 +++++++++++------------ docs/books.bib | 2 +- docs/index.rst | 2 +- toqito/nonlocal_games/quantum_hedging.py | 2 +- toqito/states/chessboard.py | 2 +- 5 files changed, 102 insertions(+), 102 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 46df55ee1..95d3f0922 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -2,16 +2,16 @@ #Last name begins with A @misc{AaronsonMaxMixed, - author = "Wikipedia", - title = "Lecture 6: {M}ixed {S}tates", - howpublished = "\url{https://www.scottaaronson.com/qclec/6.pdf}" + author = {Aaronson, Scott}, + title = "Lecture 6: Mixed States", + howpublished = {https://www.scottaaronson.com/qclec/6.pdf} } @misc{arunachalam2017quantum, title={Quantum hedging in two-round prover-verifier interactions}, - author={Srinivasan Arunachalam and Abel Molina and Vincent Russo}, + author={Arunachalam, Srinivasan and Molina, Abel and Russo, Vincent}, year={2017}, eprint={1310.7954}, archivePrefix={arXiv}, @@ -32,7 +32,7 @@ @article{Bandyopadhyay_2014 publisher={American Physical Society (APS)}, author={Bandyopadhyay, Somshubhro and Jain, Rahul and Oppenheim, Jonathan and Perry, Christopher}, year={2014}, - month=feb } + month={feb} } @article{Bennett_1999, title={Quantum nonlocality without entanglement}, @@ -45,7 +45,7 @@ @article{Bennett_1999 publisher={American Physical Society (APS)}, author={Bennett, Charles H. and DiVincenzo, David P. and Fuchs, Christopher A. and Mor, Tal and Rains, Eric and Shor, Peter W. and Smolin, John A. and Wootters, William K.}, year={1999}, - month=feb, pages={1070-1091} } + month={feb}, pages={1070-1091} } @article{Bennett_1999upb, title={Unextendible Product Bases and Bound Entanglement}, @@ -58,7 +58,7 @@ @article{Bennett_1999upb publisher={American Physical Society (APS)}, author={Bennett, Charles H. and DiVincenzo, David P. and Mor, Tal and Shor, Peter W. and Smolin, John A. and Terhal, Barbara M.}, year={1999}, - month=jun, pages={5385-5388} } + month={jun}, pages={5385-5388} } @article{Breuer_2006, @@ -72,7 +72,7 @@ @article{Breuer_2006 publisher={American Physical Society (APS)}, author={Breuer, Heinz-Peter}, year={2006}, - month=aug } + month={aug} } #Last name begins with C @@ -103,7 +103,7 @@ @article{Chen_2014 publisher={American Physical Society (APS)}, author={Chen, Jianxin and Ji, Zhengfeng and Kribs, David and Lütkenhaus, Norbert and Zeng, Bei}, year={2014}, - month=sep } + month={sep} } @article{Choi_1992, title = {Generalized Choi maps in three-dimensional matrix algebra}, @@ -129,7 +129,7 @@ @article{Chru_ci_ski_2011 publisher={Elsevier BV}, author={Chruściński, Dariusz and Kossakowski, Andrzej}, year={2011}, - month=jan, pages={434-436} } + month={jan}, pages={434-436} } @misc{cleve2008strong, title={Strong Parallel Repetition Theorem for Quantum XOR Proof Systems}, @@ -160,19 +160,19 @@ @article{Cosentino_2013 publisher={American Physical Society (APS)}, author={Cosentino, Alessandro}, year={2013}, - month=jan } + month={jan} } @misc{cosentino_2015, title={Quantum State Local Distinguishability via Convex Optimization}, author={Alessandro Cosentino}, year={2015}, - howpublished = "\url{https://uwspace.uwaterloo.ca/handle/10012/9572}" + howpublished = {https://uwspace.uwaterloo.ca/handle/10012/9572} } @misc{cvxpy_kron, author = {Murray, Riley J}, title = {{PR:} Have kron support non-constant expressions in either argument from {CXPY:} A Python-embedded modeling language for convex optimization problems}, - howpublished = "\url{https://github.com/cvxpy/cvxpy/issues/457#issue-309891424}"} + howpublished = {https://github.com/cvxpy/cvxpy/issues/457#issue-309891424}} #Last name begins with D @@ -187,7 +187,7 @@ @article{DiVincenzo_2000 publisher={American Physical Society (APS)}, author={DiVincenzo, David P. and Shor, Peter W. and Smolin, John A. and Terhal, Barbara M. and Thapliyal, Ashish V.}, year={2000}, - month=may } + month={may} } @article{Doherty_2002, @@ -201,7 +201,7 @@ @article{Doherty_2002 publisher={American Physical Society (APS)}, author={Doherty, A. C. and Parrilo, Pablo A. and Spedalieri, Federico M.}, year={2002}, - month=apr } + month={apr} } @article{D_r_2000, title={Three qubits can be entangled in two inequivalent ways}, @@ -214,7 +214,7 @@ @article{D_r_2000 publisher={American Physical Society (APS)}, author={Dür, W. and Vidal, G. and Cirac, J. I.}, year={2000}, - month=nov } + month={nov} } #Last name begins with E @article{Eldar_2003, @@ -228,7 +228,7 @@ @article{Eldar_2003 publisher={Institute of Electrical and Electronics Engineers (IEEE)}, author={Eldar, Y.C.}, year={2003}, - month=feb, pages={446-456} } + month={feb}, pages={446-456} } #Last name begins with F @@ -267,7 +267,7 @@ @article{Gurvits_2002 publisher={American Physical Society (APS)}, author={Gurvits, Leonid and Barnum, Howard}, year={2002}, - month=dec } + month={dec} } #Last name begins with H @@ -279,7 +279,7 @@ @inproceedings{Hayden_2013 publisher={IEEE}, author={Hayden, Patrick and Milner, Kevin and Wilde, Mark M.}, year={2013}, - month=jun } + month={jun} } @article{Heinosaari_2020, title={Random positive operator valued measures}, @@ -292,7 +292,7 @@ @article{Heinosaari_2020 publisher={AIP Publishing}, author={Heinosaari, Teiko and Jivulescu, Maria Anastasia and Nechita, Ion}, year={2020}, - month=apr } + month={apr} } @article{Horodecki_1997, title={Separability criterion and inseparable mixed states with positive partial transposition}, @@ -305,7 +305,7 @@ @article{Horodecki_1997 publisher={Elsevier BV}, author={Horodecki, Pawel}, year={1997}, - month=aug, pages={333-339} } + month={aug}, pages={333-339} } @misc{horodecki1998reduction, title={Reduction criterion of separability and limits for a class of protocols of entanglement distillation}, @@ -329,7 +329,7 @@ @article{Johnston_2010 publisher={AIP Publishing}, author={Johnston, Nathaniel and Kribs, David W.}, year={2010}, - month=aug } + month={aug} } @misc{johnston2012norms, @@ -352,13 +352,13 @@ @article{Johnston_2016 publisher={The Royal Society}, author={Johnston, Nathaniel and Mittal, Rajat and Russo, Vincent and Watrous, John}, year={2016}, - month=may, pages={20160003} } + month={may}, pages={20160003} } @misc{QETLAB_CB_norm, author = {Johnston, Nathaniel}, title = {{CB} norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/CBNorm.m} (Accessed: January 12, 2016)", + howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/CBNorm.m}, DOI ={10.5281/zenodo.44637} } @@ -366,7 +366,7 @@ @misc{QETLAB_CB_norm @misc{QETLAB_Diamond_norm, author = {Johnston, Nathaniel}, title = {Diamond norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/DiamondNorm.m} (Accessed: January 12, 2016)", + howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/DiamondNorm.m}, DOI ={10.5281/zenodo.44637} } @@ -374,7 +374,7 @@ @misc{QETLAB_Diamond_norm @misc{QETLAB_Kraus_Operators, author = {Johnston, Nathaniel}, title = {KrausOperators from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/KrausOperators.m} (Accessed: January 12, 2016)", + howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/KrausOperators.m}, DOI ={10.5281/zenodo.44637} } @@ -382,7 +382,7 @@ @misc{QETLAB_Kraus_Operators @misc{QETLAB_Superoperator_Dim, author = {Johnston, Nathaniel}, title = {Superoperator dims from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/superoperator_dims.m}", + howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/superoperator_dims.m}, DOI ={10.5281/zenodo.44637} } @@ -391,7 +391,7 @@ @misc{QETLAB_Superoperator_Dim @misc{QETLAB_Update_Odomoter, author = {Johnston, Nathaniel}, title = {Update Odometer from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = "\url{https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/update_odometer.m}", + howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/update_odometer.m}, DOI ={10.5281/zenodo.44637} } @@ -407,7 +407,7 @@ @article{Katariya_2021 publisher={Springer Science and Business Media LLC}, author={Katariya, Vishal and Wilde, Mark M.}, year={2021}, - month=feb } + month={feb} } #Last name begins with L @article{Liang_2007, @@ -421,7 +421,7 @@ @article{Liang_2007 publisher={American Physical Society (APS)}, author={Liang, Yeong-Cherng and Doherty, Andrew C.}, year={2007}, - month=apr } + month={apr} } @article{Lupo_2008, @@ -435,7 +435,7 @@ @article{Lupo_2008 publisher={IOP Publishing}, author={Lupo, Cosmo and Aniello, Paolo and Scardicchio, Antonello}, year={2008}, - month=sep, pages={415301} } + month={sep}, pages={415301} } #Last name begins with M @@ -468,7 +468,7 @@ @article{Molina_2012 publisher={The Royal Society}, author={Molina, Abel and Watrous, John}, year={2012}, - month=apr, pages={2614-2629} } + month={apr}, pages={2614-2629} } @misc{molina2012optimal, title={Optimal counterfeiting attacks and generalizations for Wiesner's quantum money}, @@ -491,7 +491,7 @@ @article{Navascu_s_2008 publisher={IOP Publishing}, author={Navascués, Miguel and Pironio, Stefano and Acín, Antonio}, year={2008}, - month=jul, pages={073013} } + month={jul}, pages={073013} } @article{Navascu_s_2008p, title={Pure State Estimation and the Characterization of Entanglement}, @@ -504,13 +504,13 @@ @article{Navascu_s_2008p publisher={American Physical Society (APS)}, author={Navascués, Miguel}, year={2008}, - month=feb } + month={feb} } #Last name begins with O @misc{OzolsRandU, author = "Maris Ozols", title = "How to generate a random unitary matrix", - howpublished = "\url{http://home.lu.lv/~sd20008/papers/essays/Random%20unitary%20[paper].pdf}" + howpublished = {http://home.lu.lv/~sd20008/papers/essays/Random%20unitary%20[paper].pdf} } @@ -526,7 +526,7 @@ @article{Peres_1996 publisher={American Physical Society (APS)}, author={Peres, Asher}, year={1996}, - month=aug, pages={1413-1415} } + month={aug}, pages={1413-1415} } @misc{Philip2023schrodinger, title={Schr\"odinger as a Quantum Programmer: Estimating Entanglement via Steering}, @@ -548,27 +548,27 @@ @article{Pusey_2012 publisher={Springer Science and Business Media LLC}, author={Pusey, Matthew F. and Barrett, Jonathan and Rudolph, Terry}, year={2012}, - month=may, pages={475-478} } + month={may}, pages={475-478} } #Last name begins with Q @misc{QuantikiEOF, author = "Quantiki", title = "Entanglement of Formation", - howpublished = "\url{https://www.quantiki.org/wiki/entanglement-formation}" + howpublished = {https://www.quantiki.org/wiki/entanglement-formation} } @misc{QuantikiTrNorm, author = "Quantiki", title = "Trace norm", - howpublished = "\url{https://www.quantiki.org/wiki/trace-norm}" + howpublished = {https://www.quantiki.org/wiki/trace-norm} } @misc{QuantikiTrDist, author = "Quantiki", title = "Trace distance", - howpublished = "\url{https://www.quantiki.org/wiki/trace-distance}" + howpublished = {https://www.quantiki.org/wiki/trace-distance} } @@ -607,7 +607,7 @@ @article{PhysRevA.40.4277 @misc{Rigetti_docs, author = "Rigetti", title = "Forest Benchmarking", - howpublished = "\url{https://github.com/rigetti/forest-benchmarking}" + howpublished = {https://github.com/rigetti/forest-benchmarking} } @@ -624,7 +624,7 @@ @misc{russo2017extended @misc{seshadri2021git, author = "Wikipedia", title = "Akshay Seshadri", - howpublished = "\url{https://github.com/akshayseshadri/minimax-fidelity-estimation}" + howpublished = {https://github.com/akshayseshadri/minimax-fidelity-estimation} } @@ -650,7 +650,7 @@ @misc{seshadri2021versatile @misc{SO_43884189, author = "Stack Overflow Post", title = "Check if a large matrix is diagonal matrix in python", - howpublished = "\url{https://stackoverflow.com/questions/43884189/}" + howpublished = {https://stackoverflow.com/questions/43884189/} } @@ -689,7 +689,7 @@ @misc{Watrous_2011_lecture_notes title={Theory of Quantum Information Lecture Notes}, author={John Watrous}, year={2011}, - howpublished = "\url{https://cs.uwaterloo.ca/~watrous/TQI-notes/}" + howpublished = {https://cs.uwaterloo.ca/~watrous/TQI-notes/} } @@ -725,84 +725,84 @@ @article{Wiesner_1983 @misc{WikiAsymmOp, author = "Wikipedia", title = "Anti-symmetric operator", - howpublished = "\url{https://en.wikipedia.org/wiki/Anti-symmetric_operator}" + howpublished = {https://en.wikipedia.org/wiki/Anti-symmetric_operator} } @misc{WikiBellSt, author = "Wikipedia", title = "Bell State", - howpublished = "\url{https://en.wikipedia.org/wiki/Bell_state}" + howpublished = {https://en.wikipedia.org/wiki/Bell_state} } @misc{WikiBraKet, author = "Wikipedia", title = "Bra-ket notation", - howpublished = "\url{https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation}" + howpublished = {https://en.wikipedia.org/wiki/Bra%E2%80%93ket_notation} } @misc{WikiBrauer, author = "Wikipedia", title = "Brauer Algebra", - howpublished = "\url{https://en.wikipedia.org/wiki/Brauer_algebra}" + howpublished = {https://en.wikipedia.org/wiki/Brauer_algebra} } @misc{WikiBures, author = "Wikipedia", title = "Bures distance", - howpublished = "\url{https://en.wikipedia.org/wiki/Bures_metric#Bures_distance}" + howpublished = {https://en.wikipedia.org/wiki/Bures_metric#Bures_distance} } @misc{WikiCirc, author = "Wikipedia", title = "Circulant matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Circulant_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Circulant_matrix} } @misc{WikiCircLaw, author = "Wikipedia", title = "Circular law", - howpublished = "\url{https://en.wikipedia.org/wiki/Circular_law}" + howpublished = {https://en.wikipedia.org/wiki/Circular_law} } @misc{WikiClock, author = "Wikipedia", title = "Generalizations of Pauli matrices", - howpublished = "\url{https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices}" + howpublished = {https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices} } @misc{WikiCNOT, author = "Wikipedia", title = "Controlled NOT gate", - howpublished = "\url{https://en.wikipedia.org/wiki/Controlled_NOT_gate}" + howpublished = {https://en.wikipedia.org/wiki/Controlled_NOT_gate} } @misc{WikiComm, author = "Wikipedia", title = "Commuting matrices", - howpublished = "\url{https://en.wikipedia.org/wiki/Commuting_matrices}" + howpublished = {https://en.wikipedia.org/wiki/Commuting_matrices} } @misc{WikiConcurrence, author = "Wikipedia", title = "Concurrence (quantum computing)", - howpublished = "\url{https://en.wikipedia.org/wiki/Concurrence_(quantum_computing)}" + howpublished = {https://en.wikipedia.org/wiki/Concurrence_(quantum_computing)} } @misc{WikiDen, author = "Wikipedia", title = "Density Matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Density_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Density_matrix} } @@ -811,56 +811,56 @@ @misc{WikiDen @misc{WikiDepo, author = "Wikipedia", title = "Quantum Depolarizing Channel", - howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_depolarizing_channel}" + howpublished = {https://en.wikipedia.org/wiki/Quantum_depolarizing_channel} } @misc{WikiDFT, author = "Wikipedia", title = "{DFT} matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/DFT_matrix}" + howpublished = {https://en.wikipedia.org/wiki/DFT_matrix} } @misc{WikiDiag, author = "Wikipedia", title = "Diagonal matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Diagonal_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Diagonal_matrix} } @misc{WikiDiagDom, author = "Wikipedia", title = "Diagonally dominant matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Diagonally_dominant_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Diagonally_dominant_matrix} } @misc{WikiFidQuant, author = "Wikipedia", title = "Fidelity of quantum states", - howpublished = "\url{https://en.wikipedia.org/wiki/Fidelity_of_quantum_states}" + howpublished = {https://en.wikipedia.org/wiki/Fidelity_of_quantum_states} } @misc{WikiGellMann, author = "Wikipedia", title = "Gell-{M}ann matrices", - howpublished = "\url{https://en.wikipedia.org/wiki/Gell-Mann_matrices}" + howpublished = {https://en.wikipedia.org/wiki/Gell-Mann_matrices} } @misc{WikiHadamard, author = "Wikipedia", title = "Hadamard transform", - howpublished = "\url{https://en.wikipedia.org/wiki/Hadamard_transform}" + howpublished = {https://en.wikipedia.org/wiki/Hadamard_transform} } @misc{WikiHerm, author = "Wikipedia", title = "Hermitian matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Hermitian_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Hermitian_matrix} } @@ -868,7 +868,7 @@ @misc{WikiHerm @misc{WikiHilbSchOp, author = "Wikipedia", title = "Hilbert-Schmidt operator", - howpublished = "\url{https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator}" + howpublished = {https://en.wikipedia.org/wiki/Hilbert%E2%80%93Schmidt_operator} } @@ -876,21 +876,21 @@ @misc{WikiHilbSchOp @misc{WikiHolevo, author = "Wikipedia", title = "Holevo\'s Theorem", - howpublished = "\url{https://en.wikipedia.org/wiki/Holevo%27s_theorem}" + howpublished = {https://en.wikipedia.org/wiki/Holevo%27s_theorem} } @misc{WikiIdemPot, author = "Wikipedia", title = "Idempotent matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Idempotent_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Idempotent_matrix} } @misc{WikiIden, author = "Wikipedia", title = "Identity matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Identity_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Identity_matrix} } @@ -898,49 +898,49 @@ @misc{WikiIden @misc{WikiInnerProd, author = "Wikipedia", title = "Inner product space", - howpublished = "\url{https://en.wikipedia.org/wiki/Inner_product_space}" + howpublished = {https://en.wikipedia.org/wiki/Inner_product_space} } @misc{WikiNeg, author = "Wikipedia", title = "Negativity", - howpublished = "\url{https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics)}" + howpublished = {https://en.wikipedia.org/wiki/Negativity_(quantum_mechanics)} } @misc{WikiMajorization, author = "Wikipedia", title = "Majorization", - howpublished = "\url{https://en.wikipedia.org/wiki/Majorization}" + howpublished = {https://en.wikipedia.org/wiki/Majorization} } @misc{WikiMaxEnt, author = "Wikipedia", title = "Quantum entanglement", - howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_entanglement}" + howpublished = {https://en.wikipedia.org/wiki/Quantum_entanglement} } @misc{WikiMixedSt, author = "Wikipedia", title = "Quantum State - Mixed States", - howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_state#Mixed_states}" + howpublished = {https://en.wikipedia.org/wiki/Quantum_state#Mixed_states} } @misc{WikiMUB, author = "Wikipedia", title = "Mutually unbiased bases", - howpublished = "\url{hhttps://en.wikipedia.org/wiki/Mutually_unbiased_bases}" + howpublished = {hhttps://en.wikipedia.org/wiki/Mutually_unbiased_bases} } @misc{WikiNorm, author = "Wikipedia", title = "Outer product", - howpublished = "\url{https://en.wikipedia.org/wiki/Normal_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Normal_matrix} } @@ -948,70 +948,70 @@ @misc{WikiNorm @misc{WikiOrthog, author = "Wikipedia", title = "Orthogonality", - howpublished = "\url{https://en.wikipedia.org/wiki/Orthogonality}" + howpublished = {https://en.wikipedia.org/wiki/Orthogonality} } @misc{WikiOuterProd, author = "Wikipedia", title = "Normal matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Outer_product}" + howpublished = {https://en.wikipedia.org/wiki/Outer_product} } @misc{WikiParPerm, author = "Wikipedia", title = "Parity of a permutation", - howpublished = "\url{https://en.wikipedia.org/wiki/Parity_of_a_permutation}" + howpublished = {https://en.wikipedia.org/wiki/Parity_of_a_permutation} } @misc{WikiPauli, author = "Wikipedia", title = "Pauli matrices", - howpublished = "\url{https://en.wikipedia.org/wiki/Pauli_matrices}" + howpublished = {https://en.wikipedia.org/wiki/Pauli_matrices} } @misc{WikiPauliGen, author = "Wikipedia", title = "Generalizations of {P}auli matrices", - howpublished = "\url{https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices}" + howpublished = {https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices} } @misc{WikiPartialTr, author = "Wikipedia", title = "Partial Trace", - howpublished = "\url{https://en.wikipedia.org/wiki/Partial_trace}" + howpublished = {https://en.wikipedia.org/wiki/Partial_trace} } @misc{WikiPeresHorodecki, author = "Wikipedia", title = "Peres-Horodecki criterion", - howpublished = "\url{https://en.wikipedia.org/wiki/Peres%E2%80%93Horodecki_criterion}" + howpublished = {https://en.wikipedia.org/wiki/Peres%E2%80%93Horodecki_criterion} } @misc{WikiPerm, author = "Wikipedia", title = "Permutation matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Permutation_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Permutation_matrix} } @misc{WikiPosDef, author = "Wikipedia", title = "Definite matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Definite_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Definite_matrix} } @misc{WikiPOVM, author = "Wikipedia", title = "{POVM}", - howpublished = "\url{https://en.wikipedia.org/wiki/POVM}" + howpublished = {https://en.wikipedia.org/wiki/POVM} } @@ -1019,28 +1019,28 @@ @misc{WikiPOVM @misc{WikiProjMat, author = "Wikipedia", title = "Projection matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Projection_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Projection_matrix} } @misc{WikiPureSt, author = "Wikipedia", title = "Quantum State - Pure States", - howpublished = "\url{https://en.wikipedia.org/wiki/Quantum_state#Pure_states_of_wave_functions}" + howpublished = {https://en.wikipedia.org/wiki/Quantum_state#Pure_states_of_wave_functions} } @misc{WikiPurity, author = "Wikipedia", title = "Purity (quantum mechanics)", - howpublished = "\url{https://en.wikipedia.org/wiki/Purity_(quantum_mechanics)}" + howpublished = {https://en.wikipedia.org/wiki/Purity_(quantum_mechanics)} } @misc{WikiQuantMeas, author = "Wikipedia", title = "Measurement in quantum mechanics", - howpublished = "\url{https://en.wikipedia.org/wiki/Measurement_in_quantum_mechanics}" + howpublished = {https://en.wikipedia.org/wiki/Measurement_in_quantum_mechanics} } @@ -1048,56 +1048,56 @@ @misc{WikiQuantMeas @misc{WikiReductionCrit, author = "Wikipedia", title = "Reduction Criterion", - howpublished = "\url{https://en.wikipedia.org/wiki/Reduction_criterion}" + howpublished = {https://en.wikipedia.org/wiki/Reduction_criterion} } @misc{WikiScmidtDecomp, author = "Wikipedia", title = "Schmidt decomposition", - howpublished = "\url{https://en.wikipedia.org/wiki/Schmidt_decomposition}" + howpublished = {https://en.wikipedia.org/wiki/Schmidt_decomposition} } @misc{WikiSepSt, author = "Wikipedia", title = "Separable state", - howpublished = "\url{https://en.wikipedia.org/wiki/Separable_state}" + howpublished = {https://en.wikipedia.org/wiki/Separable_state} } @misc{WikiSqMat, author = "Wikipedia", title = "Square matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Square_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Square_matrix} } @misc{WikiSymMat, author = "Wikipedia", title = "Symmetric matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Symmetric_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Symmetric_matrix} } @misc{WikiTensorProd, author = "Wikipedia", title = "Tensor product", - howpublished = "\url{https://en.wikipedia.org/wiki/Tensor_product}" + howpublished = {https://en.wikipedia.org/wiki/Tensor_product} } @misc{WikiUniMat, author = "Wikipedia", title = "Unitary matrix", - howpublished = "\url{https://en.wikipedia.org/wiki/Unitary_matrix}" + howpublished = {https://en.wikipedia.org/wiki/Unitary_matrix} } @misc{WikiUVonNeumann, author = "Wikipedia", title = "Von Neumann entropy", - howpublished = "\url{https://en.wikipedia.org/wiki/Von_Neumann_entropy}" + howpublished = {https://en.wikipedia.org/wiki/Von_Neumann_entropy} } #Last name begins with X @@ -1114,7 +1114,7 @@ @article{Yu_2012 publisher={American Physical Society (APS)}, author={Yu, Nengkun and Duan, Runyao and Ying, Mingsheng}, year={2012}, - month=jul } + month={jul} } #Last name begins with Z \ No newline at end of file diff --git a/docs/books.bib b/docs/books.bib index 87288a94e..90bec64af 100644 --- a/docs/books.bib +++ b/docs/books.bib @@ -55,7 +55,7 @@ @book{watrous_2018 DOI={10.1017/9781316848142}, publisher={Cambridge University Press}, author={Watrous, John}, - year={2018}} +year={2018}} #Last name begins with X diff --git a/docs/index.rst b/docs/index.rst index c4d92dd3b..52cb2ee07 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,7 +11,7 @@ toqito focuses on providing numerical tools to study problems pertaining to entanglement theory, nonlocal games, and other aspects of quantum information that are often associated with computer science. -[![build status]( + .. image:: https://github.com/vprusso/toqito/actions/workflows/build-test-actions.yml/badge.svg?style=plastic :alt: Build Status diff --git a/toqito/nonlocal_games/quantum_hedging.py b/toqito/nonlocal_games/quantum_hedging.py index 9f714a907..e0e8573a3 100644 --- a/toqito/nonlocal_games/quantum_hedging.py +++ b/toqito/nonlocal_games/quantum_hedging.py @@ -28,7 +28,7 @@ class QuantumHedging: .. math:: v = \cos(\pi/8)|00\rangle + \sin(\pi/8)|11\rangle. - As was illustrated in [MW12]_, the hedging value of the above scenario is + As was illustrated in :cite:`Molina_2012`, the hedging value of the above scenario is :math:`\cos(\pi/8)^2 \approx 0.8536` >>> from numpy import kron, cos, sin, pi, sqrt, isclose diff --git a/toqito/states/chessboard.py b/toqito/states/chessboard.py index bf6843c41..64a2196ae 100644 --- a/toqito/states/chessboard.py +++ b/toqito/states/chessboard.py @@ -46,7 +46,7 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = :filter: docname in docnames - :param mat_params: Parameters of the chessboard state as defined in [BP00]_. + :param mat_params: Parameters of the chessboard state as defined in :cite:`D_r_2000`. :param s_param: Default is :code:`np.conj(mat_params[2]) / np.conj(mat_params[5])`. :param t_param: Default is :code:`t_param = mat_params[0] * mat_params[3] / mat_params[4]`. :return: A chessboard state. From 79e59bd347a8b8759efbd5f54aaf2af3d0c9c008 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Wed, 22 Nov 2023 21:10:14 -0600 Subject: [PATCH 28/40] fix https://github.com/vprusso/toqito/pull/228#discussion_r1397772174 + unexpected section title --- docs/conf.py | 4 +++- toqito/channel_metrics/diamond_norm.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6eaee192c..1ebe026ad 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,9 @@ bibtex_bibfiles = ["books.bib", "articles.bib"] bibtex_default_style = "unsrt" -suppress_warnings = ["bibtex.duplicate_label", "bibtex.duplicate_citation", "bibtex.duplicate_id"] +suppress_warnings = ["bibtex.duplicate_label", "bibtex.duplicate_citation"] +# we need to skip these warnigns because all the references appear twice, in a function docstring +# and on the references page. master_doc = "index" autosummary_generate = True autodoc_typehints = "none" diff --git a/toqito/channel_metrics/diamond_norm.py b/toqito/channel_metrics/diamond_norm.py index 7e0373a66..676e910c3 100644 --- a/toqito/channel_metrics/diamond_norm.py +++ b/toqito/channel_metrics/diamond_norm.py @@ -36,10 +36,10 @@ def diamond_norm(choi_1: np.ndarray, choi_2: np.ndarray) -> float: >>> print("Diamond norm between dephasing and identity channels: ", dn) Diamond norm between depolarizing and identity channels: 0.3000024376929641 - References - ========== - .. bibliography:: - :filter: docname in docnames + References + ========== + .. bibliography:: + :filter: docname in docnames :raises ValueError: If matrices are not of equal dimension. From d0b1998bde989a4ac2dab4120510d7cbd00ff274 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Wed, 22 Nov 2023 21:30:52 -0600 Subject: [PATCH 29/40] pydocstyle errors --- .../channel_metrics/completely_bounded_spectral_norm.py | 4 ++-- toqito/channel_ops/apply_channel.py | 6 +++--- toqito/channel_ops/dual_channel.py | 6 +++--- toqito/channel_ops/kraus_to_choi.py | 6 +++--- toqito/channel_props/choi_rank.py | 6 +++--- toqito/channel_props/is_completely_positive.py | 6 +++--- toqito/channel_props/is_herm_preserving.py | 6 +++--- toqito/channel_props/is_positive.py | 6 +++--- toqito/channel_props/is_quantum_channel.py | 9 +++++---- toqito/channel_props/is_unitary.py | 7 ++++--- toqito/channels/dephasing.py | 6 +++--- toqito/channels/depolarizing.py | 7 ++++--- toqito/helper/expr_as_np_array.py | 7 ++----- toqito/helper/np_array_as_expr.py | 4 +--- toqito/matrix_ops/vectors_from_gram_matrix.py | 1 - toqito/matrix_ops/vectors_to_gram_matrix.py | 3 ++- toqito/matrix_props/is_orthonormal.py | 2 -- toqito/matrix_props/kp_norm.py | 7 ++++--- 18 files changed, 48 insertions(+), 51 deletions(-) diff --git a/toqito/channel_metrics/completely_bounded_spectral_norm.py b/toqito/channel_metrics/completely_bounded_spectral_norm.py index 4bb835669..fb3a610dd 100644 --- a/toqito/channel_metrics/completely_bounded_spectral_norm.py +++ b/toqito/channel_metrics/completely_bounded_spectral_norm.py @@ -6,8 +6,8 @@ def completely_bounded_spectral_norm(phi: np.ndarray) -> float: - r""" - Compute the completely bounded spectral norm of a quantum channel + r"""Compute the completely bounded spectral norm of a quantum channel. + :cite:`Watrous_2009_semidefinite, QETLAB_CB_norm`. References diff --git a/toqito/channel_ops/apply_channel.py b/toqito/channel_ops/apply_channel.py index a9a431ca4..d8c59e2ab 100644 --- a/toqito/channel_ops/apply_channel.py +++ b/toqito/channel_ops/apply_channel.py @@ -10,9 +10,9 @@ def apply_channel(mat: np.ndarray, phi_op: np.ndarray | list[list[np.ndarray]]) -> np.ndarray: - r""" - Apply a quantum channel to an operator (Section: Representations and Characterizations of Channels - of :cite:`watrous_2018`). + r"""Apply a quantum channel to an operator. + + (Section: Representations and Characterizations of Channels of :cite:`watrous_2018`). Specifically, an application of the channel is defined as diff --git a/toqito/channel_ops/dual_channel.py b/toqito/channel_ops/dual_channel.py index d587166aa..a64de9123 100644 --- a/toqito/channel_ops/dual_channel.py +++ b/toqito/channel_ops/dual_channel.py @@ -10,9 +10,9 @@ def dual_channel( phi_op: np.ndarray | list[np.ndarray] | list[list[np.ndarray]], dims: list[int] = None ) -> np.ndarray | list[list[np.ndarray]]: - r""" - Compute the dual of a map (quantum channel) (Section: Representations and Characterizations of Channels - of :cite:`watrous_2018`). + r"""Compute the dual of a map (quantum channel). + + (Section: Representations and Characterizations of Channels of :cite:`watrous_2018`). The map can be represented as a Choi matrix, with optional specification of input and output dimensions. If the input channel maps :math:`M_{r,c}` to :math:`M_{x,y}` diff --git a/toqito/channel_ops/kraus_to_choi.py b/toqito/channel_ops/kraus_to_choi.py index 885039576..c384f6390 100644 --- a/toqito/channel_ops/kraus_to_choi.py +++ b/toqito/channel_ops/kraus_to_choi.py @@ -7,9 +7,9 @@ def kraus_to_choi(kraus_ops: list[list[np.ndarray]], sys: int = 2) -> np.ndarray: - r""" - Compute the Choi matrix of a list of Kraus operators (Section: Kraus Representations of - :cite:`watrous_2018`). + r"""Compute the Choi matrix of a list of Kraus operators. + + (Section: Kraus Representations of :cite:`watrous_2018`). The Choi matrix of the list of Kraus operators, :code:`kraus_ops`. The default convention is that the Choi matrix is the result of applying the map to the second subsystem of the diff --git a/toqito/channel_props/choi_rank.py b/toqito/channel_props/choi_rank.py index f76cbf6a7..658191052 100644 --- a/toqito/channel_props/choi_rank.py +++ b/toqito/channel_props/choi_rank.py @@ -7,9 +7,9 @@ def choi_rank(phi: np.ndarray | list[list[np.ndarray]]) -> int: - r""" - Calculate the rank of the Choi representation of a quantum channel (Section 2.2: Quantum Channels from - :cite:`watrous_2018`).. + r"""Calculate the rank of the Choi representation of a quantum channel. + + (Section 2.2: Quantum Channels from :cite:`watrous_2018`). Examples ========== diff --git a/toqito/channel_props/is_completely_positive.py b/toqito/channel_props/is_completely_positive.py index e3ec2c9d1..54ee41fb2 100644 --- a/toqito/channel_props/is_completely_positive.py +++ b/toqito/channel_props/is_completely_positive.py @@ -13,9 +13,9 @@ def is_completely_positive( rtol: float = 1e-05, atol: float = 1e-08, ) -> bool: - r""" - Determine whether the given channel is completely positive (Section: Linear Maps Of Square Operators from - :cite:`watrous_2018`). + r"""Determine whether the given channel is completely positive. + + (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *completely positive* if it holds that diff --git a/toqito/channel_props/is_herm_preserving.py b/toqito/channel_props/is_herm_preserving.py index dc2365f14..e68174837 100644 --- a/toqito/channel_props/is_herm_preserving.py +++ b/toqito/channel_props/is_herm_preserving.py @@ -12,9 +12,9 @@ def is_herm_preserving( rtol: float = 1e-05, atol: float = 1e-08, ) -> bool: - r""" - Determine whether the given channel is Hermitian-preserving (Section: Linear Maps Of Square Operators from - :cite:`watrous_2018`).. + r"""Determine whether the given channel is Hermitian-preserving. + + (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *Hermitian-preserving* if it holds that diff --git a/toqito/channel_props/is_positive.py b/toqito/channel_props/is_positive.py index b1b8eba76..7af727fa9 100644 --- a/toqito/channel_props/is_positive.py +++ b/toqito/channel_props/is_positive.py @@ -12,9 +12,9 @@ def is_positive( rtol: float = 1e-05, atol: float = 1e-08, ) -> bool: - r""" - Determine whether the given channel is positive (Section: Linear Maps Of Square Operators from - :cite:`watrous_2018`). + r"""Determine whether the given channel is positive. + + (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *positive* if it holds that diff --git a/toqito/channel_props/is_quantum_channel.py b/toqito/channel_props/is_quantum_channel.py index 5cd0b3d28..2be6736a0 100644 --- a/toqito/channel_props/is_quantum_channel.py +++ b/toqito/channel_props/is_quantum_channel.py @@ -12,9 +12,10 @@ def is_quantum_channel( rtol: float = 1e-05, atol: float = 1e-08, ) -> bool: - r""" - Determine whether the given input is a quantum channel (Section 2.2.1: - Definitions and Basic Notions Concerning Channels from :cite:`watrous_2018`). + r"""Determine whether the given input is a quantum channel. + + (Section 2.2.1: Definitions and Basic Notions Concerning Channels from + :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is a *quantum channel* for some choice of complex Euclidean spaces :math:`\mathcal{X}` @@ -43,7 +44,7 @@ def is_quantum_channel( ========== .. bibliography:: :filter: docname in docnames - + :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). diff --git a/toqito/channel_props/is_unitary.py b/toqito/channel_props/is_unitary.py index 75406362c..849d49d9d 100644 --- a/toqito/channel_props/is_unitary.py +++ b/toqito/channel_props/is_unitary.py @@ -8,9 +8,10 @@ def is_unitary(phi: np.ndarray | list[list[np.ndarray]]) -> bool: - r""" - Given a quantum channel, determine if it is unitary (Section 2.2.1: - Definitions and Basic Notions Concerning Channels from :cite:`watrous_2018`). + r"""Given a quantum channel, determine if it is unitary. + + (Section 2.2.1: Definitions and Basic Notions Concerning Channels from + :cite:`watrous_2018`). Let :math:`\mathcal{X}` be a complex Euclidean space an let :math:`U \in U(\mathcal{X})` be a unitary operator. Then a unitary channel is defined as: diff --git a/toqito/channels/dephasing.py b/toqito/channels/dephasing.py index f57e37ec0..f14fbfa28 100644 --- a/toqito/channels/dephasing.py +++ b/toqito/channels/dephasing.py @@ -5,9 +5,9 @@ def dephasing(dim: int, param_p: float = 0) -> np.ndarray: - r""" - Produce the partially dephasing channel (Section: The completely dephasing channel from - :cite:`watrous_2018`). + r"""Produce the partially dephasing channel. + + (Section: The completely dephasing channel from :cite:`watrous_2018`). The Choi matrix of the completely dephasing channel that acts on :code:`dim`-by-:code:`dim` matrices. diff --git a/toqito/channels/depolarizing.py b/toqito/channels/depolarizing.py index 1398f7883..eba45ed2e 100644 --- a/toqito/channels/depolarizing.py +++ b/toqito/channels/depolarizing.py @@ -5,9 +5,10 @@ def depolarizing(dim: int, param_p: float = 0) -> np.ndarray: - r""" - Produce the partially depolarizing channel (Section: Replacement Channels and the Completely - Depolarizing Channel from :cite:`watrous_2018`). + r"""Produce the partially depolarizing channel. + + (Section: Replacement Channels and the Completely Depolarizing Channel from + :cite:`watrous_2018`). The Choi matrix of the completely depolarizing channel :cite:`WikiDepo` that acts on :code:`dim`-by-:code:`dim` matrices. diff --git a/toqito/helper/expr_as_np_array.py b/toqito/helper/expr_as_np_array.py index 201c0a052..e82c65713 100644 --- a/toqito/helper/expr_as_np_array.py +++ b/toqito/helper/expr_as_np_array.py @@ -1,14 +1,11 @@ -"""cvxpy expression as np.array.""" +"""Cvxpy expression as np.array.""" import numpy as np from cvxpy.expressions.expression import Expression def expr_as_np_array(cvx_expr: Expression) -> np.ndarray: - """ - Convert cvxpy expression into a numpy array. - - + """Convert cvxpy expression into a numpy array. :param cvx_expr: The cvxpy expression to be converted. :return: The numpy array of the cvxpy expression. diff --git a/toqito/helper/np_array_as_expr.py b/toqito/helper/np_array_as_expr.py index 97fd7536a..7c2109774 100644 --- a/toqito/helper/np_array_as_expr.py +++ b/toqito/helper/np_array_as_expr.py @@ -6,9 +6,7 @@ def np_array_as_expr(np_arr: [np.ndarray]) -> Expression: - """ - Convert numpy array into a cvxpy expression. - + """Convert numpy array into a cvxpy expression. :param np_arr: The numpy array to be converted. :return: The cvxpy expression of the numpy array. diff --git a/toqito/matrix_ops/vectors_from_gram_matrix.py b/toqito/matrix_ops/vectors_from_gram_matrix.py index 9ee346796..1fb1f9993 100644 --- a/toqito/matrix_ops/vectors_from_gram_matrix.py +++ b/toqito/matrix_ops/vectors_from_gram_matrix.py @@ -5,7 +5,6 @@ def vectors_from_gram_matrix(gram: np.ndarray) -> list[np.ndarray]: """Obtain the corresponding ensemble of states from the Gram matrix. - :param gram: Input Gram matrix. :return: list of ensemble states """ diff --git a/toqito/matrix_ops/vectors_to_gram_matrix.py b/toqito/matrix_ops/vectors_to_gram_matrix.py index 6eb462a96..9b8f1362f 100644 --- a/toqito/matrix_ops/vectors_to_gram_matrix.py +++ b/toqito/matrix_ops/vectors_to_gram_matrix.py @@ -6,7 +6,8 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: """Given a list of vectors, return the Gram matrix. :param vectors: Input list of vectors. - :return: Gram matrix""" + :return: Gram matrix + """ n = len(vectors) gram = np.zeros((n, n), dtype=complex) for i in range(n): diff --git a/toqito/matrix_props/is_orthonormal.py b/toqito/matrix_props/is_orthonormal.py index 12196411a..ddcf764f4 100644 --- a/toqito/matrix_props/is_orthonormal.py +++ b/toqito/matrix_props/is_orthonormal.py @@ -7,8 +7,6 @@ def is_orthonormal(vectors: list[np.ndarray]) -> bool: """Check if the vectors are orthonormal. - - :param vectors: A list of `np.ndarray` 1-by-n vectors. :return: True if vectors are orthonormal; False otherwise. """ diff --git a/toqito/matrix_props/kp_norm.py b/toqito/matrix_props/kp_norm.py index 8b369f18f..247ffaa07 100644 --- a/toqito/matrix_props/kp_norm.py +++ b/toqito/matrix_props/kp_norm.py @@ -1,11 +1,12 @@ -"""kp-norm for matrices.""" +"""Kp-norm for matrices.""" import numpy as np def kp_norm(mat: np.ndarray, k: int, p: int) -> float: - """ - Compute the p-norm of the vector or the k-largest singular values of a matrix. + """Compute the kp_norm of vector or matrix. + Calculate the p-norm of a vector or the k-largest singular values of a + matrix. :param mat: 2D numpy ndarray :param k: The number of singular values to take. From 6506ead39088dfb7f9d960abae9f61fcc1b74d98 Mon Sep 17 00:00:00 2001 From: Purva Thakre <66048318+purva-thakre@users.noreply.github.com> Date: Fri, 24 Nov 2023 14:30:50 -0600 Subject: [PATCH 30/40] Apply suggestions from code review Co-authored-by: Vincent Russo --- toqito/channels/reduction.py | 2 +- toqito/state_props/tests/test_entanglement_of_formation.py | 2 +- toqito/states/isotropic.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/toqito/channels/reduction.py b/toqito/channels/reduction.py index 958784909..a79395f95 100644 --- a/toqito/channels/reduction.py +++ b/toqito/channels/reduction.py @@ -49,4 +49,4 @@ def reduction(dim: int, k: int = 1) -> np.ndarray: :return: The reduction map. """ psi = max_entangled(dim, False, False) - return k * identity(dim ** 2) - psi * psi.conj().T +return k * identity(dim ** 2) - psi @ psi.conj().T diff --git a/toqito/state_props/tests/test_entanglement_of_formation.py b/toqito/state_props/tests/test_entanglement_of_formation.py index 1652f904e..9942915c4 100644 --- a/toqito/state_props/tests/test_entanglement_of_formation.py +++ b/toqito/state_props/tests/test_entanglement_of_formation.py @@ -28,7 +28,7 @@ def test_entanglement_of_formation(rho, dim, expected_result): # Invalid local dimension for entanglement_of_formation. (np.identity(4), 3), # Not presently known how to calculate for mixed states. - (3 / 4 * e_0 * e_0.conj().T + 1 / 4 * e_1 * e_1.conj().T, None), +(3 / 4 * e_0 @ e_0.conj().T + 1 / 4 * e_1 @ e_1.conj().T, None), # Invalid non-square matrix for entanglement_of_formation. (np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]), None), ], diff --git a/toqito/states/isotropic.py b/toqito/states/isotropic.py index ff92d4274..b94f4ed70 100644 --- a/toqito/states/isotropic.py +++ b/toqito/states/isotropic.py @@ -59,4 +59,4 @@ def isotropic(dim: int, alpha: float) -> np.ndarray: :return: Isotropic state of dimension :code:`dim`. """ psi = max_entangled(dim, False, False) - return (1 - alpha) * np.identity(dim ** 2) / dim ** 2 + alpha * psi * psi.conj().T / dim + return (1 - alpha) * np.identity(dim ** 2) / dim ** 2 + alpha * psi @ psi.conj().T / dim From 1dd43749bb26c8c27ed64649e7b2746149dd92e8 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 14:35:23 -0600 Subject: [PATCH 31/40] indent --- toqito/channels/reduction.py | 2 +- toqito/state_props/tests/test_entanglement_of_formation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toqito/channels/reduction.py b/toqito/channels/reduction.py index a79395f95..dc2a1bc96 100644 --- a/toqito/channels/reduction.py +++ b/toqito/channels/reduction.py @@ -49,4 +49,4 @@ def reduction(dim: int, k: int = 1) -> np.ndarray: :return: The reduction map. """ psi = max_entangled(dim, False, False) -return k * identity(dim ** 2) - psi @ psi.conj().T + return k * identity(dim ** 2) - psi @ psi.conj().T diff --git a/toqito/state_props/tests/test_entanglement_of_formation.py b/toqito/state_props/tests/test_entanglement_of_formation.py index 9942915c4..d8ae1c567 100644 --- a/toqito/state_props/tests/test_entanglement_of_formation.py +++ b/toqito/state_props/tests/test_entanglement_of_formation.py @@ -28,7 +28,7 @@ def test_entanglement_of_formation(rho, dim, expected_result): # Invalid local dimension for entanglement_of_formation. (np.identity(4), 3), # Not presently known how to calculate for mixed states. -(3 / 4 * e_0 @ e_0.conj().T + 1 / 4 * e_1 @ e_1.conj().T, None), + (3 / 4 * e_0 @ e_0.conj().T + 1 / 4 * e_1 @ e_1.conj().T, None), # Invalid non-square matrix for entanglement_of_formation. (np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]), None), ], From 7820df1ee5580a5a620629505d0bac621c13ffb7 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 14:50:29 -0600 Subject: [PATCH 32/40] rigetti docs to rigetti forest --- docs/articles.bib | 2 +- toqito/channel_metrics/diamond_norm.py | 2 +- toqito/channel_ops/choi_to_kraus.py | 5 ++--- toqito/matrix_ops/unvec.py | 4 ++-- toqito/state_metrics/hilbert_schmidt_inner_product.py | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 95d3f0922..2ef2f20d7 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -604,7 +604,7 @@ @article{PhysRevA.40.4277 -@misc{Rigetti_docs, +@misc{Rigetti2022forest, author = "Rigetti", title = "Forest Benchmarking", howpublished = {https://github.com/rigetti/forest-benchmarking} diff --git a/toqito/channel_metrics/diamond_norm.py b/toqito/channel_metrics/diamond_norm.py index 676e910c3..892984eca 100644 --- a/toqito/channel_metrics/diamond_norm.py +++ b/toqito/channel_metrics/diamond_norm.py @@ -10,7 +10,7 @@ def diamond_norm(choi_1: np.ndarray, choi_2: np.ndarray) -> float: The calculation uses the simplified semidefinite program of Watrous in :cite:`Watrous_2009_semidefinite`. - This function has been adapted from :cite:`Rigetti_docs` + This function has been adapted from :cite:`Rigetti2022forest` .. note:: This calculation becomes very slow for 4 or more qubits. diff --git a/toqito/channel_ops/choi_to_kraus.py b/toqito/channel_ops/choi_to_kraus.py index 9db0af7ed..41b0ad37b 100644 --- a/toqito/channel_ops/choi_to_kraus.py +++ b/toqito/channel_ops/choi_to_kraus.py @@ -12,7 +12,7 @@ def choi_to_kraus( choi_mat: np.ndarray, tol: float = 1e-9, dim: int | list[int] | np.ndarray = None ) -> list[np.ndarray] | list[list[np.ndarray]]: r""" - Compute a list of Kraus operators from the Choi matrix from `Rigetti `__. + Compute a list of Kraus operators from the Choi matrix from :cite:`Rigetti2022forest`. Note that unlike the Choi or natural representation of operators, the Kraus representation is *not* unique. @@ -24,8 +24,7 @@ def choi_to_kraus( For completely positive maps the output is a single flat list of numpy arrays since the left and right Kraus maps are the same. - This function has been adapted from `Rigetti `__ - and QETLAB :cite:`QETLAB_Kraus_Operators`. + This function has been adapted from :cite:`Rigetti2022forest` and QETLAB :cite:`QETLAB_Kraus_Operators`. Examples ======== diff --git a/toqito/matrix_ops/unvec.py b/toqito/matrix_ops/unvec.py index 25d244f39..35f241e1f 100644 --- a/toqito/matrix_ops/unvec.py +++ b/toqito/matrix_ops/unvec.py @@ -4,7 +4,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: r""" - Perform the unvec operation on a vector to obtain a matrix :cite:`Rigetti_docs`. + Perform the unvec operation on a vector to obtain a matrix :cite:`Rigetti2022forest`. Takes a column vector and transforms it into a :code:`shape[0]`-by-:code:`shape[1]` matrix. This operation is the inverse of :code:`vec` operation in :code:`toqito`. @@ -46,7 +46,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: for all :math:`a` and :math:`b`. - This function has been adapted from :cite:`Rigetti_docs`. + This function has been adapted from :cite:`Rigetti2022forest`. Examples ========== diff --git a/toqito/state_metrics/hilbert_schmidt_inner_product.py b/toqito/state_metrics/hilbert_schmidt_inner_product.py index 2999189e3..a7cc56ef1 100644 --- a/toqito/state_metrics/hilbert_schmidt_inner_product.py +++ b/toqito/state_metrics/hilbert_schmidt_inner_product.py @@ -16,7 +16,7 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> compl where :math:`|B\rangle = \text{vec}(B)` and :math:`\langle A|` is the dual vector to :math:`|A \rangle`. - Note: This function has been adapted from :cite:`Rigetti_docs`. + Note: This function has been adapted from :cite:`Rigetti2022forest`. Examples ========== From 8cefa8f182f85c18e077b6a90c0b027f3cbe3e24 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 14:55:45 -0600 Subject: [PATCH 33/40] capitalize section/chapter titles from watrous textbook --- toqito/channel_props/is_trace_preserving.py | 2 +- toqito/channel_props/is_unital.py | 2 +- toqito/channels/dephasing.py | 2 +- toqito/matrices/gen_pauli.py | 2 +- toqito/matrix_props/is_commuting.py | 2 +- toqito/state_props/von_neumann_entropy.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/toqito/channel_props/is_trace_preserving.py b/toqito/channel_props/is_trace_preserving.py index b39226728..cc8f08f60 100644 --- a/toqito/channel_props/is_trace_preserving.py +++ b/toqito/channel_props/is_trace_preserving.py @@ -16,7 +16,7 @@ def is_trace_preserving( dim: list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is trace-preserving (Section: Linear Maps of Square Operators from :cite:`watrous_2018`). + Determine whether the given channel is trace-preserving (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *trace-preserving* if it holds that diff --git a/toqito/channel_props/is_unital.py b/toqito/channel_props/is_unital.py index abc9714e5..fdf7baa17 100644 --- a/toqito/channel_props/is_unital.py +++ b/toqito/channel_props/is_unital.py @@ -15,7 +15,7 @@ def is_unital( dim: int | list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is unital (Chapter: Unital channels and Majorization from :cite:`watrous_2018`). + Determine whether the given channel is unital (Chapter: Unital Channels And Majorization from :cite:`watrous_2018`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *unital* if it holds that diff --git a/toqito/channels/dephasing.py b/toqito/channels/dephasing.py index f14fbfa28..f01cc92a2 100644 --- a/toqito/channels/dephasing.py +++ b/toqito/channels/dephasing.py @@ -7,7 +7,7 @@ def dephasing(dim: int, param_p: float = 0) -> np.ndarray: r"""Produce the partially dephasing channel. - (Section: The completely dephasing channel from :cite:`watrous_2018`). + (Section: The Completely Dephasing Channel from :cite:`watrous_2018`). The Choi matrix of the completely dephasing channel that acts on :code:`dim`-by-:code:`dim` matrices. diff --git a/toqito/matrices/gen_pauli.py b/toqito/matrices/gen_pauli.py index 78a8a7e70..001af8127 100644 --- a/toqito/matrices/gen_pauli.py +++ b/toqito/matrices/gen_pauli.py @@ -16,7 +16,7 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: from 0 to :code:`dim-1`, inclusive. Note that the generalized Pauli operators are also known by the name of - "discrete Weyl operators". (Lecture 6: Further remarks on measurements and channels from :cite:`Watrous_2011_lecture_notes`) + "discrete Weyl operators". (Lecture 6: Further Remarks On Measurements And Channels from :cite:`Watrous_2011_lecture_notes`) Examples ========== diff --git a/toqito/matrix_props/is_commuting.py b/toqito/matrix_props/is_commuting.py index e136fa6e9..d33ce16a6 100644 --- a/toqito/matrix_props/is_commuting.py +++ b/toqito/matrix_props/is_commuting.py @@ -14,7 +14,7 @@ def is_commuting(mat_1: np.ndarray, mat_2: np.ndarray) -> bool: \left[X, Y\right] = XY - YX. It holds that :math:`\left[X,Y\right]=0` if and only if :math:`X` and - :math:`Y` commute (Section: Lie Brackets and Commutants from :cite:`watrous_2018`). + :math:`Y` commute (Section: Lie Brackets And Commutants from :cite:`watrous_2018`). Examples ========== diff --git a/toqito/state_props/von_neumann_entropy.py b/toqito/state_props/von_neumann_entropy.py index 07e2eb659..9e4277ed0 100644 --- a/toqito/state_props/von_neumann_entropy.py +++ b/toqito/state_props/von_neumann_entropy.py @@ -6,7 +6,7 @@ def von_neumann_entropy(rho: np.ndarray) -> float: r""" - Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, Section: "Definitions of quantum entropic functions" from :cite:`watrous_2018`). + Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, Section: "Definitions Of Quantum Entropic Functions" from :cite:`watrous_2018`). Let :math:`P \in \text{Pos}(\mathcal{X})` be a positive semidefinite operator, for a complex Euclidean space :math:`\mathcal{X}`. Then one defines the *von Neumann entropy* as From 2a6c62c0d61dcf29186d79666d33040f64bed8a6 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 14:56:32 -0600 Subject: [PATCH 34/40] Fix https://github.com/vprusso/toqito/pull/228#discussion_r1404576718 --- toqito/matrix_ops/vectors_to_gram_matrix.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/toqito/matrix_ops/vectors_to_gram_matrix.py b/toqito/matrix_ops/vectors_to_gram_matrix.py index 9b8f1362f..a72ac6b03 100644 --- a/toqito/matrix_ops/vectors_to_gram_matrix.py +++ b/toqito/matrix_ops/vectors_to_gram_matrix.py @@ -3,11 +3,7 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: - """Given a list of vectors, return the Gram matrix. - - :param vectors: Input list of vectors. - :return: Gram matrix - """ + """Given a list of vectors, return the Gram matrix.""" n = len(vectors) gram = np.zeros((n, n), dtype=complex) for i in range(n): From 6280594c18b74e4a89a65d2010fa4e524cdf66b9 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 15:01:10 -0600 Subject: [PATCH 35/40] one link for qetlab --- docs/articles.bib | 37 ++----------------- .../completely_bounded_spectral_norm.py | 2 +- .../completely_bounded_trace_norm.py | 2 +- toqito/channel_ops/choi_to_kraus.py | 2 +- toqito/helper/channel_dim.py | 2 +- toqito/helper/update_odometer.py | 2 +- 6 files changed, 8 insertions(+), 39 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 2ef2f20d7..338684d11 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -355,46 +355,15 @@ @article{Johnston_2016 month={may}, pages={20160003} } -@misc{QETLAB_CB_norm, +@misc{QETLAB_link, author = {Johnston, Nathaniel}, - title = {{CB} norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/CBNorm.m}, + title = {{{QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + howpublished = {https://github.com/nathanieljohnston/QETLAB}, DOI ={10.5281/zenodo.44637} } -@misc{QETLAB_Diamond_norm, - author = {Johnston, Nathaniel}, - title = {Diamond norm from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/DiamondNorm.m}, - DOI ={10.5281/zenodo.44637} - -} - -@misc{QETLAB_Kraus_Operators, - author = {Johnston, Nathaniel}, - title = {KrausOperators from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/KrausOperators.m}, - DOI ={10.5281/zenodo.44637} - -} -@misc{QETLAB_Superoperator_Dim, - author = {Johnston, Nathaniel}, - title = {Superoperator dims from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/superoperator_dims.m}, - DOI ={10.5281/zenodo.44637} - -} - - -@misc{QETLAB_Update_Odomoter, - author = {Johnston, Nathaniel}, - title = {Update Odometer from {QETLAB}: {A MATLAB} toolbox for quantum entanglement}, - howpublished = {https://github.com/nathanieljohnston/QETLAB/blob/4f50dbf6ccd4a71c99d4f1afdcd85e9bfda5e9ac/helpers/update_odometer.m}, - DOI ={10.5281/zenodo.44637} - -} #Last name begins with K @article{Katariya_2021, title={Geometric distinguishability measures limit quantum channel estimation and discrimination}, diff --git a/toqito/channel_metrics/completely_bounded_spectral_norm.py b/toqito/channel_metrics/completely_bounded_spectral_norm.py index fb3a610dd..382e16cce 100644 --- a/toqito/channel_metrics/completely_bounded_spectral_norm.py +++ b/toqito/channel_metrics/completely_bounded_spectral_norm.py @@ -8,7 +8,7 @@ def completely_bounded_spectral_norm(phi: np.ndarray) -> float: r"""Compute the completely bounded spectral norm of a quantum channel. - :cite:`Watrous_2009_semidefinite, QETLAB_CB_norm`. + :cite:`Watrous_2009_semidefinite, QETLAB_link`. References ========== diff --git a/toqito/channel_metrics/completely_bounded_trace_norm.py b/toqito/channel_metrics/completely_bounded_trace_norm.py index 7d654b331..ad61e6401 100644 --- a/toqito/channel_metrics/completely_bounded_trace_norm.py +++ b/toqito/channel_metrics/completely_bounded_trace_norm.py @@ -13,7 +13,7 @@ def completely_bounded_trace_norm(phi: np.ndarray) -> float: Also known as the completely bounded diamond norm of a quantum channel (Section 3.3.2 of :cite:`watrous_2018`). The algorithm in p.11 of :cite:`watrous2012simpler` with - implementation in QETLAB :cite:`QETLAB_Diamond_norm` is used. + implementation in QETLAB :cite:`QETLAB_link` is used. References diff --git a/toqito/channel_ops/choi_to_kraus.py b/toqito/channel_ops/choi_to_kraus.py index 41b0ad37b..c2fd1ad8a 100644 --- a/toqito/channel_ops/choi_to_kraus.py +++ b/toqito/channel_ops/choi_to_kraus.py @@ -24,7 +24,7 @@ def choi_to_kraus( For completely positive maps the output is a single flat list of numpy arrays since the left and right Kraus maps are the same. - This function has been adapted from :cite:`Rigetti2022forest` and QETLAB :cite:`QETLAB_Kraus_Operators`. + This function has been adapted from :cite:`Rigetti2022forest` and QETLAB :cite:`QETLAB_link`. Examples ======== diff --git a/toqito/helper/channel_dim.py b/toqito/helper/channel_dim.py index 7439efb90..11ec3b29e 100644 --- a/toqito/helper/channel_dim.py +++ b/toqito/helper/channel_dim.py @@ -31,7 +31,7 @@ def channel_dim( instead of vectors. If COMPUTE_ENV_DIM is false and the PHI is a Choi matrix we avoid computing the rank of the Choi matrix. - This functions was adapted from QETLAB :cite:`QETLAB_Superoperator_Dim`. + This functions was adapted from QETLAB :cite:`QETLAB_link`. References ========== diff --git a/toqito/helper/update_odometer.py b/toqito/helper/update_odometer.py index ebdad99f7..ca9ce5c91 100644 --- a/toqito/helper/update_odometer.py +++ b/toqito/helper/update_odometer.py @@ -23,7 +23,7 @@ def update_odometer( from 1 to 3, you could loop over a single variable going from 1 to 3^2 and set [i, j] = update_odometer([i, j], [3, 3]) at each step within the loop. - This function is adapted from QETLAB :cite:`QETLAB_Update_Odomoter`. + This function is adapted from QETLAB :cite:`QETLAB_link`. Examples ========== From 1ab5de9de2a0eac4c772e9776b6b0419edc6c85b Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 15:16:11 -0600 Subject: [PATCH 36/40] change key style --- docs/articles.bib | 7 ++++--- docs/books.bib | 4 +++- toqito/channel_metrics/completely_bounded_trace_norm.py | 2 +- toqito/channel_metrics/fidelity_of_separability.py | 2 +- toqito/channel_ops/apply_channel.py | 2 +- toqito/channel_ops/dual_channel.py | 2 +- toqito/channel_ops/kraus_to_choi.py | 2 +- toqito/channel_ops/partial_channel.py | 2 +- toqito/channel_props/choi_rank.py | 2 +- toqito/channel_props/is_completely_positive.py | 2 +- toqito/channel_props/is_herm_preserving.py | 2 +- toqito/channel_props/is_positive.py | 2 +- toqito/channel_props/is_quantum_channel.py | 2 +- toqito/channel_props/is_trace_preserving.py | 2 +- toqito/channel_props/is_unital.py | 2 +- toqito/channel_props/is_unitary.py | 2 +- toqito/channels/dephasing.py | 2 +- toqito/channels/depolarizing.py | 2 +- toqito/matrix_ops/vec.py | 2 +- toqito/matrix_props/is_commuting.py | 2 +- toqito/nonlocal_games/quantum_hedging.py | 2 +- toqito/state_metrics/fidelity_of_separability.py | 2 +- toqito/state_opt/state_exclusion.py | 2 +- toqito/state_props/is_ensemble.py | 2 +- toqito/state_props/von_neumann_entropy.py | 2 +- toqito/states/max_mixed.py | 2 +- 26 files changed, 31 insertions(+), 28 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 338684d11..fd859db45 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -1,7 +1,8 @@ #File for all article, arxiv and other web references +# To add a key, Lastname_year_abbreviatedtitle/firstletteroftitle #Last name begins with A -@misc{AaronsonMaxMixed, +@misc{Aaronson_2018_MaxMixed, author = {Aaronson, Scott}, title = "Lecture 6: Mixed States", howpublished = {https://www.scottaaronson.com/qclec/6.pdf} @@ -9,7 +10,7 @@ @misc{AaronsonMaxMixed } -@misc{arunachalam2017quantum, +@misc{Arunachalam_2017_QuantumHedging, title={Quantum hedging in two-round prover-verifier interactions}, author={Arunachalam, Srinivasan and Molina, Abel and Russo, Vincent}, year={2017}, @@ -21,7 +22,7 @@ @misc{arunachalam2017quantum #Last name begins with B -@article{Bandyopadhyay_2014, +@article{Bandyopadhyay_2014_Conclusive, title={Conclusive exclusion of quantum states}, volume={89}, ISSN={1094-1622}, diff --git a/docs/books.bib b/docs/books.bib index 90bec64af..207427b59 100644 --- a/docs/books.bib +++ b/docs/books.bib @@ -1,4 +1,5 @@ #File for all book references +# To add a key, Lastname_year_abbreviatedtitle OR firstletteroftitle #Last name begins with A @@ -34,6 +35,7 @@ #Last name begins with O + #Last name begins with P #Last name begins with Q @@ -49,7 +51,7 @@ #Last name begins with V #Last name begins with W -@book{watrous_2018, +@book{Watrous_2018_TQI, place={Cambridge}, title={The Theory of Quantum Information}, DOI={10.1017/9781316848142}, diff --git a/toqito/channel_metrics/completely_bounded_trace_norm.py b/toqito/channel_metrics/completely_bounded_trace_norm.py index ad61e6401..2bcc74ae6 100644 --- a/toqito/channel_metrics/completely_bounded_trace_norm.py +++ b/toqito/channel_metrics/completely_bounded_trace_norm.py @@ -12,7 +12,7 @@ def completely_bounded_trace_norm(phi: np.ndarray) -> float: Find the completely bounded trace norm of a quantum channel. Also known as the completely bounded diamond norm of a quantum - channel (Section 3.3.2 of :cite:`watrous_2018`). The algorithm in p.11 of :cite:`watrous2012simpler` with + channel (Section 3.3.2 of :cite:`Watrous_2018_TQI`). The algorithm in p.11 of :cite:`watrous2012simpler` with implementation in QETLAB :cite:`QETLAB_link` is used. diff --git a/toqito/channel_metrics/fidelity_of_separability.py b/toqito/channel_metrics/fidelity_of_separability.py index 2c7e85d52..8fbde3562 100644 --- a/toqito/channel_metrics/fidelity_of_separability.py +++ b/toqito/channel_metrics/fidelity_of_separability.py @@ -39,7 +39,7 @@ def fidelity_of_separability( extension exists, it cannot be assumed directly that the state is separable. This function approximites the fidelity of separability by maximizing over PPT channels & k-extendible entanglement breaking channels - i.e. an optimization problem over channels :cite:`watrous_2018` . + i.e. an optimization problem over channels :cite:`Watrous_2018_TQI` . The following expression (Equation (I4) from :cite:`Philip2023schrodinger` ) defines the constraints for approximating diff --git a/toqito/channel_ops/apply_channel.py b/toqito/channel_ops/apply_channel.py index d8c59e2ab..cd2ed7edb 100644 --- a/toqito/channel_ops/apply_channel.py +++ b/toqito/channel_ops/apply_channel.py @@ -12,7 +12,7 @@ def apply_channel(mat: np.ndarray, phi_op: np.ndarray | list[list[np.ndarray]]) -> np.ndarray: r"""Apply a quantum channel to an operator. - (Section: Representations and Characterizations of Channels of :cite:`watrous_2018`). + (Section: Representations and Characterizations of Channels of :cite:`Watrous_2018_TQI`). Specifically, an application of the channel is defined as diff --git a/toqito/channel_ops/dual_channel.py b/toqito/channel_ops/dual_channel.py index a64de9123..28f8f2418 100644 --- a/toqito/channel_ops/dual_channel.py +++ b/toqito/channel_ops/dual_channel.py @@ -12,7 +12,7 @@ def dual_channel( ) -> np.ndarray | list[list[np.ndarray]]: r"""Compute the dual of a map (quantum channel). - (Section: Representations and Characterizations of Channels of :cite:`watrous_2018`). + (Section: Representations and Characterizations of Channels of :cite:`Watrous_2018_TQI`). The map can be represented as a Choi matrix, with optional specification of input and output dimensions. If the input channel maps :math:`M_{r,c}` to :math:`M_{x,y}` diff --git a/toqito/channel_ops/kraus_to_choi.py b/toqito/channel_ops/kraus_to_choi.py index c384f6390..3d16c879f 100644 --- a/toqito/channel_ops/kraus_to_choi.py +++ b/toqito/channel_ops/kraus_to_choi.py @@ -9,7 +9,7 @@ def kraus_to_choi(kraus_ops: list[list[np.ndarray]], sys: int = 2) -> np.ndarray: r"""Compute the Choi matrix of a list of Kraus operators. - (Section: Kraus Representations of :cite:`watrous_2018`). + (Section: Kraus Representations of :cite:`Watrous_2018_TQI`). The Choi matrix of the list of Kraus operators, :code:`kraus_ops`. The default convention is that the Choi matrix is the result of applying the map to the second subsystem of the diff --git a/toqito/channel_ops/partial_channel.py b/toqito/channel_ops/partial_channel.py index c89180cb3..23fb77b2d 100644 --- a/toqito/channel_ops/partial_channel.py +++ b/toqito/channel_ops/partial_channel.py @@ -16,7 +16,7 @@ def partial_channel( sys: int = 2, dim: list[int] | np.ndarray = None, ) -> np.ndarray: - r"""Apply channel to a subsystem of an operator :cite:`watrous_2018`. + r"""Apply channel to a subsystem of an operator :cite:`Watrous_2018_TQI`. Applies the operator diff --git a/toqito/channel_props/choi_rank.py b/toqito/channel_props/choi_rank.py index 658191052..3ad14d5db 100644 --- a/toqito/channel_props/choi_rank.py +++ b/toqito/channel_props/choi_rank.py @@ -9,7 +9,7 @@ def choi_rank(phi: np.ndarray | list[list[np.ndarray]]) -> int: r"""Calculate the rank of the Choi representation of a quantum channel. - (Section 2.2: Quantum Channels from :cite:`watrous_2018`). + (Section 2.2: Quantum Channels from :cite:`Watrous_2018_TQI`). Examples ========== diff --git a/toqito/channel_props/is_completely_positive.py b/toqito/channel_props/is_completely_positive.py index 54ee41fb2..0f045573d 100644 --- a/toqito/channel_props/is_completely_positive.py +++ b/toqito/channel_props/is_completely_positive.py @@ -15,7 +15,7 @@ def is_completely_positive( ) -> bool: r"""Determine whether the given channel is completely positive. - (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). + (Section: Linear Maps Of Square Operators from :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *completely positive* if it holds that diff --git a/toqito/channel_props/is_herm_preserving.py b/toqito/channel_props/is_herm_preserving.py index e68174837..84a3916fc 100644 --- a/toqito/channel_props/is_herm_preserving.py +++ b/toqito/channel_props/is_herm_preserving.py @@ -14,7 +14,7 @@ def is_herm_preserving( ) -> bool: r"""Determine whether the given channel is Hermitian-preserving. - (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). + (Section: Linear Maps Of Square Operators from :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *Hermitian-preserving* if it holds that diff --git a/toqito/channel_props/is_positive.py b/toqito/channel_props/is_positive.py index 7af727fa9..94989282a 100644 --- a/toqito/channel_props/is_positive.py +++ b/toqito/channel_props/is_positive.py @@ -14,7 +14,7 @@ def is_positive( ) -> bool: r"""Determine whether the given channel is positive. - (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). + (Section: Linear Maps Of Square Operators from :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *positive* if it holds that diff --git a/toqito/channel_props/is_quantum_channel.py b/toqito/channel_props/is_quantum_channel.py index 2be6736a0..76b85da84 100644 --- a/toqito/channel_props/is_quantum_channel.py +++ b/toqito/channel_props/is_quantum_channel.py @@ -15,7 +15,7 @@ def is_quantum_channel( r"""Determine whether the given input is a quantum channel. (Section 2.2.1: Definitions and Basic Notions Concerning Channels from - :cite:`watrous_2018`). + :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is a *quantum channel* for some choice of complex Euclidean spaces :math:`\mathcal{X}` diff --git a/toqito/channel_props/is_trace_preserving.py b/toqito/channel_props/is_trace_preserving.py index cc8f08f60..15dc36d4d 100644 --- a/toqito/channel_props/is_trace_preserving.py +++ b/toqito/channel_props/is_trace_preserving.py @@ -16,7 +16,7 @@ def is_trace_preserving( dim: list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is trace-preserving (Section: Linear Maps Of Square Operators from :cite:`watrous_2018`). + Determine whether the given channel is trace-preserving (Section: Linear Maps Of Square Operators from :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *trace-preserving* if it holds that diff --git a/toqito/channel_props/is_unital.py b/toqito/channel_props/is_unital.py index fdf7baa17..96d69282b 100644 --- a/toqito/channel_props/is_unital.py +++ b/toqito/channel_props/is_unital.py @@ -15,7 +15,7 @@ def is_unital( dim: int | list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is unital (Chapter: Unital Channels And Majorization from :cite:`watrous_2018`). + Determine whether the given channel is unital (Chapter: Unital Channels And Majorization from :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *unital* if it holds that diff --git a/toqito/channel_props/is_unitary.py b/toqito/channel_props/is_unitary.py index 849d49d9d..c2938d903 100644 --- a/toqito/channel_props/is_unitary.py +++ b/toqito/channel_props/is_unitary.py @@ -11,7 +11,7 @@ def is_unitary(phi: np.ndarray | list[list[np.ndarray]]) -> bool: r"""Given a quantum channel, determine if it is unitary. (Section 2.2.1: Definitions and Basic Notions Concerning Channels from - :cite:`watrous_2018`). + :cite:`Watrous_2018_TQI`). Let :math:`\mathcal{X}` be a complex Euclidean space an let :math:`U \in U(\mathcal{X})` be a unitary operator. Then a unitary channel is defined as: diff --git a/toqito/channels/dephasing.py b/toqito/channels/dephasing.py index f01cc92a2..b076d5de7 100644 --- a/toqito/channels/dephasing.py +++ b/toqito/channels/dephasing.py @@ -7,7 +7,7 @@ def dephasing(dim: int, param_p: float = 0) -> np.ndarray: r"""Produce the partially dephasing channel. - (Section: The Completely Dephasing Channel from :cite:`watrous_2018`). + (Section: The Completely Dephasing Channel from :cite:`Watrous_2018_TQI`). The Choi matrix of the completely dephasing channel that acts on :code:`dim`-by-:code:`dim` matrices. diff --git a/toqito/channels/depolarizing.py b/toqito/channels/depolarizing.py index eba45ed2e..8f3a43181 100644 --- a/toqito/channels/depolarizing.py +++ b/toqito/channels/depolarizing.py @@ -8,7 +8,7 @@ def depolarizing(dim: int, param_p: float = 0) -> np.ndarray: r"""Produce the partially depolarizing channel. (Section: Replacement Channels and the Completely Depolarizing Channel from - :cite:`watrous_2018`). + :cite:`Watrous_2018_TQI`). The Choi matrix of the completely depolarizing channel :cite:`WikiDepo` that acts on :code:`dim`-by-:code:`dim` matrices. diff --git a/toqito/matrix_ops/vec.py b/toqito/matrix_ops/vec.py index 6b055a276..5d6496929 100644 --- a/toqito/matrix_ops/vec.py +++ b/toqito/matrix_ops/vec.py @@ -4,7 +4,7 @@ def vec(mat: np.ndarray) -> np.ndarray: r""" - Perform the vec operation on a matrix ( Section: The Operator-Vector Correspondence from :cite:`watrous_2018`). + Perform the vec operation on a matrix ( Section: The Operator-Vector Correspondence from :cite:`Watrous_2018_TQI`). Stacks the rows of the matrix on top of each other to obtain the "vec" representation of the matrix. diff --git a/toqito/matrix_props/is_commuting.py b/toqito/matrix_props/is_commuting.py index d33ce16a6..c85563e9a 100644 --- a/toqito/matrix_props/is_commuting.py +++ b/toqito/matrix_props/is_commuting.py @@ -14,7 +14,7 @@ def is_commuting(mat_1: np.ndarray, mat_2: np.ndarray) -> bool: \left[X, Y\right] = XY - YX. It holds that :math:`\left[X,Y\right]=0` if and only if :math:`X` and - :math:`Y` commute (Section: Lie Brackets And Commutants from :cite:`watrous_2018`). + :math:`Y` commute (Section: Lie Brackets And Commutants from :cite:`Watrous_2018_TQI`). Examples ========== diff --git a/toqito/nonlocal_games/quantum_hedging.py b/toqito/nonlocal_games/quantum_hedging.py index e0e8573a3..766918922 100644 --- a/toqito/nonlocal_games/quantum_hedging.py +++ b/toqito/nonlocal_games/quantum_hedging.py @@ -11,7 +11,7 @@ class QuantumHedging: Calculate optimal winning probabilities for hedging scenarios. Calculate the maximal and minimal winning probabilities for quantum - hedging to occur in certain two-party scenarios :cite:`arunachalam2017quantum, Molina_2012`. + hedging to occur in certain two-party scenarios :cite:`Arunachalam_2017_QuantumHedging, Molina_2012`. Examples ========== diff --git a/toqito/state_metrics/fidelity_of_separability.py b/toqito/state_metrics/fidelity_of_separability.py index af6f1e44e..61e2fcbad 100644 --- a/toqito/state_metrics/fidelity_of_separability.py +++ b/toqito/state_metrics/fidelity_of_separability.py @@ -36,7 +36,7 @@ def fidelity_of_separability( (Positive Partial Transpose (PPT), symmetric extensions (k-extendibility ) :cite:`Hayden_2013` ) This function approximites the fidelity of separability by maximizing over PPT states & k-extendible states i.e. an optimization - problem over states :cite:`watrous_2018`. + problem over states :cite:`Watrous_2018_TQI`. The following expression (Equation (H2) from :cite:`Philip2023schrodinger` ) defines the constraints for approxiamting diff --git a/toqito/state_opt/state_exclusion.py b/toqito/state_opt/state_exclusion.py index 50653fb53..6adb5bcd2 100644 --- a/toqito/state_opt/state_exclusion.py +++ b/toqito/state_opt/state_exclusion.py @@ -46,7 +46,7 @@ def state_exclusion( \end{aligned} \end{equation} - The conclusive state exclusion SDP is written explicitly in :cite:`Bandyopadhyay_2014`. The problem of conclusive + The conclusive state exclusion SDP is written explicitly in :cite:`Bandyopadhyay_2014_Conclusive`. The problem of conclusive state exclusion was also thought about under a different guise in :cite:`Pusey_2012`. Examples diff --git a/toqito/state_props/is_ensemble.py b/toqito/state_props/is_ensemble.py index 709fa3c72..3d62e94a4 100644 --- a/toqito/state_props/is_ensemble.py +++ b/toqito/state_props/is_ensemble.py @@ -6,7 +6,7 @@ def is_ensemble(states: list[np.ndarray]) -> bool: r""" - Determine if a set of states constitute an ensemble (Section: Ensemble Of Quantum States from cite:`watrous_2018`). + Determine if a set of states constitute an ensemble (Section: Ensemble Of Quantum States from cite:`Watrous_2018_TQI`). An ensemble of quantum states is defined by a function diff --git a/toqito/state_props/von_neumann_entropy.py b/toqito/state_props/von_neumann_entropy.py index 9e4277ed0..f2b79f68d 100644 --- a/toqito/state_props/von_neumann_entropy.py +++ b/toqito/state_props/von_neumann_entropy.py @@ -6,7 +6,7 @@ def von_neumann_entropy(rho: np.ndarray) -> float: r""" - Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, Section: "Definitions Of Quantum Entropic Functions" from :cite:`watrous_2018`). + Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, Section: "Definitions Of Quantum Entropic Functions" from :cite:`Watrous_2018_TQI`). Let :math:`P \in \text{Pos}(\mathcal{X})` be a positive semidefinite operator, for a complex Euclidean space :math:`\mathcal{X}`. Then one defines the *von Neumann entropy* as diff --git a/toqito/states/max_mixed.py b/toqito/states/max_mixed.py index 8ce3c103f..3af43bb08 100644 --- a/toqito/states/max_mixed.py +++ b/toqito/states/max_mixed.py @@ -6,7 +6,7 @@ def max_mixed(dim: int, is_sparse: bool = False) -> [np.ndarray, sparse.dia_matrix]: r""" - Produce the maximally mixed state :cite:`AaronsonMaxMixed`. + Produce the maximally mixed state :cite:`Aaronson_2018_MaxMixed`. Produces the maximally mixed state on of :code:`dim` dimensions. The maximally mixed state is defined as From c5d0a157db9fc6530489f9793ae7ce3a11491f01 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 19:18:09 -0600 Subject: [PATCH 37/40] consistent bibtex key style --- docs/articles.bib | 122 +++++++++--------- toqito/channel_metrics/channel_fidelity.py | 4 +- .../completely_bounded_spectral_norm.py | 2 +- .../completely_bounded_trace_norm.py | 2 +- toqito/channel_metrics/diamond_norm.py | 4 +- .../fidelity_of_separability.py | 10 +- toqito/channel_ops/choi_to_kraus.py | 4 +- toqito/channels/choi.py | 4 +- toqito/channels/realignment.py | 2 +- toqito/helper/cvx_kron.py | 2 +- toqito/helper/npa_hierarchy.py | 2 +- toqito/matrices/gen_pauli.py | 2 +- toqito/matrices/standard_basis.py | 2 +- toqito/matrix_ops/unvec.py | 4 +- toqito/matrix_props/is_block_positive.py | 4 +- toqito/matrix_props/sk_norm.py | 4 +- toqito/matrix_props/trace_norm.py | 2 +- .../nonlocal_games/extended_nonlocal_game.py | 6 +- toqito/nonlocal_games/nonlocal_game.py | 8 +- toqito/nonlocal_games/quantum_hedging.py | 4 +- toqito/nonlocal_games/xor_game.py | 8 +- toqito/perms/symmetric_projection.py | 2 +- toqito/rand/random_ginibre.py | 2 +- toqito/rand/random_unitary.py | 2 +- .../state_metrics/fidelity_of_separability.py | 10 +- .../hilbert_schmidt_inner_product.py | 2 +- toqito/state_metrics/matsumoto_fidelity.py | 2 +- toqito/state_metrics/sub_fidelity.py | 2 +- toqito/state_metrics/trace_distance.py | 2 +- toqito/state_opt/optimal_clone.py | 4 +- toqito/state_opt/ppt_distinguishability.py | 10 +- toqito/state_opt/state_distinguishability.py | 2 +- toqito/state_opt/state_exclusion.py | 2 +- .../symmetric_extension_hierarchy.py | 10 +- .../state_props/entanglement_of_formation.py | 2 +- toqito/state_props/has_symmetric_extension.py | 4 +- toqito/state_props/in_separable_ball.py | 6 +- toqito/state_props/is_npt.py | 2 +- toqito/state_props/l1_norm_coherence.py | 2 +- toqito/state_props/sk_vec_norm.py | 2 +- toqito/states/breuer.py | 4 +- toqito/states/chessboard.py | 6 +- toqito/states/domino.py | 2 +- toqito/states/gen_bell.py | 2 +- toqito/states/ghz.py | 4 +- toqito/states/gisin.py | 4 +- toqito/states/horodecki.py | 8 +- toqito/states/isotropic.py | 2 +- toqito/states/singlet.py | 2 +- toqito/states/tile.py | 2 +- toqito/states/w_state.py | 4 +- toqito/states/werner.py | 2 +- 52 files changed, 157 insertions(+), 157 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index fd859db45..680988c71 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -35,7 +35,7 @@ @article{Bandyopadhyay_2014_Conclusive year={2014}, month={feb} } -@article{Bennett_1999, +@article{Bennett_1999_QuantumNonlocality, title={Quantum nonlocality without entanglement}, volume={59}, ISSN={1094-1622}, @@ -48,7 +48,7 @@ @article{Bennett_1999 year={1999}, month={feb}, pages={1070-1091} } -@article{Bennett_1999upb, +@article{Bennett_1999_UPB, title={Unextendible Product Bases and Bound Entanglement}, volume={82}, ISSN={1079-7114}, @@ -62,7 +62,7 @@ @article{Bennett_1999upb month={jun}, pages={5385-5388} } -@article{Breuer_2006, +@article{Breuer_2006_Optimal, title={Optimal Entanglement Criterion for Mixed Quantum States}, volume={97}, ISSN={1079-7114}, @@ -77,7 +77,7 @@ @article{Breuer_2006 #Last name begins with C -@article{PhysRevLett.89.100402, +@article{Cabello_2002_NParticle, title = {$N$-Particle $N$-Level Singlet States: Some Properties and Applications}, author = {Cabello, Ad\'an}, journal = {Phys. Rev. Lett.}, @@ -88,12 +88,12 @@ @article{PhysRevLett.89.100402 year = {2002}, month = {Aug}, publisher = {American Physical Society}, - doi = {10.1103/PhysRevLett.89.100402}, - url = {https://link.aps.org/doi/10.1103/PhysRevLett.89.100402} + doi = {10.1103/Cabello_2002_NParticle}, + url = {https://link.aps.org/doi/10.1103/Cabello_2002_NParticle} } -@article{Chen_2014, +@article{Chen_2014_Symmetric, title={Symmetric extension of two-qubit states}, volume={90}, ISSN={1094-1622}, @@ -106,7 +106,7 @@ @article{Chen_2014 year={2014}, month={sep} } -@article{Choi_1992, +@article{Choi_1992_Generalized, title = {Generalized Choi maps in three-dimensional matrix algebra}, journal = {Linear Algebra and its Applications}, volume = {171}, @@ -119,7 +119,7 @@ @article{Choi_1992 abstract = {We consider a class of positive linear maps in the three-dimensional matrix algebra, which are generalizations of the positive linear map constructed by Choi in the relation with positive semidefinite biquadratic forms. We find conditions for which such maps are completely positive, completely copositive, decomposable, and two-positive.} } -@article{Chru_ci_ski_2011, +@article{Chruscinski_2011_OnTheSymmetry, title={On the symmetry of the seminal Horodecki state}, volume={375}, ISSN={0375-9601}, @@ -132,7 +132,7 @@ @article{Chru_ci_ski_2011 year={2011}, month={jan}, pages={434-436} } -@misc{cleve2008strong, +@misc{Cleve_2008_Strong, title={Strong Parallel Repetition Theorem for Quantum XOR Proof Systems}, author={Richard Cleve and William Slofstra and Falk Unger and Sarvagya Upadhyay}, year={2008}, @@ -141,7 +141,7 @@ @misc{cleve2008strong primaryClass={quant-ph} } -@misc{cleve2010consequences, +@misc{Cleve_2010_Consequences, title={Consequences and Limits of Nonlocal Strategies}, author={Richard Cleve and Peter Hoyer and Ben Toner and John Watrous}, year={2010}, @@ -150,7 +150,7 @@ @misc{cleve2010consequences primaryClass={quant-ph} } -@article{Cosentino_2013, +@article{Cosentino_2013_PPT, title={Positive-partial-transpose-indistinguishable states via semidefinite programming}, volume={87}, ISSN={1094-1622}, @@ -163,21 +163,21 @@ @article{Cosentino_2013 year={2013}, month={jan} } -@misc{cosentino_2015, +@misc{Cosentino_2015_QuantumState, title={Quantum State Local Distinguishability via Convex Optimization}, author={Alessandro Cosentino}, year={2015}, howpublished = {https://uwspace.uwaterloo.ca/handle/10012/9572} } -@misc{cvxpy_kron, +@misc{Riley_2022_CVXPYKron, author = {Murray, Riley J}, title = {{PR:} Have kron support non-constant expressions in either argument from {CXPY:} A Python-embedded modeling language for convex optimization problems}, howpublished = {https://github.com/cvxpy/cvxpy/issues/457#issue-309891424}} #Last name begins with D -@article{DiVincenzo_2000, +@article{DiVincenzo_2000_Evidence, title={Evidence for bound entangled states with negative partial transpose}, volume={61}, ISSN={1094-1622}, @@ -191,7 +191,7 @@ @article{DiVincenzo_2000 month={may} } -@article{Doherty_2002, +@article{Doherty_2002_Distinguishing, title={Distinguishing Separable and Entangled States}, volume={88}, ISSN={1079-7114}, @@ -204,7 +204,7 @@ @article{Doherty_2002 year={2002}, month={apr} } -@article{D_r_2000, +@article{Dur_2000_ThreeQubits, title={Three qubits can be entangled in two inequivalent ways}, volume={62}, ISSN={1094-1622}, @@ -218,7 +218,7 @@ @article{D_r_2000 month={nov} } #Last name begins with E -@article{Eldar_2003, +@article{Eldar_2003_SDPApproach, title={A semidefinite programming approach to optimal unambiguous discrimination of quantum states}, volume={49}, ISSN={0018-9448}, @@ -235,7 +235,7 @@ @article{Eldar_2003 #Last name begins with F #Last name begins with G -@misc{greenberger2007going, +@misc{Greenberger_2007_Going, title={Going Beyond Bell's Theorem}, author={Daniel M. Greenberger and Michael A. Horne and Anton Zeilinger}, year={2007}, @@ -244,7 +244,7 @@ @misc{greenberger2007going primaryClass={quant-ph} } -@article{GISIN1996151, +@article{Gisin_1996_Hidden, title = {Hidden quantum nonlocality revealed by local filters}, journal = {Physics Letters A}, volume = {210}, @@ -257,7 +257,7 @@ @article{GISIN1996151 author = {N. Gisin}, } -@article{Gurvits_2002, +@article{Gurvits_2002_Largest, title={Largest separable balls around the maximally mixed bipartite quantum state}, volume={66}, ISSN={1094-1622}, @@ -272,7 +272,7 @@ @article{Gurvits_2002 #Last name begins with H -@inproceedings{Hayden_2013, +@inproceedings{Hayden_2013_TwoMessage, title={Two-Message Quantum Interactive Proofs and the Quantum Separability Problem}, url={http://dx.doi.org/10.1109/CCC.2013.24}, DOI={10.1109/ccc.2013.24}, @@ -282,7 +282,7 @@ @inproceedings{Hayden_2013 year={2013}, month={jun} } -@article{Heinosaari_2020, +@article{Heinosaari_2020_Random, title={Random positive operator valued measures}, volume={61}, ISSN={1089-7658}, @@ -295,7 +295,7 @@ @article{Heinosaari_2020 year={2020}, month={apr} } -@article{Horodecki_1997, +@article{Horodecki_1997_Separability, title={Separability criterion and inseparable mixed states with positive partial transposition}, volume={232}, ISSN={0375-9601}, @@ -308,7 +308,7 @@ @article{Horodecki_1997 year={1997}, month={aug}, pages={333-339} } -@misc{horodecki1998reduction, +@misc{Horodecki_1998_Reduction, title={Reduction criterion of separability and limits for a class of protocols of entanglement distillation}, author={Michal Horodecki and Pawel Horodecki}, year={1998}, @@ -319,7 +319,7 @@ @misc{horodecki1998reduction #Last name begins with I #Last name begins with J -@article{Johnston_2010, +@article{Johnston_2010_AFamily, title={A family of norms with applications in quantum information theory}, volume={51}, ISSN={1089-7658}, @@ -333,7 +333,7 @@ @article{Johnston_2010 month={aug} } -@misc{johnston2012norms, +@misc{Johnston_2012_Norms, title={Norms and Cones in the Theory of Quantum Entanglement}, author={Nathaniel Johnston}, year={2012}, @@ -342,7 +342,7 @@ @misc{johnston2012norms primaryClass={quant-ph} } -@article{Johnston_2016, +@article{Johnston_2016_Extended, title={Extended non-local games and monogamy-of-entanglement games}, volume={472}, ISSN={1471-2946}, @@ -358,15 +358,14 @@ @article{Johnston_2016 @misc{QETLAB_link, author = {Johnston, Nathaniel}, - title = {{{QETLAB}: {A MATLAB} toolbox for quantum entanglement}, + title = {{{QETLAB}: {A MATLAB} toolbox for quantum entanglement}}, howpublished = {https://github.com/nathanieljohnston/QETLAB}, DOI ={10.5281/zenodo.44637} - } #Last name begins with K -@article{Katariya_2021, +@article{Katariya_2021_Geometric, title={Geometric distinguishability measures limit quantum channel estimation and discrimination}, volume={20}, ISSN={1573-1332}, @@ -380,7 +379,7 @@ @article{Katariya_2021 month={feb} } #Last name begins with L -@article{Liang_2007, +@article{Liang_2007_Bounds, title={Bounds on quantum correlations in Bell-inequality experiments}, volume={75}, ISSN={1094-1622}, @@ -394,7 +393,7 @@ @article{Liang_2007 month={apr} } -@article{Lupo_2008, +@article{Lupo_2008_Bipartite, title={Bipartite quantum systems: on the realignment criterion and beyond}, volume={41}, ISSN={1751-8121}, @@ -409,7 +408,7 @@ @article{Lupo_2008 #Last name begins with M -@misc{matsumoto2010reverse, +@misc{Matsumoto_2010_Reverse, title={Reverse test and quantum analogue of classical fidelity and generalized fidelity}, author={Keiji Matsumoto}, year={2010}, @@ -418,7 +417,7 @@ @misc{matsumoto2010reverse primaryClass={quant-ph} } -@misc{miszczak2008sub, +@misc{Miszczak_2008_Sub, title={Sub-- and super--fidelity as bounds for quantum fidelity}, author={J. A. Miszczak and Z. Puchała and P. Horodecki and A. Uhlmann and K. Życzkowski}, year={2008}, @@ -427,7 +426,7 @@ @misc{miszczak2008sub primaryClass={quant-ph} } -@article{Molina_2012, +@article{Molina_2012_Hedging, title={Hedging bets with correlated quantum strategies}, volume={468}, ISSN={1471-2946}, @@ -440,7 +439,7 @@ @article{Molina_2012 year={2012}, month={apr}, pages={2614-2629} } -@misc{molina2012optimal, +@misc{Molina_2012_Optimal, title={Optimal counterfeiting attacks and generalizations for Wiesner's quantum money}, author={Abel Molina and Thomas Vidick and John Watrous}, year={2012}, @@ -450,7 +449,7 @@ @misc{molina2012optimal } #Last name begins with N -@article{Navascu_s_2008, +@article{Navascues_2008_AConvergent, title={A convergent hierarchy of semidefinite programs characterizing the set of quantum correlations}, volume={10}, ISSN={1367-2630}, @@ -463,7 +462,7 @@ @article{Navascu_s_2008 year={2008}, month={jul}, pages={073013} } -@article{Navascu_s_2008p, +@article{Navascues_2008_Pure, title={Pure State Estimation and the Characterization of Entanglement}, volume={100}, ISSN={1079-7114}, @@ -477,15 +476,16 @@ @article{Navascu_s_2008p month={feb} } #Last name begins with O -@misc{OzolsRandU, +@misc{Ozols_2009_RandU, author = "Maris Ozols", title = "How to generate a random unitary matrix", + year = {2009}, howpublished = {http://home.lu.lv/~sd20008/papers/essays/Random%20unitary%20[paper].pdf} } #Last name begins with P -@article{Peres_1996, +@article{Peres_1996_Separability, title={Separability Criterion for Density Matrices}, volume={77}, ISSN={1079-7114}, @@ -498,7 +498,7 @@ @article{Peres_1996 year={1996}, month={aug}, pages={1413-1415} } -@misc{Philip2023schrodinger, +@misc{Philip_2023_Schrodinger, title={Schr\"odinger as a Quantum Programmer: Estimating Entanglement via Steering}, author={Aby Philip and Soorya Rethinasamy and Vincent Russo and Mark M. Wilde}, year={2023}, @@ -507,7 +507,7 @@ @misc{Philip2023schrodinger primaryClass={quant-ph} } -@article{Pusey_2012, +@article{Pusey_2012_On, title={On the reality of the quantum state}, volume={8}, ISSN={1745-2481}, @@ -521,21 +521,21 @@ @article{Pusey_2012 month={may}, pages={475-478} } #Last name begins with Q -@misc{QuantikiEOF, +@misc{Quantiki_EOF, author = "Quantiki", title = "Entanglement of Formation", howpublished = {https://www.quantiki.org/wiki/entanglement-formation} } -@misc{QuantikiTrNorm, +@misc{Quantiki_TrNorm, author = "Quantiki", title = "Trace norm", howpublished = {https://www.quantiki.org/wiki/trace-norm} } -@misc{QuantikiTrDist, +@misc{Quantiki_TrDist, author = "Quantiki", title = "Trace distance", howpublished = {https://www.quantiki.org/wiki/trace-distance} @@ -543,7 +543,7 @@ @misc{QuantikiTrDist } #Last name begins with R -@article{PhysRevA.96.052336, +@article{Rana_2017_Log, title = {Logarithmic coherence: Operational interpretation of ${\ensuremath{\ell}}_{1}$-norm coherence}, author = {Rana, Swapan and Parashar, Preeti and Winter, Andreas and Lewenstein, Maciej}, journal = {Phys. Rev. A}, @@ -557,7 +557,7 @@ @article{PhysRevA.96.052336 doi = {10.1103/PhysRevA.96.052336}, url = {https://link.aps.org/doi/10.1103/PhysRevA.96.052336} } -@article{PhysRevA.40.4277, +@article{Werner_1989_QuantumStates, title = {Quantum states with Einstein-Podolsky-Rosen correlations admitting a hidden-variable model}, author = {Werner, Reinhard F.}, journal = {Phys. Rev. A}, @@ -574,14 +574,14 @@ @article{PhysRevA.40.4277 -@misc{Rigetti2022forest, +@misc{Rigetti_2022_Forest, author = "Rigetti", title = "Forest Benchmarking", howpublished = {https://github.com/rigetti/forest-benchmarking} } -@misc{russo2017extended, +@misc{Russo_2017_Extended, title={Extended Nonlocal Games}, author={Vincent Russo}, year={2017}, @@ -591,14 +591,14 @@ @misc{russo2017extended } #Last name begins with S -@misc{seshadri2021git, - author = "Wikipedia", - title = "Akshay Seshadri", +@misc{Seshadri_2021_Git, + author = "Akshay Seshadri", + title = "Minimax Fidelity Estimation", howpublished = {https://github.com/akshayseshadri/minimax-fidelity-estimation} } -@misc{seshadri2021theory, +@misc{Seshadri_2021_Theory, title={Theory of versatile fidelity estimation with confidence}, author={Akshay Seshadri and Martin Ringbauer and Thomas Monz and Stephen Becker}, year={2021}, @@ -608,7 +608,7 @@ @misc{seshadri2021theory } -@misc{seshadri2021versatile, +@misc{Seshadri_2021_Versatile, title={Versatile fidelity estimation with confidence}, author={Akshay Seshadri and Martin Ringbauer and Rainer Blatt and Thomas Monz and Stephen Becker}, year={2021}, @@ -624,7 +624,7 @@ @misc{SO_43884189 } -@article{Sych_2009, +@article{Sych_2009_AComplete, doi = {10.1088/1367-2630/11/1/013006}, url = {https://dx.doi.org/10.1088/1367-2630/11/1/013006}, year = {2009}, @@ -645,7 +645,7 @@ @article{Sych_2009 #Last name begins with V #Last name begins with W -@misc{Watrous_2009_semidefinite, +@misc{Watrous_2009_Semidefinite, title={Semidefinite programs for completely bounded norms}, author={John Watrous}, year={2009}, @@ -655,7 +655,7 @@ @misc{Watrous_2009_semidefinite } -@misc{Watrous_2011_lecture_notes, +@misc{Watrous_2011_Lecture_Notes, title={Theory of Quantum Information Lecture Notes}, author={John Watrous}, year={2011}, @@ -663,7 +663,7 @@ @misc{Watrous_2011_lecture_notes } -@misc{watrous2012simpler, +@misc{Watrous_2012_Simpler, title={Simpler semidefinite programs for completely bounded norms}, author={John Watrous}, year={2012}, @@ -672,7 +672,7 @@ @misc{watrous2012simpler primaryClass={quant-ph} } -@article{Wiesner_1983, +@article{Wiesner_1983_Conjugate, author = {Wiesner, Stephen}, title = {Conjugate Coding}, year = {1983}, @@ -1073,7 +1073,7 @@ @misc{WikiUVonNeumann #Last name begins with X #Last name begins with Y -@article{Yu_2012, +@article{Yu_2012_Four, title={Four Locally Indistinguishable Ququad-Ququad Orthogonal Maximally Entangled States}, volume={109}, ISSN={1079-7114}, diff --git a/toqito/channel_metrics/channel_fidelity.py b/toqito/channel_metrics/channel_fidelity.py index be935d400..0bb554fd1 100644 --- a/toqito/channel_metrics/channel_fidelity.py +++ b/toqito/channel_metrics/channel_fidelity.py @@ -7,7 +7,7 @@ def channel_fidelity(choi_1: np.ndarray, choi_2: np.ndarray) -> float: r""" - Compute the channel fidelity between two quantum channels :cite:`Katariya_2021`. + Compute the channel fidelity between two quantum channels :cite:`Katariya_2021_Geometric`. Let :math:`\Phi : \text{L}(\mathcal{Y}) \rightarrow \text{L}(\mathcal{X})` and :math:`\Psi: \text{L}(\mathcal{Y}) \rightarrow \text{L}(\mathcal{X})` be quantum channels. Then @@ -17,7 +17,7 @@ def channel_fidelity(choi_1: np.ndarray, choi_2: np.ndarray) -> float: \sqrt{F}(\Phi, \Psi) := \text{inf}_{\rho} \sqrt{F}(\Phi(\rho), \Psi(\rho)) where :math:`\rho \in \text{D}(\mathcal{Z} \otimes \mathcal{X})` can be calculated by means of - the following semidefinite program (Proposition 50) in :cite:`Katariya_2021`, + the following semidefinite program (Proposition 50) in :cite:`Katariya_2021_Geometric`, .. math:: \begin{align*} diff --git a/toqito/channel_metrics/completely_bounded_spectral_norm.py b/toqito/channel_metrics/completely_bounded_spectral_norm.py index 382e16cce..faf2a1469 100644 --- a/toqito/channel_metrics/completely_bounded_spectral_norm.py +++ b/toqito/channel_metrics/completely_bounded_spectral_norm.py @@ -8,7 +8,7 @@ def completely_bounded_spectral_norm(phi: np.ndarray) -> float: r"""Compute the completely bounded spectral norm of a quantum channel. - :cite:`Watrous_2009_semidefinite, QETLAB_link`. + :cite:`Watrous_2009_Semidefinite, QETLAB_link`. References ========== diff --git a/toqito/channel_metrics/completely_bounded_trace_norm.py b/toqito/channel_metrics/completely_bounded_trace_norm.py index 2bcc74ae6..eab155d63 100644 --- a/toqito/channel_metrics/completely_bounded_trace_norm.py +++ b/toqito/channel_metrics/completely_bounded_trace_norm.py @@ -12,7 +12,7 @@ def completely_bounded_trace_norm(phi: np.ndarray) -> float: Find the completely bounded trace norm of a quantum channel. Also known as the completely bounded diamond norm of a quantum - channel (Section 3.3.2 of :cite:`Watrous_2018_TQI`). The algorithm in p.11 of :cite:`watrous2012simpler` with + channel (Section 3.3.2 of :cite:`Watrous_2018_TQI`). The algorithm in p.11 of :cite:`Watrous_2012_Simpler` with implementation in QETLAB :cite:`QETLAB_link` is used. diff --git a/toqito/channel_metrics/diamond_norm.py b/toqito/channel_metrics/diamond_norm.py index 892984eca..189f39b86 100644 --- a/toqito/channel_metrics/diamond_norm.py +++ b/toqito/channel_metrics/diamond_norm.py @@ -8,9 +8,9 @@ def diamond_norm(choi_1: np.ndarray, choi_2: np.ndarray) -> float: Return the diamond norm distance between two quantum channels. The calculation uses the simplified semidefinite program of Watrous in - :cite:`Watrous_2009_semidefinite`. + :cite:`Watrous_2009_Semidefinite`. - This function has been adapted from :cite:`Rigetti2022forest` + This function has been adapted from :cite:`Rigetti_2022_Forest` .. note:: This calculation becomes very slow for 4 or more qubits. diff --git a/toqito/channel_metrics/fidelity_of_separability.py b/toqito/channel_metrics/fidelity_of_separability.py index 8fbde3562..174c70fee 100644 --- a/toqito/channel_metrics/fidelity_of_separability.py +++ b/toqito/channel_metrics/fidelity_of_separability.py @@ -21,12 +21,12 @@ def fidelity_of_separability( solver_option: str = "cvxopt", ) -> float: r""" - Define the first benchmark introduced in Appendix I of :cite:`Philip2023schrodinger` . + Define the first benchmark introduced in Appendix I of :cite:`Philip_2023_Schrodinger` . If you would like to instead use the benchmark introduced in Appendix H, go to :obj:`toqito.state_metrics.fidelity_of_separability`. - In :cite:`Philip2023schrodinger` a variational quantum algorithm (VQA) is introduced to test + In :cite:`Philip_2023_Schrodinger` a variational quantum algorithm (VQA) is introduced to test the separability of a general bipartite state. The algorithm utilizes quantum steering between two separated systems such that the separability of the state is quantified. @@ -35,13 +35,13 @@ def fidelity_of_separability( optimization semidefinite programs (SDP) benchmarks were introduced to maximize the fidelity of separability subject to some state constraints (Positive Partial Transpose (PPT), symmetric extensions (k-extendibility - ) :cite:`Hayden_2013` ). Entangled states do not have k-symmetric extensions. If an + ) :cite:`Hayden_2013_TwoMessage` ). Entangled states do not have k-symmetric extensions. If an extension exists, it cannot be assumed directly that the state is separable. This function approximites the fidelity of separability by maximizing over PPT channels & k-extendible entanglement breaking channels i.e. an optimization problem over channels :cite:`Watrous_2018_TQI` . - The following expression (Equation (I4) from :cite:`Philip2023schrodinger` ) defines the + The following expression (Equation (I4) from :cite:`Philip_2023_Schrodinger` ) defines the constraints for approximating :math:`\frac{1}{2}(1+\widetilde{F}_s^2(\rho_{AB})) {:}=` @@ -72,7 +72,7 @@ def fidelity_of_separability( :math:`\mathcal{P}_{A^{\prime k}}` is the permutation operator over k-extensions :math:`A^{\prime k}`. - The other constraints are due to the PPT condition :cite:`Peres_1996`. + The other constraints are due to the PPT condition :cite:`Peres_1996_Separability`. Examples ========== diff --git a/toqito/channel_ops/choi_to_kraus.py b/toqito/channel_ops/choi_to_kraus.py index c2fd1ad8a..c88bcb6f4 100644 --- a/toqito/channel_ops/choi_to_kraus.py +++ b/toqito/channel_ops/choi_to_kraus.py @@ -12,7 +12,7 @@ def choi_to_kraus( choi_mat: np.ndarray, tol: float = 1e-9, dim: int | list[int] | np.ndarray = None ) -> list[np.ndarray] | list[list[np.ndarray]]: r""" - Compute a list of Kraus operators from the Choi matrix from :cite:`Rigetti2022forest`. + Compute a list of Kraus operators from the Choi matrix from :cite:`Rigetti_2022_Forest`. Note that unlike the Choi or natural representation of operators, the Kraus representation is *not* unique. @@ -24,7 +24,7 @@ def choi_to_kraus( For completely positive maps the output is a single flat list of numpy arrays since the left and right Kraus maps are the same. - This function has been adapted from :cite:`Rigetti2022forest` and QETLAB :cite:`QETLAB_link`. + This function has been adapted from :cite:`Rigetti_2022_Forest` and QETLAB :cite:`QETLAB_link`. Examples ======== diff --git a/toqito/channels/choi.py b/toqito/channels/choi.py index fcfa68bf8..430a92560 100644 --- a/toqito/channels/choi.py +++ b/toqito/channels/choi.py @@ -6,13 +6,13 @@ def choi(a_var: int = 1, b_var: int = 1, c_var: int = 0) -> np.ndarray: r""" - Produce the Choi channel or one of its generalizations :cite:`Choi_1992`. + Produce the Choi channel or one of its generalizations :cite:`Choi_1992_Generalized`. The *Choi channel* is a positive map on 3-by-3 matrices that is capable of detecting some entanglement that the transpose map is not. The standard Choi channel defined with :code:`a=1`, :code:`b=1`, and :code:`c=0` is the Choi - matrix of the positive map defined in :cite:`Choi_1992`. Many of these maps are capable of detecting + matrix of the positive map defined in :cite:`Choi_1992_Generalized`. Many of these maps are capable of detecting PPT entanglement. Examples diff --git a/toqito/channels/realignment.py b/toqito/channels/realignment.py index ca62ae84d..00ae797ae 100644 --- a/toqito/channels/realignment.py +++ b/toqito/channels/realignment.py @@ -9,7 +9,7 @@ def realignment(input_mat: np.ndarray, dim: int | list[int] = None) -> np.ndarray: r""" - Compute the realignment of a bipartite operator :cite:`Lupo_2008`. + Compute the realignment of a bipartite operator :cite:`Lupo_2008_Bipartite`. Gives the realignment of the matrix :code:`input_mat`, where it is assumed that the number of rows and columns of :code:`input_mat` are both perfect squares and both subsystems have diff --git a/toqito/helper/cvx_kron.py b/toqito/helper/cvx_kron.py index f621fe452..d995b7bd2 100644 --- a/toqito/helper/cvx_kron.py +++ b/toqito/helper/cvx_kron.py @@ -16,7 +16,7 @@ def cvx_kron(expr_1: np.ndarray | Expression, expr_2: np.ndarray | Expression) - At most one of :code:`expr_1` and :code:`b` may be CVXPY Variable objects. - Kudos to Riley J. Murray for this function :cite:`cvxpy_kron` + Kudos to Riley J. Murray for this function :cite:`Riley_2022_CVXPYKron` References ========== diff --git a/toqito/helper/npa_hierarchy.py b/toqito/helper/npa_hierarchy.py index a33a3912d..2914c6927 100644 --- a/toqito/helper/npa_hierarchy.py +++ b/toqito/helper/npa_hierarchy.py @@ -128,7 +128,7 @@ def npa_constraints( # pylint: disable=too-many-locals assemblage: dict[tuple[int, int], cvxpy.Variable], k: int | str = 1, referee_dim: int = 1 ) -> list[cvxpy.constraints.constraint.Constraint]: r""" - Generate the constraints specified by the NPA hierarchy up to a finite level :cite:`Navascu_s_2008`. + Generate the constraints specified by the NPA hierarchy up to a finite level :cite:`Navascues_2008_AConvergent`. You can determine the level of the hierarchy by a positive integer or a string of a form like "1+ab+aab", which indicates that an intermediate level of the hierarchy diff --git a/toqito/matrices/gen_pauli.py b/toqito/matrices/gen_pauli.py index 001af8127..d9152e509 100644 --- a/toqito/matrices/gen_pauli.py +++ b/toqito/matrices/gen_pauli.py @@ -16,7 +16,7 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: from 0 to :code:`dim-1`, inclusive. Note that the generalized Pauli operators are also known by the name of - "discrete Weyl operators". (Lecture 6: Further Remarks On Measurements And Channels from :cite:`Watrous_2011_lecture_notes`) + "discrete Weyl operators". (Lecture 6: Further Remarks On Measurements And Channels from :cite:`Watrous_2011_Lecture_Notes`) Examples ========== diff --git a/toqito/matrices/standard_basis.py b/toqito/matrices/standard_basis.py index c7f679133..579746caf 100644 --- a/toqito/matrices/standard_basis.py +++ b/toqito/matrices/standard_basis.py @@ -17,7 +17,7 @@ def standard_basis(dim: int, flatten: bool = False) -> list[np.ndarray]: . |n> = (0, 0, 0, ..., 1)^T - This function was inspired by :cite:`seshadri2021git, seshadri2021theory, seshadri2021versatile` + This function was inspired by :cite:`Seshadri_2021_Git, Seshadri_2021_Theory, Seshadri_2021_Versatile` References ========== diff --git a/toqito/matrix_ops/unvec.py b/toqito/matrix_ops/unvec.py index 35f241e1f..32c041a7e 100644 --- a/toqito/matrix_ops/unvec.py +++ b/toqito/matrix_ops/unvec.py @@ -4,7 +4,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: r""" - Perform the unvec operation on a vector to obtain a matrix :cite:`Rigetti2022forest`. + Perform the unvec operation on a vector to obtain a matrix :cite:`Rigetti_2022_Forest`. Takes a column vector and transforms it into a :code:`shape[0]`-by-:code:`shape[1]` matrix. This operation is the inverse of :code:`vec` operation in :code:`toqito`. @@ -46,7 +46,7 @@ def unvec(vector: np.ndarray, shape: list[int] = None) -> np.ndarray: for all :math:`a` and :math:`b`. - This function has been adapted from :cite:`Rigetti2022forest`. + This function has been adapted from :cite:`Rigetti_2022_Forest`. Examples ========== diff --git a/toqito/matrix_props/is_block_positive.py b/toqito/matrix_props/is_block_positive.py index 055319eae..805e9a84b 100644 --- a/toqito/matrix_props/is_block_positive.py +++ b/toqito/matrix_props/is_block_positive.py @@ -16,7 +16,7 @@ def is_block_positive( rtol: float = 1e-5, ) -> bool: r""" - Check if matrix is block positive :cite:`johnston2012norms`. + Check if matrix is block positive :cite:`Johnston_2012_Norms`. Examples ========== @@ -86,7 +86,7 @@ def is_block_positive( # We compute the S(k)-norm of this operator since # X k-block positive iff: # c >= S(k)-norm of(c*I - X) - # See Corollary 4.2.9. of `:cite:`johnston2012norms`. + # See Corollary 4.2.9. of `:cite:`Johnston_2012_Norms`. c_mat = op_norm * np.eye(dim_xy) - mat lower_bound, upper_bound = sk_operator_norm(c_mat, k, dim, op_norm, effort) diff --git a/toqito/matrix_props/sk_norm.py b/toqito/matrix_props/sk_norm.py index 8e9995ad9..f8274cc1e 100644 --- a/toqito/matrix_props/sk_norm.py +++ b/toqito/matrix_props/sk_norm.py @@ -24,7 +24,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals effort: int = 2, ) -> float: r""" - Compute the S(k)-norm of a matrix :cite:`Johnston_2010`. + Compute the S(k)-norm of a matrix :cite:`Johnston_2010_AFamily`. The :math:`S(k)`-norm of of a matrix :math:`X` is defined as: @@ -36,7 +36,7 @@ def sk_operator_norm( # pylint: disable=too-many-locals \text{Schmidt - rank}(|w\rangle) \leq k \Big\} - Since computing the exact value of S(k)-norm :cite:`johnston2012norms` is in the general case + Since computing the exact value of S(k)-norm :cite:`Johnston_2012_Norms` is in the general case an intractable problem, this function tries to find some good lower and upper bounds. You can control the amount of computation you want to devote to computing the bounds by `effort` input argument. Note that if diff --git a/toqito/matrix_props/trace_norm.py b/toqito/matrix_props/trace_norm.py index 84c97cfac..de54fc67a 100644 --- a/toqito/matrix_props/trace_norm.py +++ b/toqito/matrix_props/trace_norm.py @@ -4,7 +4,7 @@ def trace_norm(rho: np.ndarray) -> float: r""" - Compute the trace norm of the state :cite:`QuantikiTrNorm`. + Compute the trace norm of the state :cite:`Quantiki_TrNorm`. Also computes the operator 1-norm when inputting an operator. diff --git a/toqito/nonlocal_games/extended_nonlocal_game.py b/toqito/nonlocal_games/extended_nonlocal_game.py index 74530a104..fe0d1f297 100644 --- a/toqito/nonlocal_games/extended_nonlocal_game.py +++ b/toqito/nonlocal_games/extended_nonlocal_game.py @@ -21,8 +21,8 @@ class ExtendedNonlocalGame: made by the referee, on its part of the shared quantum state, in addition to Alice and Bob's answers to the questions sent by the referee. - Extended nonlocal games were initially defined in :cite:`Johnston_2016` and more - information on these games can be found in :cite:`russo2017extended`. + Extended nonlocal games were initially defined in :cite:`Johnston_2016_Extended` and more + information on these games can be found in :cite:`Russo_2017_Extended`. References ========== @@ -431,7 +431,7 @@ def commuting_measurement_value_upper_bound(self, k: int | str = 1) -> float: Compute an upper bound on the commuting measurement value of an extended nonlocal game. This function calculates an upper bound on the commuting measurement value by - using k-levels of the NPA hierarchy :cite:`Navascu_s_2008`. The NPA hierarchy is a uniform family + using k-levels of the NPA hierarchy :cite:`Navascues_2008_AConvergent`. The NPA hierarchy is a uniform family of semidefinite programs that converges to the commuting measurement value of any extended nonlocal game. diff --git a/toqito/nonlocal_games/nonlocal_game.py b/toqito/nonlocal_games/nonlocal_game.py index c8ecfdc7b..ebd29711a 100644 --- a/toqito/nonlocal_games/nonlocal_game.py +++ b/toqito/nonlocal_games/nonlocal_game.py @@ -20,7 +20,7 @@ class NonlocalGame: are not allowed to communicate with each other once the game has started and who play cooperative against an adversary referred to as the referee. - The nonlocal game framework was originally introduced in :cite:`cleve2010consequences`. + The nonlocal game framework was originally introduced in :cite:`Cleve_2010_Consequences`. References ========== @@ -195,7 +195,7 @@ def quantum_value_lower_bound( tol: float = 10e-6, ): r""" - Compute a lower bound on the quantum value of a nonlocal game :cite:`Liang_2007`. + Compute a lower bound on the quantum value of a nonlocal game :cite:`Liang_2007_Bounds`. Calculates a lower bound on the maximum value that the specified nonlocal game can take on in quantum mechanical settings where Alice and @@ -213,7 +213,7 @@ def quantum_value_lower_bound( number of times and keep the highest value obtained. The algorithm is based on the alternating projections algorithm as it - can be applied to Bell inequalities as shown in :cite:`Liang_2007`. + can be applied to Bell inequalities as shown in :cite:`Liang_2007_Bounds`. The alternating projection algorithm has also been referred to as the "see-saw" algorithm as it goes back and forth between the following two @@ -586,7 +586,7 @@ def commuting_measurement_value_upper_bound(self, k: int | str = 1) -> float: Compute an upper bound on the commuting measurement value of the nonlocal game. This function calculates an upper bound on the commuting measurement value by - using k-levels of the NPA hierarchy :cite:`Navascu_s_2008`. The NPA hierarchy is a uniform family + using k-levels of the NPA hierarchy :cite:`Navascues_2008_AConvergent`. The NPA hierarchy is a uniform family of semidefinite programs that converges to the commuting measurement value of any nonlocal game. diff --git a/toqito/nonlocal_games/quantum_hedging.py b/toqito/nonlocal_games/quantum_hedging.py index 766918922..0c31744ef 100644 --- a/toqito/nonlocal_games/quantum_hedging.py +++ b/toqito/nonlocal_games/quantum_hedging.py @@ -11,7 +11,7 @@ class QuantumHedging: Calculate optimal winning probabilities for hedging scenarios. Calculate the maximal and minimal winning probabilities for quantum - hedging to occur in certain two-party scenarios :cite:`Arunachalam_2017_QuantumHedging, Molina_2012`. + hedging to occur in certain two-party scenarios :cite:`Arunachalam_2017_QuantumHedging, Molina_2012_Hedging`. Examples ========== @@ -28,7 +28,7 @@ class QuantumHedging: .. math:: v = \cos(\pi/8)|00\rangle + \sin(\pi/8)|11\rangle. - As was illustrated in :cite:`Molina_2012`, the hedging value of the above scenario is + As was illustrated in :cite:`Molina_2012_Hedging`, the hedging value of the above scenario is :math:`\cos(\pi/8)^2 \approx 0.8536` >>> from numpy import kron, cos, sin, pi, sqrt, isclose diff --git a/toqito/nonlocal_games/xor_game.py b/toqito/nonlocal_games/xor_game.py index df3ebca92..25117d576 100644 --- a/toqito/nonlocal_games/xor_game.py +++ b/toqito/nonlocal_games/xor_game.py @@ -14,7 +14,7 @@ class XORGame: communicate during the game itself. The quantum value of an XOR game can be solved via the semidefinite program - from :cite:`cleve2010consequences`. + from :cite:`Cleve_2010_Consequences`. This function is adapted from the QETLAB package. @@ -24,7 +24,7 @@ class XORGame: The CHSH game The CHSH game is a two-player nonlocal game with the following probability - distribution and question and answer sets :cite:`cleve2008strong`. + distribution and question and answer sets :cite:`Cleve_2008_Strong`. .. math:: \begin{equation} @@ -77,7 +77,7 @@ class XORGame: The odd cycle game - The odd cycle game is another XOR game :cite:`cleve2010consequences`. For this game, we can + The odd cycle game is another XOR game :cite:`Cleve_2010_Consequences`. For this game, we can specify the probability and predicate matrices as follows. >>> prob_mat = np.array( @@ -173,7 +173,7 @@ def quantum_value(self) -> float: To obtain the quantum value of the XOR game, we calculate the following simplified dual problem of the semidefinite program from the set of - notes: Lecture 6 of :cite:`Watrous_2011_lecture_notes` + notes: Lecture 6 of :cite:`Watrous_2011_Lecture_Notes` .. math:: \begin{equation} diff --git a/toqito/perms/symmetric_projection.py b/toqito/perms/symmetric_projection.py index bd3c6918d..da36d0ea6 100644 --- a/toqito/perms/symmetric_projection.py +++ b/toqito/perms/symmetric_projection.py @@ -12,7 +12,7 @@ def symmetric_projection( dim: int, p_val: int = 2, partial: bool = False ) -> [np.ndarray, scipy.sparse.lil_matrix]: r""" - Produce the projection onto the symmetric subspace :cite:`Chen_2014`. + Produce the projection onto the symmetric subspace :cite:`Chen_2014_Symmetric`. For a complex Euclidean space :math:`\mathcal{X}` and a positive integer :math:`n`, the projection onto the symmetric subspace is given by diff --git a/toqito/rand/random_ginibre.py b/toqito/rand/random_ginibre.py index 1f02d3c6c..3612fc0f0 100644 --- a/toqito/rand/random_ginibre.py +++ b/toqito/rand/random_ginibre.py @@ -14,7 +14,7 @@ def random_ginibre( A *Ginibre random matrix* is a matrix with independent and identically distributed complex standard Gaussian entries. - Ginibre random matrices are used in the construction of Wishart-random POVMs :cite:`Heinosaari_2020`. + Ginibre random matrices are used in the construction of Wishart-random POVMs :cite:`Heinosaari_2020_Random`. Examples ========== diff --git a/toqito/rand/random_unitary.py b/toqito/rand/random_unitary.py index cd0d02297..c62cc86d0 100644 --- a/toqito/rand/random_unitary.py +++ b/toqito/rand/random_unitary.py @@ -6,7 +6,7 @@ def random_unitary(dim: list[int] | int, is_real: bool = False) -> np.ndarray: """ - Generate a random unitary or orthogonal matrix :cite:`OzolsRandU`. + Generate a random unitary or orthogonal matrix :cite:`Ozols_2009_RandU`. Calculates a random unitary matrix (if :code:`is_real = False`) or a random real orthogonal matrix (if :code:`is_real = True`), uniformly distributed according to the Haar measure. diff --git a/toqito/state_metrics/fidelity_of_separability.py b/toqito/state_metrics/fidelity_of_separability.py index 61e2fcbad..d81437875 100644 --- a/toqito/state_metrics/fidelity_of_separability.py +++ b/toqito/state_metrics/fidelity_of_separability.py @@ -20,12 +20,12 @@ def fidelity_of_separability( solver_option: str = "cvxopt", ) -> float: r""" - Define the first benchmark introduced in Appendix H of :cite:`Philip2023schrodinger`. + Define the first benchmark introduced in Appendix H of :cite:`Philip_2023_Schrodinger`. If you would like to instead use the benchmark introduced in Appendix I, go to :obj:`toqito.channel_metrics.fidelity_of_separability`. - In :cite:`Philip2023schrodinger` a variational quantum algorithm (VQA) is introduced to test + In :cite:`Philip_2023_Schrodinger` a variational quantum algorithm (VQA) is introduced to test the separability of a general bipartite state. The algorithm utilizes quantum steering between two separated systems such that the separability of the state is quantified. @@ -34,11 +34,11 @@ def fidelity_of_separability( optimization semidefinite programs (SDP) benchmarks were introduced to maximize the fidelity of separability subject to some state constraints (Positive Partial Transpose (PPT), symmetric extensions (k-extendibility - ) :cite:`Hayden_2013` ) This function approximites the fidelity of separability by + ) :cite:`Hayden_2013_TwoMessage` ) This function approximites the fidelity of separability by maximizing over PPT states & k-extendible states i.e. an optimization problem over states :cite:`Watrous_2018_TQI`. - The following expression (Equation (H2) from :cite:`Philip2023schrodinger` ) defines the + The following expression (Equation (H2) from :cite:`Philip_2023_Schrodinger` ) defines the constraints for approxiamting :math:`\sqrt{\widetilde{F}_s^1}(\rho_{AB}) {:}=` @@ -76,7 +76,7 @@ def fidelity_of_separability( :math:`B_1, B_2, \ldots , B_{k}` which has no effect on the k-extended state :math:`\sigma_{AB^{k}}`. - The other constraints are due to the PPT condition :cite:`Peres_1996`. + The other constraints are due to the PPT condition :cite:`Peres_1996_Separability`. Examples ========== diff --git a/toqito/state_metrics/hilbert_schmidt_inner_product.py b/toqito/state_metrics/hilbert_schmidt_inner_product.py index a7cc56ef1..2d07fdc59 100644 --- a/toqito/state_metrics/hilbert_schmidt_inner_product.py +++ b/toqito/state_metrics/hilbert_schmidt_inner_product.py @@ -16,7 +16,7 @@ def hilbert_schmidt_inner_product(a_mat: np.ndarray, b_mat: np.ndarray) -> compl where :math:`|B\rangle = \text{vec}(B)` and :math:`\langle A|` is the dual vector to :math:`|A \rangle`. - Note: This function has been adapted from :cite:`Rigetti2022forest`. + Note: This function has been adapted from :cite:`Rigetti_2022_Forest`. Examples ========== diff --git a/toqito/state_metrics/matsumoto_fidelity.py b/toqito/state_metrics/matsumoto_fidelity.py index 5ca2bb12e..9aa3ce287 100644 --- a/toqito/state_metrics/matsumoto_fidelity.py +++ b/toqito/state_metrics/matsumoto_fidelity.py @@ -8,7 +8,7 @@ def matsumoto_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the Matsumoto fidelity of two density matrices :cite:`matsumoto2010reverse`. + Compute the Matsumoto fidelity of two density matrices :cite:`Matsumoto_2010_Reverse`. Calculate the Matsumoto fidelity between the two density matrices :code:`rho` and :code:`sigma`, defined by: diff --git a/toqito/state_metrics/sub_fidelity.py b/toqito/state_metrics/sub_fidelity.py index bde2a9891..074cdf238 100644 --- a/toqito/state_metrics/sub_fidelity.py +++ b/toqito/state_metrics/sub_fidelity.py @@ -6,7 +6,7 @@ def sub_fidelity(rho: np.ndarray, sigma: np.ndarray) -> float: r""" - Compute the sub fidelity of two density matrices :cite:`miszczak2008sub`. + Compute the sub fidelity of two density matrices :cite:`Miszczak_2008_Sub`. The sub-fidelity is a measure of similarity between density operators. It is defined as diff --git a/toqito/state_metrics/trace_distance.py b/toqito/state_metrics/trace_distance.py index 7d0f13713..bcd2624cf 100644 --- a/toqito/state_metrics/trace_distance.py +++ b/toqito/state_metrics/trace_distance.py @@ -14,7 +14,7 @@ def trace_distance(rho: np.ndarray, sigma: np.ndarray) -> float: \delta(\rho, \sigma) = \frac{1}{2} \left( \text{Tr}(\left| \rho - \sigma \right| \right). - More information on the trace distance can be found in :cite:`QuantikiTrDist`. + More information on the trace distance can be found in :cite:`Quantiki_TrDist`. Examples ========== diff --git a/toqito/state_opt/optimal_clone.py b/toqito/state_opt/optimal_clone.py index 1f5f2212f..40def675f 100644 --- a/toqito/state_opt/optimal_clone.py +++ b/toqito/state_opt/optimal_clone.py @@ -16,7 +16,7 @@ def optimal_clone( strategy: bool = False, ) -> float | np.ndarray: r""" - Compute probability of counterfeiting quantum money :cite:`molina2012optimal`. + Compute probability of counterfeiting quantum money :cite:`Molina_2012_Optimal`. The primal problem for the :math:`n`-fold parallel repetition is given as follows: @@ -52,7 +52,7 @@ def optimal_clone( Examples ========== - Wiesner's original quantum money scheme :cite:`Wiesner_1983` was shown in :cite:`molina2012optimal` to have an optimal + Wiesner's original quantum money scheme :cite:`Wiesner_1983_Conjugate` was shown in :cite:`Molina_2012_Optimal` to have an optimal probability of 3/4 for succeeding a counterfeiting attack. Specifically, in the single-qubit case, Wiesner's quantum money scheme corresponds to the diff --git a/toqito/state_opt/ppt_distinguishability.py b/toqito/state_opt/ppt_distinguishability.py index f9450ae16..59ba19225 100644 --- a/toqito/state_opt/ppt_distinguishability.py +++ b/toqito/state_opt/ppt_distinguishability.py @@ -14,12 +14,12 @@ def ppt_distinguishability( strategy: bool = False, ) -> float: r""" - Compute probability of optimally distinguishing a state via PPT measurements :cite:`Cosentino_2013`. + Compute probability of optimally distinguishing a state via PPT measurements :cite:`Cosentino_2013_PPT`. Implements the semidefinite program (SDP) whose optimal value is equal to the maximum probability of perfectly distinguishing orthogonal maximally entangled states using any PPT measurement; a measurement whose operators are positive under partial transpose. This SDP was - explicitly provided in :cite:`Cosentino_2013`. + explicitly provided in :cite:`Cosentino_2013_PPT`. One can specify the distinguishability method using the :code:`dist_method` argument. @@ -44,7 +44,7 @@ def ppt_distinguishability( \end{aligned} \end{equation} - It was illustrated in :cite:`Yu_2012` that for the following set of states + It was illustrated in :cite:`Yu_2012_Four` that for the following set of states .. math:: \begin{equation} @@ -57,7 +57,7 @@ def ppt_distinguishability( \end{equation} that the optimal probability of distinguishing via a PPT measurement should yield - :math:`7/8 \approx 0.875` as was proved in :cite:`Yu_2012`. + :math:`7/8 \approx 0.875` as was proved in :cite:`Yu_2012_Four`. >>> from toqito.states import bell >>> from toqito.state_opt import ppt_distinguishability @@ -67,7 +67,7 @@ def ppt_distinguishability( >>> psi_2 = bell(3) >>> psi_3 = bell(1) >>> - >>> # YDY vectors from :cite:`Yu_2012`. + >>> # YDY vectors from :cite:`Yu_2012_Four`. >>> x_1 = np.kron(psi_0, psi_0) >>> x_2 = np.kron(psi_1, psi_3) >>> x_3 = np.kron(psi_2, psi_3) diff --git a/toqito/state_opt/state_distinguishability.py b/toqito/state_opt/state_distinguishability.py index a6c5d5f23..5cf78cbb5 100644 --- a/toqito/state_opt/state_distinguishability.py +++ b/toqito/state_opt/state_distinguishability.py @@ -9,7 +9,7 @@ def state_distinguishability( states: list[np.ndarray], probs: list[float] = None, dist_method: str = "min-error" ) -> float: r""" - Compute probability of state distinguishability :cite:`Eldar_2003`. + Compute probability of state distinguishability :cite:`Eldar_2003_SDPApproach`. The "quantum state distinguishability" problem involves a collection of :math:`n` quantum states diff --git a/toqito/state_opt/state_exclusion.py b/toqito/state_opt/state_exclusion.py index 6adb5bcd2..d08bf16e2 100644 --- a/toqito/state_opt/state_exclusion.py +++ b/toqito/state_opt/state_exclusion.py @@ -47,7 +47,7 @@ def state_exclusion( \end{equation} The conclusive state exclusion SDP is written explicitly in :cite:`Bandyopadhyay_2014_Conclusive`. The problem of conclusive - state exclusion was also thought about under a different guise in :cite:`Pusey_2012`. + state exclusion was also thought about under a different guise in :cite:`Pusey_2012_On`. Examples ========== diff --git a/toqito/state_opt/symmetric_extension_hierarchy.py b/toqito/state_opt/symmetric_extension_hierarchy.py index ba43ee327..49c2de3e1 100644 --- a/toqito/state_opt/symmetric_extension_hierarchy.py +++ b/toqito/state_opt/symmetric_extension_hierarchy.py @@ -17,7 +17,7 @@ def symmetric_extension_hierarchy( dim: int | list[int] = None, ) -> float: r""" - Compute optimal value of the symmetric extension hierarchy SDP :cite:`Navascu_s_2008p`. + Compute optimal value of the symmetric extension hierarchy SDP :cite:`Navascues_2008_Pure`. The probability of distinguishing a given set of states via PPT measurements serves as a natural upper bound to the value of obtaining via separable measurements. Due to the nature of separable @@ -25,10 +25,10 @@ def symmetric_extension_hierarchy( programming techniques. We can, however, construct a hierarchy of semidefinite programs that attains closer and closer - approximations at the separable value via the techniques described in :cite:`Navascu_s_2008p`. + approximations at the separable value via the techniques described in :cite:`Navascues_2008_Pure`. The mathematical form of this hierarchy implemented here is explicitly given from equation 4.55 - in :cite:`cosentino_2015`. + in :cite:`Cosentino_2015_QuantumState`. .. math:: @@ -63,7 +63,7 @@ def symmetric_extension_hierarchy( Examples ========== - It is known from :cite:`cosentino_2015` that distinguishing three Bell states along with a resource state + It is known from :cite:`Cosentino_2015_QuantumState` that distinguishing three Bell states along with a resource state :math:`|\tau_{\epsilon}\rangle` via separable measurements has the following closed form .. math:: @@ -117,7 +117,7 @@ def symmetric_extension_hierarchy( >>> symmetric_extension_hierarchy(states=states, probs=None, level=2) 0.958305796189204 >>> - >>> # As proven in :cite:`cosentino_2015`, the true separable value of distinguishing the + >>> # As proven in :cite:`Cosentino_2015_QuantumState`, the true separable value of distinguishing the >>> # three Bell states is: >>> 1/3 * (2 + np.sqrt(1 - eps**2)) 0.9553418012614794 diff --git a/toqito/state_props/entanglement_of_formation.py b/toqito/state_props/entanglement_of_formation.py index 05843b01e..2b1c8e8f4 100644 --- a/toqito/state_props/entanglement_of_formation.py +++ b/toqito/state_props/entanglement_of_formation.py @@ -9,7 +9,7 @@ def entanglement_of_formation(rho: np.ndarray, dim: list[int] | int = None) -> float: r""" - Compute entanglement-of-formation of a bipartite quantum state :cite:`QuantikiEOF`. + Compute entanglement-of-formation of a bipartite quantum state :cite:`Quantiki_EOF`. Entanglement-of-formation is the entropy of formation of the bipartite quantum state :code:`rho`. Note that this function currently only supports diff --git a/toqito/state_props/has_symmetric_extension.py b/toqito/state_props/has_symmetric_extension.py index 1d1a6fe69..e97b9474a 100644 --- a/toqito/state_props/has_symmetric_extension.py +++ b/toqito/state_props/has_symmetric_extension.py @@ -18,7 +18,7 @@ def has_symmetric_extension( tol: float = 1e-4, ) -> bool: r""" - Determine whether there exists a symmetric extension for a given quantum state :cite:`Doherty_2002`. + Determine whether there exists a symmetric extension for a given quantum state :cite:`Doherty_2002_Distinguishing`. Determining whether an operator possesses a symmetric extension at some level :code:`level` can be used as a check to determine if the operator is entangled or not. @@ -30,7 +30,7 @@ def has_symmetric_extension( 2-qubit symmetric extension: - In :cite:`Chen_2014`, it was shown that a 2-qubit state :math:`\rho_{AB}` has a + In :cite:`Chen_2014_Symmetric`, it was shown that a 2-qubit state :math:`\rho_{AB}` has a symmetric extension if and only if .. math:: diff --git a/toqito/state_props/in_separable_ball.py b/toqito/state_props/in_separable_ball.py index 02bbb8af8..e1e8fb6c7 100644 --- a/toqito/state_props/in_separable_ball.py +++ b/toqito/state_props/in_separable_ball.py @@ -4,11 +4,11 @@ def in_separable_ball(mat: np.ndarray) -> bool: r""" - Check whether an operator is contained in ball of separability :cite:`Gurvits_2002`. + Check whether an operator is contained in ball of separability :cite:`Gurvits_2002_Largest`. Determines whether :code:`mat` is contained within the ball of separable operators centered at the identity matrix (i.e. the maximally-mixed state). The size of this ball was derived in - :cite:`Gurvits_2002`. + :cite:`Gurvits_2002_Largest`. This function can be used as a method for separability testing of states in certain scenarios. @@ -79,5 +79,5 @@ def in_separable_ball(mat: np.ndarray) -> bool: mat = mat / np.trace(mat) # The following check relies on the fact that we scaled the matrix so that trace(mat) = 1. - # The following condition is then exactly the condition mentioned in :cite:`Gurvits_2002`. + # The following condition is then exactly the condition mentioned in :cite:`Gurvits_2002_Largest`. return np.linalg.norm(mat / np.linalg.norm(mat, "fro") ** 2 - np.eye(max_dim), "fro") <= 1 diff --git a/toqito/state_props/is_npt.py b/toqito/state_props/is_npt.py index 98e938b13..bc18eff3f 100644 --- a/toqito/state_props/is_npt.py +++ b/toqito/state_props/is_npt.py @@ -12,7 +12,7 @@ def is_npt(mat: np.ndarray, sys: int = 2, dim: int | list[int] = None, tol: floa Yields either :code:`True` or :code:`False`, indicating that :code:`mat` does or does not have negative partial transpose (within numerical error). The variable :code:`mat` is assumed to act - on bipartite space. :cite:`DiVincenzo_2000` + on bipartite space. :cite:`DiVincenzo_2000_Evidence` A state has negative partial transpose if it does not have positive partial transpose. diff --git a/toqito/state_props/l1_norm_coherence.py b/toqito/state_props/l1_norm_coherence.py index f500871a0..b956eae96 100644 --- a/toqito/state_props/l1_norm_coherence.py +++ b/toqito/state_props/l1_norm_coherence.py @@ -6,7 +6,7 @@ def l1_norm_coherence(rho: np.ndarray) -> float: r""" - Compute the l1-norm of coherence of a quantum state :cite:`PhysRevA.96.052336`. + Compute the l1-norm of coherence of a quantum state :cite:`Rana_2017_Log`. The :math:`\ell_1`-norm of coherence of a quantum state :math:`\rho` is defined as diff --git a/toqito/state_props/sk_vec_norm.py b/toqito/state_props/sk_vec_norm.py index b52d0f49c..dd5e42bcc 100644 --- a/toqito/state_props/sk_vec_norm.py +++ b/toqito/state_props/sk_vec_norm.py @@ -8,7 +8,7 @@ def sk_vector_norm(rho: np.ndarray, k: int = 1, dim: int | list[int] = None) -> float: r""" - Compute the S(k)-norm of a vector :cite:`Johnston_2010`. + Compute the S(k)-norm of a vector :cite:`Johnston_2010_AFamily`. The :math:`S(k)`-norm of of a vector :math:`|v \rangle` is defined as: diff --git a/toqito/states/breuer.py b/toqito/states/breuer.py index 30f661253..ff2b31b67 100644 --- a/toqito/states/breuer.py +++ b/toqito/states/breuer.py @@ -7,11 +7,11 @@ def breuer(dim: int, lam: float) -> np.ndarray: r""" - Produce a Breuer state :cite:`Breuer_2006`. + Produce a Breuer state :cite:`Breuer_2006_Optimal`. Gives a Breuer bound entangled state for two qudits of local dimension :code:`dim`, with the :code:`lam` parameter describing the weight of the singlet component as described in - :cite:`Breuer_2006`. + :cite:`Breuer_2006_Optimal`. This function was adapted from the QETLAB package. diff --git a/toqito/states/chessboard.py b/toqito/states/chessboard.py index 64a2196ae..998b1f3e9 100644 --- a/toqito/states/chessboard.py +++ b/toqito/states/chessboard.py @@ -4,9 +4,9 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = None) -> np.ndarray: r""" - Produce a chessboard state :cite:`D_r_2000`. + Produce a chessboard state :cite:`Dur_2000_ThreeQubits`. - Generates the chessboard state defined in :cite:`D_r_2000`. Note that, for certain choices of + Generates the chessboard state defined in :cite:`Dur_2000_ThreeQubits`. Note that, for certain choices of :code:`s_param` and :code:`t_param`, this state will not have positive partial transpose, and thus may not be bound entangled. @@ -46,7 +46,7 @@ def chessboard(mat_params: list[float], s_param: float = None, t_param: float = :filter: docname in docnames - :param mat_params: Parameters of the chessboard state as defined in :cite:`D_r_2000`. + :param mat_params: Parameters of the chessboard state as defined in :cite:`Dur_2000_ThreeQubits`. :param s_param: Default is :code:`np.conj(mat_params[2]) / np.conj(mat_params[5])`. :param t_param: Default is :code:`t_param = mat_params[0] * mat_params[3] / mat_params[4]`. :return: A chessboard state. diff --git a/toqito/states/domino.py b/toqito/states/domino.py index 1c9d4b141..a4f79659b 100644 --- a/toqito/states/domino.py +++ b/toqito/states/domino.py @@ -6,7 +6,7 @@ def domino(idx: int) -> np.ndarray: r""" - Produce a domino state :cite:`Bennett_1999, Bennett_1999upb`. + Produce a domino state :cite:`Bennett_1999_QuantumNonlocality, Bennett_1999_UPB`. The orthonormal product basis of domino states is given as diff --git a/toqito/states/gen_bell.py b/toqito/states/gen_bell.py index 24fd003fc..2e7abcc91 100644 --- a/toqito/states/gen_bell.py +++ b/toqito/states/gen_bell.py @@ -7,7 +7,7 @@ def gen_bell(k_1: int, k_2: int, dim: int) -> np.ndarray: r""" - Produce a generalized Bell state :cite:`Sych_2009`. + Produce a generalized Bell state :cite:`Sych_2009_AComplete`. Produces a generalized Bell state. Note that the standard Bell states can be recovered as: diff --git a/toqito/states/ghz.py b/toqito/states/ghz.py index 6bce0735d..475e151c3 100644 --- a/toqito/states/ghz.py +++ b/toqito/states/ghz.py @@ -6,10 +6,10 @@ def ghz(dim: int, num_qubits: int, coeff: list[int] = None) -> sparse: r""" - Generate a (generalized) GHZ state :cite:`greenberger2007going`. + Generate a (generalized) GHZ state :cite:`Greenberger_2007_Going`. Returns a :code:`num_qubits`-partite GHZ state acting on :code:`dim` local dimensions, described - in :cite:`greenberger2007going`. For example, :code:`ghz(2, 3)` returns the standard 3-qubit GHZ state on qubits. + in :cite:`Greenberger_2007_Going`. For example, :code:`ghz(2, 3)` returns the standard 3-qubit GHZ state on qubits. The output of this function is sparse. For a system of :code:`num_qubits` qubits (i.e., :code:`dim = 2`), the GHZ state can be written diff --git a/toqito/states/gisin.py b/toqito/states/gisin.py index 71b383670..46325199b 100644 --- a/toqito/states/gisin.py +++ b/toqito/states/gisin.py @@ -4,9 +4,9 @@ def gisin(lambda_var: float, theta: float) -> np.ndarray: r""" - Produce a Gisin state :cite:`GISIN1996151`. + Produce a Gisin state :cite:`Gisin_1996_Hidden`. - Returns the Gisin state described in :cite:`GISIN1996151`. Specifically, the Gisin state can be defined as: + Returns the Gisin state described in :cite:`Gisin_1996_Hidden`. Specifically, the Gisin state can be defined as: .. math:: \begin{equation} diff --git a/toqito/states/horodecki.py b/toqito/states/horodecki.py index a6805fdfd..588dce2ea 100644 --- a/toqito/states/horodecki.py +++ b/toqito/states/horodecki.py @@ -4,7 +4,7 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: r""" - Produce a Horodecki state :cite:`Horodecki_1997, Chru_ci_ski_2011`. + Produce a Horodecki state :cite:`Horodecki_1997_Separability, Chruscinski_2011_OnTheSymmetry`. Returns the Horodecki state in either :math:`(3 \otimes 3)`-dimensional space or :math:`(2 \otimes 4)`-dimensional space, depending on the dimensions in the 1-by-2 vector @@ -53,9 +53,9 @@ def horodecki(a_param: float, dim: list[int] = None) -> np.ndarray: \end{equation} .. note:: - Refer to :cite:`Chru_ci_ski_2011` (specifically equations (1) and (2)) for more information on this state - and its properties. The 3x3 Horodecki state is defined explicitly in Section 4.1 of :cite:`Horodecki_1997` - and the 2x4 Horodecki state is defined explicitly in Section 4.2 of :cite:`Horodecki_1997`. + Refer to :cite:`Chruscinski_2011_OnTheSymmetry` (specifically equations (1) and (2)) for more information on this state + and its properties. The 3x3 Horodecki state is defined explicitly in Section 4.1 of :cite:`Horodecki_1997_Separability` + and the 2x4 Horodecki state is defined explicitly in Section 4.2 of :cite:`Horodecki_1997_Separability`. Examples ========== diff --git a/toqito/states/isotropic.py b/toqito/states/isotropic.py index b94f4ed70..983409f08 100644 --- a/toqito/states/isotropic.py +++ b/toqito/states/isotropic.py @@ -6,7 +6,7 @@ def isotropic(dim: int, alpha: float) -> np.ndarray: r""" - Produce a isotropic state :cite:`horodecki1998reduction`. + Produce a isotropic state :cite:`Horodecki_1998_Reduction`. Returns the isotropic state with parameter :code:`alpha` acting on (:code:`dim`-by-:code:`dim`)-dimensional space. The isotropic state has the following form diff --git a/toqito/states/singlet.py b/toqito/states/singlet.py index a5e0e87ce..ee9b3128c 100644 --- a/toqito/states/singlet.py +++ b/toqito/states/singlet.py @@ -6,7 +6,7 @@ def singlet(dim: int) -> np.ndarray: r""" - Produce a generalized singlet state acting on two n-dimensional systems :cite:`PhysRevLett.89.100402`. + Produce a generalized singlet state acting on two n-dimensional systems :cite:`Cabello_2002_NParticle`. Examples ========== diff --git a/toqito/states/tile.py b/toqito/states/tile.py index da8ac95e5..f6de10fb9 100644 --- a/toqito/states/tile.py +++ b/toqito/states/tile.py @@ -6,7 +6,7 @@ def tile(idx: int) -> np.ndarray: r""" - Produce a Tile state :cite:`Bennett_1999upb`. + Produce a Tile state :cite:`Bennett_1999_UPB`. The Tile states constitute five states on 3-by-3 dimensional space that form a UPB (unextendible product basis). diff --git a/toqito/states/w_state.py b/toqito/states/w_state.py index 8a8b28c12..e47db1fcf 100644 --- a/toqito/states/w_state.py +++ b/toqito/states/w_state.py @@ -6,9 +6,9 @@ def w_state(num_qubits: int, coeff: list[int] = None) -> np.ndarray: r""" - Produce a W-state :cite:`D_r_2000`. + Produce a W-state :cite:`Dur_2000_ThreeQubits`. - Returns the W-state described in :cite:`D_r_2000`. The W-state on `num_qubits` qubits is defined by: + Returns the W-state described in :cite:`Dur_2000_ThreeQubits`. The W-state on `num_qubits` qubits is defined by: .. math:: |W \rangle = \frac{1}{\sqrt{num\_qubits}} diff --git a/toqito/states/werner.py b/toqito/states/werner.py index ae7b58426..c74a36208 100644 --- a/toqito/states/werner.py +++ b/toqito/states/werner.py @@ -10,7 +10,7 @@ def werner(dim: int, alpha: float | list[float]) -> np.ndarray: r""" - Produce a Werner state :cite:`PhysRevA.40.4277`. + Produce a Werner state :cite:`Werner_1989_QuantumStates`. A Werner state is a state of the following form From c6df2b62a26c88038f246e0b1b9c934ae5f584d0 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 19:23:05 -0600 Subject: [PATCH 38/40] month --- docs/articles.bib | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index 680988c71..ae3673820 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -33,7 +33,7 @@ @article{Bandyopadhyay_2014_Conclusive publisher={American Physical Society (APS)}, author={Bandyopadhyay, Somshubhro and Jain, Rahul and Oppenheim, Jonathan and Perry, Christopher}, year={2014}, - month={feb} } + month={Feb}} @article{Bennett_1999_QuantumNonlocality, title={Quantum nonlocality without entanglement}, @@ -46,7 +46,7 @@ @article{Bennett_1999_QuantumNonlocality publisher={American Physical Society (APS)}, author={Bennett, Charles H. and DiVincenzo, David P. and Fuchs, Christopher A. and Mor, Tal and Rains, Eric and Shor, Peter W. and Smolin, John A. and Wootters, William K.}, year={1999}, - month={feb}, pages={1070-1091} } + month={Feb}, pages={1070-1091} } @article{Bennett_1999_UPB, title={Unextendible Product Bases and Bound Entanglement}, @@ -59,7 +59,7 @@ @article{Bennett_1999_UPB publisher={American Physical Society (APS)}, author={Bennett, Charles H. and DiVincenzo, David P. and Mor, Tal and Shor, Peter W. and Smolin, John A. and Terhal, Barbara M.}, year={1999}, - month={jun}, pages={5385-5388} } + month={Jun}, pages={5385-5388} } @article{Breuer_2006_Optimal, @@ -73,7 +73,7 @@ @article{Breuer_2006_Optimal publisher={American Physical Society (APS)}, author={Breuer, Heinz-Peter}, year={2006}, - month={aug} } + month={Aug} } #Last name begins with C @@ -104,7 +104,7 @@ @article{Chen_2014_Symmetric publisher={American Physical Society (APS)}, author={Chen, Jianxin and Ji, Zhengfeng and Kribs, David and Lütkenhaus, Norbert and Zeng, Bei}, year={2014}, - month={sep} } + month={Sep} } @article{Choi_1992_Generalized, title = {Generalized Choi maps in three-dimensional matrix algebra}, @@ -130,7 +130,7 @@ @article{Chruscinski_2011_OnTheSymmetry publisher={Elsevier BV}, author={Chruściński, Dariusz and Kossakowski, Andrzej}, year={2011}, - month={jan}, pages={434-436} } + month={Jan}, pages={434-436} } @misc{Cleve_2008_Strong, title={Strong Parallel Repetition Theorem for Quantum XOR Proof Systems}, @@ -161,7 +161,7 @@ @article{Cosentino_2013_PPT publisher={American Physical Society (APS)}, author={Cosentino, Alessandro}, year={2013}, - month={jan} } + month={Jan} } @misc{Cosentino_2015_QuantumState, title={Quantum State Local Distinguishability via Convex Optimization}, @@ -188,7 +188,7 @@ @article{DiVincenzo_2000_Evidence publisher={American Physical Society (APS)}, author={DiVincenzo, David P. and Shor, Peter W. and Smolin, John A. and Terhal, Barbara M. and Thapliyal, Ashish V.}, year={2000}, - month={may} } + month={May} } @article{Doherty_2002_Distinguishing, @@ -202,7 +202,7 @@ @article{Doherty_2002_Distinguishing publisher={American Physical Society (APS)}, author={Doherty, A. C. and Parrilo, Pablo A. and Spedalieri, Federico M.}, year={2002}, - month={apr} } + month={Apr} } @article{Dur_2000_ThreeQubits, title={Three qubits can be entangled in two inequivalent ways}, @@ -215,7 +215,7 @@ @article{Dur_2000_ThreeQubits publisher={American Physical Society (APS)}, author={Dür, W. and Vidal, G. and Cirac, J. I.}, year={2000}, - month={nov} } + month={Nov} } #Last name begins with E @article{Eldar_2003_SDPApproach, @@ -229,7 +229,7 @@ @article{Eldar_2003_SDPApproach publisher={Institute of Electrical and Electronics Engineers (IEEE)}, author={Eldar, Y.C.}, year={2003}, - month={feb}, pages={446-456} } + month={Feb}, pages={446-456} } #Last name begins with F @@ -268,7 +268,7 @@ @article{Gurvits_2002_Largest publisher={American Physical Society (APS)}, author={Gurvits, Leonid and Barnum, Howard}, year={2002}, - month={dec} } + month={Dec} } #Last name begins with H @@ -280,7 +280,7 @@ @inproceedings{Hayden_2013_TwoMessage publisher={IEEE}, author={Hayden, Patrick and Milner, Kevin and Wilde, Mark M.}, year={2013}, - month={jun} } + month={Jun} } @article{Heinosaari_2020_Random, title={Random positive operator valued measures}, @@ -293,7 +293,7 @@ @article{Heinosaari_2020_Random publisher={AIP Publishing}, author={Heinosaari, Teiko and Jivulescu, Maria Anastasia and Nechita, Ion}, year={2020}, - month={apr} } + month={Apr} } @article{Horodecki_1997_Separability, title={Separability criterion and inseparable mixed states with positive partial transposition}, @@ -306,7 +306,7 @@ @article{Horodecki_1997_Separability publisher={Elsevier BV}, author={Horodecki, Pawel}, year={1997}, - month={aug}, pages={333-339} } + month={Aug}, pages={333-339} } @misc{Horodecki_1998_Reduction, title={Reduction criterion of separability and limits for a class of protocols of entanglement distillation}, @@ -330,7 +330,7 @@ @article{Johnston_2010_AFamily publisher={AIP Publishing}, author={Johnston, Nathaniel and Kribs, David W.}, year={2010}, - month={aug} } + month={Aug} } @misc{Johnston_2012_Norms, @@ -353,7 +353,7 @@ @article{Johnston_2016_Extended publisher={The Royal Society}, author={Johnston, Nathaniel and Mittal, Rajat and Russo, Vincent and Watrous, John}, year={2016}, - month={may}, pages={20160003} } + month={May}, pages={20160003} } @misc{QETLAB_link, @@ -376,7 +376,7 @@ @article{Katariya_2021_Geometric publisher={Springer Science and Business Media LLC}, author={Katariya, Vishal and Wilde, Mark M.}, year={2021}, - month={feb} } + month={Feb} } #Last name begins with L @article{Liang_2007_Bounds, @@ -390,7 +390,7 @@ @article{Liang_2007_Bounds publisher={American Physical Society (APS)}, author={Liang, Yeong-Cherng and Doherty, Andrew C.}, year={2007}, - month={apr} } + month={Apr} } @article{Lupo_2008_Bipartite, @@ -404,7 +404,7 @@ @article{Lupo_2008_Bipartite publisher={IOP Publishing}, author={Lupo, Cosmo and Aniello, Paolo and Scardicchio, Antonello}, year={2008}, - month={sep}, pages={415301} } + month={Sep}, pages={415301} } #Last name begins with M @@ -437,7 +437,7 @@ @article{Molina_2012_Hedging publisher={The Royal Society}, author={Molina, Abel and Watrous, John}, year={2012}, - month={apr}, pages={2614-2629} } + month={Apr}, pages={2614-2629} } @misc{Molina_2012_Optimal, title={Optimal counterfeiting attacks and generalizations for Wiesner's quantum money}, @@ -460,7 +460,7 @@ @article{Navascues_2008_AConvergent publisher={IOP Publishing}, author={Navascués, Miguel and Pironio, Stefano and Acín, Antonio}, year={2008}, - month={jul}, pages={073013} } + month={Jul}, pages={073013} } @article{Navascues_2008_Pure, title={Pure State Estimation and the Characterization of Entanglement}, @@ -473,7 +473,7 @@ @article{Navascues_2008_Pure publisher={American Physical Society (APS)}, author={Navascués, Miguel}, year={2008}, - month={feb} } + month={Feb} } #Last name begins with O @misc{Ozols_2009_RandU, @@ -496,7 +496,7 @@ @article{Peres_1996_Separability publisher={American Physical Society (APS)}, author={Peres, Asher}, year={1996}, - month={aug}, pages={1413-1415} } + month={Aug}, pages={1413-1415} } @misc{Philip_2023_Schrodinger, title={Schr\"odinger as a Quantum Programmer: Estimating Entanglement via Steering}, @@ -518,7 +518,7 @@ @article{Pusey_2012_On publisher={Springer Science and Business Media LLC}, author={Pusey, Matthew F. and Barrett, Jonathan and Rudolph, Terry}, year={2012}, - month={may}, pages={475-478} } + month={May}, pages={475-478} } #Last name begins with Q @misc{Quantiki_EOF, @@ -628,7 +628,7 @@ @article{Sych_2009_AComplete doi = {10.1088/1367-2630/11/1/013006}, url = {https://dx.doi.org/10.1088/1367-2630/11/1/013006}, year = {2009}, -month = {jan}, +month = {Jan}, publisher = {}, volume = {11}, number = {1}, @@ -685,7 +685,7 @@ @article{Wiesner_1983_Conjugate url = {https://doi.org/10.1145/1008908.1008920}, doi = {10.1145/1008908.1008920}, journal = {SIGACT News}, -month = {jan}, +month = {Jan}, pages = {78-88}, numpages = {11} } @@ -1084,7 +1084,7 @@ @article{Yu_2012_Four publisher={American Physical Society (APS)}, author={Yu, Nengkun and Duan, Runyao and Ying, Mingsheng}, year={2012}, - month={jul} } + month={Jul} } #Last name begins with Z \ No newline at end of file From 1db6874f6813b3bdbc724fa74a136f5ac0e40f1d Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Fri, 24 Nov 2023 19:34:35 -0600 Subject: [PATCH 39/40] author: last name, first name --- docs/articles.bib | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index ae3673820..f5b4ff432 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -115,7 +115,7 @@ @article{Choi_1992_Generalized issn = {0024-3795}, doi = {https://doi.org/10.1016/0024-3795(92)90260-H}, url = {https://www.sciencedirect.com/science/article/pii/002437959290260H}, -author = {Sung Je Cho and Seung-Hyeok Kye and Sa Ge Lee}, +author = {Cho, Sung Je and Kye, Seung-Hyeok and Lee, Sa Ge}, abstract = {We consider a class of positive linear maps in the three-dimensional matrix algebra, which are generalizations of the positive linear map constructed by Choi in the relation with positive semidefinite biquadratic forms. We find conditions for which such maps are completely positive, completely copositive, decomposable, and two-positive.} } @@ -134,7 +134,7 @@ @article{Chruscinski_2011_OnTheSymmetry @misc{Cleve_2008_Strong, title={Strong Parallel Repetition Theorem for Quantum XOR Proof Systems}, - author={Richard Cleve and William Slofstra and Falk Unger and Sarvagya Upadhyay}, + author={Cleve, Richard and Slofstra, William and Unger, Falk and Upadhyay, Sarvagya}, year={2008}, eprint={quant-ph/0608146}, archivePrefix={arXiv}, @@ -165,7 +165,7 @@ @article{Cosentino_2013_PPT @misc{Cosentino_2015_QuantumState, title={Quantum State Local Distinguishability via Convex Optimization}, - author={Alessandro Cosentino}, + author={Cosentino, Alessandro}, year={2015}, howpublished = {https://uwspace.uwaterloo.ca/handle/10012/9572} } @@ -237,7 +237,7 @@ @article{Eldar_2003_SDPApproach #Last name begins with G @misc{Greenberger_2007_Going, title={Going Beyond Bell's Theorem}, - author={Daniel M. Greenberger and Michael A. Horne and Anton Zeilinger}, + author={Greenberger, Daniel M. and Horne, Michael A. and Zeilinger, Anton}, year={2007}, eprint={0712.0921}, archivePrefix={arXiv}, @@ -254,7 +254,7 @@ @article{Gisin_1996_Hidden issn = {0375-9601}, doi = {https://doi.org/10.1016/S0375-9601(96)80001-6}, url = {https://www.sciencedirect.com/science/article/pii/S0375960196800016}, -author = {N. Gisin}, +author = {Gisin, N.}, } @article{Gurvits_2002_Largest, @@ -310,7 +310,7 @@ @article{Horodecki_1997_Separability @misc{Horodecki_1998_Reduction, title={Reduction criterion of separability and limits for a class of protocols of entanglement distillation}, - author={Michal Horodecki and Pawel Horodecki}, + author={ Horodecki, Michal and Horodecki, Pawel}, year={1998}, eprint={quant-ph/9708015}, archivePrefix={arXiv}, @@ -410,7 +410,7 @@ @article{Lupo_2008_Bipartite #Last name begins with M @misc{Matsumoto_2010_Reverse, title={Reverse test and quantum analogue of classical fidelity and generalized fidelity}, - author={Keiji Matsumoto}, + author={Matsumoto, Keiji}, year={2010}, eprint={1006.0302}, archivePrefix={arXiv}, @@ -419,7 +419,7 @@ @misc{Matsumoto_2010_Reverse @misc{Miszczak_2008_Sub, title={Sub-- and super--fidelity as bounds for quantum fidelity}, - author={J. A. Miszczak and Z. Puchała and P. Horodecki and A. Uhlmann and K. Życzkowski}, + author={Miszczak, J. A. and Puchała, Z. and Horodecki, P. and Uhlmann, A. and Życzkowski, K.}, year={2008}, eprint={0805.2037}, archivePrefix={arXiv}, @@ -441,7 +441,7 @@ @article{Molina_2012_Hedging @misc{Molina_2012_Optimal, title={Optimal counterfeiting attacks and generalizations for Wiesner's quantum money}, - author={Abel Molina and Thomas Vidick and John Watrous}, + author={Molina, Abel and Vidick, Thomas and Watrous, John}, year={2012}, eprint={1202.4010}, archivePrefix={arXiv}, @@ -500,7 +500,7 @@ @article{Peres_1996_Separability @misc{Philip_2023_Schrodinger, title={Schr\"odinger as a Quantum Programmer: Estimating Entanglement via Steering}, - author={Aby Philip and Soorya Rethinasamy and Vincent Russo and Mark M. Wilde}, + author={Philip, Aby and Rethinasamy, Soorya and Russo, Vincent and Wilde, Mark M.}, year={2023}, eprint={2303.07911}, archivePrefix={arXiv}, @@ -583,7 +583,7 @@ @misc{Rigetti_2022_Forest @misc{Russo_2017_Extended, title={Extended Nonlocal Games}, - author={Vincent Russo}, + author={Russo, Vincent}, year={2017}, eprint={1704.07375}, archivePrefix={arXiv}, @@ -592,7 +592,7 @@ @misc{Russo_2017_Extended #Last name begins with S @misc{Seshadri_2021_Git, - author = "Akshay Seshadri", + author = "Seshadri, Akshay", title = "Minimax Fidelity Estimation", howpublished = {https://github.com/akshayseshadri/minimax-fidelity-estimation} @@ -600,7 +600,7 @@ @misc{Seshadri_2021_Git @misc{Seshadri_2021_Theory, title={Theory of versatile fidelity estimation with confidence}, - author={Akshay Seshadri and Martin Ringbauer and Thomas Monz and Stephen Becker}, + author={Seshadri, Akshay and Ringbauer, Martin and Monz, Thomas and Becker, Stephen}, year={2021}, eprint={2112.07947}, archivePrefix={arXiv}, @@ -610,7 +610,7 @@ @misc{Seshadri_2021_Theory @misc{Seshadri_2021_Versatile, title={Versatile fidelity estimation with confidence}, - author={Akshay Seshadri and Martin Ringbauer and Rainer Blatt and Thomas Monz and Stephen Becker}, + author={Seshadri, Akshay and Ringbauer, Martin and Blatt, Rainer and Monz, Thomas and Becker, Stephen}, year={2021}, eprint={2112.07925}, archivePrefix={arXiv}, @@ -633,7 +633,7 @@ @article{Sych_2009_AComplete volume = {11}, number = {1}, pages = {013006}, -author = {Denis Sych and Gerd Leuchs}, +author = {Sych, Denis and Leuchs, Gerd}, title = {A complete basis of generalized Bell states}, journal = {New Journal of Physics}, } @@ -647,7 +647,7 @@ @article{Sych_2009_AComplete #Last name begins with W @misc{Watrous_2009_Semidefinite, title={Semidefinite programs for completely bounded norms}, - author={John Watrous}, + author={Watrous, John}, year={2009}, eprint={0901.4709}, archivePrefix={arXiv}, @@ -657,7 +657,7 @@ @misc{Watrous_2009_Semidefinite @misc{Watrous_2011_Lecture_Notes, title={Theory of Quantum Information Lecture Notes}, - author={John Watrous}, + author={Watrous, John}, year={2011}, howpublished = {https://cs.uwaterloo.ca/~watrous/TQI-notes/} } @@ -665,7 +665,7 @@ @misc{Watrous_2011_Lecture_Notes @misc{Watrous_2012_Simpler, title={Simpler semidefinite programs for completely bounded norms}, - author={John Watrous}, + author={Watrous, John}, year={2012}, eprint={1207.5726}, archivePrefix={arXiv}, From 2d41cf2bbd641e06bf2a90e96c8fe0cc6c9a2820 Mon Sep 17 00:00:00 2001 From: Purva Thakre Date: Sat, 25 Nov 2023 09:42:24 -0600 Subject: [PATCH 40/40] check all docstrings --- docs/articles.bib | 34 +++++++++++++++++++ toqito/channel_props/is_trace_preserving.py | 3 +- toqito/channel_props/is_unital.py | 3 +- toqito/matrices/gen_pauli.py | 3 +- toqito/matrix_ops/vectors_from_gram_matrix.py | 6 ++-- toqito/matrix_ops/vectors_to_gram_matrix.py | 6 ++-- toqito/matrix_props/is_totally_positive.py | 7 ++-- toqito/perms/perfect_matchings.py | 7 ++-- toqito/state_props/is_antidistinguishable.py | 14 +++----- toqito/state_props/von_neumann_entropy.py | 3 +- toqito/states/trine.py | 8 ++--- 11 files changed, 64 insertions(+), 30 deletions(-) diff --git a/docs/articles.bib b/docs/articles.bib index f5b4ff432..b12ad1973 100644 --- a/docs/articles.bib +++ b/docs/articles.bib @@ -282,6 +282,19 @@ @inproceedings{Hayden_2013_TwoMessage year={2013}, month={Jun} } +@article{Heinosaari_2018_Antidistinguishability, + title={Antidistinguishability of pure quantum states}, + volume={51}, + ISSN={1751-8121}, + url={http://dx.doi.org/10.1088/1751-8121/aad1fc}, + DOI={10.1088/1751-8121/aad1fc}, + number={36}, + journal={Journal of Physics A: Mathematical and Theoretical}, + publisher={IOP Publishing}, + author={Heinosaari, Teiko and Kerppo, Oskari}, + year={2018}, + month=jul, pages={365303} } + @article{Heinosaari_2020_Random, title={Random positive operator valued measures}, volume={61}, @@ -820,6 +833,13 @@ @misc{WikiGellMann } +@misc{WikiGram, + author = "Wikipedia", + title = "Gram Matrix", + howpublished = {https://en.wikipedia.org/wiki/Gram_matrix} + +} + @misc{WikiHadamard, author = "Wikipedia", title = "Hadamard transform", @@ -1057,6 +1077,13 @@ @misc{WikiTensorProd } +@misc{WikiTotPosMat, + author = "Wikipedia", + title = "Totally positive matrix", + howpublished = {https://en.wikipedia.org/wiki/Totally_positive_matrix} + +} + @misc{WikiUniMat, author = "Wikipedia", title = "Unitary matrix", @@ -1073,6 +1100,13 @@ @misc{WikiUVonNeumann #Last name begins with X #Last name begins with Y +@misc{Yard_2017_Lecture11, + author = "Yard, Jon", + title = "Introduction to Quantum Information Processing", + howpublished = {https://www.math.uwaterloo.ca/~jyard/qic710/F17/Qic710Lec11-2017.pdf} + +} + @article{Yu_2012_Four, title={Four Locally Indistinguishable Ququad-Ququad Orthogonal Maximally Entangled States}, volume={109}, diff --git a/toqito/channel_props/is_trace_preserving.py b/toqito/channel_props/is_trace_preserving.py index 15dc36d4d..c31202f52 100644 --- a/toqito/channel_props/is_trace_preserving.py +++ b/toqito/channel_props/is_trace_preserving.py @@ -16,7 +16,8 @@ def is_trace_preserving( dim: list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is trace-preserving (Section: Linear Maps Of Square Operators from :cite:`Watrous_2018_TQI`). + Determine whether the given channel is trace-preserving (Section: Linear Maps Of Square Operators from + :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *trace-preserving* if it holds that diff --git a/toqito/channel_props/is_unital.py b/toqito/channel_props/is_unital.py index 96d69282b..74a26a70a 100644 --- a/toqito/channel_props/is_unital.py +++ b/toqito/channel_props/is_unital.py @@ -15,7 +15,8 @@ def is_unital( dim: int | list[int] | np.ndarray = None, ) -> bool: r""" - Determine whether the given channel is unital (Chapter: Unital Channels And Majorization from :cite:`Watrous_2018_TQI`). + Determine whether the given channel is unital (Chapter: Unital Channels And Majorization from + :cite:`Watrous_2018_TQI`). A map :math:`\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)` is *unital* if it holds that diff --git a/toqito/matrices/gen_pauli.py b/toqito/matrices/gen_pauli.py index d9152e509..468030f2a 100644 --- a/toqito/matrices/gen_pauli.py +++ b/toqito/matrices/gen_pauli.py @@ -16,7 +16,8 @@ def gen_pauli(k_1: int, k_2: int, dim: int) -> np.ndarray: from 0 to :code:`dim-1`, inclusive. Note that the generalized Pauli operators are also known by the name of - "discrete Weyl operators". (Lecture 6: Further Remarks On Measurements And Channels from :cite:`Watrous_2011_Lecture_Notes`) + "discrete Weyl operators". (Lecture 6: Further Remarks On Measurements And Channels from + :cite:`Watrous_2011_Lecture_Notes`) Examples ========== diff --git a/toqito/matrix_ops/vectors_from_gram_matrix.py b/toqito/matrix_ops/vectors_from_gram_matrix.py index 81ad7ac73..637769a7d 100644 --- a/toqito/matrix_ops/vectors_from_gram_matrix.py +++ b/toqito/matrix_ops/vectors_from_gram_matrix.py @@ -3,7 +3,7 @@ def vectors_from_gram_matrix(gram: np.ndarray) -> list[np.ndarray]: - r"""Obtain the corresponding ensemble of states from the Gram matrix [WikGram]_. + r"""Obtain the corresponding ensemble of states from the Gram matrix :cite:`WikiGram`. The function attempts to compute the Cholesky decomposition of the given Gram matrix. If the matrix is positive definite, the Cholesky decomposition is returned. If the matrix is not positive definite, the function falls back to @@ -30,8 +30,8 @@ def vectors_from_gram_matrix(gram: np.ndarray) -> list[np.ndarray]: References ========== - .. [WikGram] Wikipedia: Gram matrix - https://en.wikipedia.org/wiki/Gram_matrix + .. bibliography:: + :filter: docname in docnames :raises LinAlgError: If the Gram matrix is not symmetric. :raises LinAlgError: If the Gram matrix is not square.. diff --git a/toqito/matrix_ops/vectors_to_gram_matrix.py b/toqito/matrix_ops/vectors_to_gram_matrix.py index 2b76e431e..d3cc51ca4 100644 --- a/toqito/matrix_ops/vectors_to_gram_matrix.py +++ b/toqito/matrix_ops/vectors_to_gram_matrix.py @@ -3,7 +3,7 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: - r"""Construct the Gram matrix from a list of vectors [WikGram]_. + r"""Construct the Gram matrix from a list of vectors :cite:`WikiGram`. The Gram matrix is a matrix of inner products, where the entry G[i, j] is the inner product of vectors[i] and vectors[j]. This function computes the Gram matrix for a given list of vectors. @@ -26,8 +26,8 @@ def vectors_to_gram_matrix(vectors: list[np.ndarray]) -> np.ndarray: References ========== - .. [WikGram] Wikipedia: Gram matrix - https://en.wikipedia.org/wiki/Gram_matrix + .. bibliography:: + :filter: docname in docnames :raises ValueError: If the vectors are not all of the same length. :param vectors: A list of vectors (1D numpy arrays). All vectors must be of the same length. diff --git a/toqito/matrix_props/is_totally_positive.py b/toqito/matrix_props/is_totally_positive.py index deb5aba7c..4d360978f 100644 --- a/toqito/matrix_props/is_totally_positive.py +++ b/toqito/matrix_props/is_totally_positive.py @@ -5,7 +5,7 @@ def is_totally_positive(mat: np.ndarray, tol: float = 1e-6, sub_sizes: list | None = None): r""" - Determines whether a matrix is totally positive. + Determines whether a matrix is totally positive. :cite:`WikiTotPosMat` A totally positive matrix is a square matrix where all the minors are positive. Equivalently, the determinant of every square submatrix is a positive number. @@ -41,8 +41,9 @@ def is_totally_positive(mat: np.ndarray, tol: float = 1e-6, sub_sizes: list | No References ========== - .. [WikTotallyPositive] Wikipedia: Totally positive matrix. - https://en.wikipedia.org/wiki/Totally_positive_matrix + .. bibliography:: + :filter: docname in docnames + :param mat: Matrix to check. :param tol: The absolute tolerance parameter (default 1e-06). diff --git a/toqito/perms/perfect_matchings.py b/toqito/perms/perfect_matchings.py index 16d2225f0..5b51a746e 100644 --- a/toqito/perms/perfect_matchings.py +++ b/toqito/perms/perfect_matchings.py @@ -12,7 +12,7 @@ def perfect_matchings(num: list[int] | int | np.ndarray) -> np.ndarray: Returns all perfect matchings of a given list of objects. That is, it returns all ways of grouping an even number of objects into pairs. - This function is adapted from QETLAB. + This function is adapted from QETLAB. :cite:`QETLAB_link`. Examples ========== @@ -25,7 +25,10 @@ def perfect_matchings(num: list[int] | int | np.ndarray) -> np.ndarray: [1 3 2 4] [1 4 3 2]] - + References + ========== + .. bibliography:: + :filter: docname in docnames :param num: Either an even integer, indicating that you would like all perfect matchings of the integers 1,2, ... N, or a `list` or `np.array` containing an even number of distinct diff --git a/toqito/state_props/is_antidistinguishable.py b/toqito/state_props/is_antidistinguishable.py index bb6c7bd1d..43e39038c 100644 --- a/toqito/state_props/is_antidistinguishable.py +++ b/toqito/state_props/is_antidistinguishable.py @@ -5,10 +5,10 @@ def is_antidistinguishable(states: list[np.ndarray]) -> bool: r""" - Check whether a collection of vectors are antidistinguishable or not [TK18]_. + Check whether a collection of vectors are antidistinguishable or not :cite: `Heinosaari_2018_Antidistinguishability`. The ability to determine whether a set of quantum states are antidistinguishable can be obtained via the state - exclusion SDP [BJOP14]_ such that we ignore the associated probabilities with which the states are chosen from the set of + exclusion SDP :cite:`Bandyopadhyay_2014_Conclusive` such that we ignore the associated probabilities with which the states are chosen from the set of vectors. Examples @@ -47,15 +47,9 @@ def is_antidistinguishable(states: list[np.ndarray]) -> bool: References ========== - .. [TK18] Heinosaari, Teiko, and Oskari Kerppo. - "Antidistinguishability of pure quantum states." - Journal of Physics A: Mathematical and Theoretical 51.36 (2018): 365303. - https://arxiv.org/abs/1804.10457 + .. bibliography:: + :filter: docname in docnames - .. [BJOP14] Bandyopadhyay, Somshubhro, Jain, Rahul, Oppenheim, Jonathan, Perry, Christopher - "Conclusive exclusion of quantum states" - Physical Review A 89.2 (2014): 022336. - arXiv:1306.4683 :param states: A set of vectors consisting of quantum states to determine the antidistinguishability of. :return: :code:`True` if the vectors are antidistinguishable; :code:`False` otherwise. diff --git a/toqito/state_props/von_neumann_entropy.py b/toqito/state_props/von_neumann_entropy.py index f2b79f68d..84f5ccdc0 100644 --- a/toqito/state_props/von_neumann_entropy.py +++ b/toqito/state_props/von_neumann_entropy.py @@ -6,7 +6,8 @@ def von_neumann_entropy(rho: np.ndarray) -> float: r""" - Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, Section: "Definitions Of Quantum Entropic Functions" from :cite:`Watrous_2018_TQI`). + Compute the von Neumann entropy of a density matrix :cite:`WikiUVonNeumann`, + Section: "Definitions Of Quantum Entropic Functions" from :cite:`Watrous_2018_TQI`). Let :math:`P \in \text{Pos}(\mathcal{X})` be a positive semidefinite operator, for a complex Euclidean space :math:`\mathcal{X}`. Then one defines the *von Neumann entropy* as diff --git a/toqito/states/trine.py b/toqito/states/trine.py index 421ea57c2..38a868203 100644 --- a/toqito/states/trine.py +++ b/toqito/states/trine.py @@ -6,7 +6,7 @@ def trine() -> list[np.ndarray]: r""" - Produce the set of trine states [YardQIP]_. + Produce the set of trine states (Slide 6 of :cite:`Yard_2017_Lecture11`). The trine states are formally defined as: @@ -30,10 +30,8 @@ def trine() -> list[np.ndarray]: References ========== - .. [YardQIP] Yard, Jon - Introduction to Quantum Information Processing"" - (Slide 6) - https://www.math.uwaterloo.ca/~jyard/qic710/F17/Qic710Lec11-2017.pdf + .. bibliography:: + :filter: docname in docnames :return: Vector of trine states. """