-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautoMPO_QD_SC_QD.h
63 lines (52 loc) · 2.11 KB
/
autoMPO_QD_SC_QD.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
inline void get_autoMPO_qd_sc_qd(MPO& H, const double Eshift, const params &p){
auto ampo = AutoMPO(p.sites);
const auto &vl = p.Gamma_L->V(p.sc->NBath());
const auto &ivl = p.Gamma_L->iV(p.sc->NBath());
const auto &vr = p.Gamma_R->V(p.sc->NBath());
const auto &ivr = p.Gamma_R->iV(p.sc->NBath());
ampo += Eshift,"Id",1;
// left impurity, site 1
ampo += p.qd_L->U(),"Nupdn",1;
ampo += p.qd_L->eps(),"Ntot",1;
// right impurity, site p.N
ampo += p.qd_R->U(),"Nupdn",p.N;
ampo += p.qd_R->eps(),"Ntot",p.N;
// hopping terms
// watch out for conjugation of complex terms!
// the convention is: v Ddagup Cup + v^* Cdagup Dup + v^* Ddagdn Cdn + v Cdagdn Ddn
for(auto i: range1(2, p.N-1)){
ampo += (1_i * ivl[i-1] + vl[i-1]),"Cdagup",1,"Cup",i;
ampo += (-1_i * ivl[i-1] + vl[i-1]),"Cdagdn",1,"Cdn",i;
ampo += (-1_i * ivl[i-1] + vl[i-1]),"Cdagup",i,"Cup",1;
ampo += (1_i * ivl[i-1] + vl[i-1]),"Cdagdn",i,"Cdn",1;
}
for(auto i: range1(2, p.N-1)){
ampo += (1_i * ivr[i-1] + vr[i-1]),"Cdagup",p.N,"Cup",i;
ampo += (-1_i * ivr[i-1] + vr[i-1]),"Cdagdn",p.N,"Cdn",i;
ampo += (-1_i * ivr[i-1] + vr[i-1]),"Cdagup",i,"Cup",p.N;
ampo += (1_i * ivr[i-1] + vr[i-1]),"Cdagdn",i,"Cdn",p.N;
}
// impurity hopping
ampo += p.tQD,"Cdagup",p.N,"Cup",1;
ampo += p.tQD,"Cdagdn",p.N,"Cdn",1;
ampo += p.tQD,"Cdagup",1,"Cup",p.N;
ampo += p.tQD,"Cdagdn",1,"Cdn",p.N;
// bath terms
int start = 2;
int stop = p.N-1;
const auto &eps = p.sc->eps(p.band_level_shift, p.flat_band, p.flat_band_factor, p.band_rescale);
for(auto i: range1(start, stop)){
ampo += eps[i-1],"Ntot",i;
for(auto j: range1(start, stop)){
ampo += p.sc->g() * p.sc->y(i-1) * p.sc->y(j-1),"Cdagup",i,"Cdagdn",i,"Cdn",j,"Cup",j;
}
}
//occupation terms
for(auto i: range1(start, stop)){
ampo += - p.sc->Ec() * 2 * p.sc->n0(),"Ntot",i;
for(auto j: range1(start, stop)){
ampo += p.sc->Ec(),"Ntot",i,"Ntot",j;
}
}
H = toMPO(ampo);
}