I want to find the ground state of the mixed_xk method through the following naive code, and then calculate the momentum entanglement spectrum.
Code: Select all
import numpy as np
from tenpy.tools.params import get_parameter
from headfile import MixedXKLattice, MixedXKModel, SpinlessMixedXKSquare, myMixedXKSquare
from tenpy.networks.mps import MPS
from tenpy.algorithms import dmrg
import matplotlib.pyplot as plt
from tenpy.tools import misc
misc.setup_logging(to_stdout="INFO")
from tenpy.tools import misc
misc.setup_logging(to_stdout="INFO")
import h5py
from tenpy.tools import hdf5_io
def run(model_params):
dmrg_params = {
'mixer': True, # setting this to True helps to escape local minima
'mixer_params': {
'amplitude': 1.e-5,
'decay': 1.2,
'disable_after': 4
},
'trunc_params': {
# 'chi_max': chi_max,
'svd_min': 1.e-10
},
'lanczos_params': {
'N_min': 5,
'N_max': 20
},
'chi_list': {
0: 80,
4: 100,
8: 200,
12: 400,
},
'max_E_err': 1.e-9,
'max_S_err': 1.e-6,
'norm_tol': 1.e-6,
'max_sweeps': 100,
'N_sweeps_check': 10,
}
product_state = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]
print('product_state = ')
print(product_state)
eng = None
M = MixedXKSquare(model_params)
psi = MPS.from_product_state(M.lat.mps_sites(), product_state, bc=M.lat.bc_MPS)
eng = dmrg.TwoSiteDMRGEngine(psi, M, dmrg_params)
E, psi = eng.run()
print("================================================")
print("E= ",E)
print("================================================")
print(psi.entanglement_spectrum(by_charge=True)[0])
or
#I know this is wrong, but I really don't know how to correspond energy and momentum in the entanglement spectrum
for i in range(psi.L):
print(psi.get_SL(i)," ",psi.get_B(i).get_leg('vL').to_qflat())
if __name__ == "__main__":
model_params = dict(Lx=4,
Ly=6,
# mx=,2 my=1,
# filling=(1, 8),
phi=(1, 4),
t=1,
V=0,
bc_MPS='infinite',
# bc='periodic',
conserve_k=True,
)