## How to define a infiniteT MPS under canonical ensemble

How do I use this algorithm? What does that parameter do?
yasin
Posts: 4
Joined: 08 Nov 2020, 12:08

### How to define a infiniteT MPS under canonical ensemble

I want to run Purification.TEBD with a initial MPS under canonical ensemble. The way I use to creat such a MPS is  psi = PurificationMPS.from_infiniteT(M.lat.mps_sites(), bc=bc), but it gives me a grand canonical ensemble result. I want to conserve some charges, for example, I want to conserve the total number of boson. But I dont know How to do it. I use

Code: Select all

psi.gauge_total_charge([10])
to conserve the number to 10. But when I print

Code: Select all

psi.get_total_charge(only_physical_legs = True)
, it is still [0] while

Code: Select all

psi.get_total_charge()
print [10]. I see my block

Code: Select all

for i in range(L): print(psi._B[i].qtotal)
where L is my chain length, I will get [0] [0] ... [10], only the final one is [10]. Thus I dont understand how to get a canonical ensemble MPS. And PHYSICAL REVIEW B 94, 115157 (2016) is not very clearly for me.
Johannes
Site Admin
Posts: 231
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: How to define a infiniteT MPS under canonical ensemble

This wasn't implemented yet in TeNPy , as you have probably seen by the ToDo entry.

However, since today, it is: 64cd7a3a690e80b2876fce48e79675f060b52ab7

The function from_infiniteT_canonical gives you an initial density matrix with fixed particle number on the physical sector, i.e. the canonical ensemble at infinite temperature.
It follows Sec. VI C of Barthel's arXiv:1607.01696.

Could you please do me a favor and make sure that this actually works? I wrote some quick tests which check that the infinite-T density matrix is what it should be. But it would be good to compare e.g. the magnetization in the TFIChain as a function of beta with results from exact diagonalization.

yasin
Posts: 4
Joined: 08 Nov 2020, 12:08

### Re: How to define a infiniteT MPS under canonical ensemble

Thanks for your replay and the update of Tenpy. I see the function from_infiniteT_canonical, it may be helpfully. But you can’t be sure if it will actually work. Before tring your suggest, I try a bose case (the Bose Hubbard Chain). I want to control the total number of bosons $$N$$ to 10 and use TEBD to get $$N$$ as a function of $$\beta$$. The result as I show below, the total number semms to change with $$\beta$$ and finally tends to a no-ten number. Could this be due to errors? But this error is relatively large.

Attachments
1612859502(1).png (39.06 KiB) Viewed 87 times
Johannes
Site Admin
Posts: 231
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: How to define a infiniteT MPS under canonical ensemble

I played around with this a little bit. When you choose a smaller time step, the error gets smaller, it's O(dt). Further, I noticed that the error is coming from the state not being in canonical form: If you call psi.canonical_form_finite() right before measurements, at least this error is gone, as you would expect for a state conserving total N. I'm still a bit worried, though, because I don't really understand where the error comes from in the first place. I know that this is an issue if you do the even-odd trotterized "brick-wall" update, but I thought we're doing the imaginary time evolution with left-right sweeps here, which I believed to cure this issue.
As an alternative, can you try out the tenpy.algorithms.purification.PurificationApplyMPO? This one might go around the issue at all.