1#ifndef HUBBARDMODEL_U1XSU2_H_
2#define HUBBARDMODEL_U1XSU2_H_
12#include "Geometry2D.h"
16class HubbardU1xSU2 :
public Mpo<Sym::S1xS2<Sym::U1<Sym::SpinU1>,Sym::SU2<Sym::ChargeSU2> > ,double>,
17 public HubbardObservables<Sym::S1xS2<Sym::U1<Sym::SpinU1>,Sym::SU2<Sym::ChargeSU2> > >,
28 typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic>
MatrixType;
43 size_t Lcell =
P.size();
45 for (
size_t l=0; l<
N_sites; ++l)
N_phys +=
P.get<
size_t>(
"Ly",l%Lcell);
63 template<
typename Symmetry_>
65 const vector<SUB_LATTICE> &
G,
const ParamHandler &
P,
67 const BC boundary=BC::OPEN);
72 int T = abs(0.5*(N-L));
84 {
"t",1.}, {
"tRung",1.}, {
"tPrimePrime",0.},
86 {
"V",0.}, {
"Vrung",0.},
87 {
"J",0.}, {
"Jrung",0.},
88 {
"X",0.}, {
"Xrung",0.},
89 {
"REMOVE_DOUBLE",
false}, {
"REMOVE_EMPTY",
false}, {
"REMOVE_UP",
false}, {
"REMOVE_DN",
false}, {
"mfactor",1}, {
"k",1},
90 {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul}
95 {
"max_alpha",100.}, {
"min_alpha",1e-11}, {
"lim_alpha",11ul}, {
"eps_svd",1e-7},
96 {
"Dincr_abs", 2ul}, {
"Dincr_per", 2ul}, {
"Dincr_rel", 1.1},
97 {
"min_Nsv",0ul}, {
"max_Nrich",-1},
98 {
"max_halfsweeps",30ul}, {
"min_halfsweeps",6ul},
99 {
"Dinit",4ul}, {
"Qinit",10ul}, {
"Dlimit",500ul},
100 {
"tol_eigval",1e-6}, {
"tol_state",1e-5},
110 ParamHandler P(params,defaults);
111 size_t Lcell = P.size();
114 for (
size_t l=0; l<N_sites; ++l)
116 N_phys += P.get<
size_t>(
"Ly",l%Lcell);
117 setLocBasis(F[l].get_basis().qloc(),l);
120 this->set_name(
"Hubbard");
123 std::vector<std::vector<std::string>> labellist;
124 set_operators(F, G, P, pushlist, labellist, boundary);
126 this->construct_from_pushlist(pushlist, labellist, Lcell);
129 this->precalc_TwoSiteData();
132template<
typename Symmetry_>
136 std::size_t Lcell =
P.size();
140 for(std::size_t loc=0; loc<
N_sites; ++loc)
152 std::size_t orbitals =
F[loc].orbitals();
153 std::size_t next_orbitals =
F[lp1].orbitals();
154 std::size_t next3_orbitals =
F[lp3].orbitals();
157 ss <<
"Ly=" <<
P.get<
size_t>(
"Ly",loc%Lcell);
158 labellist[loc].push_back(ss.str());
160 auto push_full = [&
N_sites, &loc, &
F, &
P, &pushlist, &labellist, &boundary] (
string xxxFull,
string label,
161 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
162 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
163 vector<double> factor,
bool FERMIONIC) ->
void
165 ArrayXXd Full =
P.get<Eigen::ArrayXXd>(xxxFull);
166 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
168 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
169 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
171 for (
size_t j=0; j<first.size(); j++)
172 for (
size_t h=0; h<R[loc].size(); ++h)
174 size_t range = R[loc][h].first;
175 double value = R[loc][h].second;
179 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
181 for (
size_t i=1; i<range; ++i)
183 if (FERMIONIC) {ops[i] =
F[(loc+i)%
N_sites].sign();}
186 ops[range] = last[j][(loc+range)%
N_sites];
187 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
192 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
193 labellist[loc].push_back(ss.str());
199 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cup_ranges(
N_sites);
201 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cdn_ranges(
N_sites);
202 for (
size_t i=0; i<
N_sites; i++)
205 cup_ranges[i] =
F[i].c(
UP,
G[i],0);
207 for (
size_t i=0; i<
N_sites; i++)
210 cdn_ranges[i] =
F[i].c(
DN,
G[i],0);
213 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > frst {cdagup_sign_local, cdagdn_sign_local};
214 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {cup_ranges, cdn_ranges};
215 push_full(
"tFull",
"tᵢⱼ", frst, last, {-std::sqrt(2.),-std::sqrt(2.)},
PROP::FERMIONIC);
258 param1d Uph =
P.fill_array1d<
double>(
"Uph",
"Uphorb", orbitals, loc%Lcell);
259 param2d tperp =
P.fill_array2d<
double>(
"tRung",
"t",
"tPerp", orbitals, loc%Lcell,
P.get<
bool>(
"CYLINDER"));
260 param2d Vperp =
P.fill_array2d<
double>(
"Vrung",
"V",
"Vperp", orbitals, loc%Lcell,
P.get<
bool>(
"CYLINDER"));
261 param2d Jperp =
P.fill_array2d<
double>(
"Jrung",
"J",
"Jperp", orbitals, loc%Lcell,
P.get<
bool>(
"CYLINDER"));
263 labellist[loc].push_back(Uph.label);
264 labellist[loc].push_back(tperp.label);
265 labellist[loc].push_back(Vperp.label);
266 labellist[loc].push_back(Jperp.label);
269 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
std::enable_if< Dummy::IS_CHARGE_SU2(), Mpo< Sym::S1xS2< Sym::U1< Sym::SpinU1 >, 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::U1< Sym::SpinU1 >, 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::U1< Sym::SpinU1 >, Sym::SU2< Sym::ChargeSU2 > >, double > Id() const
vector< FermionBase< Sym::S1xS2< Sym::U1< Sym::SpinU1 >, Sym::SU2< Sym::ChargeSU2 > > > > F
DMRG::VERBOSITY::OPTION VERB
static std::vector< T > get_N_site_interaction(T const &Op0, Operator const &... Ops)
void precalc_TwoSiteData(bool FORCE=false)
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)
static constexpr MODEL_FAMILY FAMILY
HubbardU1xSU2(Mpo< Symmetry > &Mpo_input, const vector< Param > ¶ms)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixType
Sym::S1xS2< Sym::U1< Sym::SpinU1 >, Sym::SU2< Sym::ChargeSU2 > > Symmetry
static const map< string, any > sweep_defaults
static const map< string, any > defaults
static constexpr int spinfac
static qarray< 2 > singlet(int N=0, int L=0)
SiteOperatorQ< Symmetry, MatrixType > OperatorType
#define MAKE_TYPEDEFS(MODEL)