diff --git a/spin_systems/ClassicalIsingTermalState.py b/spin_systems/ClassicalIsingTermalState.py index d125e29..992e3bf 100644 --- a/spin_systems/ClassicalIsingTermalState.py +++ b/spin_systems/ClassicalIsingTermalState.py @@ -1,5 +1,7 @@ import numpy as np +import opt_einsum as oe from ..tensors.MatrixProductState import MPS +from ..tensors.iMatrixProductState import iMPS def Ising_ThermalState(L, K): """ @@ -36,4 +38,13 @@ def Ising_ThermalState(L, K): tensors[i] = tensors[i].reshape(shp[0],shp[1]*shp[2],shp[3]) rho_t = MPS(L,d=4,tensors=tensors) rho_t.right_normalize() - return rho_t \ No newline at end of file + return rho_t + +def iMPSstate(K): + B = Ising_ThermalState(3, K).tensors[1] + theta = oe.contract('abc,cde->abde',B,B).reshape(8,8) + Sb = np.linalg.svd(theta,compute_uv=False)[:2] + Sb /= np.linalg.norm(Sb) + return iMPS(Sb,B,B,d=4) + + \ No newline at end of file diff --git a/spin_systems/Hamiltonians.py b/spin_systems/Hamiltonians.py index 8695939..341567b 100644 --- a/spin_systems/Hamiltonians.py +++ b/spin_systems/Hamiltonians.py @@ -91,5 +91,4 @@ def Hierarchical_Dyson_model(N,sigma,h,J=1): tensors[k][i+1,i] = np.eye(2) if k+i