entanglement_entropy_segment doubt

How do I use this algorithm? What does that parameter do?
amankumar
Posts: 9
Joined: 17 Apr 2020, 11:14

entanglement_entropy_segment doubt

Post by amankumar »

Hey
I wanted to evaluate entanglement entropy for a subsystem given by sites in segment parameter in entanglement_entropy_segment function. It should give entropy of this subsystem meaning just one numeric number. But in return I am getting array of entropies. I completely don't understand what each element this array constitutes. Please make me clear about this.

Code: Select all

[print("Entanglement Entropy: ", psi.entanglement_entropy_segment(segment=[0,1,2,3,4,5,6,7,8]))]

User avatar
Johannes
Site Admin
Posts: 179
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

Re: entanglement_entropy_segment doubt

Post by Johannes »

Read the documentation at entanglement_entropy_segment.
There is another parameter first_site, where this segment starts.
If you use segment=[0, 1, 2] and don't specify first_site,
it will default to the segments on sites

Code: Select all

[0, 1, 2]
[1, 2, 3]
[2, 3, 4]
...
Each of them gives you one number, resulting in a 1D array returned.

If you want only the entropy of the segment say 10, 11, 14, 15, you should use

Code: Select all

psi.entanglement_entropy_segment(segment=[0, 1, 4, 5], first_site=[10])
Note that this function is exponentially expensive with len(segment)...

If you aim at calculating the entanglement of the "segment" [0, 1, ..., x-2, x-1] for some large x and finite boundary conditions, just use entanglement_entropy at bond x.

amankumar
Posts: 9
Joined: 17 Apr 2020, 11:14

Re: entanglement_entropy_segment doubt

Post by amankumar »

Thank you for your clarification. But I am concerned about one point, that whether these two operations of entanglement entropy gives the same answer or not for a same subsystem. So I did a check for a given example of Toric Code Model.
Here I took Lx=2,Ly=3 and evaluated ent. entropy for same subsystem.
Here is my result for the below code:

Entanglement Entropy_1:

Code: Select all

[3.4657359  3.4657359  4.15888308 4.15888308 4.15888308 4.15888308 3.4657359  3.4657359  4.15888308 4.15888308 4.15888308 4.15888308]
Where the first element is 3.4657359 =5*Log[2]

Entanglement Entropy_2:

Code: Select all

[4.15888308 4.15888308 4.85203026 4.85203026 4.85203026 4.15888308 4.15888308 4.15888308 4.85203026 4.85203026 4.85203026 4.15888308]
Where the first element is 4.15888308 =6*Log[2]

Entanglement Entropy_3:

Code: Select all

[2.07944154]
which is nearly equal to 3Log[2]

For Toric code model Entanglement entropy scales as (L_y-1)Log[2] for a cut on cylinder along y axis.
So I supposed answer should be 2Log[2] for psi.entanglement_entropy(bonds=[6])). But I got 3Log[2].

Another querry: psi.entanglement_entropy_segment(segment=[0,1,2,3,4,5])[0] should equal to psi.entanglement_entropy(bonds=[6])). But I am not getting the same answer (5Log[2] for first and 3Log[2] for second).
Please clarify me regarding this big confusion. If you do not understand my question let me know, I will more clarify my question.
Thank You.

Code: Select all

model_params = dict(Lx=2, Ly=3, Jv=1, Jp=1, bc_MPS="infinite", verbose= 1)
    print("Entanglement Entropy_1: ", psi.entanglement_entropy_segment(segment=[0,1,2,3,4,5]))
    print("Entanglement Entropy_2: ", psi.entanglement_entropy_segment(segment=[0,1,2,3,4,5,6]))
    print("Entanglement Entropy_3: ", psi.entanglement_entropy(bonds=[6]))

User avatar
Johannes
Site Admin
Posts: 179
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

Re: entanglement_entropy_segment doubt

Post by Johannes »

First of all: the segment [0, 1, 2, 3, 4, 5] is only equivalent to psi.entanglement_entropy()[6] on a finite system.
In an infinite system, psi.entanglement_entropy()[6] takes region A to be [..., -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], which is a single cut dividing the system into left and right halfs, whereas psi.entanglement_entropy_segment([0, 1, 2, 3, 4, 5], [0]) takes the segment [0, 1, 2, 3, 4, 5], not including the sites left of 0, cutting out a "segment" of sites in the center of the chain. The segment basically makes *two* cuts, one to the left and one to the right of the "cylinder ring" of sites [0, 1, 2, 3, 4, 5] with x=0. Hence, it is also expected that it has a larger entanglement entropy.

Now to the question how large the entropy should be.
We know that the ground state of the toric code with periodic boundary conditions (PBC) is an equal super position of all closed "loops", if we identify say up-spins with "activated" bonds (contained in a loop) and down spins with deactivated bonds (not in any loop).

Correct me, if I'm wrong, but my guess is that the result of \((L_y-1)*log(2)\) on a cylinder only holds for even Ly (for which I find that result), where you can ignore boundary effects.
However, even if we do infinite MPS, it's still open boundary conditions in x-direction; infinite DMRG just grows a finite system. If you try to draw the loops on the lattice with odd \(L_y=3,5,7\), you will find that there is always at least one open "loop" which you can't close, going from the left edge of the system to the right.
I'm not completely sure, but I think this loop contributes an additional \(log(2)\) to the entanglement.
This would explain the additional \(log(2)\) in your "entropy 3", and also in entropy 1 (which the standard argument would expect \(2(L_y-1) log(2) = 4 log(2)\) for).
To some extend, the extra loop lifts the restriction of an even number of loops going into to the region, which is the (-1) bit subtracted from the area law entanglement \(L_y log(2)\)

