I am trying to simulate a time evolution of driving 2 spin-1 system with external field by using TDVP method. Starting from ground state, when the coupling term did not present, the system has Rabi oscillation in both spin. However, once I added the coupling term in form of (Sz.Sz), I noticed that probability of the first spin to be in ground state (\(P|0>\)) is just flat to around zero. This doesn't happened to the second spin.
I believed there was a bug in TDVPEngine, but I also got the same result with ExpMPOEvolution method. What should I do with this?
1st spin 2nd spin This is the code that I use.
Code: Select all
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
from tenpy.networks.site import SpinSite
from tenpy.models.lattice import Chain
from tenpy.networks.mps import MPS
from TenPy_Model import TenPy_Dipole
from tenpy.algorithms import tdvp
from tenpy.models.model import CouplingModel, NearestNeighborModel, MPOModel
def get_probability(psi, site_idx:int):
coeff = psi.get_B(site_idx).to_ndarray().reshape(-1)
return (np.conjugate(coeff) * coeff).real
class TenPy_Dipole(CouplingModel, NearestNeighborModel, MPOModel):
def __init__(self, lattice):
self.lattice = lattice
CouplingModel.__init__(self, self.lattice)
self.add_onsite(2870., 0, 'Sz Sz') #ZFS
self.add_onsite(185., 0, 'Sz') #Zeeman
self.add_onsite(-2685., 0, 'Sz Sz') #MW
self.add_onsite(2*np.pi*15.0, 0, 'Sx') #MW
self.add_coupling_term(1.0, 0, 1, 'Sz', 'Sz', plus_hc=False)
MPOModel.__init__(self, self.lattice, self.calc_H_MPO())
#Parameter for time evolution.
T = 50e-3 #(us)
dt = 1e-3 #(us)
steps = round(T/dt)
cutoff = 1.e-10
tdvp_params = {
'start_time': 0,
'N_steps':1,
'dt': dt,
'trunc_params': {
'chi_max': 10,
'svd_min': 1.e-10,
'trunc_cut': None
}}
# predefined charges and Sp,Sm,Sz operators
S = 1.0 #Total spin number.
L = 2 #Number of defects.
site = SpinSite(S=S, conserve='None')
lat = Chain(L, site, bc_MPS='finite')
state = ["0.0","0.0"]
psi = MPS.from_product_state(lat.mps_sites(), state, lat.bc_MPS)
which_site = 0
times = []
Pg, Pm, Pp = [], [], [] #Population
for i in tqdm(range(steps)):
#Getting probability in |0> state of spin 1.
prob_array = get_probability(psi,which_site)
Pg.append(prob_array[1])
Pm.append(prob_array[0])
Pp.append(prob_array[2])
Model = TenPy_Dipole(lat)
engine = tdvp.TDVPEngine(psi, Model,options=tdvp_params)
engine.run()
times.append(dt*i)
psi = engine.psi
fig = plt.figure()
plt.plot(times, Pg, label='P(|0>)')
plt.plot(times, Pm, label='P(|-1>)')
plt.plot(times, Pp, label='P(|+1>)')
plt.legend()
plt.show()