-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4baa03
commit a701b4a
Showing
5 changed files
with
126 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import numpy as np | ||
from .mps import MPS | ||
from .canonical_mps import CanonicalMPS | ||
from ..typing import Vector | ||
|
||
|
||
def all_entanglement_entropies(state: MPS) -> Vector: | ||
cstate = CanonicalMPS(state, center=0) | ||
L = len(cstate) | ||
entropies = np.empty(L) | ||
for i in range(L): | ||
cstate = CanonicalMPS(cstate, center=i) | ||
entropies[i] = cstate.entanglement_entropy(i) | ||
return entropies | ||
|
||
|
||
def all_Renyi_entropies(state: MPS, alpha: float) -> Vector: | ||
cstate = CanonicalMPS(state, center=0) | ||
L = len(cstate) | ||
entropies = np.empty(L) | ||
for i in range(L): | ||
cstate = CanonicalMPS(cstate, center=i) | ||
entropies[i] = cstate.Renyi_entropy(i, alpha) | ||
return entropies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters