1#ifndef VANILLA_GRANDHUBBARDMODEL_COMPLEX 
    2#define VANILLA_GRANDHUBBARDMODEL_COMPLEX 
   26        size_t Lcell = 
P.size();
 
   28        for (
size_t l=0; l<
N_sites; ++l) 
N_phys += 
P.get<
size_t>(
"Ly",l%Lcell);
 
   40    template<
typename Symmetry_>
 
   43                               std::vector<std::vector<std::string>>& labellist, 
 
   44                               const BC boundary=BC::OPEN);
 
   46    static const std::map<string,std::any> 
defaults;
 
   51    {
"t",1.}, {
"tPrime",0.}, {
"tRung",1.},
 
   52    {
"mu",0.}, {
"t0",0.}, {
"Fp", 0.},
 
   54    {
"V",0.}, {
"Vrung",0.}, 
 
   55    {
"Vxy",0.}, {
"Vz",0.},
 
   57    {
"J",0.}, {
"Jrung",0.},
 
   59    {
"Delta",0.}, {
"DeltaUP",0.}, {
"DeltaDN",0.},
 
   60    {
"X",0.}, {
"Xperp",0.},
 
   61    {
"REMOVE_DOUBLE",
false}, {
"REMOVE_EMPTY",
false}, {
"REMOVE_UP",
false}, {
"REMOVE_DN",
false}, {
"mfactor",1}, {
"k",0}, 
 
   62    {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul}
 
   73    size_t Lcell = 
P.size();
 
   75    for (
size_t l=0; l<
N_sites; ++l)
 
   77        N_phys += 
P.get<
size_t>(
"Ly",l%Lcell);
 
   84    std::vector<std::vector<std::string>> labellist;
 
   93template<
typename Symmetry_>
 
   97    std::size_t Lcell = 
P.size();
 
  101    for (std::size_t loc=0; loc<
N_sites; ++loc)
 
  106        std::size_t orbitals = 
F[loc].orbitals();
 
  107        std::size_t next_orbitals = 
F[lp1].orbitals();
 
  108        std::size_t nextn_orbitals = 
F[lp2].orbitals();
 
  111        ss << 
"Ly=" << 
P.get<
size_t>(
"Ly",loc%Lcell);
 
  112        labellist[loc].push_back(ss.str());
 
  114        auto push_full = [&
N_sites, &loc, &
F, &
P, &pushlist, &labellist, &boundary] (
string xxxFull, 
string label,
 
  115                                                                                     const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > &first,
 
  116                                                                                     const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > > &last,
 
  117                                                                                     vector<double> factor, 
bool FERMIONIC) -> 
void 
  119            ArrayXXcd Full = 
