1#ifndef DOUBLEHEISENBERGMODELSU2
2#define DOUBLEHEISENBERGMODELSU2
11#include "Geometry2D.h"
28 typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic>
MatrixType;
46 template<
typename Symmetry_>
48 const ParamHandler &P,
50 const BC boundary=BC::OPEN);
61 {
"D",2ul}, {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul}
66 {
"max_alpha",100.}, {
"min_alpha",1e-11}, {
"lim_alpha",11ul}, {
"eps_svd",1e-7},
67 {
"Dincr_abs", 2ul}, {
"Dincr_per", 2ul}, {
"Dincr_rel", 1.1},
68 {
"min_Nsv",1ul}, {
"max_Nrich",-1},
69 {
"max_halfsweeps",30ul}, {
"min_halfsweeps",6ul},
70 {
"Dinit",3ul}, {
"Qinit",20ul}, {
"Dlimit",500ul},
71 {
"tol_eigval",1e-6}, {
"tol_state",1e-5},
82 size_t Lcell = P.size();
84 for (
size_t l=0; l<
N_sites; ++l)
86 N_phys += P.get<
size_t>(
"Ly",l%Lcell);
93 std::vector<std::vector<std::string>> labellist;
102template<
typename Symmetry_>
106 std::size_t Lcell = P.size();
110 for (std::size_t loc=0; loc<
N_sites; ++loc)
113 ss <<
"Ly=" << P.get<
size_t>(
"Ly",loc%Lcell);
114 labellist[loc].push_back(ss.str());
116 auto push_full = [&
N_sites, &loc, &
B0, &
B1, &P, &pushlist, &labellist, &boundary]
117 (
string xxxFull,
string label,
118 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
119 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
120 vector<double> factor) ->
void
122 ArrayXXd Full = P.get<Eigen::ArrayXXd>(xxxFull);
123 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
125 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
126 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
128 for (
size_t j=0; j<first.size(); j++)
129 for (
size_t h=0; h<R[loc].size(); ++h)
131 size_t range = R[loc][h].first;
132 double value = R[loc][h].second;
136 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
138 for (
size_t i=1; i<range; ++i)
142 ops[range] = last[j][(loc+range)%
N_sites];
143 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
148 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
149 labellist[loc].push_back(ss.str());
155 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > S_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; i++)
157 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {S_ranges};
158 push_full(
"Kfull",
"Kᵢⱼ", first, last, {3.});
164 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > S_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; i++)
166 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {S_ranges};
167 push_full(
"J1full",
"J1ᵢⱼ", first, last, {std::sqrt(3.)});
173 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > S_ranges(
N_sites);
for (
size_t i=0; i<
N_sites; i++)
175 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {S_ranges};
176 push_full(
"J2full",
"J2ᵢⱼ", first, last, {std::sqrt(3.)});
SiteOperator< Symmetry, Scalar_ > kroneckerProduct(const SiteOperator< Symmetry, Scalar_ > &O1, const SiteOperator< Symmetry, Scalar_ > &O2)
vector< SpinBase< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::AltSpinSU2 > >, 0ul > > B0
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::AltSpinSU2 > > > >::type S(size_t locx, size_t locy=0, double factor=1.) const
vector< SpinBase< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::AltSpinSU2 > >, 1ul > > B1
std::enable_if< Dummy::IS_SPIN_SU2(), Mpo< Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::AltSpinSU2 > > > >::type Sdag(size_t locx, size_t locy=0, double factor=std::sqrt(3.)) const
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)
static SiteOperatorQ< Symmetry, MatrixType_ > outerprod(const SiteOperatorQ< Symmetry, MatrixType_ > &O1, const SiteOperatorQ< Symmetry, MatrixType_ > &O2, const qType &target)
static void set_operators(const std::vector< SpinBase< Symmetry_, 0ul > > &B0, const std::vector< SpinBase< Symmetry_, 1ul > > &B1, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static qarray< 2 > singlet(int N=0)
SiteOperatorQ< Symmetry, MatrixType > OperatorType
Sym::S1xS2< Sym::SU2< Sym::SpinSU2 >, Sym::SU2< Sym::AltSpinSU2 > > Symmetry
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixType
static constexpr MODEL_FAMILY FAMILY
static const map< string, any > defaults
static const map< string, any > sweep_defaults
#define MAKE_TYPEDEFS(MODEL)