1#ifndef KONDONECKLACEU1_H_
2#define KONDONECKLACEU1_H_
14#include "Geometry2D.h"
28 typedef Eigen::Matrix<
double,Eigen::Dynamic,Eigen::Dynamic>
MatrixType;
59 static const std::map<string,std::any>
defaults;
74 {
"Jlocxy",1.}, {
"Jlocz",1.},
75 {
"Jparaxy",1.}, {
"Jparaz",1.}, {
"Jperpxy",0.}, {
"Jperpz",0.}, {
"Jprimexy",1.}, {
"Jprimez",1.},
76 {
"Bz",0.}, {
"Bzsub",0.},
77 {
"Dimp",2ul}, {
"Dsub",2ul}, {
"Ly",1ul},
78 {
"maxPower",2ul}, {
"CYLINDER",
false}
83 {
"max_alpha",100.}, {
"min_alpha",1e-11}, {
"lim_alpha",12ul}, {
"eps_svd",1e-7},
84 {
"Dincr_abs", 4ul}, {
"Dincr_per", 2ul}, {
"Dincr_rel", 1.1},
85 {
"min_Nsv",1ul}, {
"max_Nrich",-1},
86 {
"max_halfsweeps",100ul}, {
"min_halfsweeps",24ul},
87 {
"Dinit",5ul}, {
"Qinit",6ul}, {
"Dlimit",250ul},
88 {
"tol_eigval",1e-9}, {
"tol_state",1e-8},
99 std::size_t Lcell = P.size();
102 for (
size_t loc=0; loc<
N_sites; ++loc)
104 N_phys += P.get<
size_t>(
"Ly",loc%Lcell);
109 std::vector<std::vector<std::string>> labellist(
N_sites);
121 std::size_t Lcell = P.size();
123 for(std::size_t loc=0; loc<
N_sites; ++loc)
125 std::size_t orbitals =
Bsub[loc].orbitals();
126 std::size_t next_orbitals =
Bsub[(loc+1)%
N_sites].orbitals();
127 std::size_t nextn_orbitals =
Bsub[(loc+2)%
N_sites].orbitals();
131 std::stringstream ss1, ss2, ss3;
134 ss3 <<
"Ly=" << P.get<
size_t>(
"Ly",loc%Lcell);
135 labellist[loc].push_back(ss1.str());
136 labellist[loc].push_back(ss2.str());
137 labellist[loc].push_back(ss3.str());
140 param1d Bzsub = P.fill_array1d<
double>(
"Bzsub",
"Bzsuborb", orbitals, loc%Lcell);
141 labellist[loc].push_back(Bzsub.label);
144 param1d Bz = P.fill_array1d<
double>(
"Bz",
"Bzorb", orbitals, loc%Lcell);
145 labellist[loc].push_back(Bz.label);
149 auto Hloc = Himp + Hsub;
152 param1d Jlocxy = P.fill_array1d<
double>(
"Jlocxy",
"Jlocxy_array", orbitals, loc%Lcell);
153 param1d Jlocz = P.fill_array1d<
double>(
"Jlocz",
"Jlocz_array", orbitals, loc%Lcell);
156 labellist[loc].push_back(Jlocxy.label);
157 labellist[loc].push_back(Jlocz.label);
158 for(
int alpha=0; alpha<orbitals; ++alpha)
167 auto push_full = [&
N_sites, &loc, &
Bimp, &
Bsub, &P, &pushlist, &labellist, &boundary] (
string xxxFull,
string label,
168 const vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > &first,
169 const vector<vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > > &last,
170 vector<double> factor) ->
void
172 ArrayXXd Full = P.get<Eigen::ArrayXXd>(xxxFull);
173 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
175 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
176 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
178 for (
size_t j=0; j<first.size(); j++)
179 for (
size_t h=0; h<R[loc].size(); ++h)
181 size_t range = R[loc][h].first;
182 double value = R[loc][h].second;
186 vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > ops(range+1);
188 for (
size_t i=1; i<range; ++i)
192 ops[range] = last[j][(loc+range)%
N_sites];
193 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
198 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
199 labellist[loc].push_back(ss.str());
203 if (P.HAS(
"Jxyfull"))
209 vector<vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > > last {Sm_ranges,Sp_ranges};
210 push_full(
"Jxyfull",
"Jxyᵢⱼ", first, last, {0.5,0.5});
216 vector<vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > > last {Sz_ranges};
217 push_full(
"Jzfull",
"Jzᵢⱼ", first, last, {1.});
219 if (P.HAS(
"Ixyfull"))
225 vector<vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > > last {Sm_ranges,Sp_ranges};
226 push_full(
"Ixyfull",
"Ixyᵢⱼ", first, last, {0.5,0.5});
232 vector<vector<SiteOperatorQ<Symmetry,Eigen::MatrixXd> > > last {Sz_ranges};
233 push_full(
"Izfull",
"Izᵢⱼ", first, last, {1.});
235 if (P.HAS(
"Jzfull") or P.HAS(
"Jxyfull") or P.HAS(
"Izfull") or P.HAS(
"Ixyfull")) {
continue;}
boost::rational< int > frac
std::string print_frac_nice(frac r)
#define EIGEN_DEFAULT_SPARSE_INDEX_TYPE
SiteOperator< Symmetry, Scalar_ > kroneckerProduct(const SiteOperator< Symmetry, Scalar_ > &O1, const SiteOperator< Symmetry, Scalar_ > &O2)
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Sym::U1< Sym::SpinU1 > > >::type Scomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const
vector< SpinBase< Sym::U1< Sym::SpinU1 > > > Bsub
vector< SpinBase< Sym::U1< Sym::SpinU1 > > > Bimp
void finalize(const bool COMPRESS=true, const std::size_t power=1, const double tolerance=::mynumeric_limits< double >::epsilon())
void set_verbosity(const DMRG::VERBOSITY::OPTION VERB_in)
void setLocBasis(const std::vector< std::vector< qType > > &q)
DMRG::VERBOSITY::OPTION VERB
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 const std::map< string, std::any > sweep_defaults
bool validate(qType qnum)
Sym::U1< Sym::SpinU1 > Symmetry
Eigen::SparseMatrix< double, Eigen::ColMajor, EIGEN_DEFAULT_SPARSE_INDEX_TYPE > SparseMatrixType
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixType
static constexpr MODEL_FAMILY FAMILY
static const std::map< string, std::any > defaults
static void set_operators(const std::vector< SpinBase< Symmetry > > &Bsub, const std::vector< SpinBase< Symmetry > > &Bimp, const ParamHandler &P, PushType< SiteOperator< Symmetry, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary)
#define MAKE_TYPEDEFS(MODEL)