1#ifndef STRAWBERRY_SPINLESSFERMIONSU1
2#define STRAWBERRY_SPINLESSFERMIONSU1
5#include "models/SpinlessFermionsObservables.h"
31 size_t Lcell = P.size();
33 for (
size_t l=0; l<
N_sites; ++l)
N_phys += P.get<
size_t>(
"Ly",l%Lcell);
40 template<
typename Symmetry_>
48 static const std::map<string,std::any>
defaults;
54 {
"t",1.}, {
"tPrime",0.},
56 {
"Vprime",0.}, {
"VphPrime",0.},
58 {
"D",2ul}, {
"CALC_SQUARE",
true}, {
"CYLINDER",
false}, {
"OPEN_BC",
true}, {
"Ly",1ul},
79 size_t Lcell = P.size();
81 for (
size_t l=0; l<
N_sites; ++l)
83 N_phys += P.get<
size_t>(
"Ly",l%Lcell);
93 std::vector<std::vector<std::string>> labellist;
105template<
typename Symmetry_>
110 std::size_t Lcell = P.size();
114 for (std::size_t loc=0; loc<
N_sites; ++loc)
119 std::size_t orbitals =
F[loc].orbitals();
120 std::size_t next_orbitals =
F[lp1].orbitals();
121 std::size_t nextn_orbitals =
F[lp2].orbitals();
124 ss <<
"Ly=" << P.get<
size_t>(
"Ly",loc%Lcell);
125 labellist[loc].push_back(ss.str());
127 auto push_full = [&
N_sites, &loc, &
F, &P, &pushlist, &labellist, &boundary] (
string xxxFull,
string label,
128 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
129 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
130 vector<double> factor,
bool FERMIONIC) ->
void
132 ArrayXXd Full = P.get<Eigen::ArrayXXd>(xxxFull);
133 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
135 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
136 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
138 for (
size_t j=0; j<first.size(); j++)
139 for (
size_t h=0; h<R[loc].size(); ++h)
141 size_t range = R[loc][h].first;
142 double value = R[loc][h].second;
146 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
148 for (
size_t i=1; i<range; ++i)
150 if (FERMIONIC) {ops[i] =
F[(loc+i)%
N_sites].sign();}
151 else {ops[i] =
F[(loc+i)%
N_sites].Id();}
153 ops[range] = last[j][(loc+range)%
N_sites];
154 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
159 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
160 labellist[loc].push_back(ss.str());
203 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > c_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; ++i) {c_ranges[i] =
F[i].c(0);}
204 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > cdag_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; ++i) {cdag_ranges[i] =
F[i].cdag(0);}
206 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > frst {cdag_sign_local, c_sign_local};
207 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {c_ranges, cdag_ranges};
209 push_full(
"tFull",
"tᵢⱼ", frst, last, {-1., +1.},
PROP::FERMIONIC);
212 if (P.HAS(
"VextFull"))
245 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {
F[loc].n(0)};
246 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > n_ranges(
N_sites);
247 for (
size_t i=0; i<
N_sites; i++)
249 n_ranges[i] =
F[i].n(0);
252 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {n_ranges};
253 push_full(
"VextFull",
"Vᵢⱼ", first, last, {1.},
PROP::BOSONIC);
256 if (P.HAS(
"VphFull"))
258 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {
F[loc].nph(0)};
259 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > nph_ranges(
N_sites);
260 for (
size_t i=0; i<
N_sites; i++)
262 nph_ranges[i] =
F[i].nph(0);
265 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {nph_ranges};
266 push_full(
"VphFull",
"Vphᵢⱼ", first, last, {1.},
PROP::BOSONIC);
271 param1d t0 = P.fill_array1d<
double>(
"t0",
"t0orb", orbitals, loc%Lcell);
272 param1d mu = P.fill_array1d<
double>(
"mu",
"muorb", orbitals, loc%Lcell);
274 labellist[loc].push_back(t0.label);
275 labellist[loc].push_back(mu.label);
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)
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)
vector< SpinlessFermionBase< Sym::U1< Sym::ChargeU1 > > > F
static qarray< 1 > singlet(int N)
Sym::U1< Sym::ChargeU1 > Symmetry
static void set_operators(const std::vector< SpinlessFermionBase< 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 MODEL_FAMILY FAMILY
static const std::map< string, std::any > defaults
SpinlessFermionsU1(Mpo< Symmetry > &Mpo_input, const vector< Param > ¶ms)
static constexpr int spinfac
#define MAKE_TYPEDEFS(MODEL)