## entanglement_entropy_segment doubt

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

### Re: entanglement_entropy_segment doubt

I understand that, I deliberately tried to change the lattice basis vector and order in Honeycomb lattice.
1.) How to change the model such that it supports toroidal boundary condition, as you suggested in earlier post. Can you guide me for this your famous toric code example.

2.) I tried to implement kitaev model (bond dependent spin interaction) on a honeycomb(default lattice) in tenpy, since I provided the interaction parameter such that spectrum is gapless and corresponding bond dimension is increased correspondingly. I tried providing different order of lattice also, but this does not help. Can changing initial product state helps in this regard?
Is there other possible way to make the problem computationaly easy?

Code: Select all

psi = MPS.from_product_state(model.lat.mps_sites(), *(2*Ly*Lx), bc = "infinite")
dmrg_params = {'mixer': True,
'chi_list': {0: 200},
'trunc_params': {'svd_min': 1.e-10},
'verbose': 1}
results = dmrg.run(psi, model, dmrg_params)

Johannes
Posts: 177
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: entanglement_entropy_segment doubt

1.) The toric code model acutally didn't allow for that, you would have had to override the init_lattice method. I've just updated it in 4cc12c0ab9f38cc970da7e5338a1ee3210964997 to allow torus-boundary conditions with bc_MPS="finite", bc_x="periodic", bc_y="periodic".
You can see for Ly=4, that you need bond dimension 64 for the torus compared to bond dimension 8 for the infinite cylinder....

Also, I've now implemented the tenpy.models.lattice.IrregularLattice, in case you want to remove boundary sites not included into couplings for the finite case.

2.) A gapless system formally always requires infinite MPS bond dimension for the ground state, even in 1D!
Start off with small circumferences. Threading a flux through the cylinder can cause a gap opening, where DMRG converges better, but of course that also changes the physics! Same holds for tuning to a different phase by changeing other parameters (e.g., Jz > Jx + Jy in your case, or adding a magnetic field) where there is a gap.

For the Kitaev Honeycomb model, I'd guess that the best order is "Cstyle" (but I didn't try it...).

You might want to do a scaling analysis with the MPS bond dimension, i.e. run DMRG multiple times at increasing bond and look how results change. This kind of analysis still allows to infere quite a lot of information, even if you never get the fully converged ground state, c.f. arXiv:0812.2903.
Changing the initial product state will not change what the required MPS bond dimension is (unless you change the charge sector...), the most it can do is converge in less sweeps if the guess is good.

As I said before, there is no general "magic trick" to make it compuationally easy; if there were, we wouldn't need to develop quantum computers....
For this particular model, of course, you can do all calculuations analytically, making the "compuations" trivial amankumar
Posts: 9
Joined: 17 Apr 2020, 11:14

### Re: entanglement_entropy_segment doubt

Thank you for the update to allow torus-boundary conditions. And as you pointed I implemented it on Toric Code model and bond dimension is squared as compared to infinite cylinder.
1.) But now I am getting back to my old thread question. I am trying to evaluate entanglement for a system size L_x=L_y=4, by making a circular cut along y-direction. I should get the result (L_y-1)Log, but I am not getting the same. Either I am not evaluating the entanglement for a correct subsystem or missing something?
Below I show my result and changes part of code.

Code: Select all

bc_MPS = model_params.get('bc_MPS', 'finite')
bc_x = 'periodic' if bc_MPS == 'finite' else 'open'
bc_x = model_params.get('bc_x', bc_x)
bc_y = model_params.get('bc_y', 'periodic')

Results:

Code: Select all

 print("Entanglement Entropy_1: ", psi.entanglement_entropy())
Entanglement Entropy_1:  [0.69314718 1.37714441 2.06617149 2.05075731 2.74390449 2.98383923
3.1347382  3.1347382  3.16274489 3.63043339 3.6498859  3.66792347
3.66792347 3.66792347 3.66792347 3.66792347 3.66914633 3.66987443
3.66992567 3.66992567 3.66992567 3.66992567 3.66992567 3.66992567
3.66992567 2.97677849 2.28363131 1.59048413 1.59048413 1.38629323
0.69314718]
print("Entanglement Entropy_2:", psi.entanglement_entropy_segment([0,1,2,3,4,5,6,7]))
[3.1347382  3.7570416  4.28997528 4.34170791 3.80648073 3.80648073
3.80648073 3.80648073 3.80648073 3.77859391 4.17482136 4.16271136
4.15874489 4.15874489 4.15874489 4.15874489 4.15874489 4.15878895
4.15886452 3.66993139 3.66992567 3.66992567 3.66992567 3.66992567
3.66992567]

Of course this time psi.entanglement_entropy()=psi.entanglement_entropy_segment([0,1,2,3,4,5,6,7]), because of finite MPS. Can you explain the result I got in both cases?
(2.) Since I am considering torus b.c. , I should not get any boundary edge effects in entanglement entropy for odd system size(say L_y=3)?
Please correct my statement if I am missing something.

Johannes
Posts: 177
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: entanglement_entropy_segment doubt

So you try to use torus boundary conditions now?

Just to make sure, the correct way to do this is (whith the standard toric code model as in the Repo):

Code: Select all

from tenpy.networks.mps import MPS
from tenpy.algorithms import dmrg
from tenpy.models.toric_code import ToricCode

def example_run_TC():
model_params = dict(Lx=4, Ly=4, Jv=1, Jp=1,
bc_MPS="finite", bc_x="periodic", bc_y='periodic',
verbose= 1)
M = ToricCode(model_params)
product_state=*M.lat.N_sites
psi = MPS.from_product_state(M.lat.mps_sites(), product_state, bc =M.lat.bc_MPS)
dmrg_params = {
'mixer': True,  # setting this to True helps to escape local minima
'trunc_params': {
'chi_max': 100,
'svd_min': 1.e-10,
},
'max_E_err': 1.e-10,
'verbose': 1,
}
results = dmrg.run(psi, M, dmrg_params)
print("Energy per site: ", results['E'])
print("entanglement_entropy", psi.entanglement_entropy())
print("entanglement_entropy_segment", psi.entanglement_entropy_segment(list(range(8))))

if __name__ == "__main__":
example_run_TC()

Away from the boundary of the MPS, this gives an entropy of $$S = 6 \log(2) = 2 (L_y-1) \log(2)$$ on bond between sites 7-8, as expected.
The factor of 2 is expected due to the periodic boundary conditions in x-direction, and the reason why you need squared bond dimensions.

For Ly=3, I get $$S=5 \log(2)$$, I think it's for the same reason as before.