VMPS++
Loading...
Searching...
No Matches
KondoSU2xSU2.h
Go to the documentation of this file.
1#ifndef KONDOMODEL_SU2XSU2_H_
2#define KONDOMODEL_SU2XSU2_H_
3
4#include "symmetry/S1xS2.h"
5#include "symmetry/SU2.h"
6#include "bases/SpinBase.h"
7#include "bases/FermionBase.h"
8#include "Mpo.h"
9#include "ParamReturner.h"
10#include "Geometry2D.h" // from TOOLS
12
13namespace VMPS
14{
15
16class KondoSU2xSU2 : public Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > ,double>,
17 public KondoObservables<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > >,
18 public ParamReturner
19{
20public:
23 typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> MatrixType;
26
27private:
28 typedef Eigen::Index Index;
30
31public:
32
35 KondoSU2xSU2 (const size_t &L, const vector<Param> &params, const BC &boundary=BC::OPEN, const DMRG::VERBOSITY::OPTION &VERB=DMRG::VERBOSITY::OPTION::ON_EXIT);
37
38 static qarray<2> singlet (int N) {return qarray<2>{1,1};};
39
49 template<typename Symmetry_>
50 static void set_operators (const std::vector<SpinBase<Symmetry_> > &B, const std::vector<FermionBase<Symmetry_> > &F, const ParamHandler &P,
51 PushType<SiteOperator<Symmetry_,double>,double>& pushlist, std::vector<std::vector<std::string>>& labellist,
52 const BC boundary=BC::OPEN);
53
54 static const std::map<string,std::any> defaults;
55 static const map<string,any> sweep_defaults;
56};
57
58const std::map<string,std::any> KondoSU2xSU2::defaults =
59{
60 {"t",1.}, {"tRung",0.},
61 {"J",1.},
62 {"U",0.},
63 {"V",0.}, {"Vrung",0.},
64 {"D",2ul}, {"maxPower",2ul}, {"CYLINDER",false}, {"Ly",1ul}, {"LyF",1ul}
65};
66
67const map<string,any> KondoSU2xSU2::sweep_defaults =
68{
69 {"max_alpha",100.}, {"min_alpha",1.}, {"lim_alpha",16ul}, {"eps_svd",1e-7},
70 {"Dincr_abs",5ul}, {"Dincr_per",2ul}, {"Dincr_rel",1.1},
71 {"min_Nsv",0ul}, {"max_Nrich",-1},
72 {"max_halfsweeps",30ul}, {"min_halfsweeps",10ul},
73 {"Dinit",5ul}, {"Qinit",6ul}, {"Dlimit",200ul},
74 {"tol_eigval",1e-6}, {"tol_state",1e-5},
75 {"savePeriod",0ul}, {"CALC_S_ON_EXIT", true}, {"CONVTEST", DMRG::CONVTEST::VAR_2SITE}
76};
77
79KondoSU2xSU2 (const size_t &L, const vector<Param> &params, const BC &boundary, const DMRG::VERBOSITY::OPTION &VERB)
80:Mpo<Symmetry> (L, Symmetry::qvacuum(), "", PROP::HERMITIAN, PROP::NON_UNITARY, boundary, VERB),
81 KondoObservables(L,params,KondoSU2xSU2::defaults),
82 ParamReturner(KondoSU2xSU2::sweep_defaults)
83{
84 ParamHandler P(params,defaults);
85 size_t Lcell = P.size();
86
87 for (size_t l=0; l<N_sites; ++l)
88 {
89 N_phys += P.get<size_t>("LyF",l%Lcell);
90 setLocBasis((B[l].get_basis().combine(F[l].get_basis())).qloc(),l);
91 }
92
93 this->set_name("Kondo");
94
96 std::vector<std::vector<std::string>> labellist;
97 set_operators(B, F, P, pushlist, labellist, boundary);
98
99 this->construct_from_pushlist(pushlist, labellist, Lcell);
100 this->finalize(PROP::COMPRESS, P.get<size_t>("maxPower"));
101
102 this->precalc_TwoSiteData();
103}
104
105template<typename Symmetry_>
107set_operators (const std::vector<SpinBase<Symmetry_> > &B, const std::vector<FermionBase<Symmetry_> > &F, const ParamHandler &P,
108 PushType<SiteOperator<Symmetry_,double>,double>& pushlist, std::vector<std::vector<std::string>>& labellist, const BC boundary)
109{
110 std::size_t Lcell = P.size();
111 std::size_t N_sites = B.size();
112 if(labellist.size() != N_sites) {labellist.resize(N_sites);}
113
114 for (std::size_t loc=0; loc<N_sites; ++loc)
115 {
116 size_t lp1 = (loc+1)%N_sites;
117 size_t lp2 = (loc+2)%N_sites;
118
119 auto Gloc = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1,loc)));
120 auto Glp1 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1,lp1)));
121 auto Glp2 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1,lp2)));
122
123 std::size_t Forbitals = F[loc].orbitals();
124 std::size_t Fnext_orbitals = F[lp1].orbitals();
125 std::size_t Fnextn_orbitals = F[lp2].orbitals();
126
127 std::size_t Borbitals = B[loc].orbitals();
128 std::size_t Bnext_orbitals = B[lp1].orbitals();
129 std::size_t Bnextn_orbitals = B[lp2].orbitals();
130
131 stringstream Slabel;
132 Slabel << "S=" << print_frac_nice(frac(B[loc].get_D()-1,2));
133 labellist[loc].push_back(Slabel.str());
134
135 auto push_full = [&N_sites, &loc, &B, &F, &P, &pushlist, &labellist, &boundary] (string xxxFull, string label,
136 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
137 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
138 vector<double> factor, bool FERMIONIC) -> void
139 {
140 ArrayXXd Full = P.get<Eigen::ArrayXXd>(xxxFull);
141 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
142
143 if (static_cast<bool>(boundary)) {assert(R.size() == N_sites and "Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
144 else {assert(R.size() >= 2*N_sites and "Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
145
146 for (size_t j=0; j<first.size(); j++)
147 for (size_t h=0; h<R[loc].size(); ++h)
148 {
149 size_t range = R[loc][h].first;
150 double value = R[loc][h].second;
151
152 if (range != 0)
153 {
154 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
155 ops[0] = first[j];
156 for (size_t i=1; i<range; ++i)
157 {
158 if (FERMIONIC) {ops[i] = kroneckerProduct(B[(loc+i)%N_sites].Id(), F[(loc+i)%N_sites].sign());}
159 else {ops[i] = kroneckerProduct(B[(loc+i)%N_sites].Id(), F[(loc+i)%N_sites].Id());}
160 }
161 ops[range] = last[j][(loc+range)%N_sites];
162 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
163 }
164 }
165
166 stringstream ss;
167 ss << label << "(" << Geometry2D::hoppingInfo(Full) << ")";
168 labellist[loc].push_back(ss.str());
169 };
170
171 if (P.HAS("tFull"))
172 {
173 SiteOperatorQ<Symmetry_,Eigen::MatrixXd> cdag_sign_local = kroneckerProduct(B[loc].Id(),(F[loc].cdag(Gloc,0) * F[loc].sign()));
174 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > c_ranges(N_sites);
175 for (size_t i=0; i<N_sites; i++)
176 {
177 auto Gi = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1,i)));
178 c_ranges[i] = kroneckerProduct(B[loc].Id(),F[i].c(Gi,0));
179 }
180
181 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {cdag_sign_local};
182 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {c_ranges};
183 push_full("tFull", "tᵢⱼ", first, last, {-std::sqrt(2.) * std::sqrt(2.)}, PROP::FERMIONIC);
184 }
185
186 if (P.HAS("Vfull"))
187 {
188 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {kroneckerProduct(B[loc].Id(),F[loc].Tdag(0))};
189 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > T_ranges(N_sites);
190 for (size_t i=0; i<N_sites; i++) {T_ranges[i] = kroneckerProduct(B[i].Id(),F[loc].T(0));}
191
192 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {T_ranges};
193 push_full("Vfull", "Vᵢⱼ", first, last, {std::sqrt(3.)}, PROP::BOSONIC);
194 }
195
196 // local terms
197
198 // t⟂
199 param2d tPerp = P.fill_array2d<double>("tRung","t","tPerp",Forbitals,loc%Lcell,P.get<bool>("CYLINDER"));
200 labellist[loc].push_back(tPerp.label);
201
202 // V⟂
203 param2d Vperp = P.fill_array2d<double>("Vrung","V","Vperp",Forbitals,loc%Lcell,P.get<bool>("CYLINDER"));
204 labellist[loc].push_back(Vperp.label);
205
206 // Hubbard U
207 param1d U = P.fill_array1d<double>("U","Uorb",Forbitals,loc%Lcell);
208 labellist[loc].push_back(U.label);
209
210 if (F[loc].dim() > 1)
211 {
212 OperatorType KondoHamiltonian({1,1}, B[loc].get_basis().combine(F[loc].get_basis()));
213
214 ArrayXXd Jperp = B[loc].ZeroHopping();
215 ArrayXXd Jperpsub = F[loc].ZeroHopping();
216
217 //set Hubbard part of Kondo Hamiltonian
218 KondoHamiltonian = kroneckerProduct(B[loc].Id(), F[loc].HubbardHamiltonian(U.a,tPerp.a,Vperp.a,Jperpsub));
219
220 //set Heisenberg part of Hamiltonian
221 // KondoHamiltonian += OperatorType::outerprod(B[loc].HeisenbergHamiltonian(Jperp), F[loc].Id(), {1,1});
222
223 // Kondo-J
224 param1d J = P.fill_array1d<double>("J","Jorb",Forbitals,loc%Lcell);
225 labellist[loc].push_back(J.label);
226
227 //set interaction part of Hamiltonian.
228 for (int alfa=0; alfa<Forbitals; ++alfa)
229 {
230 assert(Borbitals == Forbitals and "Can only do a Kondo ladder with the same amount of spins and fermionic orbitals in y-direction!");
231 KondoHamiltonian += J(alfa) * sqrt(3.) * SiteOperatorQ<Symmetry_,Eigen::MatrixXd>::outerprod(B[loc].Sdag(alfa), F[loc].S(alfa), {1,1});
232 }
233
234 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry_,double>::get_N_site_interaction(KondoHamiltonian), 1.));
235 }
236
237 // NN terms
238 if (!P.HAS("tFull"))
239 {
240 auto [t,tPara,tlabel] = P.fill_array2d<double>("t","tPara",{{Forbitals,F[lp1].orbitals()}},loc%Lcell);
241 labellist[loc].push_back(tlabel);
242
243 if (loc < N_sites-1 or !static_cast<bool>(boundary))
244 {
245 for (int alfa=0; alfa<Forbitals; ++alfa)
246 for (int beta=0; beta<Fnext_orbitals; ++beta)
247 {
248 auto cdag_sign_loc = kroneckerProduct(B[loc].Id(), F[loc].cdag(Gloc,alfa) * F[loc].sign());
249 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry_,double>::get_N_site_interaction(cdag_sign_loc,kroneckerProduct(B[lp1].Id(),F[lp1].c(Glp1,beta))),-std::sqrt(2.)*std::sqrt(2.)*tPara(alfa,beta)));
250 }
251 }
252 }
253
254 if (!P.HAS("Vfull"))
255 {
256 auto [V,Vpara,Vlabel] = P.fill_array2d<double>("V","Vpara",{{Forbitals,F[lp1].orbitals()}},loc%Lcell);
257 labellist[loc].push_back(Vlabel);
258
259 if (loc < N_sites-1 or !static_cast<bool>(boundary))
260 {
261 for (int alfa=0; alfa<Forbitals; ++alfa)
262 for (int beta=0; beta<Fnext_orbitals; ++beta)
263 {
264 auto Tdag_loc = kroneckerProduct(B[loc].Id(), F[loc].Tdag(alfa));
265 auto T_lp1 = kroneckerProduct(B[lp1].Id(), F[lp1].T (beta));
266 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry_,double>::get_N_site_interaction(Tdag_loc,T_lp1),std::sqrt(3.)*Vpara(alfa,beta)));
267 }
268 }
269 }
270 }
271}
272
273// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
274// make_local (KONDO_SUBSYSTEM SUBSYS,
275// string name,
276// size_t locx, size_t locy,
277// const OperatorType &Op,
278// double factor, bool FERMIONIC, bool HERMITIAN) const
279// {
280// assert(locx<F.size() and locy<F[locx].dim());
281// assert(SUBSYS != IMPSUB);
282// stringstream ss;
283// ss << name << "(" << locx << "," << locy << ")";
284
285// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > Mout(N_sites, Op.Q(), ss.str(), HERMITIAN);
286// for (size_t l=0; l<F.size(); ++l) {Mout.setLocBasis((B[l].get_basis().combine(F[l].get_basis())).qloc(),l);}
287
288// OperatorType OpExt;
289// vector<SiteOperator<Symmetry,MatrixType::Scalar> > SignExt(locx);
290
291// if (SUBSYS == SUB)
292// {
293// OpExt = OperatorType::outerprod(B[locx].Id(), Op, Op.Q());
294// for (size_t l=0; l<locx; ++l)
295// {
296// SignExt[l] = OperatorType::outerprod(B[l].Id(), F[l].sign(), Symmetry::qvacuum()).plain<double>();
297// }
298// }
299// else if (SUBSYS == IMP)
300// {
301// assert(!FERMIONIC and "Impurity cannot be fermionic!");
302// OpExt = OperatorType::outerprod(Op, F[locx].Id(), Op.Q());
303// }
304
305// Mout.set_locality(locx);
306// Mout.set_localOperator(OpExt.plain<double>());
307
308// (FERMIONIC)? Mout.setLocal(locx, (factor * OpExt).plain<double>(), SignExt)
309// : Mout.setLocal(locx, (factor * OpExt).plain<double>());
310
311// return Mout;
312// }
313
314// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> >,complex<double> > KondoSU2xSU2::
315// make_FourierYSum (string name, const vector<OperatorType> &Ops,
316// double factor, bool HERMITIAN, const vector<complex<double> > &phases) const
317// {
318// stringstream ss;
319// ss << name << "_ky(";
320// for (int l=0; l<phases.size(); ++l)
321// {
322// ss << phases[l];
323// if (l!=phases.size()-1) {ss << ",";}
324// else {ss << ")";}
325// }
326
327// // all Ops[l].Q() must match
328// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> >,complex<double> > Mout(N_sites, Ops[0].Q(), ss.str(), HERMITIAN);
329// for (size_t l=0; l<F.size(); ++l) {Mout.setLocBasis((B[l].get_basis().combine(F[l].get_basis())).qloc(),l);}
330
331// vector<complex<double> > phases_x_factor = phases;
332// for (int l=0; l<phases.size(); ++l)
333// {
334// phases_x_factor[l] = phases[l] * factor;
335// }
336
337// vector<SiteOperator<Symmetry,complex<double> > > OpsPlain(Ops.size());
338// for (int l=0; l<OpsPlain.size(); ++l)
339// {
340// OpsPlain[l] = Ops[l].plain<double>().cast<complex<double> >();
341// }
342
343// Mout.setLocalSum(OpsPlain, phases_x_factor);
344
345// return Mout;
346// }
347
348// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
349// nh (size_t locx, size_t locy)
350// {
351// return make_local(SUB, "nh", locx,locy, F[locx].nh(locy), 1., false, false);
352// }
353
354// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
355// ns (size_t locx, size_t locy)
356// {
357// return make_local(SUB, "ns", locx,locy, F[locx].ns(locy), 1., false, false);
358// }
359
360// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
361// make_corr (KONDO_SUBSYSTEM SUBSYS,
362// string name1, string name2,
363// size_t locx1, size_t locx2, size_t locy1, size_t locy2,
364// const OperatorType &Op1, const OperatorType &Op2,
365// qarray<Symmetry::Nq> Qtot,
366// double factor,
367// bool BOTH_HERMITIAN) const
368// {
369// assert(locx1<this->N_sites and locx2<this->N_sites);
370// stringstream ss;
371// ss << name1 << "(" << locx1 << "," << locy1 << ")" << name2 << "(" << locx2 << "," << locy2 << ")";
372
373// bool HERMITIAN = (BOTH_HERMITIAN and locx1==locx2 and locy1==locy2)? true:false;
374
375// Mpo<Symmetry> Mout(N_sites, Qtot, ss.str(), HERMITIAN);
376// for(size_t l=0; l<this->N_sites; l++) {Mout.setLocBasis((B[l].get_basis().combine(F[l].get_basis())).qloc(),l);}
377
378// OperatorType Op1Ext;
379// OperatorType Op2Ext;
380
381// if (SUBSYS == SUB)
382// {
383// Op1Ext = OperatorType::outerprod(B[locx1].Id(), Op1, Op1.Q());
384// Op2Ext = OperatorType::outerprod(B[locx2].Id(), Op2, Op2.Q());
385// }
386// else if (SUBSYS == IMP)
387// {
388// Op1Ext = OperatorType::outerprod(Op1, F[locx1].Id(), Op1.Q());
389// Op2Ext = OperatorType::outerprod(Op2, F[locx2].Id(), Op2.Q());
390// }
391// else if (SUBSYS == IMPSUB)
392// {
393// Op2Ext = OperatorType::outerprod(Op1, F[locx1].Id(), Op1.Q());
394// Op1Ext = OperatorType::outerprod(B[locx2].Id(), Op2, Op2.Q());
395// }
396
397// if (locx1 == locx2)
398// {
399// auto LocProd = OperatorType::prod(Op1Ext, Op2Ext, Qtot);
400// Mout.setLocal(locx1, factor * LocProd.plain<double>());
401// }
402// else
403// {
404// Mout.setLocal({locx1, locx2}, {factor * Op1Ext.plain<double>(), Op2Ext.plain<double>()});
405// }
406
407// return Mout;
408// }
409
410// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
411// SsubSsub (size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
412// {
413// return make_corr (SUB, "Ssub","Ssub", locx1,locx2,locy1,locy2, F[locx1].Sdag(locy1),F[locx2].S(locy2), Symmetry::qvacuum(), sqrt(3.), false);
414// }
415
416// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
417// SimpSimp (size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
418// {
419// return make_corr (IMP, "Simp","Simp", locx1,locx2,locy1,locy2, B[locx1].Sdag(locy1),B[locx2].S(locy2), Symmetry::qvacuum(), sqrt(3.), false);
420// }
421
422// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
423// SimpSsub (size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
424// {
425// return make_corr (IMPSUB, "Simp","Ssub", locx1,locx2,locy1,locy2, B[locx1].Sdag(locy1),F[locx2].S(locy2), Symmetry::qvacuum(), sqrt(3.), false);
426// }
427
428// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
429// TsubTsub (size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
430// {
431// return make_corr (SUB, "Tsub","Tsub", locx1,locx2,locy1,locy2, F[locx1].Tdag(locy1),F[locx2].T(locy2), Symmetry::qvacuum(), sqrt(3.), false);
432// }
433
434// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
435// cdagc (size_t locx1, size_t locx2, size_t locy1, size_t locy2)
436// {
437// assert(locx1<this->N_sites and locx2<this->N_sites);
438// stringstream ss;
439// ss << "c†(" << locx1 << "," << locy1 << ")" << "c(" << locx2 << "," << locy2 << ")";
440
441// Mpo<Symmetry> Mout(N_sites, Symmetry::qvacuum(), ss.str());
442// for (size_t l=0; l<this->N_sites; l++) {Mout.setLocBasis((B[l].get_basis().combine(F[l].get_basis())).qloc(),l);}
443
444// auto cdag = OperatorType::outerprod(B[locx1].Id(), F[locx1].cdag(locy1),{2,2});
445// auto c = OperatorType::outerprod(B[locx2].Id(), F[locx2].c(locy2), {2,2});
446// auto sign1 = OperatorType::outerprod(B[locx2].Id(), F[locx1].sign(), {1,1});
447// auto sign2 = OperatorType::outerprod(B[locx2].Id(), F[locx2].sign(), {1,1});
448
449// vector<SiteOperator<Symmetry,MatrixType::Scalar> > signs;
450// for (size_t l=min(locx1,locx2)+1; l<max(locx1,locx2); l++)
451// {
452// signs.push_back(OperatorType::outerprod(B[l].Id(), F[l].sign(), {1,1}).plain<double>());
453// }
454
455// if (locx1 == locx2)
456// {
457// Mout.setLocal(locx1, sqrt(2.) * OperatorType::prod(cdag,c,Symmetry::qvacuum()).plain<double>());
458// }
459// else if(locx1<locx2)
460// {
461// Mout.setLocal({locx1, locx2}, {sqrt(2.) * OperatorType::prod(cdag, sign1, {2,2}).plain<double>(), c.plain<double>()}, signs);
462// }
463// else if(locx1>locx2)
464// {
465// Mout.setLocal({locx2, locx1}, {sqrt(2.) * OperatorType::prod(c, sign2, {2,2}).plain<double>(), cdag.plain<double>()}, signs);
466// }
467// return Mout;
468// }
469
470// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> >,complex<double> > KondoSU2xSU2::
471// Simp_ky (vector<complex<double> > phases) const
472// {
473// vector<OperatorType> Ops(N_sites);
474// for (size_t l=0; l<N_sites; ++l)
475// {
476// Ops[l] = OperatorType::outerprod(B[l].S(0), F[l].Id(), {3,1});
477// }
478// return make_FourierYSum("S", Ops, 1., false, phases);
479// }
480
481// Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> >,complex<double> > KondoSU2xSU2::
482// Simpdag_ky (vector<complex<double> > phases, double factor) const
483// {
484// vector<OperatorType> Ops(N_sites);
485// for (size_t l=0; l<N_sites; ++l)
486// {
487// Ops[l] = OperatorType::outerprod(B[l].Sdag(0), F[l].Id(), {3,1});
488// }
489// return make_FourierYSum("S†", Ops, factor, false, phases);
490// }
491
492//HamiltonianTermsXd<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > > KondoSU2xSU2::
493//set_operators (const vector<SpinBase<Symmetry> > &B, const vector<FermionBase<Symmetry> > &F, const ParamHandler &P, size_t loc)
494//{
495// HamiltonianTermsXd<Symmetry> Terms;
496//
497// frac S = frac(B[loc].get_D()-1,2);
498// stringstream Slabel;
499// Slabel << "S=" << print_frac_nice(S);
500// Terms.info.push_back(Slabel.str());
501//
502// auto save_label = [&Terms] (string label)
503// {
504// if (label!="") {Terms.info.push_back(label);}
505// };
506//
507// size_t lp1 = (loc+1)%F.size();
508//
509// // NN terms
510//
511// auto [t,tPara,tlabel] = P.fill_array2d<double>("t","tPara",{{F[loc].orbitals(),F[lp1].orbitals()}},loc);
512// save_label(tlabel);
513//
514// auto [V,Vpara,Vlabel] = P.fill_array2d<double>("V","Vpara",{{F[loc].orbitals(),F[lp1].orbitals()}},loc);
515// save_label(Vlabel);
516//
517// for (int i=0; i<F[loc].orbitals(); ++i)
518// for (int j=0; j<F[lp1].orbitals(); ++j)
519// {
520// if (tPara(i,j) != 0.)
521// {
528// }
529// }
530//
531// // local terms
532//
533// // t⟂
534// auto [tRung,tPerp,tPerplabel] = P.fill_array2d<double>("tRung","t","tPerp",F[loc].orbitals(),loc,P.get<bool>("CYLINDER"));
535// save_label(tPerplabel);
536//
537// // V⟂
538// auto [Vrung,Vperp,Vperplabel] = P.fill_array2d<double>("Vrung","V","Vperp",F[loc].orbitals(),loc,P.get<bool>("CYLINDER"));
539// save_label(Vperplabel);
540//
541// // J⟂
542// auto [Jrung,Jperp,Jperplabel] = P.fill_array2d<double>("Jrung","J","Jperp",F[loc].orbitals(),loc,P.get<bool>("CYLINDER"));
543// save_label(Jperplabel);
544//
545// // Hubbard U
546// auto [U,Uorb,Ulabel] = P.fill_array1d<double>("U","Uorb",F[loc].orbitals(),loc);
547// save_label(Ulabel);
548//
549// OperatorType KondoHamiltonian({1,0}, B[loc].get_structured_basis().combine(F[loc].get_basis()));
550//
551// //set Hubbard part of Kondo Hamiltonian
552// KondoHamiltonian = OperatorType::outerprod(B[loc].Id(), F[loc].HubbardHamiltonian(Uorb,tPerp,Vperp,Jperp), {1,1});
553//
554// //set Heisenberg part of Hamiltonian
556//
557// // Kondo-J
558// auto [J,Jorb,Jlabel] = P.fill_array1d<double>("J","Jorb",F[loc].orbitals(),loc);
559// save_label(Jlabel);
560//
561// //set interaction part of Hamiltonian.
562//
563// for (int i=0; i<F[loc].orbitals(); ++i)
564// {
565// KondoHamiltonian += Jorb(i)*sqrt(3.) * OperatorType::outerprod(B[loc].Sdag(i), F[loc].S(i), {1,1});
566// }
567//
568// Terms.local.push_back(make_tuple(1.,KondoHamiltonian.plain<double>()));
569//
570// Terms.name = "Kondo SU(2)⊗SU(2)";
571// Terms.local.push_back(make_tuple(1.,KondoHamiltonian.plain<double>()));
572//
573// return Terms;
574//}
575
576//Mpo<Sym::SU2<Sym::ChargeSU2> > KondoSU2xSU2::
577//Simp (SPINOP_LABEL Sa, size_t locx, size_t locy) const
578//{
579// assert(locx < this->N_sites);
580// std::stringstream ss;
581//
582// Mpo<Symmetry> Mout(N_sites, Symmetry::qvacuum(), ss.str());
583// for (std::size_t l=0; l<this->N_sites; l++) { Mout.setLocBasis((B[l].get_structured_basis().combine(F[l].get_basis())).qloc(),l); }
584//
585// auto Sop = OperatorType::outerprod(B[locx].Scomp(Sa,locy).structured(), F[locx].Id(), {1});
586//
587// Mout.setLocal(locx, Sop.plain<double>());
588// return Mout;
589//}
590
591//Mpo<Sym::SU2<Sym::ChargeSU2> > KondoSU2xSU2::
592//Ssub (SPINOP_LABEL Sa, size_t locx, size_t locy) const
593//{
594// assert(locx < this->N_sites);
595// std::stringstream ss;
596//
597// Mpo<Symmetry> Mout(N_sites, Symmetry::qvacuum(), ss.str());
598// for (std::size_t l=0; l<this->N_sites; l++) { Mout.setLocBasis((B[l].get_structured_basis().combine(F[l].get_basis())).qloc(),l); }
599//
600// auto Sop = OperatorType::outerprod(B[locx].Id().structured(), F[locx].Scomp(Sa,locy), {1});
601//
602// Mout.setLocal(locx, Sop.plain<double>());
603// return Mout;
604//}
605
621
622//Mpo<Sym::SU2<Sym::ChargeSU2> > KondoSU2xSU2::
623//make_corr (KONDO_SUBSYSTEM SUBSYS, string name1, string name2,
624// size_t locx1, size_t locx2, size_t locy1, size_t locy2,
625// const OperatorType &Op1, const OperatorType &Op2,
626// bool BOTH_HERMITIAN) const
627//{
628// assert(locx1<F.size() and locx2<F.size() and locy1<F[locx1].dim() and locy2<F[locx2].dim());
629// stringstream ss;
630// ss << name1 << "(" << locx1 << "," << locy1 << ")"
631// << name2 << "(" << locx2 << "," << locy2 << ")";
632//
633// bool HERMITIAN = (BOTH_HERMITIAN and locx1==locx2 and locy1==locy2)? true:false;
634//
635// OperatorType Op1Ext;
636// OperatorType Op2Ext;
637//
638// Mpo<Symmetry> Mout(F.size(), Symmetry::qvacuum(), ss.str(), HERMITIAN);
639// for (size_t l=0; l<F.size(); ++l) {Mout.setLocBasis((B[l].get_structured_basis().combine(F[l].get_basis())).qloc(),l);}
640//
641// if (SUBSYS == SUB)
642// {
643// Op1Ext = OperatorType::outerprod(B[locx1].Id().structured(), Op1, {1});
644// Op2Ext = OperatorType::outerprod(B[locx2].Id().structured(), Op2, {1});
645// }
646// else if (SUBSYS == IMP)
647// {
648// Op1Ext = OperatorType::outerprod(Op1, F[locx1].Id(), {1});
649// Op2Ext = OperatorType::outerprod(Op2, F[locx2].Id(), {1});
650// }
651// else if (SUBSYS == IMPSUB and locx1 != locx2)
652// {
653// Op1Ext = OperatorType::outerprod(Op1, F[locx1].Id(), {1});
654// Op2Ext = OperatorType::outerprod(B[locx2].Id().structured(), Op2, {1});
655// }
656// else if (SUBSYS == IMPSUB and locx1 == locx2)
657// {
658// OperatorType OpExt = OperatorType::outerprod(Op1, Op2, {1});
659//
660// Mout.setLocal(locx1, OpExt.plain<double>());
661// return Mout;
662// }
663//
664// Mout.setLocal({locx1,locx2}, {Op1Ext.plain<double>(),Op2Ext.plain<double>()});
665// return Mout;
666//}
667
668//Mpo<Sym::SU2<Sym::ChargeSU2> > KondoSU2xSU2::
669//SimpSsub (SPINOP_LABEL SOP1, SPINOP_LABEL SOP2, size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
670//{
671// stringstream ss1; ss1 << SOP1 << "imp";
672// stringstream ss2; ss2 << SOP2 << "sub";
673//
674// return make_corr(IMPSUB, ss1.str(),ss2.str(), locx1,locx2,locy1,locy2, B[locx1].Scomp(SOP1,locy1).structured(), F[locx2].Scomp(SOP2,locy2));
675//}
676
677//Mpo<Sym::SU2<Sym::ChargeSU2> > KondoSU2xSU2::
678//SimpSimp (SPINOP_LABEL SOP1, SPINOP_LABEL SOP2, size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
679//{
680// stringstream ss1; ss1 << SOP1 << "imp";
681// stringstream ss2; ss2 << SOP2 << "imp";
682//
683// return make_corr(IMP, ss1.str(),ss2.str(), locx1,locx2,locy1,locy2, B[locx1].Scomp(SOP1,locy1).structured(), B[locx2].Scomp(SOP2,locy2).structured());
684//}
685
686//Mpo<Sym::SU2<Sym::ChargeSU2> > KondoSU2xSU2::
687//SsubSsub (SPINOP_LABEL SOP1, SPINOP_LABEL SOP2, size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
688//{
689// stringstream ss1; ss1 << SOP1 << "sub";
690// stringstream ss2; ss2 << SOP2 << "sub";
691//
692// return make_corr(SUB, ss1.str(),ss2.str(), locx1,locx2,locy1,locy2, F[locx1].Scomp(SOP1,locy1), F[locx2].Scomp(SOP2,locy2));
693//}
694
695} //end namespace VMPS
696
697#endif
boost::rational< int > frac
Definition: DmrgExternal.h:11
std::string print_frac_nice(frac r)
Definition: DmrgExternal.h:32
size_t dim(const PivotMatrix0< Symmetry, Scalar, MpoScalar > &H)
MODEL_FAMILY
Definition: DmrgTypedefs.h:96
@ KONDO
Definition: DmrgTypedefs.h:96
BC
Definition: DmrgTypedefs.h:161
SUB_LATTICE
Definition: DmrgTypedefs.h:130
@ B
Definition: DmrgTypedefs.h:130
SiteOperator< Symmetry, Scalar_ > kroneckerProduct(const SiteOperator< Symmetry, Scalar_ > &O1, const SiteOperator< Symmetry, Scalar_ > &O2)
Definition: SiteOperator.h:164
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > >::type cdag(size_t locx, size_t locy=0, double factor=std::sqrt(2.)) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > >::type c(size_t locx, size_t locy=0, double factor=1.) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > >::type S(size_t locx, size_t locy=0, double factor=1.) const
vector< SpinBase< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > > B
std::enable_if< Dummy::IS_CHARGE_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > >::type Tdag(size_t locx, size_t locy=0, double factor=std::sqrt(3.)) const
vector< FermionBase< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > > F
std::enable_if< Dummy::IS_CHARGE_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > >::type T(size_t locx, size_t locy=0, double factor=1.) const
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
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)
static SiteOperatorQ< Symmetry, MatrixType_ > outerprod(const SiteOperatorQ< Symmetry, MatrixType_ > &O1, const SiteOperatorQ< Symmetry, MatrixType_ > &O2, const qType &target)
Definition: SU2.h:36
Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > Symmetry
Definition: KondoSU2xSU2.h:21
static constexpr MODEL_FAMILY FAMILY
Definition: KondoSU2xSU2.h:25
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixType
Definition: KondoSU2xSU2.h:23
static qarray< 2 > singlet(int N)
Definition: KondoSU2xSU2.h:38
Eigen::Index Index
Definition: KondoSU2xSU2.h:28
static const std::map< string, std::any > defaults
Definition: KondoSU2xSU2.h:54
SiteOperatorQ< Symmetry, MatrixType > OperatorType
Definition: KondoSU2xSU2.h:22
static const map< string, any > sweep_defaults
Definition: KondoSU2xSU2.h:55
static void set_operators(const std::vector< SpinBase< Symmetry_ > > &B, 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: KondoSU2xSU2.h:107
#define MAKE_TYPEDEFS(MODEL)
Definition: macros.h:4
const bool COMPRESS
Definition: DmrgTypedefs.h:499
const bool FERMIONIC
Definition: DmrgTypedefs.h:496
const bool BOSONIC
Definition: DmrgTypedefs.h:498
Definition: qarray.h:26