VMPS++
Loading...
Searching...
No Matches
HeisenbergObservables.h
Go to the documentation of this file.
1#ifndef HEISENBERGOBSERVABLES
2#define HEISENBERGOBSERVABLES
3
4#include "Mpo.h"
5#include "ParamHandler.h" // from HELPERS
6#include "bases/SpinBase.h"
7//include "DmrgLinearAlgebra.h"
8//include "DmrgExternal.h"
9#include "Permutations.h"
10
11template<typename Symmetry, typename Scalar=double>
13{
15
16public:
17
20 HeisenbergObservables (const size_t &L); // for inheritance purposes
21 HeisenbergObservables (const size_t &L, const vector<Param> &params, const std::map<string,std::any> &defaults);
23
25 template<typename Dummy = Symmetry>
26 typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type S (size_t locx, size_t locy=0, double factor=1.) const;
27 template<typename Dummy = Symmetry>
28 typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Sdag (size_t locx, size_t locy=0, double factor=std::sqrt(3.)) const;
29 template<typename Dummy = Symmetry>
30 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Scomp (SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const;
31 template<typename Dummy = Symmetry>
32 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Qcomp (SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const;
33 template<typename Dummy = Symmetry>
34 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Sz (size_t locx, size_t locy=0) const;
35 template<typename Dummy = Symmetry>
36 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Sx (size_t locx, size_t locy=0) const {return Scomp(SX,locx,locy);};
37 template<typename Dummy = Symmetry>
38 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type iSy (size_t locx, size_t locy=0) const {return Scomp(iSY,locx,locy);};
39 template<typename Dummy = Symmetry>
40 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Sp (size_t locx, size_t locy=0) const {return Scomp(SP,locx,locy);};
41 template<typename Dummy = Symmetry>
42 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Sm (size_t locx, size_t locy=0) const {return Scomp(SM,locx,locy);};
43 template<typename Dummy = Symmetry>
44 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,complex<double> > >::type exp_ipiSz (size_t locx, size_t locy=0, double factor=1.) const;
45 template<typename Dummy = Symmetry>
46 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type ScompScomp (SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const;
47 template<typename Dummy = Symmetry>
48 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type QcompQcomp (SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const;
49 template<typename Dummy = Symmetry>
50 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type SpSm (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const {return ScompScomp(SP,SM,locx1,locx2,locy1,locy2,fac);}
51 template<typename Dummy = Symmetry>
52 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type SmSp (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const {return ScompScomp(SM,SP,locx1,locx2,locy1,locy2,fac);}
53 template<typename Dummy = Symmetry>
54 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type SzSz (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const {return ScompScomp(SZ,SZ,locx1,locx2,locy1,locy2,1.);}
55 template<typename Dummy = Symmetry>
56 typename std::enable_if<Dummy::NO_SPIN_SYM(), Mpo<Symmetry,Scalar> >::type SxSx (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const {return ScompScomp(SX,SX,locx1,locx2,locy1,locy2,1.);}
57 template<typename Dummy = Symmetry>
58 typename std::conditional<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar>, vector<Mpo<Symmetry,Scalar> > >::type SdagS (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double factor=1.) const;
59 template<typename Dummy = Symmetry>
60 typename std::conditional<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar>, vector<Mpo<Symmetry,Scalar> > >::type QdagQ (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const;
61 template<typename Dummy = Symmetry>
62 typename std::conditional<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar>, vector<Mpo<Symmetry,Scalar> > >::type SdagSxS (size_t locx1, size_t locx2, size_t locx3, size_t locy1=0, size_t locy2=0, size_t locy3=0) const;
63 template<typename Dummy = Symmetry>
64 typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Stot (size_t locy1=0, double factor=1., int dLphys=1) const;
65 template<typename Dummy = Symmetry>
66 typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Sdagtot (size_t locy1=0, double factor=std::sqrt(3.), int dLphys=1) const;
67 template<typename Dummy = Symmetry>
68 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Scomptot (SPINOP_LABEL Sa, size_t locy1=0, double factor=1., int dLphys=1) const;
69
70 template<typename Dummy = Symmetry>
71 typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Q (size_t locx, size_t locy=0, double factor=1.) const;
72 template<typename Dummy = Symmetry>
73 typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type Qdag (size_t locx, size_t locy=0, double factor=std::sqrt(5.)) const;
74
75 template<typename Dummy = Symmetry>
76 typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry, complex<double> > >::type Rcomp (SPINOP_LABEL Sa, size_t locx, size_t locy=0) const;
78
79 // ///@{
80 // Mpo<Symmetry,Scalar> Scomp (SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const;
81 // Mpo<Symmetry,Scalar> ScompScomp (SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const;
82 // Mpo<Symmetry,complex<double>> Rcomp (SPINOP_LABEL Sa, size_t locx, size_t locy=0) const;
83 // ///@}
84
85 // ///@{
86 // Mpo<Symmetry,Scalar> Sz (size_t locx, size_t locy=0) const {return Scomp(SZ,locx,locy);};
87 // Mpo<Symmetry,Scalar> Sx (size_t locx, size_t locy=0) const {return Scomp(SX,locx,locy);};
88 // Mpo<Symmetry,Scalar> n (size_t locx, size_t locy=0) const;
89 // Mpo<Symmetry,Scalar> SzSz (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const {return ScompScomp(SZ,SZ,locx1,locx2,locy1,locy2,1.);};
90 // Mpo<Symmetry,Scalar> SpSm (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const {return ScompScomp(SP,SM,locx1,locx2,locy1,locy2,fac);};
91 // Mpo<Symmetry,Scalar> SmSp (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const {return ScompScomp(SM,SP,locx1,locx2,locy1,locy2,fac);};
92 // Mpo<Symmetry,Scalar> SxSx (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const {return ScompScomp(SX,SX,locx1,locx2,locy1,locy2,fac);};
93 // vector<Mpo<Symmetry,Scalar> > SdagS (size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const;
94 // ///@}
95
96 template<typename Dummy = Symmetry>
97 typename std::enable_if<Dummy::IS_SPIN_SU2(),Mpo<Symmetry,complex<double> > >::type S_ky (vector<complex<double> > phases) const;
98 template<typename Dummy = Symmetry>
99 typename std::enable_if<Dummy::IS_SPIN_SU2(),Mpo<Symmetry,complex<double> > >::type Sdag_ky (vector<complex<double> > phases, double factor=sqrt(3.)) const;
100 template<typename Dummy = Symmetry>
101 typename std::enable_if<!Dummy::IS_SPIN_SU2(),Mpo<Symmetry,complex<double> > >::type Sa_ky (SPINOP_LABEL Sa, vector<complex<double> > phases) const;
102
104 template<typename Dummy = Symmetry>
105 typename std::enable_if<!Dummy::IS_SPIN_SU2(),Mpo<Symmetry,Scalar> >::type String (STRING STR, size_t locx, size_t locy=0) const;
106
107 template<typename Dummy = Symmetry>
108 typename std::enable_if<!Dummy::IS_SPIN_SU2(),Mpo<Symmetry,Scalar> >::type StringCorr (STRING STR, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const;
110
111/* typename Symmetry::qType getQ_ScompScomp(SPINOP_LABEL Sa1, SPINOP_LABEL Sa2) const*/
112/* {*/
113/* if (Symmetry::IS_TRIVIAL) {return Symmetry::qvacuum();}*/
114/* typename Symmetry::qType out;*/
115/* if ((Sa1 == SZ and Sa2 == SZ) or */
116/* (Sa1 == SP and Sa2 == SM) or */
117/* (Sa1 == SM and Sa2 == SP) or */
118/* (Sa1 == SX and Sa1 == iSY) or */
119/* (Sa1 == QZ and Sa2 == QZ) or */
120/* (Sa1 == QP and Sa2 == QM) or */
121/* (Sa1 == QM and Sa2 == QP) or */
122/* (Sa1 == QPZ and Sa2 == QMZ) or */
123/* (Sa1 == QMZ and Sa2 == QPZ)*/
124/* )*/
125/* {*/
126/* out = Symmetry::qvacuum();*/
127/* }*/
128/* else*/
129/* {*/
130/* lout << "Sa1=" << Sa1 << ", Sa2=" << Sa2 << endl;*/
131/* assert(false and "Quantum number for the chosen ScompScomp is not computed. Add in HubbardObservables::getQ_ScompScomp");*/
132/* }*/
133/* return out;*/
134/* }*/
135
136 std::vector<Mpo<Symmetry,Scalar>> make_spinPermutation (const Permutation& permutations) const;
137
138
139 MpoTerms<Symmetry,double> spin_swap_operator_D2 (const std::size_t locx1, const std::size_t locx2, const std::size_t locy1=0ul, const std::size_t locy2=0ul) const;
140
141 MpoTerms<Symmetry,double> Psinglet (const std::size_t locx1, const std::size_t locx2, const std::size_t locy1=0ul, const std::size_t locy2=0ul) const;
142
143 MpoTerms<Symmetry,double> spin_swap_operator_D3 (const std::size_t locx1, const std::size_t locx2, const std::size_t locy1=0ul, const std::size_t locy2=0ul) const;
144
145protected:
146
147 Mpo<Symmetry,Scalar> make_local (size_t locx, size_t locy,
148 const OperatorType &Op,
149 double factor =1.,
150 bool HERMITIAN=false,
151 STRING STR=NOSTRING) const;
152 Mpo<Symmetry,Scalar> make_localSum (const vector<OperatorType> &Op, vector<Scalar> factor, bool HERMITIAN) const;
153 Mpo<Symmetry,Scalar> make_corr (size_t locx1, size_t locx2, size_t locy1, size_t locy2,
154 const OperatorType &Op1, const OperatorType &Op2, qarray<Symmetry::Nq> Qtot,
155 double factor, bool HERMITIAN,
156 STRING STR=NOSTRING) const;
157 Mpo<Symmetry,complex<double> > make_FourierYSum (string name, const vector<OperatorType> &Ops, double factor, bool HERMITIAN, const vector<complex<double> > &phases) const;
158
159 vector<SpinBase<Symmetry> > B;
160};
161
162template<typename Symmetry, typename Scalar>
164HeisenbergObservables (const size_t &L)
165{
166 B.resize(L);
167}
168
169template<typename Symmetry, typename Scalar>
171HeisenbergObservables (const size_t &L, const vector<Param> &params, const std::map<string,std::any> &defaults)
172{
173 ParamHandler P(params,defaults);
174 size_t Lcell = P.size();
175 B.resize(L);
176
177 for (size_t l=0; l<L; ++l)
178 {
179 B[l] = SpinBase<Symmetry>(P.get<size_t>("Ly",l%Lcell), P.get<size_t>("D",l%Lcell), P.get<int>("mfactor",l%Lcell));
180 }
181}
182
183template<typename Symmetry, typename Scalar>
185make_local (size_t locx, size_t locy, const OperatorType &Op, double factor, bool HERMITIAN, STRING STR) const
186{
187 assert(locx<B.size() and locy<B[locx].dim());
188 stringstream ss;
189 ss << Op.label() << "(" << locx << "," << locy;
190 if (factor != 1.) ss << ",factor=" << factor;
191 ss << ")";
192
193 Mpo<Symmetry,Scalar> Mout(B.size(), Op.Q(), ss.str(), HERMITIAN);
194 for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis().qloc(),l);}
195
196 if (STR==NOSTRING)
197 {
198 Mout.setLocal(locx, (factor * Op).template cast<Scalar>(). template plain<Scalar>());
199 }
200/* else*/
201/* {*/
202/* Mout.setLocal(locx, (factor * Op).template cast<Scalar>(). template plain<Scalar>(), */
203/* B[0].bead(STR).template cast<Scalar>(). template plain<Scalar>());*/
204/* }*/
205
206 return Mout;
207}
208
209template<typename Symmetry, typename Scalar>
211make_localSum (const vector<OperatorType> &Op, vector<Scalar> factor, bool HERMITIAN) const
212{
213 assert(Op.size()==B.size() and factor.size()==B.size());
214 stringstream ss;
215 ss << Op[0].label() << "localSum";
216
217 Mpo<Symmetry,Scalar> Mout(B.size(), Op[0].Q(), ss.str(), HERMITIAN);
218 for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis().qloc(),l);}
219
220 vector<SiteOperator<Symmetry,Scalar>> Op_plain;
221 for (int i=0; i<Op.size(); ++i)
222 {
223 Op_plain.push_back(Op[i].template cast<Scalar>().template plain<Scalar>());
224 }
225 Mout.setLocalSum(Op_plain, factor);
226
227 return Mout;
228}
229
230template<typename Symmetry, typename Scalar>
232make_corr (size_t locx1, size_t locx2, size_t locy1, size_t locy2,
233 const OperatorType &Op1, const OperatorType &Op2,
235 double factor, bool HERMITIAN,
236 STRING STR) const
237{
238 assert(locx1<B.size() and locy1<B[locx1].dim());
239 assert(locx2<B.size() and locy2<B[locx2].dim());
240
241 stringstream ss;
242 ss << Op1.label() << "(" << locx1 << "," << locy1 << ")"
243 << Op2.label() << "(" << locx2 << "," << locy2;
244 if (factor != 1.) {ss << ",fac=" << factor;}
245 ss << ")";
246
247 Mpo<Symmetry,Scalar> Mout(B.size(), Qtot, ss.str(), HERMITIAN);
248 for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis().qloc(),l);}
249
250 if (locx1 == locx2)
251 {
252 auto product = factor*OperatorType::prod(Op1, Op2, Qtot);
253 Mout.setLocal(locx1, product.template cast<Scalar>().template plain<Scalar>());
254 }
255 else
256 {
257 if (STR==NOSTRING)
258 {
259 // Set dummySign carefully because basis might be site-dependent
260 if (int(locx2)-int(locx1)-1 != 0)
261 {
262 vector<SiteOperator<Symmetry,Scalar> > dummySign(max(locx1,locx2)-min(locx1,locx2)-1);
263 for (int i=0; i<dummySign.size(); ++i)
264 {
265 dummySign[i] = B[min(locx1,locx2)+i+1].Id().template cast<Scalar>().template plain<Scalar>();
266 }
267 Mout.setLocal(vector<size_t>{locx1, locx2},
268 vector<SiteOperator<Symmetry,Scalar> >{
269 (factor*Op1).template cast<Scalar>().template plain<Scalar>(),
270 Op2 .template cast<Scalar>().template plain<Scalar>()},
271 dummySign);
272 }
273 else
274 {
275 Mout.setLocal(vector<size_t>{locx1, locx2},
276 vector<SiteOperator<Symmetry,Scalar> >{
277 (factor*Op1).template cast<Scalar>().template plain<Scalar>(),
278 Op2 .template cast<Scalar>().template plain<Scalar>()});
279 }
280 }
281/* else*/
282/* {*/
283/* Mout.setLocal({locx1, locx2}, {(factor*Op1).template cast<Scalar>().template plain<Scalar>(), */
284/* Op2 .template cast<Scalar>().template plain<Scalar>()}, */
285/* B[0].bead(STR).template cast<Scalar>().template plain<Scalar>());*/
286/* }*/
287 }
288
289 return Mout;
290}
291
292template<typename Symmetry, typename Scalar>
294make_FourierYSum (string name, const vector<OperatorType> &Ops,
295 double factor, bool HERMITIAN, const vector<complex<double> > &phases) const
296{
297 stringstream ss;
298 ss << name << "_ky(";
299 for (int l=0; l<phases.size(); ++l)
300 {
301 ss << phases[l];
302 if (l!=phases.size()-1) {ss << ",";}
303 else {ss << ")";}
304 }
305
306 // all Ops[l].Q() must match
307 Mpo<Symmetry,complex<double> > Mout(B.size(), Ops[0].Q(), ss.str(), HERMITIAN);
308 for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis().qloc(),l);}
309
310 vector<complex<double> > phases_x_factor = phases;
311 for (int l=0; l<phases.size(); ++l)
312 {
313 phases_x_factor[l] = phases[l] * factor;
314 }
315
316 vector<SiteOperator<Symmetry,complex<double> > > OpsPlain(Ops.size());
317 for (int l=0; l<OpsPlain.size(); ++l)
318 {
319 OpsPlain[l] = Ops[l].template cast<complex<double> >(). template plain<complex<double> >();
320 }
321
322 Mout.setLocalSum(OpsPlain, phases_x_factor);
323
324 return Mout;
325}
326
327//-------------
328
329template<typename Symmetry, typename Scalar>
330template<typename Dummy>
331typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
332Scomp (SPINOP_LABEL Sa, size_t locx, size_t locy, double factor) const
333{
334 bool HERMITIAN = (Sa==SX or Sa==SZ)? true:false;
335 return make_local(locx,locy, B[locx].Scomp(Sa,locy).template cast<Scalar>(), factor, HERMITIAN);
336}
337
338template<typename Symmetry, typename Scalar>
339template<typename Dummy>
340typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
341Qcomp (SPINOP_LABEL Sa, size_t locx, size_t locy, double factor) const
342{
343 bool HERMITIAN = (Sa==QZ)? true:false;
344 return make_local(locx,locy, B[locx].Qcomp(Sa,locy).template cast<Scalar>(), factor, HERMITIAN);
345}
346
347template<typename Symmetry, typename Scalar>
348template<typename Dummy>
349typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,complex<double> > >::type HeisenbergObservables<Symmetry,Scalar>::
350Rcomp (SPINOP_LABEL Sa, size_t locx, size_t locy) const
351{
352 stringstream ss;
353 if (Sa==iSY)
354 {
355 ss << "exp[2Ï€" << Sa << "(" << locx << "," << locy << ")]";
356 }
357 else
358 {
359 ss << "exp[2Ï€i" << Sa << "(" << locx << "," << locy << ")]";
360 }
361
362 auto Op = B[locx].Rcomp(Sa,locy).template plain<complex<double> >();
363
364 Mpo<Symmetry,complex<double>> Mout(B.size(), Op.Q, ss.str(), false);
365 for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis().qloc(),l);}
366
367 Mout.setLocal(locx, Op);
368
369 return Mout;
370}
371
372template<typename Symmetry, typename Scalar>
373template<typename Dummy>
374typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
375ScompScomp (SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1, size_t locy2, double fac) const
376{
377 bool HERMITIAN = false;
378 if ((Sa1 == SZ and Sa2 == SZ) or (Sa1 == SX and Sa2 == SX)) HERMITIAN = true;
379 auto Qtot = B[locx1].Scomp(Sa1,locy1).Q() + B[locx2].Scomp(Sa2,locy2).Q();
380 return make_corr(locx1,locx2,locy1,locy2, B[locx1].Scomp(Sa1,locy1).template cast<Scalar>(), B[locx2].Scomp(Sa2,locy2).template cast<Scalar>(), Qtot, fac, HERMITIAN);
381}
382
383template<typename Symmetry, typename Scalar>
384template<typename Dummy>
385typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
386QcompQcomp (SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1, size_t locy2, double fac) const
387{
388 bool HERMITIAN = false;
389 if (Sa1 == QZ and Sa2 == QZ) HERMITIAN = true;
390 auto Qtot = B[locx1].Qcomp(Sa1,locy1).Q() + B[locx2].Qcomp(Sa2,locy2).Q();
391 return make_corr(locx1,locx2,locy1,locy2, B[locx1].Qcomp(Sa1,locy1).template cast<Scalar>(), B[locx2].Qcomp(Sa2,locy2).template cast<Scalar>(), Qtot, fac, HERMITIAN);
392}
393
394template<typename Symmetry, typename Scalar>
395template<typename Dummy>
396typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
397S (size_t locx, size_t locy, double factor) const
398{
399 return make_local(locx,locy, B[locx].S(locy), factor, PROP::NON_HERMITIAN);
400}
401
402template<typename Symmetry, typename Scalar>
403template<typename Dummy>
404typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
405Sdag (size_t locx, size_t locy, double factor) const
406{
407 return make_local(locx,locy, B[locx].Sdag(locy), factor, PROP::NON_HERMITIAN);
408}
409
410template<typename Symmetry, typename Scalar>
411template<typename Dummy>
412typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
413Q (size_t locx, size_t locy, double factor) const
414{
415 return make_local(locx,locy, B[locx].Q(locy), factor, PROP::NON_HERMITIAN);
416}
417
418template<typename Symmetry, typename Scalar>
419template<typename Dummy>
420typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
421Qdag (size_t locx, size_t locy, double factor) const
422{
423 return make_local(locx,locy, B[locx].Qdag(locy), factor, PROP::NON_HERMITIAN);
424}
425
426template<typename Symmetry, typename Scalar>
427template<typename Dummy>
428typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
429Sz (size_t locx, size_t locy) const
430{
431 return Scomp(SZ,locx,locy);
432}
433
434template<typename Symmetry, typename Scalar>
435template<typename Dummy>
436typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,complex<double> > >::type HeisenbergObservables<Symmetry,Scalar>::
437exp_ipiSz (size_t locx, size_t locy, double factor) const
438{
439 bool HERMITIAN = false;
440
441 assert(locx<B.size() and locy<B[locx].dim());
442 stringstream ss;
443 ss << B[locx].exp_ipiSz(locy).label() << "(" << locx << "," << locy;
444 if (factor != 1.) ss << ",factor=" << factor;
445 ss << ")";
446
447 Mpo<Symmetry,complex<double> > Mout(B.size(), B[locx].exp_ipiSz(locy).Q(), ss.str(), HERMITIAN);
448 for (size_t l=0; l<B.size(); ++l) Mout.setLocBasis(B[l].get_basis().qloc(),l);
449
450 Mout.setLocal(locx, (factor * B[locx].exp_ipiSz(locy)).template plain<complex<double> >().template cast<complex<double> >());
451
452 return Mout;
453}
454
455template<typename Symmetry, typename Scalar>
456template<typename Dummy>
457typename std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
458Scomptot (SPINOP_LABEL Sa, size_t locy, double factor, int dLphys) const
459{
460 vector<OperatorType> Ops(B.size());
461 vector<Scalar> factors(B.size());
462 for (int l=0; l<B.size(); ++l)
463 {
464 Ops[l] = B[l].Scomp(Sa,locy).template cast<Scalar>();
465 factors[l] = 0.;
466 }
467 for (int l=0; l<B.size(); l+=dLphys)
468 {
469 factors[l] = factor;
470 }
471 return make_localSum(Ops, factors, (Sa==SZ)?PROP::HERMITIAN:PROP::NON_HERMITIAN);
472}
473
474template<typename Symmetry, typename Scalar>
475template<typename Dummy>
476typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
477Stot (size_t locy, double factor, int dLphys) const
478{
479 vector<OperatorType> Ops(B.size());
480 vector<Scalar> factors(B.size());
481 for (int l=0; l<B.size(); ++l)
482 {
483 Ops[l] = B[l].S(locy).template cast<Scalar>();
484 factors[l] = 0.;
485 }
486 for (int l=0; l<B.size(); l+=dLphys)
487 {
488 factors[l] = factor;
489 }
490 return make_localSum(Ops, factors, PROP::NON_HERMITIAN);
491}
492
493template<typename Symmetry, typename Scalar>
494template<typename Dummy>
495typename std::enable_if<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
496Sdagtot (size_t locy, double factor, int dLphys) const
497{
498 vector<OperatorType> Ops(B.size());
499 vector<double> factors(B.size());
500 for (int l=0; l<B.size(); ++l)
501 {
502 Ops[l] = B[l].Sdag(locy);
503 factors[l] = 0.;
504 }
505 for (int l=0; l<B.size(); l+=dLphys)
506 {
507 factors[l] = factor;
508 }
509 return make_localSum(Ops, factors, PROP::NON_HERMITIAN);
510}
511
512template<typename Symmetry, typename Scalar>
513template<typename Dummy>
514typename std::conditional<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar>, vector<Mpo<Symmetry,Scalar> > >::type HeisenbergObservables<Symmetry,Scalar>::
515SdagS (size_t locx1, size_t locx2, size_t locy1, size_t locy2, double factor) const
516{
517 if constexpr (Symmetry::IS_SPIN_SU2())
518 {
519 return make_corr(locx1, locx2, locy1, locy2, B[locx1].Sdag(locy1), B[locx2].S(locy2), Symmetry::qvacuum(), factor*sqrt(3.), PROP::HERMITIAN);
520 }
521 else
522 {
523 vector<Mpo<Symmetry,Scalar> > out(3);
524 out[0] = SzSz(locx1,locx2,locy1,locy2);
525 out[1] = SpSm(locx1,locx2,locy1,locy2,0.5);
526 out[2] = SmSp(locx1,locx2,locy1,locy2,0.5);
527 return out;
528 }
529}
530
531template<typename Symmetry, typename Scalar>
532template<typename Dummy>
533typename std::conditional<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar>, vector<Mpo<Symmetry,Scalar> > >::type HeisenbergObservables<Symmetry,Scalar>::
534QdagQ (size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
535{
536 if constexpr (Symmetry::IS_SPIN_SU2())
537 {
538 return make_corr(locx1, locx2, locy1, locy2, B[locx1].Qdag(locy1), B[locx2].Q(locy2), Symmetry::qvacuum(), sqrt(5.), PROP::HERMITIAN);
539 }
540 else
541 {
542 vector<Mpo<Symmetry,Scalar> > out(5);
543 out[0] = QcompQcomp(QZ,QZ,locx1,locx2,locy1,locy2);
544 out[1] = QcompQcomp(QP,QM,locx1,locx2,locy1,locy2,0.5);
545 out[2] = QcompQcomp(QM,QP,locx1,locx2,locy1,locy2,0.5);
546 out[3] = QcompQcomp(QPZ,QMZ,locx1,locx2,locy1,locy2,0.5);
547 out[4] = QcompQcomp(QMZ,QPZ,locx1,locx2,locy1,locy2,0.5);
548 return out;
549 }
550}
551
552template<typename Symmetry, typename Scalar>
553template<typename Dummy>
554typename std::conditional<Dummy::IS_SPIN_SU2(), Mpo<Symmetry,Scalar>, vector<Mpo<Symmetry,Scalar> > >::type HeisenbergObservables<Symmetry,Scalar>::
555SdagSxS (size_t locx1, size_t locx2, size_t locx3, size_t locy1, size_t locy2, size_t locy3) const
556{
557 if constexpr (Symmetry::IS_SPIN_SU2())
558 {
559 Mpo<Symmetry,double> Mout(B.size(), Symmetry::qvacuum(), "SdagSxS", PROP::NON_HERMITIAN, false, BC::OPEN, DMRG::VERBOSITY::HALFSWEEPWISE);
560 for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis().qloc(),l);}
561
562 std::vector<typename Symmetry::qType> qList(B.size()+1);
563 std::vector<SiteOperator<Symmetry,double>> opList(B.size());
564
565 for (int i=0; i<qList.size(); ++i) {qList[i] = Symmetry::qvacuum();}
566 for (int i=0; i<opList.size(); ++i) {opList[i] = B[i].Id().template plain<double>();}
567
568 for (int i=0; i<B.size(); ++i)
569 {
570 if (i>=locx1 and i<locx3)
571 {
572 qList[1+i] = qarray<Symmetry::Nq>{3};
573 if (i==locx1)
574 {
575 opList[i] = (B[i].S(i)).template plain<double>();
576 }
577 else if (i==locx2)
578 {
579 opList[i] = (B[i].S(i)).template plain<double>();
580 }
581 }
582 else
583 {
584 opList[i] = (B[i].S(i)).template plain<double>();
585 }
586 }
587
588 for (int i=0; i<qList.size(); ++i)
589 {
590 cout << "i=" << i << ", q=" << qList[i] << endl;
591 }
592
593 Mout.push_qpath(locx1, opList, qList, 1.);
594
595 Mout.N_phys = B.size();
596 Mout.finalize(PROP::COMPRESS, 1); // power=1
597 Mout.precalc_TwoSiteData(true);
598
599 return Mout;
600 }
601 else
602 {
603 lout << "SdagSxS is not implemented for this symmetry!" << endl;
604 throw;
605 }
606}
607
608template<typename Symmetry, typename Scalar>
609template<typename Dummy>
610typename std::enable_if<Dummy::IS_SPIN_SU2(),Mpo<Symmetry,complex<double> > >::type HeisenbergObservables<Symmetry,Scalar>::
611S_ky (vector<complex<double> > phases) const
612{
613 vector<OperatorType> Ops(B.size());
614 for (size_t l=0; l<B.size(); ++l)
615 {
616 Ops[l] = B[l].S(0);
617 }
618 return make_FourierYSum("S", Ops, 1., false, phases);
619}
620
621template<typename Symmetry, typename Scalar>
622template<typename Dummy>
623typename std::enable_if<Dummy::IS_SPIN_SU2(),Mpo<Symmetry,complex<double> > >::type HeisenbergObservables<Symmetry,Scalar>::
624Sdag_ky (vector<complex<double> > phases, double factor) const
625{
626 vector<OperatorType> Ops(B.size());
627 for (size_t l=0; l<B.size(); ++l)
628 {
629 Ops[l] = B[l].Sdag(0);
630 }
631 return make_FourierYSum("S†", Ops, 1., false, phases);
632}
633
634template<typename Symmetry, typename Scalar>
635template<typename Dummy>
636typename std::enable_if<!Dummy::IS_SPIN_SU2(),Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
637String (STRING STR, size_t locx, size_t locy) const
638{
639 return make_local(locx, locy, B[locx].Scomp(STRING_TO_SPINOP(STR),locy), 1., false, STR);
640}
641
642template<typename Symmetry, typename Scalar>
643template<typename Dummy>
644typename std::enable_if<!Dummy::IS_SPIN_SU2(),Mpo<Symmetry,Scalar> >::type HeisenbergObservables<Symmetry,Scalar>::
645StringCorr (STRING STR, size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
646{
648 auto Qtot = B[locx1].Scomp(Sa,locy1).Q() + B[locx2].Scomp(Sa,locy2).Q();
649 // factor -1 because of Sa*exp(i*pi*Sa) = -Sa
650 return make_corr(locx1, locx2, locy1, locy2, B[locx1].Scomp(Sa,locy1), B[locx2].Scomp(Sa,locy2), Qtot, -1., false, STR);
651}
652
653// template<typename Symmetry, typename Scalar>
654// Mpo<Symmetry,Scalar> HeisenbergObservables<Symmetry,Scalar>::
655// Scomp (SPINOP_LABEL Sa, size_t locx, size_t locy, double factor) const
656// {
657// assert(locx<B.size() and locy<B[locx].dim());
658// stringstream ss;
659// ss << Sa << "(" << locx << "," << locy << ")";
660
661// OperatorType Op = factor * B[locx].Scomp(Sa,locy);
662
663// bool HERMITIAN = (Sa==SX or Sa==SZ)? true:false;
664
665// Mpo<Symmetry,Scalar> Mout(B.size(), Op.Q, ss.str(), HERMITIAN);
666// for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis(),l);}
667
668// Mout.setLocal(locx,Op);
669// return Mout;
670// }
671
672// template<typename Symmetry, typename Scalar>
673// Mpo<Symmetry,complex<double>> HeisenbergObservables<Symmetry,Scalar>::
674// Rcomp (SPINOP_LABEL Sa, size_t locx, size_t locy) const
675// {
676// assert(locx<B.size() and locy<B[locx].dim());
677// stringstream ss;
678// if (Sa==iSY)
679// {
680// ss << "exp[1/S*Ï€*" << Sa << "](" << locx << "," << locy << ")]";
681// }
682// else
683// {
684// ss << "exp[1/S*Ï€*i" << Sa << "](" << locx << "," << locy << ")]";
685// }
686
687// auto Op = B[locx].Rcomp(Sa,locy);
688
689// Mpo<Symmetry,complex<double>> Mout(B.size(), Op.Q, ss.str(), false);
690// for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis(),l);}
691
692// Mout.setLocal(locx,Op);
693// return Mout;
694// }
695
696// template<typename Symmetry, typename Scalar>
697// Mpo<Symmetry,Scalar> HeisenbergObservables<Symmetry,Scalar>::
698// n (size_t locx, size_t locy) const
699// {
700// assert(locx<B.size() and locy<B[locx].dim());
701// stringstream ss;
702// ss << "n(" << locx << "," << locy << ")";
703
704// OperatorType Op = B[locx].n(locy);
705
706// Mpo<Symmetry,Scalar> Mout(B.size(), Op.Q, ss.str(), true);
707// for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis(),l);}
708
709// Mout.setLocal(locx,Op);
710// return Mout;
711// }
712
713// template<typename Symmetry, typename Scalar>
714// Mpo<Symmetry,Scalar> HeisenbergObservables<Symmetry,Scalar>::
715// ScompScomp (SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1, size_t locy2, double fac) const
716// {
717// assert(locx1<B.size() and locx2<B.size() and locy1<B[locx1].dim() and locy2<B[locx2].dim());
718// stringstream ss;
719// ss << Sa1 << "(" << locx1 << "," << locy1 << ")" << Sa2 << "(" << locx2 << "," << locy2 << ")";
720
721// OperatorType Op1 = B[locx1].Scomp(Sa1,locy1);
722// OperatorType Op2 = B[locx2].Scomp(Sa2,locy2);
723
724// bool HERMITIAN = (Sa1==Sa2 and (Sa1==SZ or Sa1==SX) and locx1==locx2 and locy1==locy2)? true:false;
725
726// Mpo<Symmetry,Scalar> Mout(B.size(), Op1.Q+Op2.Q, ss.str(), HERMITIAN);
727// for (size_t l=0; l<B.size(); ++l) {Mout.setLocBasis(B[l].get_basis(),l);}
728
729// Mout.setLocal({locx1,locx2}, {fac*Op1,Op2});
730// return Mout;
731// }
732
733// template<typename Symmetry, typename Scalar>
734// vector<Mpo<Symmetry,Scalar> >HeisenbergObservables<Symmetry,Scalar>::
735// SdagS (size_t locx1, size_t locx2, size_t locy1, size_t locy2) const
736// {
737// vector<Mpo<Symmetry,Scalar> > out(3);
738// out[0] = SzSz(locx1,locx2,locy1,locy2);
739// out[1] = SpSm(locx1,locx2,locy1,locy2,0.5);
740// out[2] = SmSp(locx1,locx2,locy1,locy2,0.5);
741// return out;
742// }
743
744
745template<typename Symmetry, typename Scalar>
746std::vector<Mpo<Symmetry,Scalar>> HeisenbergObservables<Symmetry,Scalar>::
747make_spinPermutation (const Permutation& permutations) const
748{
749 auto check_locs = [this](std::size_t& locx1, std::size_t& locx2, std::size_t& locy1, std::size_t& locy2)
750 {
751 assert(locx1 < B.size() and locx2 < B.size());
752 assert(locy1 < B[locx1].dim() and locy2 < B[locx2].dim());
753 assert(locx1 != locx2 or locy1 != locy2);
754 if(locx1 > locx2)
755 {
756 std::swap(locx1,locx2);
757 std::swap(locy1,locy2);
758 }
759 };
760 std::size_t D = B[0].get_D();
761 assert(D == 2ul or D == 3ul);
762 for (size_t loc=0; loc<B.size(); ++loc)
763 {
764 assert(B[loc].get_D() == D);
765 }
766 Stopwatch<> watch;
767 std::vector<std::vector<Transposition>> transpositions = permutations.independentTranspositions();
768 std::size_t divisions = transpositions.size();
769 std::vector<Mpo<Symmetry,Scalar>> Mout(divisions);
770 for(std::size_t div=0; div<divisions; ++div)
771 {
772 std::size_t locx1 = transpositions[div][0].source;
773 std::size_t locx2 = transpositions[div][0].target;
774 std::size_t locy1 = 0ul;
775 std::size_t locy2 = 0ul;
776 check_locs(locx1,locx2,locy1,locy2);
777 MpoTerms<Symmetry,double> terms = (D == 2ul ? spin_swap_operator_D2(locx1,locx2,locy1,locy2) : spin_swap_operator_D3(locx1,locx2,locy1,locy2));
778 for (std::size_t t=1; t<transpositions[div].size(); ++t)
779 {
780 std::size_t locx1 = transpositions[div][t].source;
781 std::size_t locx2 = transpositions[div][t].target;
782 std::size_t locy1 = 0ul;
783 std::size_t locy2 = 0ul;
784 check_locs(locx1,locx2,locy1,locy2);
785 terms = (D == 2ul ? MpoTerms<Symmetry,double>::prod(spin_swap_operator_D2(locx1,locx2,locy1,locy2),terms,Symmetry::qvacuum()) : MpoTerms<Symmetry,double>::prod(spin_swap_operator_D3(locx1,locx2,locy1,locy2),terms,Symmetry::qvacuum()));
786 }
787 std::stringstream ss;
788 ss << "Spin permutation";
789 if(divisions>1)
790 {
791 ss << " " << div+1 << "/" << divisions;
792 }
793 ss << ": " << terms.get_name();
794 terms.set_name(ss.str());
795 Mout[div] = terms;
796 Mout[div].UNITARY = true;
797 }
798 lout << "Construction of spin permutation operator: " << watch.info("Time") << std::endl;
799 return Mout;
800}
801
802template<typename Symmetry, typename Scalar>
804spin_swap_operator_D2 (const std::size_t locx1, const std::size_t locx2, const std::size_t locy1, const std::size_t locy2) const
805{
806 MpoTerms<Symmetry,double> Tout(B.size());
807 for (size_t loc=0; loc<B.size(); ++loc)
808 {
809 Tout.setLocBasis(B[loc].get_basis().qloc(),loc);
810 }
811 if(locx1 == locx2)
812 {
813 SiteOperator<Symmetry,double> identity = B[locx1].Id().template plain<double>();
814 Tout.push(locx1,{identity},0.5);
815 if constexpr (Symmetry::IS_SPIN_SU2())
816 {
817 SiteOperator<Symmetry,double> SdagS = (OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].S(locy2), {1})).template plain<double>();
818 Tout.push(locx1,{SdagS},2.*std::sqrt(3.));
819 }
820 else
821 {
822 SiteOperator<Symmetry,double> SzSz = (OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sz(locy2), {0})).template plain<double>();
823 SiteOperator<Symmetry,double> SpSm = (OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sm(locy2), {0})).template plain<double>();
824 SiteOperator<Symmetry,double> SmSp = (OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sp(locy2), {0})).template plain<double>();
825 Tout.push(locx1,{SzSz},2.);
826 Tout.push(locx1,{SpSm},1.);
827 Tout.push(locx1,{SmSp},1.);
828 }
829 }
830 else
831 {
832 std::vector<SiteOperator<Symmetry,double>> opList(locx2-locx1+1);
833 for(int j=0; j<-1+locx2-locx1; ++j)
834 {
835 opList[j+1] = (B[j].Id().template plain<double>());
836 }
837 SiteOperator<Symmetry,double> &first_op = opList[0];
838 SiteOperator<Symmetry,double> &last_op = opList[locx2-locx1];
839 first_op = B[locx1].Id().template plain<double>();
840 last_op = B[locx2].Id().template plain<double>();
841 Tout.push(locx1,opList,0.5);
842
843 if constexpr (Symmetry::IS_SPIN_SU2())
844 {
845 first_op = (B[locx1].Sdag(locy1).template plain<double>());
846 last_op = (B[locx2].S(locy2).template plain<double>());
847 Tout.push(locx1,opList,2.*std::sqrt(3));
848 }
849 else
850 {
851 first_op = (B[locx1].Sz(locy1).template plain<double>());
852 last_op = (B[locx2].Sz(locy2).template plain<double>());
853 Tout.push(locx1,opList,2.);
854
855 first_op = (B[locx1].Sp(locy1).template plain<double>());
856 last_op = (B[locx2].Sm(locy2).template plain<double>());
857 Tout.push(locx1,opList,1.);
858
859 first_op = (B[locx1].Sm(locy1).template plain<double>());
860 last_op = (B[locx2].Sp(locy2).template plain<double>());
861 Tout.push(locx1,opList,1.);
862 }
863 }
864 Tout.finalize(true,1);
865 std::stringstream ss;
866 ss << "(" << locx1 << "<->" << locx2 << ")";
867 Tout.set_name(ss.str());
868 return Tout;
869}
870
871template<typename Symmetry, typename Scalar>
873Psinglet (const std::size_t locx1, const std::size_t locx2, const std::size_t locy1, const std::size_t locy2) const
874{
875 MpoTerms<Symmetry,double> Tout(B.size());
876 for (size_t loc=0; loc<B.size(); ++loc)
877 {
878 Tout.setLocBasis(B[loc].get_basis().qloc(),loc);
879 }
880 if(locx1 == locx2)
881 {
882 SiteOperator<Symmetry,double> identity = B[locx1].Id().template plain<double>();
883 Tout.push(locx1,{identity},0.25);
884 if constexpr (Symmetry::IS_SPIN_SU2())
885 {
886 SiteOperator<Symmetry,double> SdagS = (OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].S(locy2), {1})).template plain<double>();
887 Tout.push(locx1,{SdagS},-1.*std::sqrt(3.));
888 }
889 else
890 {
891 SiteOperator<Symmetry,double> SzSz = (OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sz(locy2), {0})).template plain<double>();
892 SiteOperator<Symmetry,double> SpSm = (OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sm(locy2), {0})).template plain<double>();
893 SiteOperator<Symmetry,double> SmSp = (OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sp(locy2), {0})).template plain<double>();
894 Tout.push(locx1,{SzSz},-1.);
895 Tout.push(locx1,{SpSm},-0.5);
896 Tout.push(locx1,{SmSp},-0.5);
897 }
898 }
899 else
900 {
901 std::vector<SiteOperator<Symmetry,double>> opList(locx2-locx1+1);
902 for(int j=0; j<-1+locx2-locx1; ++j)
903 {
904 opList[j+1] = (B[j].Id().template plain<double>());
905 }
906 SiteOperator<Symmetry,double> &first_op = opList[0];
907 SiteOperator<Symmetry,double> &last_op = opList[locx2-locx1];
908 first_op = B[locx1].Id().template plain<double>();
909 last_op = B[locx2].Id().template plain<double>();
910 Tout.push(locx1,opList,0.25);
911
912 if constexpr (Symmetry::IS_SPIN_SU2())
913 {
914 first_op = (B[locx1].Sdag(locy1).template plain<double>());
915 last_op = (B[locx2].S(locy2).template plain<double>());
916 Tout.push(locx1,opList,-1.*std::sqrt(3));
917 }
918 else
919 {
920 first_op = (B[locx1].Sz(locy1).template plain<double>());
921 last_op = (B[locx2].Sz(locy2).template plain<double>());
922 Tout.push(locx1,opList,-1.);
923
924 first_op = (B[locx1].Sp(locy1).template plain<double>());
925 last_op = (B[locx2].Sm(locy2).template plain<double>());
926 Tout.push(locx1,opList,-0.5);
927
928 first_op = (B[locx1].Sm(locy1).template plain<double>());
929 last_op = (B[locx2].Sp(locy2).template plain<double>());
930 Tout.push(locx1,opList,-0.5);
931 }
932 }
933 Tout.finalize(true,1);
934 std::stringstream ss;
935 ss << "Psinglet(" << locx1 << "," << locx2 << ")";
936 Tout.set_name(ss.str());
937 return Tout;
938}
939
940template<typename Symmetry, typename Scalar>
942spin_swap_operator_D3 (const std::size_t locx1, const std::size_t locx2, const std::size_t locy1, const std::size_t locy2) const
943{
944 MpoTerms<Symmetry,double> Tout(B.size());
945 for (size_t loc=0; loc<B.size(); ++loc)
946 {
947 Tout.setLocBasis(B[loc].get_basis().qloc(),loc);
948 }
949 if(locx1 == locx2)
950 {
951 SiteOperator<Symmetry,double> identity = B[locx1].Id().template plain<double>();
952 Tout.push(locx1,{identity},-1.);
953 if constexpr (Symmetry::IS_SPIN_SU2())
954 {
955 SiteOperator<Symmetry,double> SdagS = (OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].S(locy2), {1})).template plain<double>();
956 Tout.push(locx1,{SdagS},std::sqrt(3.));
957
958 OperatorType SdagSdag_singl = OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].Sdag(locy1), {1});
959 OperatorType SS_singl = OperatorType::prod(B[locx2].S(locy2), B[locx2].S(locy2), {1});
960 SiteOperator<Symmetry,double> SdagSdagSS_singl = (OperatorType::prod(SdagSdag_singl, SS_singl, {1})).template plain<double>();
961 Tout.push(locx1,{SdagSdagSS_singl},1.);
962
963 OperatorType SdagSdag_tripl = OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].Sdag(locy1), {3});
964 OperatorType SS_tripl = OperatorType::prod(B[locx2].S(locy2), B[locx2].S(locy2), {3});
965 SiteOperator<Symmetry,double> SdagSdagSS_tripl = (OperatorType::prod(SdagSdag_tripl, SS_tripl, {1})).template plain<double>();
966 Tout.push(locx1,{SdagSdagSS_tripl},std::sqrt(3.));
967
968 OperatorType SdagSdag_quint = OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].Sdag(locy1), {5});
969 OperatorType SS_quint = OperatorType::prod(B[locx2].S(locy2), B[locx2].S(locy2), {5});
970 SiteOperator<Symmetry,double> SdagSdagSS_quint = (OperatorType::prod(SdagSdag_quint, SS_quint, {1})).template plain<double>();
971 Tout.push(locx1,{SdagSdagSS_quint},std::sqrt(5.));
972 }
973 else
974 {
975 SiteOperator<Symmetry,double> SzSz = (OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sz(locy2), {0})).template plain<double>();
976 SiteOperator<Symmetry,double> SpSm = (OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sm(locy2), {0})).template plain<double>();
977 SiteOperator<Symmetry,double> SmSp = (OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sp(locy2), {0})).template plain<double>();
978 Tout.push(locx1,{SzSz},1.);
979 Tout.push(locx1,{SpSm},0.5);
980 Tout.push(locx1,{SmSp},0.5);
981
982 OperatorType SzSz_1 = OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sz(locy1), {0});
983 OperatorType SzSp_1 = OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sp(locy1), {2});
984 OperatorType SzSm_1 = OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sm(locy1), {-2});
985 OperatorType SpSz_1 = OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sz(locy1), {2});
986 OperatorType SpSp_1 = OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sp(locy1), {4});
987 OperatorType SpSm_1 = OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sm(locy1), {0});
988 OperatorType SmSz_1 = OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sz(locy1), {-2});
989 OperatorType SmSp_1 = OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sp(locy1), {0});
990 OperatorType SmSm_1 = OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sm(locy1), {-4});
991 OperatorType SzSz_2 = OperatorType::prod(B[locx2].Sz(locy2), B[locx2].Sz(locy2), {0});
992 OperatorType SzSp_2 = OperatorType::prod(B[locx2].Sz(locy2), B[locx2].Sp(locy2), {2});
993 OperatorType SzSm_2 = OperatorType::prod(B[locx2].Sz(locy2), B[locx2].Sm(locy2), {-2});
994 OperatorType SpSz_2 = OperatorType::prod(B[locx2].Sp(locy2), B[locx2].Sz(locy2), {2});
995 OperatorType SpSp_2 = OperatorType::prod(B[locx2].Sp(locy2), B[locx2].Sp(locy2), {4});
996 OperatorType SpSm_2 = OperatorType::prod(B[locx2].Sp(locy2), B[locx2].Sm(locy2), {0});
997 OperatorType SmSz_2 = OperatorType::prod(B[locx2].Sm(locy2), B[locx2].Sz(locy2), {-2});
998 OperatorType SmSp_2 = OperatorType::prod(B[locx2].Sm(locy2), B[locx2].Sp(locy2), {0});
999 OperatorType SmSm_2 = OperatorType::prod(B[locx2].Sm(locy2), B[locx2].Sm(locy2), {-4});
1000
1001 SiteOperator<Symmetry,double> SzSzSzSz = (OperatorType::prod(SzSz_1,SzSz_2,{0})).template plain<double>();
1002 SiteOperator<Symmetry,double> SzSpSzSm = (OperatorType::prod(SzSp_1,SzSm_2,{0})).template plain<double>();
1003 SiteOperator<Symmetry,double> SpSzSmSz = (OperatorType::prod(SpSz_1,SmSz_2,{0})).template plain<double>();
1004 SiteOperator<Symmetry,double> SzSmSzSp = (OperatorType::prod(SzSm_1,SzSp_2,{0})).template plain<double>();
1005 SiteOperator<Symmetry,double> SmSzSpSz = (OperatorType::prod(SmSz_1,SpSz_2,{0})).template plain<double>();
1006 SiteOperator<Symmetry,double> SpSpSmSm = (OperatorType::prod(SpSp_1,SmSm_2,{0})).template plain<double>();
1007 SiteOperator<Symmetry,double> SmSmSpSp = (OperatorType::prod(SmSm_1,SpSp_2,{0})).template plain<double>();
1008 SiteOperator<Symmetry,double> SpSmSmSp = (OperatorType::prod(SpSm_1,SmSp_2,{0})).template plain<double>();
1009 SiteOperator<Symmetry,double> SmSpSpSm = (OperatorType::prod(SmSp_1,SpSm_2,{0})).template plain<double>();
1010
1011 Tout.push(locx1,{SzSzSzSz},1.);
1012 Tout.push(locx1,{SzSpSzSm},0.5);
1013 Tout.push(locx1,{SzSmSzSp},0.5);
1014 Tout.push(locx1,{SpSzSmSz},0.5);
1015 Tout.push(locx1,{SmSzSpSz},0.5);
1016 Tout.push(locx1,{SpSmSmSp},0.25);
1017 Tout.push(locx1,{SmSpSpSm},0.25);
1018 Tout.push(locx1,{SpSpSmSm},0.25);
1019 Tout.push(locx1,{SmSmSpSp},0.25);
1020 }
1021 }
1022 else
1023 {
1024 std::vector<SiteOperator<Symmetry,double>> opList(locx2-locx1+1);
1025 for(int j=0; j<-1+locx2-locx1; ++j)
1026 {
1027 opList[j+1] = (B[j].Id().template plain<double>());
1028 }
1029 SiteOperator<Symmetry,double> &first_op = opList[0];
1030 SiteOperator<Symmetry,double> &last_op = opList[locx2-locx1];
1031 first_op = B[locx1].Id().template plain<double>();
1032 last_op = B[locx2].Id().template plain<double>();
1033 Tout.push(locx1,opList,-1.);
1034
1035 if constexpr (Symmetry::IS_SPIN_SU2())
1036 {
1037 first_op = (B[locx1].Sdag(locy1).template plain<double>());
1038 last_op = (B[locx2].S(locy2).template plain<double>());
1039 Tout.push(locx1,opList,std::sqrt(3.));
1040
1041 first_op = (OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].Sdag(locy1), {1})).template plain<double>();
1042 last_op = (OperatorType::prod(B[locx2].S(locy2), B[locx2].S(locy2), {1})).template plain<double>();
1043 Tout.push(locx1,opList,1.);
1044
1045 first_op = (OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].Sdag(locy1), {3})).template plain<double>();
1046 last_op = (OperatorType::prod(B[locx2].S(locy2), B[locx2].S(locy2), {3})).template plain<double>();
1047 Tout.push(locx1,opList,std::sqrt(3.));
1048
1049 first_op = (OperatorType::prod(B[locx1].Sdag(locy1), B[locx1].Sdag(locy1), {5})).template plain<double>();
1050 last_op = (OperatorType::prod(B[locx2].S(locy2), B[locx2].S(locy2), {5})).template plain<double>();
1051 Tout.push(locx1,opList,std::sqrt(5.));
1052 }
1053 else
1054 {
1055 first_op = (B[locx1].Sz(locy1).template plain<double>());
1056 last_op = (B[locx2].Sz(locy2).template plain<double>());
1057 Tout.push(locx1,opList,1.);
1058
1059 first_op = (B[locx1].Sp(locy1).template plain<double>());
1060 last_op = (B[locx2].Sm(locy2).template plain<double>());
1061 Tout.push(locx1,opList,0.5);
1062
1063 first_op = (B[locx1].Sm(locy1).template plain<double>());
1064 last_op = (B[locx2].Sp(locy2).template plain<double>());
1065 Tout.push(locx1,opList,0.5);
1066
1067 first_op = (OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sz(locy1), {0})).template plain<double>();
1068 last_op = (OperatorType::prod(B[locx2].Sz(locy2), B[locx2].Sz(locy2), {0})).template plain<double>();
1069 Tout.push(locx1,opList,1.);
1070
1071 first_op = (OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sp(locy1), {2})).template plain<double>();
1072 last_op = (OperatorType::prod(B[locx2].Sz(locy2), B[locx2].Sm(locy2), {-2})).template plain<double>();
1073 Tout.push(locx1,opList,0.5);
1074
1075 first_op = (OperatorType::prod(B[locx1].Sz(locy1), B[locx1].Sm(locy1), {-2})).template plain<double>();
1076 last_op = (OperatorType::prod(B[locx2].Sz(locy2), B[locx2].Sp(locy2), {2})).template plain<double>();
1077 Tout.push(locx1,opList,0.5);
1078
1079 first_op = (OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sz(locy1), {2})).template plain<double>();
1080 last_op = (OperatorType::prod(B[locx2].Sm(locy2), B[locx2].Sz(locy2), {-2})).template plain<double>();
1081 Tout.push(locx1,opList,0.5);
1082
1083 first_op = (OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sp(locy1), {4})).template plain<double>();
1084 last_op = (OperatorType::prod(B[locx2].Sm(locy2), B[locx2].Sm(locy2), {-4})).template plain<double>();
1085 Tout.push(locx1,opList,0.25);
1086
1087 first_op = (OperatorType::prod(B[locx1].Sp(locy1), B[locx1].Sm(locy1), {0})).template plain<double>();
1088 last_op = (OperatorType::prod(B[locx2].Sm(locy2), B[locx2].Sp(locy2), {0})).template plain<double>();
1089 Tout.push(locx1,opList,0.25);
1090
1091 first_op = (OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sz(locy1), {-2})).template plain<double>();
1092 last_op = (OperatorType::prod(B[locx2].Sp(locy2), B[locx2].Sz(locy2), {2})).template plain<double>();
1093 Tout.push(locx1,opList,0.5);
1094
1095 first_op = (OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sp(locy1), {0})).template plain<double>();
1096 last_op = (OperatorType::prod(B[locx2].Sp(locy2), B[locx2].Sm(locy2), {0})).template plain<double>();
1097 Tout.push(locx1,opList,0.25);
1098
1099 first_op = (OperatorType::prod(B[locx1].Sm(locy1), B[locx1].Sm(locy1), {-4})).template plain<double>();
1100 last_op = (OperatorType::prod(B[locx2].Sp(locy2), B[locx2].Sp(locy2), {4})).template plain<double>();
1101 Tout.push(locx1,opList,0.25);
1102 }
1103 }
1104 Tout.finalize(true,1);
1105 std::stringstream ss;
1106 ss << "(" << locx1 << "<->" << locx2 << ")";
1107 Tout.set_name(ss.str());
1108 return Tout;
1109}
1110#endif
size_t dim(const PivotMatrix0< Symmetry, Scalar, MpoScalar > &H)
SPINOP_LABEL
Definition: DmrgTypedefs.h:60
@ QZ
Definition: DmrgTypedefs.h:60
@ iSY
Definition: DmrgTypedefs.h:60
@ QM
Definition: DmrgTypedefs.h:60
@ QP
Definition: DmrgTypedefs.h:60
@ SZ
Definition: DmrgTypedefs.h:60
@ SP
Definition: DmrgTypedefs.h:60
@ SX
Definition: DmrgTypedefs.h:60
@ QPZ
Definition: DmrgTypedefs.h:60
@ SM
Definition: DmrgTypedefs.h:60
@ QMZ
Definition: DmrgTypedefs.h:60
@ OPEN
Definition: DmrgTypedefs.h:163
@ B
Definition: DmrgTypedefs.h:130
SPINOP_LABEL STRING_TO_SPINOP(STRING STR)
Definition: DmrgTypedefs.h:89
STRING
Definition: DmrgTypedefs.h:78
@ NOSTRING
Definition: DmrgTypedefs.h:78
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Q(size_t locx, size_t locy=0, double factor=1.) const
Mpo< Symmetry, Scalar > make_localSum(const vector< OperatorType > &Op, vector< Scalar > factor, bool HERMITIAN) const
HeisenbergObservables(const size_t &L)
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type String(STRING STR, size_t locx, size_t locy=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Qcomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type QcompQcomp(SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const
std::vector< Mpo< Symmetry, Scalar > > make_spinPermutation(const Permutation &permutations) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type iSy(size_t locx, size_t locy=0) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Qdag(size_t locx, size_t locy=0, double factor=std::sqrt(5.)) const
vector< SpinBase< Symmetry > > B
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, complex< double > > >::type S_ky(vector< complex< double > > phases) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, complex< double > > >::type Sa_ky(SPINOP_LABEL Sa, vector< complex< double > > phases) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Sm(size_t locx, size_t locy=0) const
Mpo< Symmetry, complex< double > > make_FourierYSum(string name, const vector< OperatorType > &Ops, double factor, bool HERMITIAN, const vector< complex< double > > &phases) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Sp(size_t locx, size_t locy=0) const
std::enable_if< Dummy::NO_SPIN_SYM(), Mpo< Symmetry, Scalar > >::type SxSx(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type ScompScomp(SPINOP_LABEL Sa1, SPINOP_LABEL Sa2, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type SmSp(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type SpSm(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double fac=1.) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Sdag(size_t locx, size_t locy=0, double factor=std::sqrt(3.)) const
std::conditional< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar >, vector< Mpo< Symmetry, Scalar > > >::type SdagS(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0, double factor=1.) const
std::conditional< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar >, vector< Mpo< Symmetry, Scalar > > >::type SdagSxS(size_t locx1, size_t locx2, size_t locx3, size_t locy1=0, size_t locy2=0, size_t locy3=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type SzSz(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Sx(size_t locx, size_t locy=0) const
Mpo< Symmetry, Scalar > make_local(size_t locx, size_t locy, const OperatorType &Op, double factor=1., bool HERMITIAN=false, STRING STR=NOSTRING) const
MpoTerms< Symmetry, double > spin_swap_operator_D2(const std::size_t locx1, const std::size_t locx2, const std::size_t locy1=0ul, const std::size_t locy2=0ul) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, complex< double > > >::type exp_ipiSz(size_t locx, size_t locy=0, double factor=1.) const
Mpo< Symmetry, Scalar > make_corr(size_t locx1, size_t locx2, size_t locy1, size_t locy2, const OperatorType &Op1, const OperatorType &Op2, qarray< Symmetry::Nq > Qtot, double factor, bool HERMITIAN, STRING STR=NOSTRING) const
SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Dynamic, Dynamic > > OperatorType
HeisenbergObservables(const size_t &L, const vector< Param > &params, const std::map< string, std::any > &defaults)
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type StringCorr(STRING STR, size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Scomptot(SPINOP_LABEL Sa, size_t locy1=0, double factor=1., int dLphys=1) const
std::conditional< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar >, vector< Mpo< Symmetry, Scalar > > >::type QdagQ(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Scomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const
MpoTerms< Symmetry, double > Psinglet(const std::size_t locx1, const std::size_t locx2, const std::size_t locy1=0ul, const std::size_t locy2=0ul) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type S(size_t locx, size_t locy=0, double factor=1.) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Stot(size_t locy1=0, double factor=1., int dLphys=1) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, complex< double > > >::type Rcomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Sz(size_t locx, size_t locy=0) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, Scalar > >::type Sdagtot(size_t locy1=0, double factor=std::sqrt(3.), int dLphys=1) const
MpoTerms< Symmetry, double > spin_swap_operator_D3(const std::size_t locx1, const std::size_t locx2, const std::size_t locy1=0ul, const std::size_t locy2=0ul) const
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Symmetry, complex< double > > >::type Sdag_ky(vector< complex< double > > phases, double factor=sqrt(3.)) const
static MpoTerms< Symmetry, Scalar > prod(const MpoTerms< Symmetry, Scalar > &top, const MpoTerms< Symmetry, Scalar > &bottom, const qType &qTot, const double tolerance=::mynumeric_limits< double >::epsilon())
Definition: MpoTerms.h:3289
std::vector< std::vector< std::string > > info
Definition: MpoTerms.h:86
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
void setLocBasis(const std::vector< std::vector< qType > > &q)
Definition: MpoTerms.h:715
virtual void push(const std::size_t loc, const std::vector< OperatorType > &opList, const std::vector< qType > &qList, const Scalar lambda=1.0)
Definition: MpoTerms.h:893
const std::string get_name() const
Definition: MpoTerms.h:476
void set_name(const std::string &label_in)
Definition: MpoTerms.h:471
Definition: Mpo.h:40
void setLocal(std::size_t loc, const OperatorType &op)
void setLocalSum(const OperatorType &op, Scalar(*f)(int)=localSumTrivial)
void precalc_TwoSiteData(bool FORCE=false)
void push_qpath(const std::size_t loc, const std::vector< OperatorType > &opList, const std::vector< qType > &qList, const Scalar lambda=1.0)
Definition: Mpo.h:75
std::string & label()
const bool COMPRESS
Definition: DmrgTypedefs.h:499
const bool NON_HERMITIAN
Definition: DmrgTypedefs.h:493
const bool HERMITIAN
Definition: DmrgTypedefs.h:492
Definition: qarray.h:26