Coming to think about it: the DMRG will also drop the vertex/plaquette terms at the edge of a finite system where one of the operators "leaks" out of the system.
For a finite system, you could explicitly add the corresponding terms.
Alternatively, which should also work for infinite DMRG, I think you can avoid that if you switch off any charge (parity) conservation and adjust the starting left/right environments to be all ones (or more precisely, all ones except for the IdR/IdL index, if you want to avoid adding a global constant).

Also, I've noticed that the order how the MPS winds through the system was not optimal for the toric code.
After the commit 73193b192a3c12e67217a876510cd17d01b3695a I've just made, my tests indicate that you only need a quarter of the bond dimension for the toric code ground state.

amankumar
Posts: 9
Joined: 17 Apr 2020, 11:14

Re: entanglement_entropy_segment doubt

Post by amankumar »

Thank You for the clarification,
1.)Does tenpy also implement toroidal boundary condition ?
2.) I have another question not related to the thread, Suppose I have a model whose ground state is highly entangled, and it requires huge number of chi_max. So can you suggest me some way reduce chi_max, or DMRG is not the right method for the model?

User avatar
Johannes
Site Admin
Posts: 179
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

Re: entanglement_entropy_segment doubt

Post by Johannes »

1) TeNPy only supports "open" MPS, since peridoic MPS don't have a canonical form.
You can make your Model have periodic/toric boundary conditions and still have an open MPS, and TeNPy supports that.
The price you pay is that you need the squared bond dimension due to the (expected) entanglement entropy from one end of the MPS to the other end.
2)
The required bond dimension is dictated by the entanglement, which is a physical quantity, so usually you can't do anything about it.
It is basis dependent, so if you are able to change the basis (e.g. going to momentum space around the cylinder), this can sometimes help. Rearranging the order of sites in your MPS (unit cell), as I did for the toric code is another example of such a basis change.

Appart from that, there is no "magic" trick to to reduce the required bond dimension - it's dictated by physics, after all.

amankumar
Posts: 9
Joined: 17 Apr 2020, 11:14

Re: entanglement_entropy_segment doubt

Post by amankumar »

Can you explain a bit more your second point. Of course entanglement entropy is basis dependent, if you write the Hamiltonian in the basis of exact eigenstate of model, then in that basis ground state would be pure state. But I do not understand how the bond dimension is reduced in Dual Square lattice instead of usual Square lattice as computed by Leon Balents in there nature paper. I mean by just changing the order of lattice sites or unit cell ,how bond dimension is reduced. You can suggest me good reference for this.

(2.) You also suggested me to go to momentum space, and try evaluated entanglement entropy, but while integrated out the space degree of freedom, I need to go back to the space basis. How this will be helpful?

User avatar
Johannes
Site Admin
Posts: 179
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

Re: entanglement_entropy_segment doubt

Post by Johannes »

The square lattice of Leon Balents' paper is a 45-degree rotation compared to the DualSquareLattice we are using.
This implies a different geometry for the cylinder axis (going in the [1, 1] direction of our DualSquareLattice),
and a different "cut" when you split the MPS between unit cells, so it can require different amounts of entanglement entropy in the MPS.

All I'm trying to say is that the way the MPS winds through the lattice can dictate how much entanglement entropy you need. As an example where this is pretty obvious, consider the model coupled spin dimers, e.g. Appendix D of arXiv:1205.4289.
Let me draw strong bonds with = and weak bonds with -,
and let's even consider the limit where the - bonds are completely zero, such that the physical ground state is singlets on the = bonds.
If you consider this ordering of sites:

Code: Select all

5 = 6 - 11= 12
|   |   |   |
3 = 4 - 9 = 10
|   |   |   |
1 = 2 - 7 = 8
you will find the entanglement entropy on the MPS bonds to be [0, 1, 0, 1, 0, 1, ...] (in units of log(2)),
since cutting the MPS into left and right only cuts at most one singlet of the state (e.g. on bond 1-2 or 3-4).

However, if you do the "naive" ordering of going into y-direction first,

Code: Select all

3 = 6 - 9 = 12
|   |   |   |
2 = 5 - 8 = 11
|   |   |   |
1 = 4 - 7 = 10
you will find that your entanglement of the MPS will be [0, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1] (times log(2)),
the maximum scaling with Ly.


PS:
I did not check which geometry gives you the smaller entanglement entropy.
With TenPy, it should be fairly easily implement another ToricCodeModel using the other geometry, and check that ;)
Ask again, if you want to do that but don't know how.

amankumar
Posts: 9
Joined: 17 Apr 2020, 11:14

Re: entanglement_entropy_segment doubt

Post by amankumar »

Thank you for such a beautiful explanation,
1.) I understand by changing the winding direction, bond dimensions changes depending on the interaction. As you said one can try different geometry(changing the winding) and try to see MPS entropy, Is there another possible geometry possible for square lattice.

3.) I tried to look for Honeycomb lattice also, but I could not able to visualize different winding other than usual. Can you suggest me different winding for this Honeycomb lattice, by defining different dual lattice which I can implement in tenpy.
Attachments
Honeycomb.png
Honeycomb.png (105.2 KiB) Viewed 2623 times

User avatar
Johannes
Site Admin
Posts: 179
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

Re: entanglement_entropy_segment doubt

Post by Johannes »

1) It depends on the physical system, not just the lattice! E.g. in the dimer lattice of my previous post, you should define the ordering such that each dimer is nearest-neighbor in the MPS.

3.) The order you plotted here is different from the default one of the tenpy.models.lattice.Honeycomb lattice! You can change the ordering with the "order" model parameter, I'd recommend trying order="default" and order="Cstyle". Again, it depends on the physical system what order actually is the best.

Post Reply