How to use TDVP for one site
Posted: 14 Mar 2021, 17:28
Dear community,
I am trying to use TDVP on one site. I understand the theory behind the construction and I thought I also understood how to use it in practice. I checked the example code provided by Tenpy developers. My specific problem is that I manage to run the two site TDVP obtaining non-trivial results (e.g., check the evolution of the particle density which for small system size I verified to be correct), but when using one site TDVP, the initial state does not evolve at all. I might be missing something stupid but attending to the documentation I look to be setting it correctly. Could anyone give me a hint? I attach a simple code I used to test the implementation. To change between two and one site TDVP one only needs to change the line eng_H.run_two_sites to eng_H.run_one_site.
Thanks in advance.
I am trying to use TDVP on one site. I understand the theory behind the construction and I thought I also understood how to use it in practice. I checked the example code provided by Tenpy developers. My specific problem is that I manage to run the two site TDVP obtaining non-trivial results (e.g., check the evolution of the particle density which for small system size I verified to be correct), but when using one site TDVP, the initial state does not evolve at all. I might be missing something stupid but attending to the documentation I look to be setting it correctly. Could anyone give me a hint? I attach a simple code I used to test the implementation. To change between two and one site TDVP one only needs to change the line eng_H.run_two_sites to eng_H.run_one_site.
Thanks in advance.
Code: Select all
from tenpy.networks.mps import MPS
from tenpy.algorithms import tdvp
from tenpy.models.hubbard import FermiHubbardModel
if __name__ == "__main__":
J=1.
D_bond = 50
U=3.
dt=0.01
product_state = ['empty','up','empty','down','empty','up','empty','down','empty','up','empty','down','empty']
L = len(product_state)
model_params = {'L': L, 'U': U, 't': J,'bc_MPS': 'finite', 'cons_N':'N','cons_Sz':'Sz', 'verbose': 0}
print("parameters: ", model_params)
M = FermiHubbardModel(model_params)
psi = MPS.from_product_state(M.lat.mps_sites(), product_state, bc=M.lat.bc_MPS)
tdvp_params = {
'start_time': 0,
'dt': dt,
'trunc_params': {
'chi_max': D_bond,
'svd_min': 1.e-16,
'trunc_cut': None
}}
eng_H = tdvp.Engine(psi, M, tdvp_params)
for n in range(30):
eng_H.run_one_site(N_steps=1)
print(psi.expectation_value('Ntot'))