Code: Select all
class DipoleLadder(CouplingModel, MPOModel):
def __init__(self, L, t, delta):
fermion_site = FermionSite(conserve='N')
lattice = Chain(L, fermion_site, bc='open', bc_MPS='finite')
CouplingModel.__init__(self, lattice)
tArray = np.array([(t if i%2==0 else 0) for i in range(L-3)])
deltaArray = np.array([(delta if i%2==0 else 0) for i in range(L-3)])
self.add_multi_coupling(tArray, [('Cd',0,0),('C',1,0),('Cd',3,0),('C',2,0)], plus_hc=True)
self.add_multi_coupling(deltaArray, [('Cd',0,0),('C',1,0),('Cd',2,0),('C',3,0)], plus_hc=True)
H_MPO = self.calc_H_MPO()
MPOModel.__init__(self, lattice, H_MPO)
I think the Hamiltonian is being constructed correctly since print(DipoleLadder(8, 1, 2).all_coupling_terms().to_TermList()) returns:
2.00000 * C JW_0 Cd_1 C JW_2 Cd_3 +
-1.00000 * C JW_0 Cd_1 Cd JW_2 C_3 +
-1.00000 * Cd JW_0 C_1 C JW_2 Cd_3 +
2.00000 * Cd JW_0 C_1 Cd JW_2 C_3 +
2.00000 * C JW_2 Cd_3 C JW_4 Cd_5 +
-1.00000 * C JW_2 Cd_3 Cd JW_4 C_5 +
-1.00000 * Cd JW_2 C_3 C JW_4 Cd_5 +
2.00000 * Cd JW_2 C_3 Cd JW_4 C_5 +
2.00000 * C JW_4 Cd_5 C JW_6 Cd_7 +
-1.00000 * C JW_4 Cd_5 Cd JW_6 C_7 +
-1.00000 * Cd JW_4 C_5 C JW_6 Cd_7 +
2.00000 * Cd JW_4 C_5 Cd JW_6 C_7
which is what I'd expect to get. However, if I run:
Code: Select all
dsc = DipoleLadder(8, 1, 2)
p_state=[["full"],['empty']]
psi = MPS.from_lat_product_state(dsc.lat,p_state)
dmrg_params = {
'mixer': None, # setting this to True helps to escape local minima
'max_E_err': 1.e-10,
'trunc_params': {
'chi_max': 100,
'svd_min': 1.e-10,
},
'verbose': True,
'combine': True
}
eng = dmrg.TwoSiteDMRGEngine(psi, dsc, dmrg_params)
E, psi = eng.run()