VMPS++
Loading...
Searching...
No Matches
HeisenbergXYZ.h
Go to the documentation of this file.
1#ifndef STRAWBERRY_HEISENBERGXYZ
2#define STRAWBERRY_HEISENBERGXYZ
3
4#include "models/Heisenberg.h"
5
6namespace VMPS
7{
8
32class HeisenbergXYZ : public Mpo<Sym::U0,complex<double> >, public HeisenbergObservables<Sym::U0>, public ParamReturner
33{
34public:
37
38private:
39 typedef typename Symmetry::qType qType;
40
41 static qarray<0> singlet(int N=0) {return qarray<0>{};};
42 static constexpr MODEL_FAMILY FAMILY = HEISENBERG;
43
44public:
45
47 HeisenbergXYZ() : Mpo<Symmetry,complex<double> >(), ParamReturner(Heisenberg::sweep_defaults) {};
48
49 HeisenbergXYZ (const size_t &L, const vector<Param> &params, const BC &boundary=BC::OPEN, const DMRG::VERBOSITY::OPTION &VERB=DMRG::VERBOSITY::OPTION::ON_EXIT);
50
51 HeisenbergXYZ (Mpo<Symmetry,complex<double> > &Mpo_input, const vector<Param> &params)
52 :Mpo<Symmetry,complex<double> >(Mpo_input),
55 {
56 ParamHandler P(params,Heisenberg::defaults);
57 size_t Lcell = P.size();
58 N_phys = 0;
59 for (size_t l=0; l<N_sites; ++l) N_phys += P.get<size_t>("Ly",l%Lcell);
60 this->precalc_TwoSiteData();
61 this->HERMITIAN = true;
62 this->HAMILTONIAN = true;
63 };
65
66 template<typename Symmetry_>
67 void add_operators (const std::vector<SpinBase<Symmetry_>> &B, const ParamHandler &P,
68 PushType<SiteOperator<Symmetry_,complex<double>>,double>& pushlist, std::vector<std::vector<std::string>>& labellist,
69 const BC boundary=BC::OPEN);
70
71 static const std::map<string,std::any> defaults;
72};
73
74const std::map<string,std::any> HeisenbergXYZ::defaults =
75{
76 {"Jx",0.}, {"Jy",0.}, {"Jz",0.},
77 {"Jxrung",0.}, {"Jyrung",0.}, {"Jzrung",0.},
78 {"Jxprime",0.}, {"Jyprime",0.}, {"Jzprime",0.},
79
80 // Dzialoshinsky-Moriya terms
81 {"Dx",0.}, {"Dy",0.}, {"Dz",0.},
82 {"Dxrung",0.}, {"Dyrung",0.}, {"Dzrung",0.},
83 {"Dxprime",0.}, {"Dyprime",0.}, {"Dzprime",0.},
84
85 {"Bx",0.}, {"By",0.}, {"Bz",0.},
86 {"Kx",0.}, {"Ky",0.}, {"Kz",0.},
87
88 {"D",2ul}, {"maxPower",2ul}, {"CYLINDER",false}, {"Ly",1ul},
89
90 {"J",0.}, {"Jprime",0.}, {"Jxy",0.}, {"mu",0.}, {"nu",0.}, {"R",0.}, {"Jxyprime",0.}, {"Jzprime",0.}, {"Jw",0.}, {"betaKT",0.}
91};
92
94HeisenbergXYZ (const size_t &L, const vector<Param> &params, const BC &boundary, const DMRG::VERBOSITY::OPTION &VERB)
95:Mpo<Symmetry,complex<double> > (L, qarray<0>({}), "", PROP::HERMITIAN, PROP::NON_UNITARY, boundary, VERB),
98{
99 ParamHandler P(params,HeisenbergXYZ::defaults);
100 size_t Lcell = P.size();
101
102 for (size_t l=0; l<N_sites; ++l)
103 {
104 N_phys += P.get<size_t>("Ly",l%Lcell);
105 setLocBasis(B[l].get_basis().qloc(),l);
106 }
107
108 if(P.HAS_ANY_OF({"Dx", "Dy", "Dz", "Dxprime", "Dyprime", "Dzprime", "Dxpara", "Dypara", "Dzpara", "Dxperp", "Dzperp"}))
109 {
110 this->set_name("Dzyaloshinsky-Moriya");
111 }
112 else
113 {
114 this->set_name("HeisenbergXYZ");
115 }
116
117 PushType<SiteOperator<Symmetry,double>,double> pushlist_aux;
118 std::vector<std::vector<std::string>> labellist;
119
120 HeisenbergU1::set_operators(B,P,pushlist_aux,labellist,boundary);
121 Heisenberg::add_operators(B,P,pushlist_aux,labellist,boundary);
122
124 add_operators(B,P,pushlist,labellist,boundary);
125
126 this->construct_from_pushlist(pushlist, labellist, Lcell);
127 this->finalize(PROP::COMPRESS, P.get<size_t>("maxPower"));
128
129 this->precalc_TwoSiteData();
130}
131
132template<typename Symmetry_>
134add_operators(const std::vector<SpinBase<Symmetry_>> &B, const ParamHandler &P, PushType<SiteOperator<Symmetry_,complex<double>>,double>& pushlist, std::vector<std::vector<std::string>>& labellist, const BC boundary)
135{
136 std::size_t Lcell = P.size();
137 std::size_t N_sites = B.size();
138 if(labellist.size() != N_sites) {labellist.resize(N_sites);}
139
140 for(std::size_t loc=0; loc<N_sites; ++loc)
141 {
142 std::size_t orbitals = B[loc].orbitals();
143 std::size_t next_orbitals = B[(loc+1)%N_sites].orbitals();
144 std::size_t nextn_orbitals = B[(loc+2)%N_sites].orbitals();
145
146 stringstream ss1, ss2;
147 ss1 << "S=" << print_frac_nice(frac(P.get<size_t>("D",loc%Lcell)-1,2));
148 ss2 << "Ly=" << P.get<size_t>("Ly",loc%Lcell);
149 labellist[loc].push_back(ss1.str());
150 labellist[loc].push_back(ss2.str());
151
152 // Local terms: J⟂, DM⟂, B and K
153
154 param2d Jxperp = P.fill_array2d<double>("Jxrung", "Jx", "Jxperp", orbitals, loc%Lcell, P.get<bool>("CYLINDER"));
155 param2d Jyperp = P.fill_array2d<double>("Jyrung", "Jy", "Jyperp", orbitals, loc%Lcell, P.get<bool>("CYLINDER"));
156 param2d Jzperp = P.fill_array2d<double>("Jzrung", "Jz", "Jzperp", orbitals, loc%Lcell, P.get<bool>("CYLINDER"));
157 param2d Dxperp = P.fill_array2d<double>("Dxrung", "Dx", "Dxperp", orbitals, loc%Lcell, P.get<bool>("CYLINDER"));
158 param2d Dzperp = P.fill_array2d<double>("Dzrung", "Dz", "Dzperp", orbitals, loc%Lcell, P.get<bool>("CYLINDER"));
159 param1d By = P.fill_array1d<double>("By", "Byorb", orbitals, loc%Lcell);
160 param1d Ky = P.fill_array1d<double>("Ky", "Kyorb", orbitals, loc%Lcell);
161
162 labellist[loc].push_back(Jxperp.label);
163 labellist[loc].push_back(Jyperp.label);
164 labellist[loc].push_back(Jzperp.label);
165 labellist[loc].push_back(Dxperp.label);
166 labellist[loc].push_back(Dzperp.label);
167 labellist[loc].push_back(By.label);
168 labellist[loc].push_back(Ky.label);
169
170 std::array<Eigen::ArrayXXd,3> Jperp = {Jxperp.a, Jyperp.a, Jzperp.a};
171 std::array<Eigen::ArrayXd,3> B_array = {B[loc].ZeroField(), By.a, B[loc].ZeroField()};
172 std::array<Eigen::ArrayXd,3> K_array = {B[loc].ZeroField(), Ky.a, B[loc].ZeroField()};
173 std::array<Eigen::ArrayXXd,3> Dperp = {Dxperp.a, B[loc].ZeroHopping(), Dzperp.a};
174
175 auto Hloc = Mpo<Symmetry,complex<double> >::get_N_site_interaction(B[loc].HeisenbergHamiltonian(Jperp,B_array,K_array,Dperp));
176 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
177
178 // Nearest-neighbour terms: J and DM
179 param2d Jxpara = P.fill_array2d<double>("Jx", "Jxpara", {orbitals, next_orbitals}, loc%Lcell);
180 param2d Jypara = P.fill_array2d<double>("Jy", "Jypara", {orbitals, next_orbitals}, loc%Lcell);
181 param2d Jzpara = P.fill_array2d<double>("Jz", "Jzpara", {orbitals, next_orbitals}, loc%Lcell);
182 param2d Dxpara = P.fill_array2d<double>("Dx", "Dxpara", {orbitals, next_orbitals}, loc%Lcell);
183 param2d Dzpara = P.fill_array2d<double>("Dz", "Dzpara", {orbitals, next_orbitals}, loc%Lcell);
184
185 labellist[loc].push_back(Jxpara.label);
186 labellist[loc].push_back(Jypara.label);
187 labellist[loc].push_back(Jzpara.label);
188 labellist[loc].push_back(Dxpara.label);
189 labellist[loc].push_back(Dzpara.label);
190
191 if (loc < N_sites-1 or !static_cast<bool>(boundary))
192 {
193 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
194 for (std::size_t beta=0; beta<next_orbitals; ++beta)
195 {
196 auto local_Sx = B[loc].Scomp(SX,alfa).template cast<complex<double> >();
197 auto local_Sy = -1.i*B[loc].Scomp(iSY,alfa).template cast<complex<double> >();
198 auto local_Sz = B[loc].Scomp(SZ,alfa).template cast<complex<double> >();
199
200 auto tight_Sx = B[(loc+1)%N_sites].Scomp(SX,beta).template cast<complex<double> >();
201 auto tight_Sy = -1.i*B[(loc+1)%N_sites].Scomp(iSY,beta).template cast<complex<double> >();
202 auto tight_Sz = B[(loc+1)%N_sites].Scomp(SZ,beta).template cast<complex<double> >();
203
204 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sx, tight_Sx), Jxpara(alfa,beta)));
205 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sy, tight_Sy), Jypara(alfa,beta)));
206 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sz, tight_Sz), Jzpara(alfa,beta)));
207
208 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sy, tight_Sx), +Dzpara(alfa,beta)));
209 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sy, tight_Sz), -Dxpara(alfa,beta)));
210 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sz, tight_Sy), +Dxpara(alfa,beta)));
211 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sx, tight_Sy), -Dzpara(alfa,beta)));
212 }
213 }
214
215 // Next-nearest-neighbour terms: J and DM
216 param2d Jxprime = P.fill_array2d<double>("Jxprime", "Jxprime", {orbitals, nextn_orbitals}, loc%Lcell);
217 param2d Jyprime = P.fill_array2d<double>("Jyprime", "Jyprime", {orbitals, nextn_orbitals}, loc%Lcell);
218 param2d Jzprime = P.fill_array2d<double>("Jzprime", "Jzprime", {orbitals, nextn_orbitals}, loc%Lcell);
219 param2d Dxprime = P.fill_array2d<double>("Dxprime", "Dxprime_array", {orbitals, nextn_orbitals}, loc%Lcell);
220 param2d Dzprime = P.fill_array2d<double>("Dzprime", "Dzprime_array", {orbitals, nextn_orbitals}, loc%Lcell);
221
222 labellist[loc].push_back(Jxprime.label);
223 labellist[loc].push_back(Jyprime.label);
224 labellist[loc].push_back(Jzprime.label);
225 labellist[loc].push_back(Dxprime.label);
226 labellist[loc].push_back(Dzprime.label);
227
228 if(loc < N_sites-2 or !static_cast<bool>(boundary))
229 {
230 for(std::size_t alfa=0; alfa<orbitals; ++alfa)
231 for(std::size_t beta=0; beta<nextn_orbitals; ++beta)
232 {
233 auto local_Sx = B[loc].Scomp(SX,alfa).template cast<complex<double> >();
234 auto local_Sy = -1.i*B[loc].Scomp(iSY,alfa).template cast<complex<double> >();
235 auto local_Sz = B[loc].Scomp(SZ,alfa).template cast<complex<double> >();
236 auto tight_Id = B[(loc+1)%N_sites].Id().template cast<complex<double> >();
237 auto nextn_Sx = B[(loc+2)%N_sites].Scomp(SX,beta).template cast<complex<double> >();
238 auto nextn_Sy = -1.i*B[(loc+2)%N_sites].Scomp(iSY,beta).template cast<complex<double> >();
239 auto nextn_Sz = B[(loc+2)%N_sites].Scomp(SZ,beta).template cast<complex<double> >();
240
241 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sx, tight_Id, nextn_Sx), Jxprime(alfa,beta)));
242 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sy, tight_Id, nextn_Sy), Jyprime(alfa,beta)));
243 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sz, tight_Id, nextn_Sz), Jzprime(alfa,beta)));
244
245 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sy, tight_Id, nextn_Sx), +Dzprime(alfa,beta)));
246 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sy, tight_Id, nextn_Sz), -Dxprime(alfa,beta)));
247 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sz, tight_Id, nextn_Sy), +Dxprime(alfa,beta)));
248 pushlist.push_back(std::make_tuple(loc, Mpo<Symmetry,complex<double> >::get_N_site_interaction(local_Sx, tight_Id, nextn_Sy), -Dzprime(alfa,beta)));
249 }
250 }
251 }
252}
253
254} //end namespace VMPS
255
256#endif
boost::rational< int > frac
Definition: DmrgExternal.h:11
std::string print_frac_nice(frac r)
Definition: DmrgExternal.h:32
MODEL_FAMILY
Definition: DmrgTypedefs.h:96
@ HEISENBERG
Definition: DmrgTypedefs.h:96
@ iSY
Definition: DmrgTypedefs.h:60
@ SZ
Definition: DmrgTypedefs.h:60
@ SX
Definition: DmrgTypedefs.h:60
BC
Definition: DmrgTypedefs.h:161
@ B
Definition: DmrgTypedefs.h:130
vector< SpinBase< Sym::U0 > > B
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Sym::U0, double > >::type Scomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const
std::size_t N_phys
Definition: MpoTerms.h:400
std::size_t N_sites
Definition: MpoTerms.h:395
DMRG::VERBOSITY::OPTION VERB
Definition: MpoTerms.h:102
Definition: Mpo.h:40
static std::vector< T > get_N_site_interaction(T const &Op0, Operator const &... Ops)
Definition: Mpo.h:117
void precalc_TwoSiteData(bool FORCE=false)
Definition: U0.h:28
static void set_operators(const std::vector< SpinBase< Symmetry_ > > &B, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
Definition: HeisenbergU1.h:180
Heisenberg Model with general XYZ coupling.
Definition: HeisenbergXYZ.h:33
Symmetry::qType qType
Definition: HeisenbergXYZ.h:39
void add_operators(const std::vector< SpinBase< Symmetry_ > > &B, const ParamHandler &P, PushType< SiteOperator< Symmetry_, complex< double > >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static qarray< 0 > singlet(int N=0)
Definition: HeisenbergXYZ.h:41
HeisenbergXYZ(Mpo< Symmetry, complex< double > > &Mpo_input, const vector< Param > &params)
Definition: HeisenbergXYZ.h:51
static constexpr MODEL_FAMILY FAMILY
Definition: HeisenbergXYZ.h:42
static const std::map< string, std::any > defaults
Definition: HeisenbergXYZ.h:71
Heisenberg Model.
Definition: Heisenberg.h:34
static const std::map< string, std::any > sweep_defaults
Definition: Heisenberg.h:72
static void add_operators(const std::vector< SpinBase< Symmetry > > &B, const ParamHandler &P, PushType< SiteOperator< Symmetry, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
Definition: Heisenberg.h:149
static const std::map< string, std::any > defaults
Definition: Heisenberg.h:71
#define MAKE_TYPEDEFS(MODEL)
Definition: macros.h:4
const bool COMPRESS
Definition: DmrgTypedefs.h:499
const bool NON_UNITARY
Definition: DmrgTypedefs.h:495
const bool HERMITIAN
Definition: DmrgTypedefs.h:492
void finalize(bool PRINT_STATS=false)
Definition: functions.h:127
PushType< OtherOperator, OtherScalar > cast()
Definition: DmrgTypedefs.h:214
Definition: qarray.h:26