8#include <boost/dynamic_bitset.hpp>
10#include <unsupported/Eigen/MatrixFunctions>
25template<
typename Symmetry_>
36 typedef typename Symmetry::qType
qType;
44 FermionBase (std::size_t L_input,
bool REMOVE_DOUBLE=
false,
bool REMVOVE_EMPTY=
false,
bool REMOVE_UP=
false,
bool REMOVE_DN=
false,
int mfactor=1,
int k_input=0);
65 template<
class Dummy = Symmetry>
66 typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
OperatorType>::type
c (
size_t orbital=0) const;
183 if constexpr (Dummy::NO_SPIN_SYM())
201 template<
class Dummy = Symmetry>
209 template<
class Dummy = Symmetry>
216 template<
class Dummy = Symmetry>
223 template<
class Dummy = Symmetry>
226 template<
class Dummy = Symmetry>
233 template<
class Dummy = Symmetry>
240 template<
class Dummy = Symmetry>
243 template<
class Dummy = Symmetry>
246 double factor =
static_cast<double>(
static_cast<int>(G));
250 template<
class Dummy = Symmetry>
253 double factor =
static_cast<double>(
static_cast<int>(G));
262 template<
class Dummy = Symmetry>
269 template<
class Dummy = Symmetry>
293 template<
typename Scalar_>
295 const Array<Scalar_,Dynamic,Dynamic> &t,
296 const Array<Scalar_,Dynamic,Dynamic> &V,
297 const Array<Scalar_,Dynamic,Dynamic> &J)
const;
299 template<
typename Scalar_,
typename Dummy = Symmetry>
300 typename std::enable_if<Dummy::ABELIAN,
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
302 const Array<Scalar_,Dynamic,1> &Uph,
303 const Array<Scalar_,Dynamic,1> &Eorb,
304 const Array<Scalar_,Dynamic,1> &Bz,
305 const Array<Scalar_,Dynamic,Dynamic> &t,
306 const Array<Scalar_,Dynamic,Dynamic> &V,
307 const Array<Scalar_,Dynamic,Dynamic> &Vz,
308 const Array<Scalar_,Dynamic,Dynamic> &Vxy,
309 const Array<Scalar_,Dynamic,Dynamic> &Jz,
310 const Array<Scalar_,Dynamic,Dynamic> &Jxy,
311 const Array<Scalar_,Dynamic,Dynamic> &C)
const;
313 template<
typename Scalar_,
typename Dummy = Symmetry>
314 typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
316 const Array<Scalar_,Dynamic,1> &Uph,
317 const Array<Scalar_,Dynamic,1> &Eorb,
318 const Array<Scalar_,Dynamic,Dynamic> &t,
319 const Array<Scalar_,Dynamic,Dynamic> &V,
320 const Array<Scalar_,Dynamic,Dynamic> &Vz,
321 const Array<Scalar_,Dynamic,Dynamic> &Vxy,
322 const Array<Scalar_,Dynamic,Dynamic> &J) const;
324 template<typename Scalar_, typename Dummy =
Symmetry>
325 typename
std::enable_if<Dummy::NO_SPIN_SYM() and Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
327 const Array<Scalar_,Dynamic,Dynamic> &t,
328 const Array<Scalar_,Dynamic,Dynamic> &V,
329 const Array<Scalar_,Dynamic,Dynamic> &Jz,
330 const Array<Scalar_,Dynamic,Dynamic> &Jxy,
331 const Array<Scalar_,Dynamic,1> &Bz,
332 const Array<Scalar_,Dynamic,1> &Bx) const;
334 template<typename Scalar_, typename Dummy =
Symmetry>
335 typename
std::enable_if<Dummy::IS_SPIN_U1() and Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
337 const Array<Scalar_,Dynamic,Dynamic> &t,
338 const Array<Scalar_,Dynamic,Dynamic> &V,
339 const Array<Scalar_,Dynamic,Dynamic> &Jz,
340 const Array<Scalar_,Dynamic,Dynamic> &Jxy,
341 const Array<Scalar_,Dynamic,1> &Bz) const;
343 template<typename Scalar_, typename Dummy =
Symmetry>
344 typename
std::enable_if<Dummy::NO_SPIN_SYM(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> >>::type
coupling_Bx (const Array<
double,Dynamic,1> &Bx) const;
347 typename
std::enable_if<Dummy::NO_SPIN_SYM(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<complex<
double>,-1,-1> >>::type
coupling_By (const Array<
double,Dynamic,1> &By) const;
349 template<typename Scalar_, typename Dummy =
Symmetry>
352 template<typename Scalar_, typename Dummy =
Symmetry>
353 typename
std::enable_if<Dummy::NO_SPIN_SYM(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> >>::type
coupling_XYZspin (const Array<
double,Dynamic,Dynamic> &Jx,
354 const Array<
double,Dynamic,Dynamic> &Jy,
355 const Array<
double,Dynamic,Dynamic> &Jz) const;
372template <
typename Symmetry_>
374FermionBase (std::size_t L_input,
bool REMOVE_DOUBLE,
bool REMVOVE_EMPTY,
bool REMOVE_UP,
bool REMOVE_DN,
int mfactor,
int k_input)
375:
FermionSite<
Symmetry>(REMOVE_DOUBLE, REMVOVE_EMPTY, REMOVE_UP, REMOVE_DN, mfactor, k_input), N_orbitals(L_input)
378 typename Symmetry::qType Q=Symmetry::qvacuum();
379 Eigen::Index inner_dim = 1;
404template<
typename Symmetry_>
409 if (N_orbitals == 1) {out = Op_1s; out.
label() = label;
return out;}
410 else if (N_orbitals == 0) {
return Zero_vac;}
414 if (FERMIONIC) {stringOp = this->F_1s();}
415 else {stringOp = this->Id_1s();}
417 if (
orbital == 0) {out = OperatorType::outerprod(Op_1s,this->Id_1s(),Op_1s.
Q()); TOGGLE=
true;}
420 if (
orbital == 1) {out = OperatorType::outerprod(stringOp,Op_1s,Op_1s.
Q()); TOGGLE=
true;}
421 else {out = OperatorType::outerprod(stringOp,stringOp,Symmetry_::qvacuum());}
423 for(std::size_t o=2; o<N_orbitals; o++)
425 if (
orbital == o) {out = OperatorType::outerprod(out,Op_1s,Op_1s.
Q()); TOGGLE=
true; }
426 else if (TOGGLE==
false) {out = OperatorType::outerprod(out,stringOp,Symmetry_::qvacuum());}
427 else if (TOGGLE==
true) {out = OperatorType::outerprod(out,this->Id_1s(),Op_1s.
Q());}
434template <
typename Symmetry_>
435template <
typename Dummy>
436typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
442template <
typename Symmetry_>
443template <
typename Dummy>
444typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
451template <
typename Symmetry_>
452template <
typename Dummy>
453typename std::enable_if<!Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
461template <
typename Symmetry_>
462template <
typename Dummy>
463typename std::enable_if<!Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
468 ss <<
"c†" << sigma;
472template <
typename Symmetry_>
473template <
typename Dummy>
474typename std::enable_if<Dummy::IS_CHARGE_SU2() and !Dummy::IS_SPIN_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
478 ss <<
"c" << sigma << G;
482template <
typename Symmetry_>
483template <
typename Dummy>
484typename std::enable_if<Dummy::IS_CHARGE_SU2() and !Dummy::IS_SPIN_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
489 ss <<
"c†" << sigma << G;
493template <
typename Symmetry_>
494template <
typename Dummy>
495typename std::enable_if<Dummy::IS_CHARGE_SU2() and Dummy::IS_SPIN_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
503template <
typename Symmetry_>
504template <
typename Dummy>
505typename std::enable_if<Dummy::IS_CHARGE_SU2() and Dummy::IS_SPIN_SU2(),
SiteOperatorQ<Symmetry_, Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
514template <
typename Symmetry_>
521template <
typename Symmetry_>
523sign (std::size_t orb1, std::size_t orb2)
const
526 if (N_orbitals == 1) {Oout = this->F_1s(); Oout.
label()=
"sign";
return Oout;}
527 else if (N_orbitals == 0) {
return Zero_vac;}
531 for (
int i=orb1; i<N_orbitals; ++i)
533 Oout = Oout * (nh(i) - ns(i));
535 for (
int i=0; i<orb2; ++i)
537 Oout = Oout * (nh(i) - ns(i));
539 Oout.
label() =
"sign";
544template <
typename Symmetry_>
545template <
typename Dummy>
546typename std::enable_if<true, SiteOperatorQ<Symmetry_,Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> > >::type
FermionBase<Symmetry_>::
552template <
typename Symmetry_>
553template <
typename Dummy>
562template <
typename Symmetry_>
569template <
typename Symmetry_>
576template <
typename Symmetry_>
577template <
typename Dummy>
584template<
typename Symmetry_>
585template <
typename Dummy>
594 Oout = 2.*M_PI*Scomp_cmplx;
598 Oout = 2.*1.i*M_PI*Scomp_cmplx;
602 cout <<
"Rcomp=" << Oout << endl << endl;
610template <
typename Symmetry_>
611template <
typename Dummy>
618template <
typename Symmetry_>
619template <
typename Dummy>
626template <
typename Symmetry_>
627template <
typename Dummy>
634template <
typename Symmetry_>
635template <
typename Dummy>
644 out = this->exp_ipiSz_1s(); out.
label() =
"exp(i*Ï€*Sz)";
653template <
typename Symmetry_>
654template <
typename Dummy>
661template <
typename Symmetry_>
662template <
typename Dummy>
669template <
typename Symmetry_>
670template <
typename Dummy>
679template <
typename Symmetry_>
680template <
typename Dummy>
689template <
typename Symmetry_>
690template <
typename Dummy>
697template <
typename Symmetry_>
698template <
typename Dummy>
705template <
typename Symmetry_>
706template <
typename Dummy>
713template <
typename Symmetry_>
714template <
typename Dummy>
734template <
typename Symmetry_>
735template <
typename Dummy>
740 out.
label() =
"Tz=1/2*(n-Id)";
744template <
typename Symmetry_>
745template <
typename Dummy>
750 out.
label() =
"tz=n-0.5*Id";
754template <
typename Symmetry_>
755template <
typename Dummy>
764template <
typename Symmetry_>
765template <
typename Dummy>
774template <
typename Symmetry_>
781template<
typename Symmetry_>
782template<
typename Scalar_>
784HubbardHamiltonian (
const Array<Scalar_,Dynamic,1> &Uph,
const Array<Scalar_,Dynamic,Dynamic> &t,
785 const Array<Scalar_,Dynamic,Dynamic> &V,
const Array<Scalar_,Dynamic,Dynamic> &J)
const
791 for (
int i=0; i<N_orbitals; ++i)
792 for (
int j=0; j<N_orbitals; ++j)
795 auto G1 =
static_cast<SUB_LATTICE>(
static_cast<int>(pow(-1,i)));
796 auto G2 =
static_cast<SUB_LATTICE>(
static_cast<int>(pow(-1,j)));
799 if constexpr (Symmetry_::IS_SPIN_SU2() and Symmetry::IS_CHARGE_SU2())
801 Oout += -t(i,j) * std::sqrt(2.)*std::sqrt(2.) * OperatorType::prod(cdag(G1,i),c(G2,j),Symmetry::qvacuum()).template cast<Scalar_>();
803 else if constexpr (Symmetry_::IS_SPIN_SU2() and !Symmetry_::IS_CHARGE_SU2())
805 Oout += -t(i,j)*std::sqrt(2.) * (OperatorType::prod(cdag(i),c(j),Symmetry::qvacuum())).
template cast<Scalar_>();
806 Oout += -t(j,i)*std::sqrt(2.) * (OperatorType::prod(c(i),cdag(j),Symmetry::qvacuum())).
template cast<Scalar_>();
808 else if constexpr (!Symmetry_::IS_SPIN_SU2() and Symmetry_::IS_CHARGE_SU2())
810 Oout += -t(i,j) * std::sqrt(2.) * (OperatorType::prod(cdag(
UP,G1,i),c(
UP,G2,j),Symmetry::qvacuum()) + OperatorType::prod(cdag(
DN,G1,i),c(
DN,G2,j),Symmetry::qvacuum())).
template cast<Scalar_>();
812 else if constexpr (!Symmetry_::IS_SPIN_SU2() and !Symmetry_::IS_CHARGE_SU2())
814 Oout += -t(i,j)*(cdag(
UP,i) * c(
UP,j) + cdag(
DN,i) * c(
DN,j)).
template cast<Scalar_>();
815 Oout += -t(j,i)*(cdag(
UP,j) * c(
UP,i) + cdag(
DN,j) * c(
DN,i)).
template cast<Scalar_>();
824 if constexpr (Symmetry::IS_CHARGE_SU2())
826 Oout += V(i,j)*std::sqrt(3.) * (OperatorType::prod(Tdag(i),T(j),Symmetry::qvacuum())).
template cast<Scalar_>();
830 Oout += V(i,j) * (OperatorType::prod(Tz(i),Tz(j),Symmetry::qvacuum())).
template cast<Scalar_>();
831 Oout += 0.5*V(i,j) * (OperatorType::prod(Tp(i,G1),Tm(j,G2),Symmetry::qvacuum()) +
832 OperatorType::prod(Tm(i,G1),Tp(j,G2),Symmetry::qvacuum())).
template cast<Scalar_>();
837 if constexpr (Symmetry::IS_SPIN_SU2())
839 lout <<
"Setting SdagS" << endl;
840 Oout += J(i,j)*std::sqrt(3.) * (OperatorType::prod(Sdag(i),S(j),Symmetry::qvacuum())).
template cast<Scalar_>();
844 Oout += J(i,j) * (OperatorType::prod(Sz(i),Sz(j),Symmetry::qvacuum())).
template cast<Scalar_>();
845 Oout += 0.5*J(i,j) * (OperatorType::prod(Sp(i),Sm(j),Symmetry::qvacuum()) +
846 OperatorType::prod(Sm(i),Sp(j),Symmetry::qvacuum())).
template cast<Scalar_>();
851 for (
int i=0; i<N_orbitals; ++i)
853 if (Uph(i) != 0. and Uph(i) != std::numeric_limits<double>::infinity())
855 Oout += 0.5*Uph(i) * nh(i).template cast<Scalar_>();
858 Oout.
label() =
"Hloc";
862template<
typename Symmetry_>
863template<
typename Scalar_,
typename Dummy>
866 const Array<Scalar_,Dynamic,1> &Uph,
867 const Array<Scalar_,Dynamic,1> &Eorb,
868 const Array<Scalar_,Dynamic,1> &Bz,
869 const Array<Scalar_,Dynamic,Dynamic> &t,
870 const Array<Scalar_,Dynamic,Dynamic> &V,
871 const Array<Scalar_,Dynamic,Dynamic> &Vz,
872 const Array<Scalar_,Dynamic,Dynamic> &Vxy,
873 const Array<Scalar_,Dynamic,Dynamic> &Jz,
874 const Array<Scalar_,Dynamic,Dynamic> &Jxy,
875 const Array<Scalar_,Dynamic,Dynamic> &C)
const
878 auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, ZeroHopping(), ZeroHopping());
880 for (
int i=0; i<N_orbitals; ++i)
881 for (
int j=0; j<N_orbitals; ++j)
883 auto G1 =
static_cast<SUB_LATTICE>(
static_cast<int>(pow(-1,i)));
884 auto G2 =
static_cast<SUB_LATTICE>(
static_cast<int>(pow(-1,j)));
888 Oout += V(i,j) * (n(i)*n(j)).
template cast<Scalar_>();
892 Oout += Vz(i,j) * (Tz(i)*Tz(j)).
template cast<Scalar_>();
896 Oout += 0.5*Vxy(i,j) * (OperatorType::prod(Tp(i,G1),Tm(j,G2),Symmetry::qvacuum()) +
897 OperatorType::prod(Tm(i,G1),Tp(j,G2),Symmetry::qvacuum())).
template cast<Scalar_>();
901 Oout += Jz(i,j) * (Sz(i)*Sz(j)).
template cast<Scalar_>();
905 Oout += 0.5*Jxy(i,j) * (Sp(i)*Sm(j) + Sm(i)*Sp(j)).
template cast<Scalar_>();
909 for (
int i=0; i<N_orbitals; ++i)
911 if (U(i) != 0. and U(i) != numeric_limits<double>::infinity())
913 Oout += U(i) * d(i).template cast<Scalar_>();
917 Oout += Eorb(i) * n(i).template cast<Scalar_>();
921 Oout -= Bz(i) * Sz(i).template cast<Scalar_>();
929 Oout += C(i) * (c(
UP,i)*c(
DN,i)).
template cast<Scalar_>();
930 Oout += C(i) * (cdag(
DN,i)*cdag(
UP,i)).
template cast<Scalar_>();
933 Oout.label() =
"Hloc";
937template<
typename Symmetry_>
938template<
typename Scalar_,
typename Dummy>
939typename std::enable_if<Dummy::IS_SPIN_SU2() and !Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
FermionBase<Symmetry_>::
940HubbardHamiltonian (const Array<Scalar_,Dynamic,1> &U,
941 const Array<Scalar_,Dynamic,1> &Uph,
942 const Array<Scalar_,Dynamic,1> &Eorb,
943 const Array<Scalar_,Dynamic,Dynamic> &t,
944 const Array<Scalar_,Dynamic,Dynamic> &V,
945 const Array<Scalar_,Dynamic,Dynamic> &Vz,
946 const Array<Scalar_,Dynamic,Dynamic> &Vxy,
947 const Array<Scalar_,Dynamic,Dynamic> &J)
const
951 auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, ZeroHopping(), J);
953 for (
int i=0; i<N_orbitals; ++i)
954 for (
int j=0; j<N_orbitals; ++j)
956 auto G1 =
static_cast<SUB_LATTICE>(
static_cast<int>(pow(-1,i)));
957 auto G2 =
static_cast<SUB_LATTICE>(
static_cast<int>(pow(-1,j)));
960 Oout += V(i,j) * (n(i)*n(j)).
template cast<Scalar_>();
964 Oout += Vz(i,j) * (Tz(i)*Tz(j)).
template cast<Scalar_>();
968 Oout += 0.5*Vxy(i,j) * (OperatorType::prod(Tp(i,G1),Tm(j,G2),Symmetry::qvacuum()) +
969 OperatorType::prod(Tm(i,G1),Tp(j,G2),Symmetry::qvacuum())).
template cast<Scalar_>();
973 for (
int i=0; i<N_orbitals; ++i)
975 if (U(i) != 0. and U(i) != numeric_limits<double>::infinity())
977 Oout += U(i) * d(i).template cast<Scalar_>();
981 Oout += Eorb(i) * n(i).template cast<Scalar_>();
984 Oout.label() =
"Hloc";
988template<
typename Symmetry_>
989template<
typename Scalar_,
typename Dummy>
990typename std::enable_if<Dummy::NO_SPIN_SYM() and Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
FermionBase<Symmetry_>::
991HubbardHamiltonian (const Array<Scalar_,Dynamic,1> &Uph,
992 const Array<Scalar_,Dynamic,Dynamic> &t,
993 const Array<Scalar_,Dynamic,Dynamic> &V,
994 const Array<Scalar_,Dynamic,Dynamic> &Jz,
995 const Array<Scalar_,Dynamic,Dynamic> &Jxy,
996 const Array<Scalar_,Dynamic,1> &Bz,
997 const Array<Scalar_,Dynamic,1> &Bx)
const
1000 auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, V, ZeroHopping());
1002 for (
int i=0; i<N_orbitals; ++i)
1003 for (
int j=0; j<N_orbitals; ++j)
1007 Oout += Jz(i,j) * (Sz(i)*Sz(j)).
template cast<Scalar_>();
1011 Oout += 0.5*Jxy(i,j) * (OperatorType::prod(Sp(i),Sm(j),Symmetry::qvacuum()) +
1012 OperatorType::prod(Sm(i),Sp(j),Symmetry::qvacuum())).
template cast<Scalar_>();
1016 for (
int i=0; i<N_orbitals; ++i)
1020 Oout += -1. * Bz(i) * Sz(i).template cast<Scalar_>();
1024 Oout += -1. * Bx(i) * Sx(i).template cast<Scalar_>();
1027 Oout.label() =
"Hloc";
1031template<
typename Symmetry_>
1032template<
typename Scalar_,
typename Dummy>
1033typename std::enable_if<Dummy::IS_SPIN_U1() and Dummy::IS_CHARGE_SU2(),
SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > >::type
FermionBase<Symmetry_>::
1034HubbardHamiltonian (const Array<Scalar_,Dynamic,1> &Uph,
1035 const Array<Scalar_,Dynamic,Dynamic> &t,
1036 const Array<Scalar_,Dynamic,Dynamic> &V,
1037 const Array<Scalar_,Dynamic,Dynamic> &Jz,
1038 const Array<Scalar_,Dynamic,Dynamic> &Jxy,
1039 const Array<Scalar_,Dynamic,1> &Bz)
const
1042 auto Oout = HubbardHamiltonian<Scalar_>(Uph, t, V, ZeroHopping());
1044 for (
int i=0; i<N_orbitals; ++i)
1045 for (
int j=0; j<N_orbitals; ++j)
1049 Oout += Jz(i,j) * (Sz(i)*Sz(j)).
template cast<Scalar_>();
1053 Oout += 0.5*Jxy(i,j) * (OperatorType::prod(Sp(i),Sm(j),Symmetry::qvacuum()) +
1054 OperatorType::prod(Sm(i),Sp(j),Symmetry::qvacuum())).
template cast<Scalar_>();
1058 for (
int i=0; i<N_orbitals; ++i)
1062 Oout += -1. * Bz(i) * Sz(i).template cast<Scalar_>();
1065 Oout.label() =
"Hloc";
1069template<
typename Symmetry_>
1070template<
typename Scalar_,
typename Dummy>
1072coupling_Bx (
const Array<double,Dynamic,1> &Bx)
const
1074 SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > Mout(Symmetry::qvacuum(), TensorBasis);
1075 for (
int i=0; i<N_orbitals; ++i)
1079 Mout -= Bx(i) * Sx(i).template cast<Scalar_>();
1085template<
typename Symmetry_>
1086template<
typename Dummy>
1088coupling_By (
const Array<double,Dynamic,1> &By)
const
1091 for (
int i=0; i<N_orbitals; ++i)
1095 Mout -= -1i*By(i) * iSy(i).template cast<complex<double> >();
1101template<
typename Symmetry_>
1102template<
typename Scalar_,
typename Dummy>
1106 SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > Mout(Symmetry::qvacuum(), TensorBasis);
1107 for (
int i=0; i<N_orbitals; ++i)
1111 Mout += Fp(i) * (c(
UP,i) + cdag(
UP,i) + c(
DN,i) + cdag(
DN,i)).
template cast<Scalar_>();
1117template<
typename Symmetry_>
1118template<
typename Scalar_,
typename Dummy>
1120coupling_XYZspin (
const Array<double,Dynamic,Dynamic> &Jx,
const Array<double,Dynamic,Dynamic> &Jy,
const Array<double,Dynamic,Dynamic> &Jz)
const
1122 SiteOperatorQ<Symmetry_,Eigen::Matrix<Scalar_,-1,-1> > Mout(Symmetry::qvacuum(), TensorBasis);
1123 for (
int i=0; i<N_orbitals; ++i)
1124 for (
int j=0; j<N_orbitals; ++j)
1128 Mout += Jx(i,j) * OperatorType::prod(Sx(i), Sx(j), Symmetry::qvacuum()).template cast<Scalar_>();
1132 Mout += -Jy(i,j) * OperatorType::prod(iSy(i), iSy(j), Symmetry::qvacuum()).template cast<Scalar_>();
1136 Mout += Jz(i,j) * OperatorType::prod(Sz(i), Sz(j), Symmetry::qvacuum()).template cast<Scalar_>();
OperatorType sign_local(std::size_t orbital=0) const
std::enable_if< Dummy::NO_SPIN_SYM(), OperatorType >::type Sx(size_t orbital=0) const
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type Tp(size_t orbital=0, SUB_LATTICE G=A) const
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), OperatorType >::type cdag(size_t orbital=0) const
OperatorType make_operator(const OperatorType &Op_1s, size_t orbital=0, bool FERMIONIC=false, string label="") const
std::enable_if< Dummy::NO_SPIN_SYM(), SiteOperatorQ< Symmetry_, Eigen::Matrix< Scalar_,-1,-1 > > >::type coupling_Bx(const Array< double, Dynamic, 1 > &Bx) const
std::enable_if< true, OperatorType >::type n(std::size_t orbital=0) const
SiteOperatorQ< Symmetry, Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > OperatorType
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type cdagcdag(size_t orbital=0) const
std::enable_if< Dummy::NO_CHARGE_SYM(), OperatorType >::type iTy(size_t orbital=0, SUB_LATTICE G=A) const
std::enable_if< Dummy::NO_SPIN_SYM(), SiteOperatorQ< Symmetry_, Eigen::Matrix< Scalar_,-1,-1 > > >::type coupling_XYZspin(const Array< double, Dynamic, Dynamic > &Jx, const Array< double, Dynamic, Dynamic > &Jy, const Array< double, Dynamic, Dynamic > &Jz) const
OperatorType Id(std::size_t orbital=0) const
std::enable_if< Dummy::IS_SPIN_SU2(), OperatorType >::type S(size_t orbital=0) const
std::size_t orbitals() const
OperatorType nh(std::size_t orbital=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Sp(size_t orbital=0) const
Qbasis< Symmetry > TensorBasis
std::enable_if< Dummy::IS_CHARGE_SU2(), OperatorType >::type Tdag(size_t orbital=0) const
SiteOperatorQ< Symmetry, Eigen::Matrix< complex< Scalar >, Eigen::Dynamic, Eigen::Dynamic > > ComplexOperatorType
std::enable_if<!Dummy::IS_SPIN_SU2(), SiteOperatorQ< Symmetry, Eigen::MatrixXcd > >::type Rcomp(SPINOP_LABEL Sa, int orbital) const
ArrayXd ZeroField() const
std::enable_if< Dummy::IS_TRIVIAL, SiteOperatorQ< Symmetry_, Eigen::Matrix< Scalar_,-1,-1 > > >::type coupling_singleFermion(const Array< double, Dynamic, 1 > &Fp) const
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type Tm(size_t orbital=0, SUB_LATTICE G=A) const
OperatorType ns(std::size_t orbital=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Sz(size_t orbital=0) const
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type cc(size_t orbital=0) const
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type Tz(size_t orbital=0) const
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type d(std::size_t orbital=0) const
OperatorType sign(std::size_t orb1=0, std::size_t orb2=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), ComplexOperatorType >::type exp_ipiSz(size_t orbital=0) const
std::enable_if< Dummy::NO_SPIN_SYM(), OperatorType >::type iSy(size_t orbital=0) const
SiteOperatorQ< Symmetry_, Eigen::Matrix< Scalar_,-1,-1 > > HubbardHamiltonian(const Array< Scalar_, Dynamic, 1 > &Uph, const Array< Scalar_, Dynamic, Dynamic > &t, const Array< Scalar_, Dynamic, Dynamic > &V, const Array< Scalar_, Dynamic, Dynamic > &J) const
ArrayXXd ZeroHopping() const
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Scomp(SPINOP_LABEL Sa, int orbital) const
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), OperatorType >::type c(size_t orbital=0) const
std::enable_if< Dummy::IS_CHARGE_SU2(), OperatorType >::type T(size_t orbital=0) const
std::enable_if< Dummy::NO_CHARGE_SYM(), OperatorType >::type Tx(size_t orbital=0, SUB_LATTICE G=A) const
std::enable_if< Dummy::IS_SPIN_SU2(), OperatorType >::type Sdag(size_t orbital=0) const
std::enable_if<!Dummy::IS_SPIN_SU2(), OperatorType >::type Sm(size_t orbital=0) const
Qbasis< Symmetry > get_basis() const
std::enable_if<!Dummy::IS_CHARGE_SU2(), OperatorType >::type tz(size_t orbital=0) const
std::enable_if< Dummy::NO_SPIN_SYM(), SiteOperatorQ< Symmetry_, Eigen::Matrix< complex< double >,-1,-1 > > >::type coupling_By(const Array< double, Dynamic, 1 > &By) const
Qbasis< Symmetry > basis_1s() const
void push_back(const std::tuple< qType, Eigen::Index, std::vector< std::string > > &state)
Biped< Symmetry, MatrixType_ > exp(const expScalar x) const