1#ifndef STRAWBERRY_HUBBARDMODEL_U1SPINONLY
2#define STRAWBERRY_HUBBARDMODEL_U1SPINONLY
30 size_t Lcell =
P.size();
32 for (
size_t l=0; l<
N_sites; ++l)
N_phys +=
P.get<
size_t>(
"Ly",l%Lcell);
41 template<
typename Symmetry_>
44 const BC boundary=BC::OPEN);
51 static const std::map<string,std::any>
defaults;
56 {
"t",1.}, {
"tPrime",0.}, {
"tRung",1.},
59 {
"V",0.}, {
"Vrung",0.},
60 {
"Vxy",0.}, {
"Vz",0.},
62 {
"J",0.}, {
"Jperp",0.}, {
"J3site",0.},
63 {
"X",0.}, {
"Xperp",0.},
64 {
"C",0.}, {
"Cperp",0.},
65 {
"REMOVE_DOUBLE",
false}, {
"REMOVE_EMPTY",
false}, {
"REMOVE_UP",
false}, {
"REMOVE_DN",
false}, {
"mfactor",1}, {
"k",0},
66 {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul}
77 size_t Lcell =
P.size();
79 for (
size_t l=0; l<
N_sites; ++l)
81 N_phys +=
P.get<
size_t>(
"Ly",l%Lcell);
85 param1d U =
P.fill_array1d<
double>(
"U",
"Uorb",
F[0].orbitals(), 0);
86 if (isfinite(U.a.sum()))
90 else if (P.HAS_ANY_OF({
"J",
"J3site"}))
100 std::vector<std::vector<std::string>> labellist;
110template<
typename Symmetry_>
114 std::size_t Lcell =
P.size();
117 for(std::size_t loc=0; loc<
N_sites; ++loc)
119 std::size_t orbitals =
F[loc].orbitals();
121 ArrayXd U_array =
F[loc].ZeroField();
122 ArrayXd Uph_array =
F[loc].ZeroField();
123 ArrayXd E_array =
F[loc].ZeroField();
124 ArrayXd Bz_array =
F[loc].ZeroField();
125 ArrayXXd tperp_array =
F[loc].ZeroHopping();
126 ArrayXXd Vperp_array =
F[loc].ZeroHopping();
127 ArrayXXd Jperp_array =
F[loc].ZeroHopping();
129 param1d C =
P.fill_array1d<
double>(
"C",
"Corb", orbitals, loc%Lcell);
130 labellist[loc].push_back(C.label);
135 F[loc].
template HubbardHamiltonian<double>(U_array, Uph_array, E_array, Bz_array, tperp_array, Vperp_array, Vperp_array, Vperp_array, Jperp_array, Jperp_array, C.a)
137 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
139 auto push_full = [&
N_sites, &loc, &
F, &
P, &pushlist, &labellist, &boundary] (
string xxxFull,
string label,
140 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
141 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
142 vector<double> factor,
bool FERMIONIC) ->
void
144 ArrayXXd Full =
P.get<Eigen::ArrayXXd>(xxxFull);
145 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
147 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
148 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
150 for (
size_t j=0; j<first.size(); j++)
151 for (
size_t h=0; h<R[loc].size(); ++h)
153 size_t range = R[loc][h].first;
154 double value = R[loc][h].second;
158 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
160 for (
size_t i=1; i<range; ++i)
162 if (FERMIONIC) {ops[i] =
F[(loc+i)%
N_sites].sign();}
165 ops[range] = last[j][(loc+range)%
N_sites];
166 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
171 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
172 labellist[loc].push_back(ss.str());
183 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cUP_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; ++i) {cUP_ranges[i] =
F[i].c(
UP,0);}
184 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cDN_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; ++i) {cDN_ranges[i] =
F[i].c(
DN,0);}
185 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cdagUP_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; ++i) {cdagUP_ranges[i] =
F[i].cdag(
UP,0);}
186 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cdagDN_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; ++i) {cdagDN_ranges[i] =
F[i].cdag(
DN,0);}
191 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > frst {cUP_sign_local, cdagUP_sign_local};
192 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {cDN_ranges, cdagDN_ranges};
193 push_full(
"Cfull",
"Cᵢⱼ", frst, last, {+1., -1.},
PROP::FERMIONIC);
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), Mpo< Sym::U1< Sym::SpinU1 >, double > >::type P(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
Mpo< Sym::U1< Sym::SpinU1 >, double > Id() const
vector< FermionBase< Sym::U1< Sym::SpinU1 > > > F
void finalize(const bool COMPRESS=true, const std::size_t power=1, const double tolerance=::mynumeric_limits< double >::epsilon())
void setLocBasis(const std::vector< std::vector< qType > > &q)
DMRG::VERBOSITY::OPTION VERB
void set_name(const std::string &label_in)
static std::vector< T > get_N_site_interaction(T const &Op0, Operator const &... Ops)
void precalc_TwoSiteData(bool FORCE=false)
void construct_from_pushlist(const PushType< OperatorType, CouplScalar > &pushlist, const std::vector< std::vector< std::string > > &labellist, size_t Lcell)
static qarray< 1 > singlet(int N=0)
static constexpr MODEL_FAMILY FAMILY
HubbardU1spin(Mpo< Symmetry > &Mpo_input, const vector< Param > ¶ms)
static const std::map< string, std::any > defaults
Sym::U1< Sym::SpinU1 > Symmetry
static void add_operators(const std::vector< FermionBase< Symmetry_ > > &F, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static constexpr int spinfac
static void set_operators(const std::vector< FermionBase< Symmetry_ > > &F, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
#define MAKE_TYPEDEFS(MODEL)