VMPS++
Loading...
Searching...
No Matches
SpinlessFermionsZ2.h
Go to the documentation of this file.
1#ifndef STRAWBERRY_SPINLESSFERMIONSZ2
2#define STRAWBERRY_SPINLESSFERMIONSZ2
3
4#include "symmetry/ZN.h"
5#include "models/SpinlessFermionsU1.h"
6
7namespace VMPS
8{
9
26class SpinlessFermionsZ2 : public Mpo<Sym::ZN<Sym::ChargeZ2,2> >, public SpinlessFermionsObservables<Sym::ZN<Sym::ChargeZ2,2> >, public ParamReturner
27{
28public:
31
32private:
33 typedef typename Symmetry::qType qType;
34
35public:
36
39 SpinlessFermionsZ2 (const size_t &L, const vector<Param> &params);
41
42 static qarray<1> singlet (int N) {return qarray<1>{EVEN};};
43 static constexpr MODEL_FAMILY FAMILY = SPINLESS;
44
45 template<typename Symmetry_>
46 static void add_operators (const std::vector<SpinlessFermionBase<Symmetry_> > &B, const ParamHandler &P, HamiltonianTermsXd<Symmetry_> &Terms);
47
48 static const std::map<string,std::any> defaults;
49 static const std::map<string,std::any> sweep_defaults;
50};
51
52const std::map<string,std::any> SpinlessFermionsZ2::defaults =
53{
54 {"t",1.}, {"Delta",0.}, {"tPrime",0.},
55 {"V",0.}, {"Vph",0.},
56 {"Vprime",0.}, {"VphPrime",0.},
57 {"mu",0.},{"t0",0.},
58 {"D",2ul}, {"CALC_SQUARE",true}, {"CYLINDER",false}, {"OPEN_BC",true}, {"Ly",1ul},
59};
60
61const std::map<string,std::any> SpinlessFermionsZ2::sweep_defaults =
62{
63 {"max_alpha",100.}, {"min_alpha",1.e-11}, {"lim_alpha",10ul}, {"eps_svd",1.e-7},
64 {"Dincr_abs", 4ul}, {"Dincr_per", 2ul}, {"Dincr_rel", 1.1},
65 {"min_Nsv",0ul}, {"max_Nrich",-1},
66 {"max_halfsweeps",40ul}, {"min_halfsweeps",1ul},
67 {"Dinit",10ul}, {"Qinit",2ul}, {"Dlimit",1000ul},
68 {"tol_eigval",1.e-5}, {"tol_state",1.e-5},
69 {"savePeriod",0ul}, {"CALC_S_ON_EXIT", true}, {"CONVTEST", DMRG::CONVTEST::VAR_2SITE}
70};
71
73SpinlessFermionsZ2 (const size_t &L, const vector<Param> &params)
74:Mpo<Symmetry> (L, Symmetry::qvacuum(), "", PROP::HERMITIAN, PROP::NON_UNITARY, PROP::HAMILTONIAN),
76 ParamReturner(SpinlessFermionsZ2::sweep_defaults)
77{
78 ParamHandler P(params,SpinlessFermionsZ2::defaults);
79 size_t Lcell = P.size();
80
81 for (size_t l=0; l<N_sites; ++l)
82 {
83 N_phys += P.get<size_t>("Ly",l%Lcell);
84 setLocBasis(F[l].get_basis(),l);
85 }
86
87 HamiltonianTermsXd<Symmetry> Terms(N_sites, P.get<bool>("OPEN_BC"));
89 add_operators(F,P,Terms);
90
91 this->construct_from_Terms(Terms, Lcell, P.get<bool>("CALC_SQUARE"), P.get<bool>("OPEN_BC"));
92 this->precalc_TwoSiteData();
93}
94
95template<typename Symmetry_>
97add_operators (const std::vector<SpinlessFermionBase<Symmetry_> > &F, const ParamHandler &P, HamiltonianTermsXd<Symmetry_> &Terms)
98{
99 std::size_t Lcell = P.size();
100 std::size_t N_sites = Terms.size();
101
102 Terms.set_name("SpinlessFermionsZ2");
103
104 for (std::size_t loc=0; loc<N_sites; ++loc)
105 {
106 size_t lp1 = (loc+1)%N_sites;
107 size_t lp2 = (loc+2)%N_sites;
108
109 std::size_t orbitals = F[loc].orbitals();
110 std::size_t next_orbitals = F[lp1].orbitals();
111 std::size_t nextn_orbitals = F[lp2].orbitals();
112
113 // Nearest-neighbour terms: p-wave SC
114
115 param2d DeltaPara = P.fill_array2d<double>("Delta", "DeltaPara", {orbitals, next_orbitals}, loc%Lcell);
116 Terms.save_label(loc, DeltaPara.label);
117
118 if (loc < N_sites-1 or !P.get<bool>("OPEN_BC"))
119 {
120 for (std::size_t alfa=0; alfa < orbitals; ++alfa)
121 for (std::size_t beta=0; beta < next_orbitals; ++beta)
122 {
123 Terms.push_tight(loc, +DeltaPara(alfa,beta), F[loc].cdag(alfa) * F[loc].sign(), F[lp1].cdag(beta));
124 Terms.push_tight(loc, -DeltaPara(alfa,beta), F[loc].c(alfa) * F[loc].sign(), F[lp1].c(beta));
125
126 // Old: mapped to Heisenberg
127 // variant 1:
128// Terms.push_tight(loc, +DeltaPara(alfa,beta), B[loc].Scomp(SP,alfa)*B[loc].sign(), B[lp1].Scomp(SP,beta));
129// Terms.push_tight(loc, -DeltaPara(alfa,beta), B[loc].Scomp(SM,alfa)*B[loc].sign(), B[lp1].Scomp(SM,beta));
130//
131// Terms.push_tight(loc, -tPara(alfa,beta), B[loc].Scomp(SP,alfa)*B[loc].sign(), B[lp1].Scomp(SM,beta));
132// Terms.push_tight(loc, +tPara(alfa,beta), B[loc].Scomp(SM,alfa)*B[loc].sign(), B[lp1].Scomp(SP,beta));
133
134 // variant 2:
135 // t=-Delta is mappable to Ising chain: S^x_i*S^x_j = 1/4*(S^+_i+S^-_j)*(S^+_j+S^-_i) = 1/4*(cā€ ^i*c^j + c^i*c^j + h.c.)
136// if ((tPara.a+DeltaPara.a).matrix().norm() < 1e-14)
137// {
138// Terms.push_tight(loc, +4.*DeltaPara(alfa,beta), B[loc].Scomp(SX,alfa), B[lp1].Scomp(SX,beta));
139// }
140// else
141// {
142// Terms.push_tight(loc, +DeltaPara(alfa,beta), B[loc].Scomp(SP,alfa), B[lp1].Scomp(SP,beta));
143// Terms.push_tight(loc, +DeltaPara(alfa,beta), B[loc].Scomp(SM,alfa), B[lp1].Scomp(SM,beta));
144//
145// Terms.push_tight(loc, -tPara(alfa,beta), B[loc].Scomp(SP,alfa), B[lp1].Scomp(SM,beta));
146// Terms.push_tight(loc, -tPara(alfa,beta), B[loc].Scomp(SM,alfa), B[lp1].Scomp(SP,beta));
147// }
148 }
149 }
150 }
151}
152
153} // end namespace VMPS
154
155#endif
MODEL_FAMILY
Definition: DmrgTypedefs.h:96
@ SPINLESS
Definition: DmrgTypedefs.h:96
@ EVEN
Definition: DmrgTypedefs.h:128
@ B
Definition: DmrgTypedefs.h:130
void set_name(const std::string &label_in)
void push_tight(std::size_t loc, Scalar lambda, OperatorType Op1, OperatorType Op2)
void save_label(std::size_t loc, const std::string &label)
std::size_t size() const
std::size_t N_phys
Definition: MpoTerms.h:400
std::size_t N_sites
Definition: MpoTerms.h:395
void setLocBasis(const std::vector< std::vector< qType > > &q)
Definition: MpoTerms.h:715
Definition: Mpo.h:40
void precalc_TwoSiteData(bool FORCE=false)
vector< SpinlessFermionBase< Sym::ZN< Sym::ChargeZ2, 2 > > > F
Definition: ZN.h:25
static void set_operators(const std::vector< SpinlessFermionBase< Symmetry_ > > &F, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
SpinlessFermionsZ2 Model.
static const std::map< string, std::any > sweep_defaults
static void add_operators(const std::vector< SpinlessFermionBase< Symmetry_ > > &B, const ParamHandler &P, HamiltonianTermsXd< Symmetry_ > &Terms)
static qarray< 1 > singlet(int N)
static const std::map< string, std::any > defaults
static constexpr MODEL_FAMILY FAMILY
Sym::ZN< Sym::ChargeZ2, 2 > Symmetry
#define MAKE_TYPEDEFS(MODEL)
Definition: macros.h:4
Definition: qarray.h:26