Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro-santini committed Jun 4, 2022
1 parent 4a9129e commit e9bb028
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 3 deletions.
Binary file modified spin_systems/__pycache__/Hamiltonians.cpython-38.pyc
Binary file not shown.
Binary file modified spin_systems/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion spin_systems/iHamiltonians.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def IsingChainWithAncilla(J=1., h_z=0.25, h_x=0.):
sx_sys = np.kron(sx,Id2)

sz_anc = np.kron(Id2,sz)
sx_anc = np.kron(Id2,sz)
sx_anc = np.kron(Id2,sx)

H = -J*(np.kron(sx_sys,sx_sys))-h_z*(np.kron(sz_sys,Id4)+np.kron(Id4,sz_sys))-h_x*(np.kron(sx_sys,Id4)+np.kron(Id4,sx_sys))
H -= -J*(np.kron(sx_anc,sx_anc))-h_z*(np.kron(sz_anc,Id4)+np.kron(Id4,sz_anc))-h_x*(np.kron(sx_anc,Id4)+np.kron(Id4,sx_anc))
Expand Down
Binary file modified tensors/__pycache__/iMatrixProductState.cpython-38.pyc
Binary file not shown.
6 changes: 4 additions & 2 deletions tensors/iMatrixProductState.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ def compute_transfer_matrix(self):
T = oe.contract('abe,ehf,cbd,dhg->acfg',self.B1,self.B2,self.B1.conj(),self.B2.conj())
self.Tnot_reshaped = T.copy()
self.T = T.reshape(shp1[0]**2,shp1[0]**2)

def compute_corr_length(self):
self.compute_transfer_matrix()
eigs = np.sort(np.abs(np.linalg.eigvals(self.T)))[::-1]
return -2./np.log(eigs[1])
eig =np.sort( np.abs(eigs(self.T, k=6, ncv=300, which='LM',return_eigenvectors=False)) )[::-1]
self.Teig = eig
return -2./np.log(eig[1])

def compute_long_distance_observable_degenerate(self,op):
self.compute_transfer_matrix()
Expand Down

0 comments on commit e9bb028

Please sign in to comment.