VMPS++
Loading...
Searching...
No Matches
HubbardZ2.h
Go to the documentation of this file.
1#ifndef STRAWBERRY_HUBBARDMODEL_Z2
2#define STRAWBERRY_HUBBARDMODEL_Z2
3
4#include "symmetry/ZN.h"
7#include "ParamReturner.h"
8#include "Geometry2D.h" // from TOOLS
9
10namespace VMPS
11{
12class HubbardZ2 : public Mpo<Sym::ZN<Sym::ChargeZ2,2>,double>,
13 public HubbardObservables<Sym::ZN<Sym::ChargeZ2,2> >,
14 public ParamReturner
15{
16public:
17
20
21
22 HubbardZ2() : Mpo(){};
23
24 HubbardZ2(Mpo<Symmetry> &Mpo_input, const vector<Param> &params)
25 :Mpo<Symmetry>(Mpo_input),
28 {
29 ParamHandler P(params,HubbardZ2::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 HubbardZ2 (const size_t &L, const vector<Param> &params, const BC &boundary=BC::OPEN, const DMRG::VERBOSITY::OPTION &VERB=DMRG::VERBOSITY::OPTION::ON_EXIT);
39
40 template<typename Symmetry_>
41 static void add_operators (const std::vector<FermionBase<Symmetry_> > &F, const ParamHandler &P,
42 PushType<SiteOperator<Symmetry_,double>,double>& pushlist, std::vector<std::vector<std::string>>& labellist,
43 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
50 static const std::map<string,std::any> defaults;
51};
52
53const std::map<string,std::any> HubbardZ2::defaults =
54{
55 {"t",1.}, {"tPrime",0.}, {"tRung",1.},
56 {"mu",0.}, {"t0",0.}, {"DeltaUP",0.}, {"DeltaDN",0.},
57 {"U",0.}, {"Uph",0.},
58 {"V",0.}, {"Vrung",0.},
59 {"Vxy",0.}, {"Vz",0.},
60 {"Bz",0.},
61 {"J",0.}, {"Jperp",0.}, {"J3site",0.},
62 {"X",0.}, {"Xperp",0.},
63 {"V",0.}, {"Vrung",0.},
64 {"REMOVE_DOUBLE",false}, {"REMOVE_EMPTY",false}, {"REMOVE_UP",false}, {"REMOVE_DN",false}, {"mfactor",1}, {"k",0},
65 {"maxPower",2ul}, {"CYLINDER",false}, {"Ly",1ul}
66};
67
69HubbardZ2 (const size_t &L, const vector<Param> &params, const BC &boundary, const DMRG::VERBOSITY::OPTION &VERB)
70:Mpo<Symmetry> (L, Symmetry::qvacuum(), "", PROP::HERMITIAN, PROP::NON_UNITARY, boundary, VERB),
71 HubbardObservables(L,params,HubbardZ2::defaults),
73{
74 ParamHandler P(params, HubbardZ2::defaults);
75 size_t Lcell = P.size();
76
77 for (size_t l=0; l<N_sites; ++l)
78 {
79 N_phys += P.get<size_t>("Ly",l%Lcell);
80 setLocBasis(F[l].get_basis().qloc(),l);
81 }
82
83 this->set_name("HubbardZ2");
84
86 std::vector<std::vector<std::string>> labellist;
87 HubbardU1xU1::set_operators(F, P, pushlist, labellist, boundary);
88 add_operators(F, P, pushlist, labellist, boundary);
89
90 this->construct_from_pushlist(pushlist, labellist, Lcell);
91 this->finalize(PROP::COMPRESS, P.get<size_t>("maxPower"));
92 this->precalc_TwoSiteData();
93}
94
95template<typename Symmetry_>
97add_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)
98{
99 std::size_t Lcell = P.size();
100 std::size_t N_sites = F.size();
101
102 for(std::size_t loc=0; loc<N_sites; ++loc)
103 {
104 std::size_t lp1 = (loc+1)%N_sites;
105 std::size_t lp2 = (loc+2)%N_sites;
106
107 std::size_t orbitals = F[loc].orbitals();
108 std::size_t next_orbitals = F[lp1].orbitals();
109 std::size_t nextn_orbitals = F[lp2].orbitals();
110
111 param2d DeltaUPpara = P.fill_array2d<double>("DeltaUP", "DeltaUPpara", {orbitals, next_orbitals}, loc%Lcell);
112 param2d DeltaDNpara = P.fill_array2d<double>("DeltaDN", "DeltaDNpara", {orbitals, next_orbitals}, loc%Lcell);
113
114 labellist[loc].push_back(DeltaUPpara.label);
115 labellist[loc].push_back(DeltaDNpara.label);
116
117 if (loc < N_sites-1 or !static_cast<bool>(boundary))
118 {
119 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
120 for (std::size_t beta=0; beta<next_orbitals; ++beta)
121 {
122 if (!P.HAS("DeltaUPfull"))
123 {
124 if (DeltaUPpara(alfa,beta) != 0.)
125 {
126 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,double>::get_N_site_interaction((F[loc].cdag(UP,alfa)*F[loc].sign()), F[lp1].cdag(UP,beta)), +DeltaUPpara(alfa,beta)));
127 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,double>::get_N_site_interaction((F[loc].c(UP,alfa) *F[loc].sign()), F[lp1].c(UP,beta)), -DeltaUPpara(alfa,beta)));
128 }
129 }
130 if (!P.HAS("DeltaDNfull"))
131 {
132 if (DeltaDNpara(alfa,beta) != 0.)
133 {
134 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,double>::get_N_site_interaction((F[loc].cdag(DN,alfa)*F[loc].sign()), F[lp1].c(DN,beta)), +DeltaDNpara(alfa,beta)));
135 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,double>::get_N_site_interaction((F[loc].c(DN,alfa) *F[loc].sign()), F[lp1].cdag(DN,beta)), -DeltaDNpara(alfa,beta)));
136 }
137 }
138 }
139 }
140 }
141}
142
143} // end namespace VMPS::models
144
145#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(), Mpo< Sym::ZN< Sym::ChargeZ2, 2 >, double > >::type c(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::ZN< Sym::ChargeZ2, 2 >, double > >::type P(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
vector< FermionBase< Sym::ZN< Sym::ChargeZ2, 2 > > > F
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Sym::ZN< Sym::ChargeZ2, 2 >, double > >::type cdag(size_t locx, size_t locy=0, double factor=std::sqrt(2.)) 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
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)
Definition: ZN.h:25
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
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)
Definition: HubbardZ2.h:97
Sym::ZN< Sym::ChargeZ2, 2 > Symmetry
Definition: HubbardZ2.h:18
static constexpr int spinfac
Definition: HubbardZ2.h:48
static qarray< 1 > singlet(int N=0)
Definition: HubbardZ2.h:46
HubbardZ2(Mpo< Symmetry > &Mpo_input, const vector< Param > &params)
Definition: HubbardZ2.h:24
static const std::map< string, std::any > defaults
Definition: HubbardZ2.h:50
static constexpr MODEL_FAMILY FAMILY
Definition: HubbardZ2.h:47
#define MAKE_TYPEDEFS(MODEL)
Definition: macros.h:4
const bool COMPRESS
Definition: DmrgTypedefs.h:499
Definition: qarray.h:26