Skip to content

Commit

Permalink
change file name
Browse files Browse the repository at this point in the history
  • Loading branch information
rochisha0 committed Jul 16, 2024
1 parent ed0d9f6 commit 0dbeeb4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion qutip/core/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'hellinger_dist', 'hilbert_dist', 'average_gate_fidelity',
'process_fidelity', 'unitarity', 'dnorm']

from ..backend import np
from ..numpy_backend import np
from scipy import linalg as la
import scipy.sparse as sp
from .superop_reps import to_choi, _to_superpauli, to_super, kraus_to_choi
Expand Down
11 changes: 5 additions & 6 deletions qutip/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
'concurrence', 'entropy_conditional', 'entangling_power',
'entropy_relative']

from .backend import np
from math import e
from .numpy_backend import np
from .partial_transpose import partial_transpose
from . import (ptrace, tensor, sigmay, ket2dm,
expand_operator)
from .core import data as _data


def entropy_vn(rho, base=e, sparse=False):
def entropy_vn(rho, base=np.e, sparse=False):
"""
Von-Neumann entropy of density matrix
Expand Down Expand Up @@ -150,7 +149,7 @@ def negativity(rho, subsys, method='tracenorm', logarithmic=False):
return N


def entropy_mutual(rho, selA, selB, base=e, sparse=False):
def entropy_mutual(rho, selA, selB, base=np.e, sparse=False):
"""
Calculates the mutual information S(A:B) between selection
components of a system density matrix.
Expand Down Expand Up @@ -192,7 +191,7 @@ def entropy_mutual(rho, selA, selB, base=e, sparse=False):
return out


def entropy_relative(rho, sigma, base=e, sparse=False, tol=1e-12):
def entropy_relative(rho, sigma, base=np.e, sparse=False, tol=1e-12):
"""
Calculates the relative entropy S(rho||sigma) between two density
matrices.
Expand Down Expand Up @@ -288,7 +287,7 @@ def entropy_relative(rho, sigma, base=e, sparse=False, tol=1e-12):
return np.maximum(0, S)


def entropy_conditional(rho, selB, base=e, sparse=False):
def entropy_conditional(rho, selB, base=np.e, sparse=False):
"""
Calculates the conditional entropy :math:`S(A|B)=S(A,B)-S(B)`
of a selected density matrix component.
Expand Down
2 changes: 1 addition & 1 deletion qutip/backend.py → qutip/numpy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def __getattr__(self, name):
return getattr(backend, name)

# Initialize the numpy backend
np = NumpyBackend()
np = NumpyBackend()

0 comments on commit 0dbeeb4

Please sign in to comment.