I am trying to calculate the ground state of 1d heisenberg model H=j(SxSx+SySy+SzSz). However, when the chain length L=20, the ground state seems wrong with the result I got from ED method. I caculate the evolution of the system and calculate the fidelity of the final state(with'distpsi'). The result is quite different.
So, I want to know weather MPS can get right ground state in gapless system? Or I take something wrong with the code. The code is following。
PostProcess = False
if PostProcess:
print('Print results')
else: print('Run MPS')
Jxy = -1.0
Jz = -1.0
hz = 5.0
staticParameters = [{
'simtype' : 'Finite',
'job_ID' : 'Spin0.5Heisenberg',
'unique_ID' : '-L_'+str(L)+'-state',
'Write_Directory' : 'TMP_'+str(jobid)+'-state/',
'Output_Directory' : 'OUTPUTS_'+str(jobid)+'-state/',
'L' : L,
'J_z' : -Jz, # use -H to get the highest excited state
'J_xy' : -Jxy,# use -H to get the highest excited state
'h_z' : 0*h_z, # set hz=0 to get the afm state
'Abelian_generators' : ['sz'],
'Abelian_quantum_numbers' : [0],
'verbose' : 1,
'logfile' : True,
'MPSObservables' : myObservables,
'MPSConvergenceParameters' : myConv
}]
sq = 0
for jj in np.arange(-(L-1),L):
sq += (-1)np.abs(jj) * np.sum(np.diag(szz,k=jj))
sq = sq/L/0.52
print('S_q_afm = %.6f'%sq)
zoz = np.matrix(sz).transpose().dot(np.matrix(sz))
cd = np.zeros(2L-1,)
for jj in np.arange(-(L-1),L):
cd[jj+L-1] += (-1)*np.abs(jj) * np.mean(np.diag(szz,k=jj)-np.diag(zoz,k=jj))
I am having trouble to follow and would need some more details. Can you
attach the actual python files? Do you mean by evolution the ground-state
search or did you do some dynamics on top? Where is the distpsi measurement
which I cannot see in the copy-pasted python code? Where is the ED
calculation? Do the ground state energies match? How big is the error?
If you would have a python script which prints out the error at the end
that would be ideal. Then, we can look at your problem and don't have to
guess what you did.
I am trying to calculate the ground state of 1d heisenberg model
H=j(SxSx+SySy+SzSz). However, when the chain length L=20, the ground state
seems wrong with the result I got from ED method. I caculate the evolution
of the system and calculate the fidelity of the final state(with'distpsi').
The result is quite different.
So, I want to know weather MPS can get right ground state in gapless
system? Or I take something wrong with the code. The code is following。
PostProcess = False
if PostProcess:
print('Print results')
else: print('Run MPS')
Jxy = -1.0
Jz = -1.0
hz = 5.0
staticParameters = [{
'simtype' : 'Finite',
'job_ID' : 'Spin0.5Heisenberg',
'unique_ID' : '-L_'+str(L)+'-state',
'Write_Directory' : 'TMP_'+str(jobid)+'-state/',
'Output_Directory' : 'OUTPUTS_'+str(jobid)+'-state/',
'L' : L,
'J_z' : -Jz, # use -H to get the highest excited state
'J_xy' : -Jxy,# use -H to get the highest excited state
'h_z' : 0*h_z, # set hz=0 to get the afm state
'Abelian_generators' : ['sz'],
'Abelian_quantum_numbers' : [0],
'verbose' : 1,
'logfile' : True,
'MPSObservables' : myObservables,
'MPSConvergenceParameters' : myConv
}]
I donnot know whether MPS can get the right ground state of Heisenberg model or not. Or I calculate the fidelity in a wrong way. I use quspin to simulate the evolution with ED. The fidelity at the end is quite different from MPS.
Really looking forward to your reply!
It will help me a lot.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the file ready and I can run it myself. I can look into the standard
points, but it will take me some time depending on which direction I will
go with my feedback.
I donnot know whether MPS can get the right ground state of Heisenberg
model or not. Or I calculate the fidelity in a wrong way. I use quspin to
simulate the evolution with ED. The fidelity at the end is quite different
from MPS.
Really looking forward to your reply!
It will help me a lot.
if anyone joins the discussion, here is a short summary in my own words.
The script calculates a ground state |GS>. The time evolution does not
start in the ground state, but starts in a product state defined by the
user, say |psi(t=0)>. The aim is to calculate the distance between |GS> and
the state |psi(t_final)> at the end of the quench. The handling of the
states seems alright at first glance.
Since I cannot compare to your ED result, I would have one point to check
for you. Please define the quench function as
In fact, always pass all parameters used in the quench function except the
time t. python will otherwise take the last value defined and not the
actual value at the specific iteration of the loop. Maybe you can rerun and
tell us if there is still a discrepancy? I could check some more points and
probably compare the results to our built-in ED code for ten sites or so.
I have the file ready and I can run it myself. I can look into the standard
points, but it will take me some time depending on which direction I will
go with my feedback.
Best regards,
Daniel
On Thu, May 14, 2020 at 8:02 PM yanjunxie yjxie@users.sourceforge.net
wrote:
I donnot know whether MPS can get the right ground state of Heisenberg
model or not. Or I calculate the fidelity in a wrong way. I use quspin to
simulate the evolution with ED. The fidelity at the end is quite different
from MPS.
Really looking forward to your reply!
It will help me a lot.
Hi,
Thanks for your reply. I think the evolution of the model is correct. It's because I calculate the observation$(-1)^i*Mz$ and the same result with two methods.
So , I think maybe the ground state is wrong in large system. When you truncate the m
eigenstates to build a new block, MPS uses lanczos method. Does this method can be used in a gapless system? Maybe, just using 'Eigh' or 'Eigsh' is OK.
Or I calculate the fidelity in a wrong way? I donnot know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried your method. However, it didn't work. I really don't why this discrepancy came out. I tried L=10 before. The fidelity have small discrepancy with ED method. So I think it don't converge for L=20.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried your method. However, it didn't work. I really don't why this
discrepancy came out. I tried L=10 before. The fidelity have small
discrepancy with ED method. So I think it don't converge for L=20.
I'm sorry I didn't make it clear. I want to simulate the evolution of spin1/2 heisenberg model in a staggered field. $$ \mathbf{H} = \frac{J_{xy}}{2}\sum_{\langle i,j\rangle} (S^+i S^-_j + S^-_i S^+_j) + J_z\sum S^z_i S^z_j + \sum_i h_z (-1)^i S^z_i$$
I want to evolve the system by tuning the parameter h_z and compute the fidelity of the final state with the ground state of heisenberg model(h_z=0). But I cannot get the same result with ED method. I cannot offer the ED calculation. But I am sure that I take some mistakes when I use MPS.
Really thank you for helping me.
Last edit: yanjunxie 2020-05-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to calculate the ground state of 1d heisenberg model H=j(SxSx+SySy+SzSz). However, when the chain length L=20, the ground state seems wrong with the result I got from ED method. I caculate the evolution of the system and calculate the fidelity of the final state(with'distpsi'). The result is quite different.
So, I want to know weather MPS can get right ground state in gapless system? Or I take something wrong with the code. The code is following。
Operators = mps.BuildSpinOperators(spin=0.5)
H = mps.MPO(Operators)
H.AddMPOTerm('bond', ['splus', 'sminus'], hparam='J_xy', weight=0.5)
H.AddMPOTerm('bond', ['sz', 'sz'], hparam='J_z', weight=1.0)
H.AddMPOTerm('site', 'sz', hparam='h_z', weight=1.0 )
myObservables = mps.Observables(Operators)
myObservables.AddObservable('site', 'sz', 'z')
myObservables.AddObservable('corr', ['sz', 'sz'], 'zz')
myObservables.AddObservable('corr', ['splus', 'sminus'], 'pm')
myObservables.SpecifyCorrelationRange(1000)
myObservables.AddObservable('State', True)
myConv = mps.MPSConvParam(max_bond_dimension=20,
max_num_sweeps=20,
local_tol=1E-14)
L, jobid, gs, lin = 20, '020', -1, 0 # gs, exp
PostProcess = False
if PostProcess:
print('Print results')
else: print('Run MPS')
Jxy = -1.0
Jz = -1.0
hz = 5.0
staticParameters = [{
'simtype' : 'Finite',
'job_ID' : 'Spin0.5Heisenberg',
'unique_ID' : '-L_'+str(L)+'-state',
'Write_Directory' : 'TMP_'+str(jobid)+'-state/',
'Output_Directory' : 'OUTPUTS_'+str(jobid)+'-state/',
'L' : L,
'J_z' : -Jz, # use -H to get the highest excited state
'J_xy' : -Jxy,# use -H to get the highest excited state
'h_z' : 0*h_z, # set hz=0 to get the afm state
'Abelian_generators' : ['sz'],
'Abelian_quantum_numbers' : [0],
'verbose' : 1,
'logfile' : True,
'MPSObservables' : myObservables,
'MPSConvergenceParameters' : myConv
}]
MainFiles = mps.WriteFiles(staticParameters, Operators, H,
PostProcess=PostProcess)
if(not PostProcess):
if os.path.isfile('./Execute_MPSMain'):
RunDir = './'
else:
RunDir = None
mps.runMPS(MainFiles, RunDir=RunDir)
Outputs = mps.ReadStaticObservables(staticParameters)
p = Outputs[-1]
szz = p['zz']
spm = p['pm']
sz = np.array(p['z'])
Mz = sz.dot((-1)**np.arange(L)) / L / 0.5
print('M_z_afm = %.6f'%Mz)
energy = -p['energy']/L
print('E_afm = %.6f'%energy)
sq = 0
for jj in np.arange(-(L-1),L):
sq += (-1)np.abs(jj) * np.sum(np.diag(szz,k=jj))
sq = sq/L/0.52
print('S_q_afm = %.6f'%sq)
zoz = np.matrix(sz).transpose().dot(np.matrix(sz))
cd = np.zeros(2L-1,)
for jj in np.arange(-(L-1),L):
cd[jj+L-1] += (-1)*np.abs(jj) * np.mean(np.diag(szz,k=jj)-np.diag(zoz,k=jj))
cd0 = cd/0.5**2
print('C_d_afm = %.6f'%cd0[-1])
stateDir = staticParameters[0]['Output_Directory']+ \
staticParameters[0]['job_ID'] + \
staticParameters[0]['unique_ID'] + \
'ObsOut0_1_State.bin'
Hi,
I am having trouble to follow and would need some more details. Can you
attach the actual python files? Do you mean by evolution the ground-state
search or did you do some dynamics on top? Where is the distpsi measurement
which I cannot see in the copy-pasted python code? Where is the ED
calculation? Do the ground state energies match? How big is the error?
If you would have a python script which prints out the error at the end
that would be ideal. Then, we can look at your problem and don't have to
guess what you did.
Best regards,
Daniel
On Tue, May 12, 2020 at 9:49 AM yanjunxie yjxie@users.sourceforge.net
wrote:
I donnot know whether MPS can get the right ground state of Heisenberg model or not. Or I calculate the fidelity in a wrong way. I use quspin to simulate the evolution with ED. The fidelity at the end is quite different from MPS.
Really looking forward to your reply!
It will help me a lot.
Hi,
I have the file ready and I can run it myself. I can look into the standard
points, but it will take me some time depending on which direction I will
go with my feedback.
Best regards,
Daniel
On Thu, May 14, 2020 at 8:02 PM yanjunxie yjxie@users.sourceforge.net
wrote:
Hi,
if anyone joins the discussion, here is a short summary in my own words.
The script calculates a ground state |GS>. The time evolution does not
start in the ground state, but starts in a product state defined by the
user, say |psi(t=0)>. The aim is to calculate the distance between |GS> and
the state |psi(t_final)> at the end of the quench. The handling of the
states seems alright at first glance.
Since I cannot compare to your ED result, I would have one point to check
for you. Please define the quench function as
def hzfuncdown(t, tau=tau, tau0=tau0, h_z=h_z, lin=lin):
...
In fact, always pass all parameters used in the quench function except the
time t. python will otherwise take the last value defined and not the
actual value at the specific iteration of the loop. Maybe you can rerun and
tell us if there is still a discrepancy? I could check some more points and
probably compare the results to our built-in ED code for ten sites or so.
Best regards,
Daniel
On Thu, May 14, 2020 at 10:36 PM Daniel Jaschke djaschke@users.sourceforge.net wrote:
Hi,
Thanks for your reply. I think the evolution of the model is correct. It's because I calculate the observation$(-1)^i*Mz$ and the same result with two methods.
So , I think maybe the ground state is wrong in large system. When you truncate the m
eigenstates to build a new block, MPS uses lanczos method. Does this method can be used in a gapless system? Maybe, just using 'Eigh' or 'Eigsh' is OK.
Or I calculate the fidelity in a wrong way? I donnot know.
I have tried your method. However, it didn't work. I really don't why this discrepancy came out. I tried L=10 before. The fidelity have small discrepancy with ED method. So I think it don't converge for L=20.
Hi,
I have a minimal example comparing MPS against our own ED code, but I am
still in the process of debugging further.
Best regards,
Daniel
On Thu, May 21, 2020 at 9:02 AM yanjunxie yjxie@users.sourceforge.net
wrote:
I'm sorry I didn't make it clear. I want to simulate the evolution of spin1/2 heisenberg model in a staggered field. $$ \mathbf{H} = \frac{J_{xy}}{2}\sum_{\langle i,j\rangle} (S^+i S^-_j + S^-_i S^+_j) + J_z\sum S^z_i S^z_j + \sum_i h_z (-1)^i S^z_i$$
I want to evolve the system by tuning the parameter h_z and compute the fidelity of the final state with the ground state of heisenberg model(h_z=0). But I cannot get the same result with ED method. I cannot offer the ED calculation. But I am sure that I take some mistakes when I use MPS.
Really thank you for helping me.
Last edit: yanjunxie 2020-05-12