P.get<Eigen::ArrayXXcd>(xxxFull);
 
  120            vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
 
  122            if (
static_cast<bool>(boundary)) {assert(R.size() ==   
N_sites and 
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
 
  123            else                             {assert(R.size() >= 2*
N_sites and 
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
 
  125            for (
size_t j=0; j<first.size(); j++)
 
  126            for (
size_t h=0; h<R[loc].size(); ++h)
 
  128                size_t range = R[loc][h].first;
 
  129                double value = R[loc][h].second;
 
  133                    vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > ops(range+1);
 
  135                    for (
size_t i=1; i<range; ++i)
 
  137                        if (FERMIONIC) {ops[i] = 
F[(loc+i)%
N_sites].sign().template cast<complex<double> >();}
 
  138                        else {ops[i] = 
F[(loc+i)%
N_sites].
Id().template cast<complex<double> >();}
 
  140                    ops[range] = last[j][(loc+range)%
N_sites];
 
  141                    pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
 
  146            ss << 
label << 
"(" << Geometry2D::hoppingInfo(Full) << 
")";
 
  147            labellist[loc].push_back(ss.str());
 
  157            vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > cUP_ranges(
N_sites);    
for (
size_t i=0; i<
N_sites; ++i) {cUP_ranges[i]    = 
F[i].c(
UP,0).template cast<complex<double> >();}
 
  158            vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > cdagUP_ranges(
N_sites); 
for (
size_t i=0; i<
N_sites; ++i) {cdagUP_ranges[i] = 
F[i].cdag(
UP,0).template cast<complex<double> >();}
 
  159            vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > cDN_ranges(
N_sites);    
for (
size_t i=0; i<
N_sites; ++i) {cDN_ranges[i]    = 
F[i].c(
DN,0).template cast<complex<double> >();}
 
  160            vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > cdagDN_ranges(
N_sites); 
for (
size_t i=0; i<
N_sites; ++i) {cdagDN_ranges[i] = 
F[i].cdag(
DN,0).template cast<complex<double> >();}
 
  162            vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> >          frst {cdagUP_sign_local, cUP_sign_local, cdagDN_sign_local, cDN_sign_local};
 
  163            vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXcd> > > last {cUP_ranges, cdagUP_ranges, cDN_ranges, cdagDN_ranges};
 
  164            push_full(
"tFull", 
"tᵢⱼ", frst, last, {-1., +1., -1., +1.}, 
PROP::FERMIONIC);
 
  169        param1d U = 
P.fill_array1d<
double>(
"U", 
"Uorb", orbitals, loc%Lcell);
 
  170        param1d Uph = 
P.fill_array1d<
double>(
"Uph", 
"Uorb", orbitals, loc%Lcell);
 
  171        param1d t0 = 
P.fill_array1d<
double>(
"t0", 
"t0orb", orbitals, loc%Lcell);
 
  172        param1d mu = 
P.fill_array1d<
double>(
"mu", 
"muorb", orbitals, loc%Lcell);
 
  173        param1d Bz = 
P.fill_array1d<
double>(
"Bz", 
"Bzorb", orbitals, loc%Lcell);
 
  174        param2d tperp = 
P.fill_array2d<
double>(
"tRung", 
"t", 
"tPerp", orbitals, loc%Lcell, 
P.get<
bool>(
"CYLINDER"));
 
  175        param2d Vperp = 
P.fill_array2d<
double>(
"Vrung", 
"V", 
"Vperp", orbitals, loc%Lcell, 
P.get<
bool>(
"CYLINDER"));
 
  176        param2d Vxyperp = 
P.fill_array2d<
double>(
"Vxyrung", 
"Vxy", 
"Vxyperp", orbitals, loc%Lcell, 
P.get<
bool>(
"CYLINDER"));
 
  177        param2d Vzperp = 
P.fill_array2d<
double>(
"Vzrung", 
"Vz", 
"Vzperp", orbitals, loc%Lcell, 
P.get<
bool>(
"CYLINDER"));
 
  178        param2d Jperp = 
P.fill_array2d<
double>(
"Jrung", 
"J", 
"Jperp", orbitals, loc%Lcell, 
P.get<
bool>(
"CYLINDER"));
 
  180        labellist[loc].push_back(U.label);
 
  181        labellist[loc].push_back(Uph.label);
 
  182        labellist[loc].push_back(t0.label);
 
  183        labellist[loc].push_back(mu.label);
 
  184        labellist[loc].push_back(Bz.label);
 
  185        labellist[loc].push_back(tperp.label);
 
  186        labellist[loc].push_back(Vperp.label);
 
  187        labellist[loc].push_back(Jperp.label);
 
  188        ArrayXd  C_array = 
F[loc].ZeroField();
 
  195            F[loc].
template HubbardHamiltonian<double>(U.a, Uph.a, t0.a-mu.a, Bz.a, tperp.a, Vperp.a, Vzperp.a, Vxyperp.a, Jperp.a, Jperp.a, C_array)
 
  196        ).cast<complex<double> >());
 
  197        pushlist.push_back(std::make_tuple(loc, Hloc, 1.+0.i));
 
std::enable_if< Dummy::IS_SPIN_SU2() and!Dummy::IS_CHARGE_SU2(), Mpo< Sym::U0, complex< double > > >::type P(size_t locx1, size_t locx2, size_t locy1=0, size_t locy2=0) const
Mpo< Sym::U0, complex< double > > Id() const
vector< FermionBase< Sym::U0 > > 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
MpoTerms< Symmetry, OtherScalar > cast()
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)
HubbardComplex(Mpo< Symmetry, complex< double > > &Mpo_input, const vector< Param > ¶ms)
static constexpr MODEL_FAMILY FAMILY
static void set_operators(const std::vector< FermionBase< Symmetry_ > > &F, const ParamHandler &P, PushType< SiteOperator< Symmetry_, complex< double > >, complex< double > > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static const std::map< string, std::any > defaults
static constexpr int spinfac
static qarray< 0 > singlet(int N)
#define MAKE_TYPEDEFS(MODEL)