Skip to content

Commit

Permalink
higher precision
Browse files Browse the repository at this point in the history
  • Loading branch information
meandmytram committed Jan 31, 2025
1 parent f9d05a2 commit b63472c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions mdopt/mps/canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def dense(

if renormalise:
norm = float(np.linalg.norm(dense, ord=norm))
if norm > 1e-12:
if norm > 1e-17:
dense /= norm

return dense
Expand Down Expand Up @@ -315,7 +315,7 @@ def density_mpo(self) -> List[np.ndarray]:

return list(mpo)

def entanglement_entropy(self, tolerance: float = float(1e-12)) -> np.ndarray:
def entanglement_entropy(self, tolerance: float = float(1e-17)) -> np.ndarray:
"""
Returns the entanglement entropy for bipartitions at each of the bonds.
"""
Expand Down Expand Up @@ -702,7 +702,7 @@ def compress_bond(
self,
bond: int,
chi_max: int = int(1e4),
cut: float = float(1e-12),
cut: float = float(1e-17),
renormalise: bool = False,
strategy: str = "svd",
return_truncation_error: bool = False,
Expand Down Expand Up @@ -873,7 +873,7 @@ def compress_bond(
def compress(
self,
chi_max: int = int(1e4),
cut: float = float(1e-12),
cut: float = float(1e-17),
renormalise: bool = False,
strategy: str = "svd",
return_truncation_errors: bool = False,
Expand Down
6 changes: 3 additions & 3 deletions mdopt/mps/explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def dense(

if renormalise:
norm = float(np.linalg.norm(dense, ord=norm))
if norm > 1e-12:
if norm > 1e-17:
dense /= norm

return dense
Expand Down Expand Up @@ -551,7 +551,7 @@ def compress_bond(
self,
bond: int,
chi_max: int = int(1e4),
cut: float = float(1e-12),
cut: float = float(1e-17),
renormalise: bool = False,
return_truncation_error: bool = False,
) -> Tuple["ExplicitMPS", Optional[float]]:
Expand Down Expand Up @@ -621,7 +621,7 @@ def compress_bond(
def compress(
self,
chi_max: int = int(1e4),
cut: float = float(1e-12),
cut: float = float(1e-17),
renormalise: bool = False,
return_truncation_errors: bool = False,
) -> Tuple["ExplicitMPS", List[Optional[float]]]:
Expand Down

0 comments on commit b63472c

Please sign in to comment.