1#ifndef HUBBARDMODELSU2XSU2_H_
2#define HUBBARDMODELSU2XSU2_H_
10#include "Geometry2D.h"
36class HubbardSU2xSU2 :
public Mpo<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > ,double>,
37 public HubbardObservables<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::SU2<Sym::ChargeSU2> > >,
48 typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic>
MatrixType;
63 size_t Lcell =
P.size();
65 for (
size_t l=0; l<
N_sites; ++l)
N_phys +=
P.get<
size_t>(
"Ly",l%Lcell);
83 template<
typename Symmetry_>
85 const vector<SUB_LATTICE> &
G,
const ParamHandler &
P,
87 const BC boundary=BC::OPEN);
92 int T = abs(0.5*(N-L));
98 Mpo<Symmetry> B (
size_t locx1,
size_t locx2,
size_t locy1=0,
size_t locy2=0)
const {
return cdagc(locx1,locx2,locy1,locy2);};
99 Mpo<Symmetry> C (
size_t locx1,
size_t locx2,
size_t locy1=0,
size_t locy2=0)
const;
107 {
"t",1.}, {
"tRung",1.}, {
"tPrimePrime",0.},
109 {
"V",0.}, {
"Vrung",0.},
110 {
"J",0.}, {
"Jrung",0.},
111 {
"X",0.}, {
"Xrung",0.},
112 {
"REMOVE_DOUBLE",
false}, {
"REMOVE_EMPTY",
false}, {
"REMOVE_UP",
false}, {
"REMOVE_DN",
false}, {
"mfactor",1}, {
"k",1},
113 {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul}
118 {
"max_alpha",100.}, {
"min_alpha",1e-11}, {
"lim_alpha",11ul}, {
"eps_svd",1e-7},
119 {
"Dincr_abs", 2ul}, {
"Dincr_per", 2ul}, {
"Dincr_rel", 1.1},
120 {
"min_Nsv",0ul}, {
"max_Nrich",-1},
121 {
"max_halfsweeps",30ul}, {
"min_halfsweeps",6ul},
122 {
"Dinit",4ul}, {
"Qinit",10ul}, {
"Dlimit",500ul},
123 {
"tol_eigval",1e-6}, {
"tol_state",1e-5},
133 ParamHandler P(params,defaults);
134 size_t Lcell = P.size();
137 for (
size_t l=0; l<N_sites; ++l)
139 N_phys += P.get<
size_t>(
"Ly",l%Lcell);
140 setLocBasis(F[l].get_basis().qloc(),l);
143 this->set_name(
"Hubbard");
146 std::vector<std::vector<std::string>> labellist;
147 set_operators(F, G, P, pushlist, labellist, boundary);
149 this->construct_from_pushlist(pushlist, labellist, Lcell);
152 this->precalc_TwoSiteData();
155template<
typename Symmetry_>
159 std::size_t Lcell =
P.size();
163 for(std::size_t loc=0; loc<
N_sites; ++loc)
169 std::size_t orbitals =
F[loc].orbitals();
170 std::size_t next_orbitals =
F[lp1].orbitals();
171 std::size_t next3_orbitals =
F[lp3].orbitals();
174 ss <<
"Ly=" <<
P.get<
size_t>(
"Ly",loc%Lcell);
175 labellist[loc].push_back(ss.str());
177 auto push_full = [&
N_sites, &loc, &
F, &
P, &pushlist, &labellist, &boundary] (
string xxxFull,
string label,
178 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
179 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
180 vector<double> factor,
bool FERMIONIC) ->
void
182 ArrayXXd Full =
P.get<Eigen::ArrayXXd>(xxxFull);
183 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
185 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
186 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
188 for (
size_t j=0; j<first.size(); j++)
189 for (
size_t h=0; h<R[loc].size(); ++h)
191 size_t range = R[loc][h].first;
192 double value = R[loc][h].second;
196 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
198 for (
size_t i=1; i<range; ++i)
200 if (FERMIONIC) {ops[i] =
F[(loc+i)%
N_sites].sign();}
203 ops[range] = last[j][(loc+range)%
N_sites];
204 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
209 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
210 labellist[loc].push_back(ss.str());
216 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > c_ranges(
N_sites);
217 for (
size_t i=0; i<
N_sites; i++)
219 c_ranges[i] =
F[i].c(
G[i],0);
222 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {cdag_sign_local};
223 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {c_ranges};
224 push_full(
"tFull",
"tᵢⱼ", first, last, {-std::sqrt(2.) * std::sqrt(2.)},
PROP::FERMIONIC);
230 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > c_ranges(
N_sites);
231 for (
size_t i=0; i<
N_sites; i++)
236 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {cdag_sign_local};
237 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {c_ranges};
238 push_full(
"tFullA",
"tAᵢⱼ", first, last, {-std::sqrt(2.) * std::sqrt(2.)},
PROP::FERMIONIC);
243 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {
F[loc].Tdag(0)};
244 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > T_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; i++) {T_ranges[i] =
F[i].T(0);}
245 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {T_ranges};
246 push_full(
"Vfull",
"Jᵢⱼ", first, last, {std::sqrt(3.)},
PROP::BOSONIC);
251 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {
F[loc].Sdag(0)};
252 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > S_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; i++) {S_ranges[i] =
F[i].S(0);}
253 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {S_ranges};
254 push_full(
"Jfull",
"Jᵢⱼ", first, last, {std::sqrt(3.)},
PROP::BOSONIC);
262 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > PsiLran(
N_sites);
263 for(
size_t i=0; i<
N_sites; i++)
265 PsiLran[i] = (
F[i].ns() *
F[i].c(
G[i]));
267 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > PsiRran(
N_sites);
268 for(
size_t i=0; i<
N_sites; i++)
270 PsiRran[i] = (
F[i].c(
G[i]) *
F[i].ns());
273 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {PsidagLloc,PsidagRloc};
274 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {PsiRran,PsiLran};
275 push_full(
"Xfull",
"Xᵢⱼ", first, last, {-std::sqrt(2.) * std::sqrt(2.), -std::sqrt(2.) * std::sqrt(2.)},
PROP::FERMIONIC);
280 param1d Uph =
P.fill_array1d<
double>(
"Uph",
"Uphorb", orbitals, loc%Lcell);
281 param2d tperp =
P.fill_array2d<
double>(
"tRung",
"t",
"tPerp", orbitals, loc%Lcell,
P.get<
bool>(
"CYLINDER"));
282 param2d Vperp =
P.fill_array2d<
double>(
"Vrung",
"V",
"Vperp", orbitals, loc%Lcell,
P.get<
bool>(
"CYLINDER"));
283 param2d Jperp =
P.fill_array2d<
double>(
"Jrung",
"J",
"Jperp", orbitals, loc%Lcell,
P.get<
bool>(
"CYLINDER"));
285 labellist[loc].push_back(Uph.label);
286 labellist[loc].push_back(tperp.label);
287 labellist[loc].push_back(Vperp.label);
288 labellist[loc].push_back(Jperp.label);
291 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
297 param2d tpara =
P.fill_array2d<
double>(
"t",
"tPara", {orbitals, next_orbitals}, loc%Lcell);
298 labellist[loc].push_back(tpara.label);
300 if (loc <
N_sites-1 or !
static_cast<bool>(boundary))
302 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
303 for (std::size_t beta=0; beta<next_orbitals; ++beta)
315 param2d Vpara =
P.fill_array2d<
double>(
"V",
"Vpara", {orbitals, next_orbitals}, loc%Lcell);
316 labellist[loc].push_back(Vpara.label);
318 if (loc <
N_sites-1 or !
static_cast<bool>(boundary))
320 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
321 for (std::size_t beta=0; beta<next_orbitals; ++beta)
333 param2d Jpara =
P.fill_array2d<
double>(
"J",
"Jpara", {orbitals, next_orbitals}, loc%Lcell);
334 labellist[loc].push_back(Jpara.label);
336 if (loc <
N_sites-1 or !
static_cast<bool>(boundary))
338 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
339 for (std::size_t beta=0; beta<next_orbitals; ++beta)
351 param2d Xpara =
P.fill_array2d<
double>(
"X",
"Xpara", {orbitals, next_orbitals}, loc%Lcell);
352 labellist[loc].push_back(Xpara.label);
354 if (loc <
N_sites-1 or !
static_cast<bool>(boundary))
356 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
357 for (std::size_t beta=0; beta<next_orbitals; ++beta)
374 param2d tPrimePrime =
P.fill_array2d<
double>(
"tPrimePrime",
"tPrimePrime_array", {orbitals, next3_orbitals}, loc%Lcell);
375 labellist[loc].push_back(tPrimePrime.label);
377 if (loc <
N_sites-2 or !
static_cast<bool>(boundary))
382 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
383 for (std::size_t beta=0; beta<next3_orbitals; ++beta)
396C (
size_t locx1,
size_t locx2,
size_t locy1,
size_t locy2)
const
SUB_LATTICE flip_sublattice(SUB_LATTICE sublat)
std::enable_if< Dummy::IS_CHARGE_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > >, double > >::type T(size_t locx, size_t locy=0, double factor=1.) const
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > >, double > >::type P(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > >, double > ns(size_t locx, size_t locy=0) const
std::conditional< Dummy::IS_SPIN_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > >, double >, vector< Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > >, double > > >::type cdagc(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > >, double > Id() const
vector< FermionBase< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > > > F
DMRG::VERBOSITY::OPTION VERB
const std::vector< std::vector< qType > > & locBasis() const
static std::vector< T > get_N_site_interaction(T const &Op0, Operator const &... Ops)
Mpo< Symmetry, Scalar > Identity() const
void precalc_TwoSiteData(bool FORCE=false)
static const map< string, any > defaults
static constexpr int spinfac
Mpo< Symmetry > C(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
static qarray< 2 > singlet(int N=0, int L=0)
static const map< string, any > sweep_defaults
HubbardSU2xSU2(Mpo< Symmetry > &Mpo_input, const vector< Param > ¶ms)
SiteOperatorQ< Symmetry, MatrixType > OperatorType
Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::ChargeSU2 > > Symmetry
static constexpr MODEL_FAMILY FAMILY
Mpo< Symmetry > B(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
static void set_operators(const std::vector< FermionBase< Symmetry_ > > &F, const vector< SUB_LATTICE > &G, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixType
#define MAKE_TYPEDEFS(MODEL)