Skip to content

Commit

Permalink
update Renyi entanglement entropy docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhky committed Jun 13, 2022
1 parent 35e403d commit 02091fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions pyqentangle/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def entanglement_entropy(schmidt_modes):
""" Calculate the entanglement entropy
Given the calculated Schmidt modes, compute the entanglement entropy
with the formula :math:`H=-\\sum_i p_i \log p_i`.
with the formula :math:`H=-\\sum_i p_i \\log p_i`.
:param schmidt_modes: Schmidt modes
:return: the entanglement entropy
Expand All @@ -39,6 +39,15 @@ def entanglement_entropy(schmidt_modes):

# Renyi's entropy
def renyi_entanglement_entropy(schmidt_modes, alpha):
""" Calculate the Renyi's entanglement entropy
Given the calculated Schmidt modes and an :math:`\\alpha`, compute the
Renyi's entanglement entropy with the formula :math:`H= - \\frac{1}{1-\\alpha} \\log \\sum p_i^{\\alpha}`.
:param schmidt_modes:
:param alpha:
:return:
"""
if alpha == 1:
warnings.warn('alpha = 1, doing Shannon entanglement entropy.')
return entanglement_entropy(schmidt_modes)
Expand Down Expand Up @@ -71,7 +80,7 @@ def negativity(bipartite_tensor):
""" Calculate the negativity
Given a normalized bipartite discrete state, compute the negativity
with the formula :math:`N = \\frac{||\\rho^{\Gamma_A}||_1-1}{2}`
with the formula :math:`N = \\frac{||\\rho^{\\Gamma_A}||_1-1}{2}`
:param bipartite_tensor: tensor describing the bi-partitite states, with each elements the coefficients for :math:`|ij\\rangle`
:return: negativity
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def install_requirements():


setup(name='pyqentangle',
version="3.2.0a1",
version="3.2.0a2",
description="Quantum Entanglement in Python",
long_description=package_description(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 02091fd

Please sign in to comment.