Xped
Loading...
Searching...
No Matches
FermionBase.hpp
Go to the documentation of this file.
1#ifndef XPED_FERMIONBASE_HPP_
2#define XPED_FERMIONBASE_HPP_
3
4#include <sstream>
5
13
14namespace Xped {
15
16// Note: Don't put a name in this documentation with \class .. because doxygen gets confused with template symbols
23template <typename Symmetry_>
24class FermionBase : public Fermion<Symmetry_>
25{
26 using Scalar = double;
27
28public:
29 using Symmetry = Symmetry_;
32 using qType = typename Symmetry::qType;
33
34 FermionBase() = default;
35
39 FermionBase(std::size_t L_input, bool REMOVE_DOUBLE = false, bool REMVOVE_EMPTY = false, bool REMOVE_SINGLE = false);
40
42 inline std::size_t dim() const { return N_states; }
43
45 inline std::size_t orbitals() const { return N_orbitals; }
46
48
60 template <class Dummy = Symmetry>
61 typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), OperatorType>::type c(std::size_t orbital = 0) const;
62
63 template <class Dummy = Symmetry>
64 typename std::enable_if<!Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), OperatorType>::type c(SPIN_INDEX sigma, std::size_t orbital = 0) const;
65
66 template <class Dummy = Symmetry>
67 typename std::enable_if<Dummy::IS_CHARGE_SU2() and !Dummy::IS_SPIN_SU2(), OperatorType>::type
68 c(SPIN_INDEX sigma, SUB_LATTICE G, std::size_t orbital = 0) const;
69
70 template <class Dummy = Symmetry>
71 typename std::enable_if<Dummy::IS_CHARGE_SU2() and Dummy::IS_SPIN_SU2(), OperatorType>::type c(SUB_LATTICE G, std::size_t orbital = 0) const;
72
86 template <class Dummy = Symmetry>
87 typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), OperatorType>::type cdag(std::size_t orbital = 0) const;
88
89 template <class Dummy = Symmetry>
90 typename std::enable_if<!Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), OperatorType>::type cdag(SPIN_INDEX sigma,
91 std::size_t orbital = 0) const;
92
93 template <class Dummy = Symmetry>
94 typename std::enable_if<Dummy::IS_CHARGE_SU2() and !Dummy::IS_SPIN_SU2(), OperatorType>::type
95 cdag(SPIN_INDEX sigma, SUB_LATTICE G, std::size_t orbital = 0) const;
96
97 template <class Dummy = Symmetry>
98 typename std::enable_if<Dummy::IS_CHARGE_SU2() and Dummy::IS_SPIN_SU2(), OperatorType>::type cdag(SUB_LATTICE G, std::size_t orbital = 0) const;
99
105 OperatorType sign(std::size_t orb1 = 0, std::size_t orb2 = 0) const;
106
111 OperatorType sign_local(std::size_t orbital = 0) const;
112
117 template <class Dummy = Symmetry>
118 typename std::enable_if<true, OperatorType>::type n(std::size_t orbital = 0) const;
119
120 template <class Dummy = Symmetry>
121 typename std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType>::type n(SPIN_INDEX sigma, std::size_t orbital = 0) const;
122
127 template <class Dummy = Symmetry>
128 typename std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType>::type d(std::size_t orbital = 0) const;
129
134 OperatorType ns(std::size_t orbital = 0) const;
135
140 OperatorType nh(std::size_t orbital = 0) const;
142
144
148 template <class Dummy = Symmetry>
149 typename std::enable_if<Dummy::IS_SPIN_SU2(), OperatorType>::type S(std::size_t orbital = 0) const;
150
155 template <class Dummy = Symmetry>
156 typename std::enable_if<Dummy::IS_SPIN_SU2(), OperatorType>::type Sdag(std::size_t orbital = 0) const;
157
158 template <class Dummy = Symmetry>
159 typename std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType>::type Sz(std::size_t orbital = 0) const;
160
161 template <class Dummy = Symmetry>
162 typename std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType>::type Sp(std::size_t orbital = 0) const;
163
164 template <class Dummy = Symmetry>
165 typename std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType>::type Sm(std::size_t orbital = 0) const;
166
167 template <class Dummy = Symmetry>
168 typename std::enable_if<Dummy::NO_SPIN_SYM(), OperatorType>::type Sx(std::size_t orbital = 0) const;
169
170 template <class Dummy = Symmetry>
171 typename std::enable_if<Dummy::NO_SPIN_SYM(), OperatorTypeC>::type Sy(std::size_t orbital = 0) const;
172
173 template <class Dummy = Symmetry>
174 typename std::enable_if<Dummy::NO_SPIN_SYM(), OperatorType>::type iSy(std::size_t orbital = 0) const;
175
176 template <class Dummy = Symmetry>
177 typename std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType>::type Scomp(SPINOP_LABEL Sa, int orbital) const
178 {
179 assert(Sa != SPINOP_LABEL::SY);
180 OperatorType out;
181 if constexpr(Dummy::NO_SPIN_SYM()) {
182 if(Sa == SPINOP_LABEL::SX) {
183 out = Sx(orbital);
184 } else if(Sa == SPINOP_LABEL::iSY) {
185 out = iSy(orbital);
186 } else if(Sa == SPINOP_LABEL::SZ) {
187 out = Sz(orbital);
188 } else if(Sa == SPINOP_LABEL::SP) {
189 out = Sp(orbital);
190 } else if(Sa == SPINOP_LABEL::SM) {
191 out = Sm(orbital);
192 }
193 } else {
194 if(Sa == SPINOP_LABEL::SZ) {
195 out = Sz(orbital);
196 } else if(Sa == SPINOP_LABEL::SP) {
197 out = Sp(orbital);
198 } else if(Sa == SPINOP_LABEL::SM) {
199 out = Sm(orbital);
200 }
201 }
202 return out;
203 };
205
206 // template <class Dummy = Symmetry>
207 // typename std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType>::type Rcomp(SPINOP_LABEL Sa, int orbital) const;
208
210
214 template <class Dummy = Symmetry>
215 typename std::enable_if<Dummy::IS_CHARGE_SU2(), OperatorType>::type T(std::size_t orbital = 0) const;
216
221 template <class Dummy = Symmetry>
222 typename std::enable_if<Dummy::IS_CHARGE_SU2(), OperatorType>::type Tdag(std::size_t orbital = 0) const;
223
228 template <class Dummy = Symmetry>
229 typename std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType>::type Tz(std::size_t orbital = 0) const;
230
235 template <class Dummy = Symmetry>
236 typename std::enable_if<Dummy::NO_CHARGE_SYM(), OperatorType>::type Tx(std::size_t orbital = 0, SUB_LATTICE G = A) const;
237
242 template <class Dummy = Symmetry>
243 typename std::enable_if<Dummy::NO_CHARGE_SYM(), OperatorType>::type iTy(std::size_t orbital = 0, SUB_LATTICE G = A) const;
244
245 template <class Dummy = Symmetry>
246 typename std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType>::type Tp(std::size_t orbital = 0, SUB_LATTICE G = A) const
247 {
248 double factor = static_cast<double>(static_cast<int>(G));
249 return factor * cc(orbital);
250 };
251
252 template <class Dummy = Symmetry>
253 typename std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType>::type Tm(std::size_t orbital = 0, SUB_LATTICE G = A) const
254 {
255 double factor = static_cast<double>(static_cast<int>(G));
256 return factor * cdagcdag(orbital);
257 };
258
260
264 template <class Dummy = Symmetry>
265 typename std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType>::type cc(std::size_t orbital = 0) const;
266
271 template <class Dummy = Symmetry>
272 typename std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType>::type cdagcdag(std::size_t orbital = 0) const;
274
276 OperatorType Id(std::size_t orbital = 0) const;
277
278 // /**Returns an array of size dim() with zeros.*/
279 // ArrayXd ZeroField() const { return ArrayXd::Zero(N_orbitals); }
280
281 // /**Returns an array of size dim()xdim() with zeros.*/
282 // ArrayXXd ZeroHopping() const { return ArrayXXd::Zero(N_orbitals, N_orbitals); }
283
295 // template <typename Scalar_>
296 // OperatorType HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& Uph,
297 // const Array<Scalar_, Dynamic, Dynamic>& t,
298 // const Array<Scalar_, Dynamic, Dynamic>& V,
299 // const Array<Scalar_, Dynamic, Dynamic>& J) const;
300
301 // template <typename Scalar_, typename Dummy = Symmetry>
302 // typename std::enable_if<Dummy::ABELIAN, OperatorType>::type HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& U,
303 // const Array<Scalar_, Dynamic, 1>& Uph,
304 // const Array<Scalar_, Dynamic, 1>& Eorb,
305 // const Array<Scalar_, Dynamic, 1>& Bz,
306 // const Array<Scalar_, Dynamic, Dynamic>& t,
307 // const Array<Scalar_, Dynamic, Dynamic>& V,
308 // const Array<Scalar_, Dynamic, Dynamic>& Vz,
309 // const Array<Scalar_, Dynamic, Dynamic>& Vxy,
310 // const Array<Scalar_, Dynamic, Dynamic>& Jz,
311 // const Array<Scalar_, Dynamic, Dynamic>& Jxy,
312 // const Array<Scalar_, Dynamic, Dynamic>& C) const;
313
314 // template <typename Scalar_, typename Dummy = Symmetry>
315 // typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), OperatorType>::type
316 // HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& U,
317 // const Array<Scalar_, Dynamic, 1>& Uph,
318 // const Array<Scalar_, Dynamic, 1>& Eorb,
319 // const Array<Scalar_, Dynamic, Dynamic>& t,
320 // const Array<Scalar_, Dynamic, Dynamic>& V,
321 // const Array<Scalar_, Dynamic, Dynamic>& Vz,
322 // const Array<Scalar_, Dynamic, Dynamic>& Vxy,
323 // const Array<Scalar_, Dynamic, Dynamic>& J) const;
324
325 // template <typename Scalar_, typename Dummy = Symmetry>
326 // typename std::enable_if<Dummy::NO_SPIN_SYM() and Dummy::IS_CHARGE_SU2(), SiteOperatorQ<Symmetry_, Eigen::Matrix<Scalar_, -1, -1>>>::type
327 // HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& Uph,
328 // const Array<Scalar_, Dynamic, Dynamic>& t,
329 // const Array<Scalar_, Dynamic, Dynamic>& V,
330 // const Array<Scalar_, Dynamic, Dynamic>& Jz,
331 // const Array<Scalar_, Dynamic, Dynamic>& Jxy,
332 // const Array<Scalar_, Dynamic, 1>& Bz,
333 // const Array<Scalar_, Dynamic, 1>& Bx) const;
334
335 // template <typename Scalar_, typename Dummy = Symmetry>
336 // typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperatorQ<Symmetry_, Eigen::Matrix<Scalar_, -1, -1>>>::type
337 // coupling_Bx(const Array<double, Dynamic, 1>& Bx) const;
338
339 // template <typename Dummy = Symmetry>
340 // typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperatorQ<Symmetry_, Eigen::Matrix<complex<double>, -1, -1>>>::type
341 // coupling_By(const Array<double, Dynamic, 1>& By) const;
342
343 // template <typename Scalar_, typename Dummy = Symmetry>
344 // typename std::enable_if<Dummy::IS_TRIVIAL, SiteOperatorQ<Symmetry_, Eigen::Matrix<Scalar_, -1, -1>>>::type
345 // coupling_singleFermion(const Array<double, Dynamic, 1>& Fp) const;
346
347 // template <typename Scalar_, typename Dummy = Symmetry>
348 // typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperatorQ<Symmetry_, Eigen::Matrix<Scalar_, -1, -1>>>::type
349 // coupling_XYZspin(const Array<double, Dynamic, Dynamic>& Jx,
350 // const Array<double, Dynamic, Dynamic>& Jy,
351 // const Array<double, Dynamic, Dynamic>& Jz) const;
352
354 Qbasis<Symmetry, 1> get_basis() const { return TensorBasis; }
355
356private:
357 OperatorType make_operator(const OperatorType& Op_1s, std::size_t orbital = 0, bool FERMIONIC = false, std::string label = "") const;
358 std::size_t N_orbitals;
359 std::size_t N_states;
360
361 Qbasis<Symmetry, 1> TensorBasis; // Final basis for N_orbital sites
362
363 // operators defined on zero orbitals
364 OperatorType Id_vac, Zero_vac;
365};
366
367template <typename Symmetry>
368FermionBase<Symmetry>::FermionBase(std::size_t L_input, bool REMOVE_DOUBLE, bool REMVOVE_EMPTY, bool REMOVE_SINGLE)
369 : Fermion<Symmetry>(REMOVE_DOUBLE, REMVOVE_EMPTY, REMOVE_SINGLE)
370 , N_orbitals(L_input)
371{
372 // create basis for zero orbitals
373 qType Q = Symmetry::qvacuum();
374 Qbasis<Symmetry, 1> vacuum;
375 vacuum.push_back(Q, 1);
376
377 // create operators for zero orbitals
378 Zero_vac = OperatorType(Symmetry::qvacuum(), vacuum);
379 Zero_vac.setZero();
380 Id_vac = OperatorType(Symmetry::qvacuum(), vacuum);
381 Id_vac.setIdentity();
382
383 // create basis for N_orbitals fermionic sites
384 if(N_orbitals == 1) {
385 TensorBasis = this->basis_1s();
386 } else if(N_orbitals == 0) {
387 TensorBasis = vacuum;
388 } else {
389 TensorBasis = this->basis_1s().combine(this->basis_1s()).forgetHistory();
390 for(std::size_t o = 2; o < N_orbitals; o++) { TensorBasis = TensorBasis.combine(this->basis_1s()).forgetHistory(); }
391 }
392
393 N_states = TensorBasis.dim();
394}
395
396template <typename Symmetry>
398FermionBase<Symmetry>::make_operator(const OperatorType& Op_1s, std::size_t orbital, bool FERMIONIC, std::string label) const
399{
400 assert(orbital < N_orbitals);
401 OperatorType out;
402 if(N_orbitals == 1) {
403 out = Op_1s;
404 out.label() = label;
405 return out;
406 } else if(N_orbitals == 0) {
407 return Zero_vac;
408 } else {
409 OperatorType stringOp;
410 if(FERMIONIC) {
411 stringOp = this->Id_1s();
412 } else {
413 stringOp = this->Id_1s();
414 }
415 bool TOGGLE = false;
416 if(orbital == 0) {
417 out = OperatorType::outerprod(Op_1s, this->Id_1s(), Op_1s.Q);
418 TOGGLE = true;
419 } else {
420 if(orbital == 1) {
421 out = OperatorType::outerprod(stringOp, Op_1s, Op_1s.Q);
422 TOGGLE = true;
423 } else {
424 out = OperatorType::outerprod(stringOp, stringOp, Symmetry::qvacuum());
425 }
426 }
427 for(std::size_t o = 2; o < N_orbitals; o++) {
428 if(orbital == o) {
429 out = OperatorType::outerprod(out, Op_1s, Op_1s.Q);
430 TOGGLE = true;
431 } else if(TOGGLE == false) {
432 out = OperatorType::outerprod(out, stringOp, Symmetry::qvacuum());
433 } else if(TOGGLE == true) {
434 out = OperatorType::outerprod(out, this->Id_1s(), Op_1s.Q);
435 }
436 }
437 out.label() = label;
438 return out;
439 }
440}
441
442template <typename Symmetry>
443template <typename Dummy>
444typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type
445FermionBase<Symmetry>::c(std::size_t orbital) const
446{
447 return make_operator(this->c_1s(), orbital, PROP::FERMIONIC, "c");
448}
449
450template <typename Symmetry>
451template <typename Dummy>
452typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type
453FermionBase<Symmetry>::cdag(std::size_t orbital) const
454{
455 return c(orbital).adjoint();
456}
457
458template <typename Symmetry>
459template <typename Dummy>
460typename std::enable_if<!Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type
461FermionBase<Symmetry>::c(SPIN_INDEX sigma, std::size_t orbital) const
462{
463 std::stringstream ss;
464 ss << "c" << sigma;
465 return make_operator(this->c_1s(sigma), orbital, PROP::FERMIONIC, ss.str());
466}
467
468template <typename Symmetry>
469template <typename Dummy>
470typename std::enable_if<!Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type
471FermionBase<Symmetry>::cdag(SPIN_INDEX sigma, std::size_t orbital) const
472{
473 // return c(sigma,orbital).adjoint();
474 std::stringstream ss;
475 ss << "c†" << sigma;
476 return make_operator(this->cdag_1s(sigma), orbital, PROP::FERMIONIC, ss.str());
477}
478
479template <typename Symmetry>
480template <typename Dummy>
481typename std::enable_if<Dummy::IS_CHARGE_SU2() and !Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type
482FermionBase<Symmetry>::c(SPIN_INDEX sigma, SUB_LATTICE G, std::size_t orbital) const
483{
484 std::stringstream ss;
485 return make_operator(this->c_1s(sigma, G), orbital, PROP::FERMIONIC, ss.str());
486}
487
488template <typename Symmetry>
489template <typename Dummy>
490typename std::enable_if<Dummy::IS_CHARGE_SU2() and !Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type
491FermionBase<Symmetry>::cdag(SPIN_INDEX sigma, SUB_LATTICE G, std::size_t orbital) const
492{
493 return c(sigma, G, orbital).adjoint();
494}
495
496template <typename Symmetry>
497template <typename Dummy>
498typename std::enable_if<Dummy::IS_CHARGE_SU2() and Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type
499FermionBase<Symmetry>::c(SUB_LATTICE G, std::size_t orbital) const
500{
501 std::stringstream ss;
502 ss << "c" << G;
503 return make_operator(this->c_1s(G), orbital, PROP::FERMIONIC, ss.str());
504}
505
506template <typename Symmetry>
507template <typename Dummy>
508typename std::enable_if<Dummy::IS_CHARGE_SU2() and Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type
509FermionBase<Symmetry>::cdag(SUB_LATTICE G, std::size_t orbital) const
510{
511 return c(G, orbital).adjoint();
512}
513
514template <typename Symmetry>
516{
517 return make_operator(this->F_1s(), orbital, PROP::FERMIONIC, "F");
518}
519
520template <typename Symmetry>
521SiteOperator<double, Symmetry> FermionBase<Symmetry>::sign(std::size_t orb1, std::size_t orb2) const
522{
523 OperatorType Oout;
524 if(N_orbitals == 1) {
525 Oout = this->F_1s();
526 Oout.label() = "sign";
527 return Oout;
528 } else if(N_orbitals == 0) {
529 return Zero_vac;
530 } else {
531 Oout = Id();
532 for(int i = orb1; i < N_orbitals; ++i) { Oout = Oout * (nh(i) - ns(i)); }
533 for(int i = 0; i < orb2; ++i) { Oout = Oout * (nh(i) - ns(i)); }
534 Oout.label() = "sign";
535 return Oout;
536 }
537}
538
539template <typename Symmetry>
540template <typename Dummy>
541typename std::enable_if<true, SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::n(std::size_t orbital) const
542{
543 return make_operator(this->n_1s(), orbital, PROP::NON_FERMIONIC, "n");
544}
545
546template <typename Symmetry>
547template <typename Dummy>
548typename std::enable_if<!Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::n(SPIN_INDEX sigma,
549 std::size_t orbital) const
550{
551 std::stringstream ss;
552 ss << "n" << sigma;
553 return make_operator(this->n_1s(sigma), orbital, PROP::NON_FERMIONIC, ss.str());
554}
555
556template <typename Symmetry>
558{
559 return make_operator(this->ns_1s(), orbital, PROP::NON_FERMIONIC, "ns");
560}
561
562template <typename Symmetry>
564{
565 return make_operator(this->nh_1s(), orbital, PROP::NON_FERMIONIC, "nh");
566}
567
568template <typename Symmetry>
569template <typename Dummy>
570typename std::enable_if<!Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::d(std::size_t orbital) const
571{
572 return make_operator(this->d_1s(), orbital, PROP::NON_FERMIONIC, "d");
573}
574
575// template <typename Symmetry>
576// template <typename Dummy>
577// typename std::enable_if<!Dummy::IS_SPIN_SU2(), SiteOperatorQ<Symmetry, Eigen::Matrix<complex<double>, Eigen::Dynamic, Eigen::Dynamic>>>::type
578// FermionBase<Symmetry>::Rcomp(SPINOP_LABEL Sa, int orbital) const
579// {
580// assert(orbital < N_orbitals);
581// SiteOperatorQ<Symmetry, Eigen::Matrix<complex<double>, Eigen::Dynamic, Eigen::Dynamic>> Oout;
582// SiteOperatorQ<Symmetry, Eigen::Matrix<complex<double>, Eigen::Dynamic, Eigen::Dynamic>> Scomp_cmplx =
583// Scomp(Sa, orbital).template cast<complex<double>>();
584// if(Sa == iSY) {
585// Oout = 2. * M_PI * Scomp_cmplx;
586// } else {
587// Oout = 2. * 1.i * M_PI * Scomp_cmplx;
588// }
589// Oout.data() = Oout.data().exp(1.);
590
591// cout << "Rcomp=" << Oout << endl << endl;
592// // cout << "Re=" << Mtmp.exp().real() << endl << endl;
593// // cout << "Im=" << Mtmp.exp().imag() << endl << endl;
594// // cout << "Op=" << Op << endl << endl;
595
596// return Oout; // SiteOperator<Symmetry,complex<double>>(Op,getQ(Sa));
597// }
598
599template <typename Symmetry>
600template <typename Dummy>
601typename std::enable_if<Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::S(std::size_t orbital) const
602{
603 return make_operator(this->S_1s(), orbital, PROP::NON_FERMIONIC, "S");
604}
605
606template <typename Symmetry>
607template <typename Dummy>
608typename std::enable_if<Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Sdag(std::size_t orbital) const
609{
610 return S(orbital).adjoint();
611}
612
613template <typename Symmetry>
614template <typename Dummy>
615typename std::enable_if<!Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Sz(std::size_t orbital) const
616{
617 return make_operator(this->Sz_1s(), orbital, PROP::NON_FERMIONIC, "Sz");
618}
619
620template <typename Symmetry>
621template <typename Dummy>
622typename std::enable_if<!Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Sp(std::size_t orbital) const
623{
624 return make_operator(this->Sp_1s(), orbital, PROP::NON_FERMIONIC, "Sp");
625}
626
627template <typename Symmetry>
628template <typename Dummy>
629typename std::enable_if<!Dummy::IS_SPIN_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Sm(std::size_t orbital) const
630{
631 return make_operator(this->Sm_1s(), orbital, PROP::NON_FERMIONIC, "Sm");
632}
633
634template <typename Symmetry>
635template <typename Dummy>
636typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Sx(std::size_t orbital) const
637{
638 OperatorType out = 0.5 * (Sp(orbital) + Sm(orbital));
639 out.label() = "Sx";
640 return out;
641}
642
643template <typename Symmetry>
644template <typename Dummy>
645typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperator<std::complex<double>, Symmetry>>::type FermionBase<Symmetry>::Sy(std::size_t orbital) const
646{
647 using namespace std::complex_literals;
648 OperatorTypeC out = -1i * 0.5 * (Sp(orbital) - Sm(orbital));
649 out.label() = "Sy";
650 return out;
651}
652
653template <typename Symmetry>
654template <typename Dummy>
655typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::iSy(std::size_t orbital) const
656{
657 OperatorType out = 0.5 * (Sp(orbital) - Sm(orbital));
658 out.label() = "iSy";
659 return out;
660}
661
662template <typename Symmetry>
663template <typename Dummy>
664typename std::enable_if<Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::T(std::size_t orbital) const
665{
666 return make_operator(this->T_1s(), orbital, PROP::NON_FERMIONIC, "T");
667}
668
669template <typename Symmetry>
670template <typename Dummy>
671typename std::enable_if<Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Tdag(std::size_t orbital) const
672{
673 return T(orbital).adjoint();
674}
675
676template <typename Symmetry>
677template <typename Dummy>
678typename std::enable_if<!Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::cc(std::size_t orbital) const
679{
680 return make_operator(this->cc_1s(), orbital, PROP::NON_FERMIONIC, "cc");
681}
682
683template <typename Symmetry>
684template <typename Dummy>
685typename std::enable_if<!Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::cdagcdag(std::size_t orbital) const
686{
687 // return cc(orbital).adjoint();
688 return make_operator(this->cdagcdag_1s(), orbital, PROP::NON_FERMIONIC, "c†c†");
689}
690
691// SiteOperatorQ<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::U1<Sym::ChargeU1> >,Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> >
692// FermionBase<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::U1<Sym::ChargeU1> > >:: Tp (std::size_t orbital) const
693//{
694// return Eta(orbital);
695// }
696
697// SiteOperatorQ<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::U1<Sym::ChargeU1> >,Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> >
698// FermionBase<Sym::S1xS2<Sym::SU2<Sym::SpinSU2>,Sym::U1<Sym::ChargeU1> > >:: Tm (std::size_t orbital) const
699//{
700// return Eta(orbital).adjoint();
701// }
702
703template <typename Symmetry>
704template <typename Dummy>
705typename std::enable_if<!Dummy::IS_CHARGE_SU2(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Tz(std::size_t orbital) const
706{
707 OperatorType out = 0.5 * (n(orbital) - Id());
708 out.label() = "Tz=1/2*(n-Id)";
709 return out;
710}
711
712template <typename Symmetry>
713template <typename Dummy>
714typename std::enable_if<Dummy::NO_CHARGE_SYM(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::Tx(std::size_t orbital,
715 SUB_LATTICE G) const
716{
717 OperatorType out = 0.5 * (Tp(orbital, G) + Tm(orbital, G));
718 out.label() = "Tx";
719 return out;
720}
721
722template <typename Symmetry>
723template <typename Dummy>
724typename std::enable_if<Dummy::NO_CHARGE_SYM(), SiteOperator<double, Symmetry>>::type FermionBase<Symmetry>::iTy(std::size_t orbital,
725 SUB_LATTICE G) const
726{
727 OperatorType out = 0.5 * (Tp(orbital, G) - Tm(orbital, G));
728 out.label() = "iTy";
729 return out;
730}
731
732template <typename Symmetry>
734{
735 return make_operator(this->Id_1s(), orbital, PROP::NON_FERMIONIC, "Id");
736}
737
738// template <typename Symmetry>
739// template <typename Scalar_>
740// SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, Eigen::Dynamic, Eigen::Dynamic>>
741// FermionBase<Symmetry>::HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& Uph,
742// const Array<Scalar_, Dynamic, Dynamic>& t,
743// const Array<Scalar_, Dynamic, Dynamic>& V,
744// const Array<Scalar_, Dynamic, Dynamic>& J) const
745// {
746// SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, Eigen::Dynamic, Eigen::Dynamic>> Oout(Symmetry::qvacuum(), TensorBasis);
747
748// for(int i = 0; i < N_orbitals; ++i)
749// for(int j = 0; j < N_orbitals; ++j) {
750// auto G1 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1, i)));
751// auto G2 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1, j)));
752// if(t(i, j) != 0.) {
753// if constexpr(Symmetry::IS_SPIN_SU2() and Symmetry::IS_CHARGE_SU2()) {
754// Oout += -t(i, j) * std::sqrt(2.) * std::sqrt(2.) *
755// OperatorType::prod(cdag(G1, i), c(G2, j), Symmetry::qvacuum()).template cast<Scalar_>();
756// } else if constexpr(Symmetry::IS_SPIN_SU2() and !Symmetry::IS_CHARGE_SU2()) {
757// Oout += -t(i, j) * std::sqrt(2.) * (OperatorType::prod(cdag(i), c(j), Symmetry::qvacuum())).template cast<Scalar_>();
758// Oout += -t(j, i) * std::sqrt(2.) * (OperatorType::prod(c(i), cdag(j), Symmetry::qvacuum())).template cast<Scalar_>();
759// } else if constexpr(!Symmetry::IS_SPIN_SU2() and Symmetry::IS_CHARGE_SU2()) {
760// Oout += -t(i, j) * std::sqrt(2.) *
761// (OperatorType::prod(cdag(UP, G1, i), c(UP, G2, j), Symmetry::qvacuum()) +
762// OperatorType::prod(cdag(DN, G1, i), c(DN, G2, j), Symmetry::qvacuum()))
763// .template cast<Scalar_>();
764// } else if constexpr(!Symmetry::IS_SPIN_SU2() and !Symmetry::IS_CHARGE_SU2()) {
765// Oout += -t(i, j) * (cdag(UP, i) * c(UP, j) + cdag(DN, i) * c(DN, j)).template cast<Scalar_>();
766// Oout += -t(j, i) * (cdag(UP, j) * c(UP, i) + cdag(DN, j) * c(DN, i)).template cast<Scalar_>();
767// } else {
768// // static_assert(false, "You use a symmetry combination for which there is no implementation of the hopping part in
769// // FermionBase::HubbardHamiltonian()");
770// }
771// }
772// if(V(i, j) != 0.) {
773// if constexpr(Symmetry::IS_CHARGE_SU2()) {
774// Oout += V(i, j) * std::sqrt(3.) * (OperatorType::prod(Tdag(i), T(j), Symmetry::qvacuum())).template cast<Scalar_>();
775// } else {
776// Oout += V(i, j) * (OperatorType::prod(Tz(i), Tz(j), Symmetry::qvacuum())).template cast<Scalar_>();
777// Oout += 0.5 * V(i, j) *
778// (OperatorType::prod(Tp(i, G1), Tm(j, G2), Symmetry::qvacuum()) +
779// OperatorType::prod(Tm(i, G1), Tp(j, G2), Symmetry::qvacuum()))
780// .template cast<Scalar_>();
781// }
782// }
783// if(J(i, j) != 0.) {
784// if constexpr(Symmetry::IS_SPIN_SU2()) {
785// Oout += J(i, j) * std::sqrt(3.) * (OperatorType::prod(Sdag(i), S(j), Symmetry::qvacuum())).template cast<Scalar_>();
786// } else {
787// Oout += J(i, j) * (OperatorType::prod(Sz(i), Sz(j), Symmetry::qvacuum())).template cast<Scalar_>();
788// Oout += 0.5 * J(i, j) *
789// (OperatorType::prod(Sp(i), Sm(j), Symmetry::qvacuum()) + OperatorType::prod(Sm(i), Sp(j), Symmetry::qvacuum()))
790// .template cast<Scalar_>();
791// }
792// }
793// }
794
795// for(int i = 0; i < N_orbitals; ++i) {
796// if(Uph(i) != 0. and Uph(i) != std::numeric_limits<double>::infinity()) { Oout += 0.5 * Uph(i) * nh(i).template cast<Scalar_>(); }
797// }
798// Oout.label() = "Hloc";
799// return Oout;
800// }
801
802// template <typename Symmetry>
803// template <typename Scalar_, typename Dummy>
804// typename std::enable_if<Dummy::ABELIAN, SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>>>::type
805// FermionBase<Symmetry>::HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& U,
806// const Array<Scalar_, Dynamic, 1>& Uph,
807// const Array<Scalar_, Dynamic, 1>& Eorb,
808// const Array<Scalar_, Dynamic, 1>& Bz,
809// const Array<Scalar_, Dynamic, Dynamic>& t,
810// const Array<Scalar_, Dynamic, Dynamic>& V,
811// const Array<Scalar_, Dynamic, Dynamic>& Vz,
812// const Array<Scalar_, Dynamic, Dynamic>& Vxy,
813// const Array<Scalar_, Dynamic, Dynamic>& Jz,
814// const Array<Scalar_, Dynamic, Dynamic>& Jxy,
815// const Array<Scalar_, Dynamic, Dynamic>& C) const
816// {
817// auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, ZeroHopping(), ZeroHopping());
818
819// for(int i = 0; i < N_orbitals; ++i)
820// for(int j = 0; j < N_orbitals; ++j) {
821// auto G1 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1, i)));
822// auto G2 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1, j)));
823
824// if(V(i, j) != 0.) { Oout += V(i, j) * (n(i) * n(j)).template cast<Scalar_>(); }
825// if(Vz(i, j) != 0.) { Oout += Vz(i, j) * (Tz(i) * Tz(j)).template cast<Scalar_>(); }
826// if(Vxy(i, j) != 0.) {
827// Oout +=
828// 0.5 * Vxy(i, j) *
829// (OperatorType::prod(Tp(i, G1), Tm(j, G2), Symmetry::qvacuum()) + OperatorType::prod(Tm(i, G1), Tp(j, G2), Symmetry::qvacuum()))
830// .template cast<Scalar_>();
831// }
832// if(Jz(i, j) != 0.) { Oout += Jz(i, j) * Sz(i) * Sz(j).template cast<Scalar_>(); }
833// if(Jxy(i, j) != 0.) { Oout += 0.5 * Jxy(i, j) * (Sp(i) * Sm(j) + Sm(i) * Sp(j)).template cast<Scalar_>(); }
834// }
835
836// for(int i = 0; i < N_orbitals; ++i) {
837// if(U(i) != 0. and U(i) != numeric_limits<double>::infinity()) { Oout += U(i) * d(i).template cast<Scalar_>(); }
838// if(Eorb(i) != 0.) { Oout += Eorb(i) * n(i).template cast<Scalar_>(); }
839// if(Bz(i) != 0.) { Oout -= Bz(i) * Sz(i).template cast<Scalar_>(); }
840// if(C(i) != 0.) {
841// // convention: cUP*cDN + cdagDN*cdagUP
842// // convention for cc, cdagcdag is opposite, therefore needs one commutation
843// // Oout -= C(i) * cc(i).template cast<Scalar_>();
844// // Oout -= C(i) * cdagcdag(i).template cast<Scalar_>();
845// Oout += C(i) * (c(UP, i) * c(DN, i)).template cast<Scalar_>();
846// Oout += C(i) * (cdag(DN, i) * cdag(UP, i)).template cast<Scalar_>();
847// }
848// }
849// Oout.label() = "Hloc";
850// return Oout;
851// }
852
853// template <typename Symmetry>
854// template <typename Scalar_, typename Dummy>
855// typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(), SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>>>::type
856// FermionBase<Symmetry>::HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& U,
857// const Array<Scalar_, Dynamic, 1>& Uph,
858// const Array<Scalar_, Dynamic, 1>& Eorb,
859// const Array<Scalar_, Dynamic, Dynamic>& t,
860// const Array<Scalar_, Dynamic, Dynamic>& V,
861// const Array<Scalar_, Dynamic, Dynamic>& Vz,
862// const Array<Scalar_, Dynamic, Dynamic>& Vxy,
863// const Array<Scalar_, Dynamic, Dynamic>& J) const
864// {
865// auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, ZeroHopping(), J);
866
867// for(int i = 0; i < N_orbitals; ++i)
868// for(int j = 0; j < N_orbitals; ++j) {
869// auto G1 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1, i)));
870// auto G2 = static_cast<SUB_LATTICE>(static_cast<int>(pow(-1, j)));
871// if(V(i, j) != 0.) { Oout += V(i, j) * (n(i) * n(j)).template cast<Scalar_>(); }
872// if(Vz(i, j) != 0.) { Oout += Vz(i, j) * (Tz(i) * Tz(j)).template cast<Scalar_>(); }
873// if(Vxy(i, j) != 0.) {
874// Oout +=
875// 0.5 * Vxy(i, j) *
876// (OperatorType::prod(Tp(i, G1), Tm(j, G2), Symmetry::qvacuum()) + OperatorType::prod(Tm(i, G1), Tp(j, G2), Symmetry::qvacuum()))
877// .template cast<Scalar_>();
878// }
879// }
880
881// for(int i = 0; i < N_orbitals; ++i) {
882// if(U(i) != 0. and U(i) != numeric_limits<double>::infinity()) { Oout += U(i) * d(i).template cast<Scalar_>(); }
883// if(Eorb(i) != 0.) { Oout += Eorb(i) * n(i).template cast<Scalar_>(); }
884// }
885// Oout.label() = "Hloc";
886// return Oout;
887// }
888
889// template <typename Symmetry>
890// template <typename Scalar_, typename Dummy>
891// typename std::enable_if<Dummy::NO_SPIN_SYM() and Dummy::IS_CHARGE_SU2(), SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>>>::type
892// FermionBase<Symmetry>::HubbardHamiltonian(const Array<Scalar_, Dynamic, 1>& Uph,
893// const Array<Scalar_, Dynamic, Dynamic>& t,
894// const Array<Scalar_, Dynamic, Dynamic>& V,
895// const Array<Scalar_, Dynamic, Dynamic>& Jz,
896// const Array<Scalar_, Dynamic, Dynamic>& Jxy,
897// const Array<Scalar_, Dynamic, 1>& Bz,
898// const Array<Scalar_, Dynamic, 1>& Bx) const
899// {
900// auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, V, ZeroHopping());
901
902// for(int i = 0; i < N_orbitals; ++i)
903// for(int j = 0; j < N_orbitals; ++j) {
904// if(Jz(i, j) != 0.) { Oout += Jz(i, j) * (Sz(i) * Sz(j)).template cast<Scalar_>(); }
905// if(Jxy(i, j) != 0.) {
906// Oout += 0.5 * Jxy(i, j) *
907// (OperatorType::prod(Sp(i), Sm(j), Symmetry::qvacuum()) + OperatorType::prod(Sm(i), Sp(j), Symmetry::qvacuum()))
908// .template cast<Scalar_>();
909// }
910// }
911
912// for(int i = 0; i < N_orbitals; ++i) {
913// if(Bz(i) != 0.) { Oout += -1. * Bz(i) * Sz(i).template cast<Scalar_>(); }
914// if(Bx(i) != 0.) { Oout += -1. * Bx(i) * Sx(i).template cast<Scalar_>(); }
915// }
916// Oout.label() = "Hloc";
917// return Oout;
918// }
919
920// template <typename Symmetry>
921// template <typename Scalar_, typename Dummy>
922// typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>>>::type
923// FermionBase<Symmetry>::coupling_Bx(const Array<double, Dynamic, 1>& Bx) const
924// {
925// SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>> Mout(Symmetry::qvacuum(), TensorBasis);
926// for(int i = 0; i < N_orbitals; ++i) {
927// if(Bx(i) != 0.) { Mout -= Bx(i) * Sx(i).template cast<Scalar_>(); }
928// }
929// return Mout;
930// }
931
932// template <typename Symmetry>
933// template <typename Dummy>
934// typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperatorQ<Symmetry, Eigen::Matrix<complex<double>, -1, -1>>>::type
935// FermionBase<Symmetry>::coupling_By(const Array<double, Dynamic, 1>& By) const
936// {
937// SiteOperatorQ<Symmetry, Eigen::Matrix<complex<double>, -1, -1>> Mout(Symmetry::qvacuum(), TensorBasis);
938// for(int i = 0; i < N_orbitals; ++i) {
939// if(By(i) != 0.) { Mout -= -1i * By(i) * iSy(i).template cast<complex<double>>(); }
940// }
941// return Mout;
942// }
943
944// template <typename Symmetry>
945// template <typename Scalar_, typename Dummy>
946// typename std::enable_if<Dummy::IS_TRIVIAL, SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>>>::type
947// FermionBase<Symmetry>::coupling_singleFermion(const Array<double, Dynamic, 1>& Fp) const
948// {
949// SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>> Mout(Symmetry::qvacuum(), TensorBasis);
950// for(int i = 0; i < N_orbitals; ++i) {
951// if(Fp(i) != 0.) { Mout += Fp(i) * (c(UP, i) + cdag(UP, i) + c(DN, i) + cdag(DN, i)).template cast<Scalar_>(); }
952// }
953// return Mout;
954// }
955
956// template <typename Symmetry>
957// template <typename Scalar_, typename Dummy>
958// typename std::enable_if<Dummy::NO_SPIN_SYM(), SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>>>::type
959// FermionBase<Symmetry>::coupling_XYZspin(const Array<double, Dynamic, Dynamic>& Jx,
960// const Array<double, Dynamic, Dynamic>& Jy,
961// const Array<double, Dynamic, Dynamic>& Jz) const
962// {
963// SiteOperatorQ<Symmetry, Eigen::Matrix<Scalar_, -1, -1>> Mout(Symmetry::qvacuum(), TensorBasis);
964// for(int i = 0; i < N_orbitals; ++i)
965// for(int j = 0; j < N_orbitals; ++j) {
966// if(Jx(i, j) != 0.) { Mout += Jx(i, j) * OperatorType::prod(Sx(i), Sx(j), Symmetry::qvacuum()).template cast<Scalar_>(); }
967// if(Jy(i, j) != 0.) { Mout += -Jy(i, j) * OperatorType::prod(iSy(i), iSy(j), Symmetry::qvacuum()).template cast<Scalar_>(); }
968// if(Jz(i, j) != 0.) { Mout += Jz(i, j) * OperatorType::prod(Sz(i), Sz(j), Symmetry::qvacuum()).template cast<Scalar_>(); }
969// }
970// return Mout;
971// }
972
973} // namespace Xped
974#endif
Definition: FermionBase.hpp:25
std::enable_if< Dummy::NO_SPIN_SYM(), OperatorType >::type iSy(std::size_t orbital=0) const
Definition: FermionBase.hpp:655
std::enable_if< Dummy::IS_CHARGE_SU2(), OperatorType >::type Tdag(std::size_t orbital=0) const
Definition: FermionBase.hpp:671
SiteOperator< Scalar, Symmetry > OperatorType
Definition: FermionBase.hpp:30
FermionBase()=default
std::size_t orbitals() const
Definition: FermionBase.hpp:45
std::enable_if< Dummy::IS_SPIN_SU2(), OperatorType >::type Sdag(std::size_t orbital=0) const
Definition: FermionBase.hpp:608
std::enable_if< Dummy::IS_SPIN_SU2(), OperatorType >::type S(std::size_t orbital=0) const
Definition: FermionBase.hpp:601
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Scomp(SPINOP_LABEL Sa, int orbital) const
Definition: FermionBase.hpp:177
OperatorType Id(std::size_t orbital=0) const
Definition: FermionBase.hpp:733
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Sz(std::size_t orbital=0) const
Definition: FermionBase.hpp:615
OperatorType ns(std::size_t orbital=0) const
Definition: FermionBase.hpp:557
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type Tm(std::size_t orbital=0, SUB_LATTICE G=A) const
Definition: FermionBase.hpp:253
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), OperatorType >::type cdag(std::size_t orbital=0) const
Definition: FermionBase.hpp:453
std::enable_if< Dummy::NO_CHARGE_SYM(), OperatorType >::type iTy(std::size_t orbital=0, SUB_LATTICE G=A) const
Definition: FermionBase.hpp:724
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type cdagcdag(std::size_t orbital=0) const
Definition: FermionBase.hpp:685
std::enable_if< true, OperatorType >::type n(std::size_t orbital=0) const
Definition: FermionBase.hpp:541
std::enable_if< Dummy::IS_CHARGE_SU2(), OperatorType >::type T(std::size_t orbital=0) const
Definition: FermionBase.hpp:664
OperatorType sign(std::size_t orb1=0, std::size_t orb2=0) const
Definition: FermionBase.hpp:521
Symmetry_ Symmetry
Definition: FermionBase.hpp:29
std::enable_if< Dummy::NO_SPIN_SYM(), OperatorTypeC >::type Sy(std::size_t orbital=0) const
Definition: FermionBase.hpp:645
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), OperatorType >::type c(std::size_t orbital=0) const
Definition: FermionBase.hpp:445
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Sp(std::size_t orbital=0) const
Definition: FermionBase.hpp:622
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type Tp(std::size_t orbital=0, SUB_LATTICE G=A) const
Definition: FermionBase.hpp:246
FermionBase(std::size_t L_input, bool REMOVE_DOUBLE=false, bool REMVOVE_EMPTY=false, bool REMOVE_SINGLE=false)
Definition: FermionBase.hpp:368
OperatorType nh(std::size_t orbital=0) const
Definition: FermionBase.hpp:563
OperatorType sign_local(std::size_t orbital=0) const
Definition: FermionBase.hpp:515
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type d(std::size_t orbital=0) const
Definition: FermionBase.hpp:570
std::size_t dim() const
Definition: FermionBase.hpp:42
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type Tz(std::size_t orbital=0) const
Definition: FermionBase.hpp:705
std::enable_if< Dummy::NO_SPIN_SYM(), OperatorType >::type Sx(std::size_t orbital=0) const
Definition: FermionBase.hpp:636
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type cc(std::size_t orbital=0) const
Definition: FermionBase.hpp:678
Qbasis< Symmetry, 1 > get_basis() const
Definition: FermionBase.hpp:354
std::enable_if< Dummy::NO_CHARGE_SYM(), OperatorType >::type Tx(std::size_t orbital=0, SUB_LATTICE G=A) const
Definition: FermionBase.hpp:714
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Sm(std::size_t orbital=0) const
Definition: FermionBase.hpp:629
typename Symmetry::qType qType
Definition: FermionBase.hpp:32
Definition: Fermion.hpp:21
Qbasis< Symmetry, 1 > basis_1s() const
Definition: Fermion.hpp:63
Definition: Qbasis.hpp:39
void push_back(const qType &q, const size_t &inner_dim)
Definition: Qbasis.cpp:32
Qbasis< Symmetry, depth+1, AllocationPolicy > combine(const Qbasis< Symmetry, 1, AllocationPolicy > &other, bool CONJ=false) const
Definition: Qbasis.cpp:439
std::size_t dim() const
Definition: Qbasis.hpp:75
constexpr bool FERMIONIC
Definition: Properties.hpp:10
constexpr bool NON_FERMIONIC
Definition: Properties.hpp:11
Definition: bench.cpp:62
SUB_LATTICE
Definition: SubLattice.hpp:9
@ A
Definition: SubLattice.hpp:10
void setZero()
Definition: SiteOperator.hpp:62
std::string & label()
Definition: SiteOperator.hpp:85
void setIdentity()
Definition: SiteOperator.hpp:63