VMPS++
Loading...
Searching...
No Matches
HubbardU1spin.h
Go to the documentation of this file.
1#ifndef STRAWBERRY_HUBBARDMODEL_U1SPINONLY
2#define STRAWBERRY_HUBBARDMODEL_U1SPINONLY
3
4//include "bases/FermionBase.h"
5//include "symmetry/S1xS2.h"
6//include "Mpo.h"
7//include "ParamHandler.h" // from HELPERS
8//include "models/HubbardObservables.h"
10
11namespace VMPS
12{
13
14class HubbardU1spin : public Mpo<Sym::U1<Sym::SpinU1>,double>, public HubbardObservables<Sym::U1<Sym::SpinU1> >, public ParamReturner
15{
16public:
17
20
21
23
24 HubbardU1spin(Mpo<Symmetry> &Mpo_input, const vector<Param> &params)
25 :Mpo<Symmetry>(Mpo_input),
28 {
29 ParamHandler P(params,HubbardU1spin::defaults);
30 size_t Lcell = P.size();
31 N_phys = 0;
32 for (size_t l=0; l<N_sites; ++l) N_phys += P.get<size_t>("Ly",l%Lcell);
33 this->precalc_TwoSiteData();
34 this->HERMITIAN = true;
35 this->HAMILTONIAN = true;
36 };
37
38 HubbardU1spin (const size_t &L, const vector<Param> &params, const BC &boundary=BC::OPEN, const DMRG::VERBOSITY::OPTION &VERB=DMRG::VERBOSITY::OPTION::ON_EXIT);
40
41 template<typename Symmetry_>
42 static void add_operators (const std::vector<FermionBase<Symmetry_> > &F, const ParamHandler &P,
43 PushType<SiteOperator<Symmetry_,double>,double>& pushlist, std::vector<std::vector<std::string>>& labellist,
44 const BC boundary=BC::OPEN);
45
46 static qarray<1> singlet (int N=0) {return qarray<1>{0};};
47 static constexpr MODEL_FAMILY FAMILY = HUBBARD;
48 static constexpr int spinfac = 2;
49
51 static const std::map<string,std::any> defaults;
52};
53
54const std::map<string,std::any> HubbardU1spin::defaults =
55{
56 {"t",1.}, {"tPrime",0.}, {"tRung",1.},
57 {"mu",0.}, {"t0",0.},
58 {"U",0.}, {"Uph",0.},
59 {"V",0.}, {"Vrung",0.},
60 {"Vxy",0.}, {"Vz",0.},
61 {"Bz",0.},
62 {"J",0.}, {"Jperp",0.}, {"J3site",0.},
63 {"X",0.}, {"Xperp",0.},
64 {"C",0.}, {"Cperp",0.},
65 {"REMOVE_DOUBLE",false}, {"REMOVE_EMPTY",false}, {"REMOVE_UP",false}, {"REMOVE_DN",false}, {"mfactor",1}, {"k",0},
66 {"maxPower",2ul}, {"CYLINDER",false}, {"Ly",1ul}
67};
68
70HubbardU1spin (const size_t &L, const vector<Param> &params, const BC &boundary, const DMRG::VERBOSITY::OPTION &VERB)
71:Mpo<Symmetry> (L, Symmetry::qvacuum(), "", PROP::HERMITIAN, PROP::NON_UNITARY, boundary, VERB),
72 HubbardObservables(L,params,HubbardU1spin::defaults),
74{
75 ParamHandler P(params,HubbardU1spin::defaults);
76
77 size_t Lcell = P.size();
78
79 for (size_t l=0; l<N_sites; ++l)
80 {
81 N_phys += P.get<size_t>("Ly",l%Lcell);
82 setLocBasis(F[l].get_basis().qloc(),l);
83 }
84
85 param1d U = P.fill_array1d<double>("U", "Uorb", F[0].orbitals(), 0);
86 if (isfinite(U.a.sum()))
87 {
88 this->set_name("Hubbard");
89 }
90 else if (P.HAS_ANY_OF({"J", "J3site"}))
91 {
92 this->set_name("t-J");
93 }
94 else
95 {
96 this->set_name("U=∞-Hubbard");
97 }
98
100 std::vector<std::vector<std::string>> labellist;
101 HubbardU1xU1::set_operators(F, P, pushlist, labellist, boundary);
102 add_operators(F, P, pushlist, labellist, boundary);
103
104 this->construct_from_pushlist(pushlist, labellist, Lcell);
105 this->finalize(PROP::COMPRESS, P.get<size_t>("maxPower"));
106
107 this->precalc_TwoSiteData();
108}
109
110template<typename Symmetry_>
112add_operators (const std::vector<FermionBase<Symmetry_> > &F, const ParamHandler &P, PushType<SiteOperator<Symmetry_,double>,double>& pushlist, std::vector<std::vector<std::string>>& labellist, const BC boundary)
113{
114 std::size_t Lcell = P.size();
115 std::size_t N_sites = F.size();
116
117 for(std::size_t loc=0; loc<N_sites; ++loc)
118 {
119 std::size_t orbitals = F[loc].orbitals();
120
121 ArrayXd U_array = F[loc].ZeroField();
122 ArrayXd Uph_array = F[loc].ZeroField();
123 ArrayXd E_array = F[loc].ZeroField();
124 ArrayXd Bz_array = F[loc].ZeroField();
125 ArrayXXd tperp_array = F[loc].ZeroHopping();
126 ArrayXXd Vperp_array = F[loc].ZeroHopping();
127 ArrayXXd Jperp_array = F[loc].ZeroHopping();
128
129 param1d C = P.fill_array1d<double>("C", "Corb", orbitals, loc%Lcell);
130 labellist[loc].push_back(C.label);
131
132 // local superconducting term C_{ii}
134 (
135 F[loc].template HubbardHamiltonian<double>(U_array, Uph_array, E_array, Bz_array, tperp_array, Vperp_array, Vperp_array, Vperp_array, Jperp_array, Jperp_array, C.a)
136 );
137 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
138
139 auto push_full = [&N_sites, &loc, &F, &P, &pushlist, &labellist, &boundary] (string xxxFull, string label,
140 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
141 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
142 vector<double> factor, bool FERMIONIC) -> void
143 {
144 ArrayXXd Full = P.get<Eigen::ArrayXXd>(xxxFull);
145 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
146
147 if (static_cast<bool>(boundary)) {assert(R.size() == N_sites and "Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
148 else {assert(R.size() >= 2*N_sites and "Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
149
150 for (size_t j=0; j<first.size(); j++)
151 for (size_t h=0; h<R[loc].size(); ++h)
152 {
153 size_t range = R[loc][h].first;
154 double value = R[loc][h].second;
155
156 if (range != 0)
157 {
158 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
159 ops[0] = first[j];
160 for (size_t i=1; i<range; ++i)
161 {
162 if (FERMIONIC) {ops[i] = F[(loc+i)%N_sites].sign();}
163 else {ops[i] = F[(loc+i)%N_sites].Id();}
164 }
165 ops[range] = last[j][(loc+range)%N_sites];
166 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
167 }
168 }
169
170 stringstream ss;
171 ss << label << "(" << Geometry2D::hoppingInfo(Full) << ")";
172 labellist[loc].push_back(ss.str());
173 };
174
175 // non-local superconducting term C_{ij}
176 if (P.HAS("Cfull"))
177 {
178 SiteOperatorQ<Symmetry_,Eigen::MatrixXd> cUP_sign_local = F[loc].c(UP,0) * F[loc].sign();
179 SiteOperatorQ<Symmetry_,Eigen::MatrixXd> cDN_sign_local = F[loc].c(DN,0) * F[loc].sign();
180 SiteOperatorQ<Symmetry_,Eigen::MatrixXd> cdagUP_sign_local = F[loc].cdag(UP,0) * F[loc].sign();
181 SiteOperatorQ<Symmetry_,Eigen::MatrixXd> cdagDN_sign_local = F[loc].cdag(DN,0) * F[loc].sign();
182
183 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cUP_ranges(N_sites); for (size_t i=0; i<N_sites; ++i) {cUP_ranges[i] = F[i].c(UP,0);}
184 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cDN_ranges(N_sites); for (size_t i=0; i<N_sites; ++i) {cDN_ranges[i] = F[i].c(DN,0);}
185 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cdagUP_ranges(N_sites); for (size_t i=0; i<N_sites; ++i) {cdagUP_ranges[i] = F[i].cdag(UP,0);}
186 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cdagDN_ranges(N_sites); for (size_t i=0; i<N_sites; ++i) {cdagDN_ranges[i] = F[i].cdag(DN,0);}
187
188 // sort by lattice site:
189 // c↑i*c↓j + c†↓j*c†↑i
190 // = c↑i*c↓j - c†↑i*c†↓j
191 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > frst {cUP_sign_local, cdagUP_sign_local};
192 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {cDN_ranges, cdagDN_ranges};
193 push_full("Cfull", "Cᵢⱼ", frst, last, {+1., -1.}, PROP::FERMIONIC);
194 }
195 }
196}
197
198} // end namespace VMPS::models
199
200#endif
@ DN
Definition: DmrgTypedefs.h:38
@ UP
Definition: DmrgTypedefs.h:37
MODEL_FAMILY
Definition: DmrgTypedefs.h:96
@ HUBBARD
Definition: DmrgTypedefs.h:96
BC
Definition: DmrgTypedefs.h:161
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), Mpo< Sym::U1< Sym::SpinU1 >, double > >::type P(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
Mpo< Sym::U1< Sym::SpinU1 >, double > Id() const
vector< FermionBase< Sym::U1< Sym::SpinU1 > > > F
std::size_t N_phys
Definition: MpoTerms.h:400
void finalize(const bool COMPRESS=true, const std::size_t power=1, const double tolerance=::mynumeric_limits< double >::epsilon())
Definition: MpoTerms.h:1281
std::size_t N_sites
Definition: MpoTerms.h:395
void setLocBasis(const std::vector< std::vector< qType > > &q)
Definition: MpoTerms.h:715
DMRG::VERBOSITY::OPTION VERB
Definition: MpoTerms.h:102
void set_name(const std::string &label_in)
Definition: MpoTerms.h:471
std::string label
Definition: MpoTerms.h:615
Definition: Mpo.h:40
static std::vector< T > get_N_site_interaction(T const &Op0, Operator const &... Ops)
Definition: Mpo.h:117
void precalc_TwoSiteData(bool FORCE=false)
void construct_from_pushlist(const PushType< OperatorType, CouplScalar > &pushlist, const std::vector< std::vector< std::string > > &labellist, size_t Lcell)
Definition: U1.h:25
static qarray< 1 > singlet(int N=0)
Definition: HubbardU1spin.h:46
static constexpr MODEL_FAMILY FAMILY
Definition: HubbardU1spin.h:47
HubbardU1spin(Mpo< Symmetry > &Mpo_input, const vector< Param > &params)
Definition: HubbardU1spin.h:24
static const std::map< string, std::any > defaults
Definition: HubbardU1spin.h:51
Sym::U1< Sym::SpinU1 > Symmetry
Definition: HubbardU1spin.h:18
static void add_operators(const std::vector< FermionBase< Symmetry_ > > &F, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static constexpr int spinfac
Definition: HubbardU1spin.h:48
static void set_operators(const std::vector< FermionBase< Symmetry_ > > &F, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
Definition: HubbardU1xU1.h:153
#define MAKE_TYPEDEFS(MODEL)
Definition: macros.h:4
const bool COMPRESS
Definition: DmrgTypedefs.h:499
const bool FERMIONIC
Definition: DmrgTypedefs.h:496
Definition: qarray.h:26