I am trying to reproduce the phase diagram of the transverse field Ising Model on a 1d chain. I essentially use the example code in d_examples_dmrg.
Code: Select all
from tenpy.networks.mps import MPS
from tenpy.models.tf_ising import TFIChain
from tenpy.algorithms import dmrg
def DMRG_finite(L, g,verbose=False,chi_max = 30):
model_params = dict(L=L, J=1., g=g, bc_MPS='finite', conserve=None, verbose=0)
M = TFIChain(model_params)
psi = MPS.from_product_state(M.lat.mps_sites(), [0] * L, bc='finite')
dmrg_params = {
'mixer': None,
'trunc_params': {
'chi_max': chi_max,
'svd_min': 1.e-10
},
'lanczos_params' : {"reortho" : True},
'max_E_err': 1.e-10,
'verbose': verbose
}
dmrg.run(psi, M, dmrg_params)
E = np.sum(psi.expectation_value(M.H_bond[1:]))
return E, psi
I calculate magnetization via
Code: Select all
def magX(psi):
return np.sum(psi.expectation_value("Sigmax"))/psi.L
but cannot reproduce the phase diagram. Especially the magnetiazion is essentially 0 everywhere:
(y is magnetization as calculated above, so summed site expectation values divided by length, x is g from 0 to 1.5)
What am I missing?
On another matter: So far I have been using simply the toycode that is provided in the library (toycodes/a_MPS,b_model,d_dmrg). When trying to reproduce the phase diagram there, I find that it actually looks better for smaller bond dimension, which seems counterintuitive to me. See the following examples:
(eps is my threshold from which onwards singular values are neglected. conf is the relative confidence I am trying to achieve in energy convergence. i.e. the sweeping condition is e_before - e_after/ e_after < conf. From looking at the history throughout my sweeps I am fairly convinced it converged in energy.)
This "unsmooth breakdown" can be shifted towards the true critical point (g=1) by increasing the number of sites L. But when trying to do finite size scaling it doesnt look like what is expected, namely, that all curves meet in one point, which should be the true critical point. So what is going wrong here? I dont think it is a convergence problem, at least further sweeping at the points of m=0 but g<1 it doesnt help, i.e. "grow" further magnetiation via sweeping. I also tried with other initial states, i.e. the all zero and all plus product states. The results are essentially the same except for that the magnetization also becomes negative when starting from the zero state.
Help or input of any sort would be much appreciated!
Also thanks for this awesome library!
Best regards,
Korbinian