# Noise in measured quantity even after sufficient sweeps and setmaxdim

+1 vote
edited

Attachment is the magnetization curve for 1D system of 12 spins obtained from ED for the reference.

This Attachment is the magnetization curve for 1D system of 30 spins obtained from Itensors.

Using Itensors, I am getting poor results (noisy) even after giving sufficient number of sweeps (10) and setmaxdim!(sweeps, 2,4,6,8,10,20,30,40,50) . I am expecting smooth steps in magnetization as in figure one.,

P. S. I am finding the magnetization as

ampo0 = OpSum()
for j=1:N
ampo0 += "Sz",j
end
Mz = MPO(ampo0,sites)
........
energy, psi = dmrg(H,psi0, sweeps)
mgn=(inner(psi,Mz,psi))/(n*s)

commented by (70.1k points)
Thanks for the question. A bit hard to say without knowing more details, but first of all: isn’t the MPO you made just the uniform magnetization and not the staggered magnetization?
commented by (290 points)
yes, I m sorry, edited that part.
commented by (290 points)
here is the scripts which I am using for a 1D trimer system:

https://pastebin.com/z8WfBz3f
commented by (70.1k points)
Thanks for posting the code. So for an issue like this, the thing to do is to dive a little deeper: pick one of the values of h_z where the DMRG differs noticeably from the ED and then just study that fixed h_z value.

Does the code (not doing the for loop) give the same result  if you run it multiple times? Observe the reported truncation error and energy after each sweep. Are both consistently getter better and acting smoothly?

It could be any number of things, like a slight difference in how you defined the Hamiltonian in ITensor versus the ED or just that you actually need more than 10 sweeps or larger bond dimension than 50, which can certainly happen sometimes. 50 is actually not such a large bond dimension, so did you try 100 or 200?

Best regards,
Miles
commented by (290 points)
edited by
OK, I will try that.

Yes, I tried 100, as well as 200, result gets better but not so significantly,specially for large part of h_z (0.5-0.8).

Do you think that hamiltonian may be defined in a better way ? specially the numbers (coefficients) used in that.
commented by (70.1k points)
I see. Could you post the numerical value of one of the magnetizations from ED for a specific h_z value so I could try to see what happens?

Also when you say results don’t get better, are they the same each time or changing a little bit every time?
commented by (290 points)
edited by
Took 18 Spins: ED results  Mz= 0.44445 for h_z = 0.65, while itensor   [setmaxdim!(sweeps, 4,8,10,20,30,40,50,60,70,80,90,100)] results 0.42945 and  0.43697 in two separate runs for the same h_z.

If I define Sx , Sy in terms of S+, S- then I get 0.44426.

One more point: In ED program,  Sx , Sy is defined in terms of S+, S-.
commented by (290 points)
edited by
One More Seprate Doubt:

For the following set,

sweeps = Sweeps(100)
setmaxdim!(sweeps, 2,4,8,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,180,250,300,400,500)

I see that setmaxdim value does not increase after reaching the setmaxdim=110, and sweep keeps running at setmaxdim=110 till the end of number of sweeps.

Could you please explain, why so ?
commented by (290 points)
One more Question:

Sorry for multiple doubts/questions. I am newbie, and enjoying itensor.

1: Can I do the same calculation using PBC ? If so, how it can be done ?

2: How can I do the finite temperature calculations ? for example the same calculation ?

Thanks.
commented by (70.1k points)
Hi, regarding your maxdim question, the reason it saturates to 110 is probably because you also have set a cutoff. The cutoff will eventually limit the actual maxdim reached. They work together to determine the actual maxdim reached. What cutoff do you have set?

Regarding the other two questions about PBC and finite temperature, could you please post a new question or questions about these? It is a longer conversation.

Briefly: you can use a PBC Hamiltonian on a regular (OBC) MPS, though the cost can be rather high. It’s usually not worth it unless you have a good reason. For finite temperature there are multiple algorithms and which one you use depends on what temperature range you need, how entangled the system, and how much coding you want to do. It’s a whole subject unto itself.

Miles
commented by (290 points)
Thank you so much for replying, miles!

Ok understood now, I have set the cutoff 1e-10.
I have seen in one case in which maxdim starts decreasing after reaching a value, and it goes down to 1 also.

Ok, thanks I will ask a separate question for each.
commented by (70.1k points)
Ok great, glad you are exploring those settings. I would recommend studying various h_z values and doing a study where you adjust both cutoff and maxim and the number of sweeps and determine how much the magnetization varies. Once it is stable to these choices then see how it compares to ED. Usually it's better to work at one h_z value at a time like this, rather than putting a for loop around many DMRG runs.
commented by (290 points)
ok, thanks Miles.