1#ifndef STRAWBERRY_HEISENBERGU1XXZ
2#define STRAWBERRY_HEISENBERGU1XXZ
44 template<
typename Symmetry_>
47 const BC boundary=BC::OPEN);
49 static const std::map<string,std::any>
defaults;
54 {
"Jxy",1.}, {
"Jxyprime",0.}, {
"Jxyrung",1.},
55 {
"Jz",0.}, {
"Jzprime",0.}, {
"Jzrung",0.},
57 {
"Dy",0.}, {
"Dyprime",0.}, {
"Dyrung",0.},
59 {
"D",2ul}, {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul},
62 {
"J",0.}, {
"Jprime",0.}
75 size_t Lcell = P.size();
77 for (
size_t l=0; l<
N_sites; ++l)
79 N_phys += P.get<
size_t>(
"Ly",l%Lcell);
85 if (P.HAS_ANY_OF({
"Jxy",
"Jxypara",
"Jxyperp",
"Jxyfull"}))
95 std::vector<std::vector<std::string>> labellist;
105template<
typename Symmetry_>
109 std::size_t Lcell = P.size();
113 for (std::size_t loc=0; loc<
N_sites; ++loc)
118 std::size_t orbitals =
B[loc].orbitals();
119 std::size_t next_orbitals =
B[lp1].orbitals();
120 std::size_t nextn_orbitals =
B[lp2].orbitals();
126 auto push_full = [&
N_sites, &loc, &
B, &P, &pushlist, &labellist, &boundary] (
string xxxFull,
string label,
127 const vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > &first,
128 const vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > &last,
129 vector<double> factor) ->
void
131 ArrayXXd Full = P.get<Eigen::ArrayXXd>(xxxFull);
132 vector<vector<std::pair<size_t,double> > > R = Geometry2D::rangeFormat(Full);
134 if (
static_cast<bool>(boundary)) {assert(R.size() ==
N_sites and
"Use an (N_sites)x(N_sites) hopping matrix for open BC!");}
135 else {assert(R.size() >= 2*
N_sites and
"Use at least a (2*N_sites)x(N_sites) hopping matrix for infinite BC!");}
137 for (
size_t j=0; j<first.size(); j++)
138 for (
size_t h=0; h<R[loc].size(); ++h)
140 size_t range = R[loc][h].first;
141 double value = R[loc][h].second;
146 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > ops(range+1);
148 for (
size_t i=1; i<range; ++i)
152 ops[range] = last[j][(loc+range)%
N_sites];
153 pushlist.push_back(std::make_tuple(loc, ops, factor[j] * value));
158 ss <<
label <<
"(" << Geometry2D::hoppingInfo(Full) <<
")";
159 labellist[loc].push_back(ss.str());
164 param2d Jxyperp = P.fill_array2d<
double>(
"Jxyrung",
"Jxy",
"Jxyperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
165 param2d Jzperp = P.fill_array2d<
double>(
"Jzrung",
"Jz",
"Jzperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
167 labellist[loc].push_back(Jxyperp.label);
168 labellist[loc].push_back(Jzperp.label);
170 ArrayXd Bz_array =
B[loc].ZeroField();
171 ArrayXd Bx_array =
B[loc].ZeroField();
172 ArrayXd mu_array =
B[loc].ZeroField();
173 ArrayXd Kz_array =
B[loc].ZeroField();
174 ArrayXd Kx_array =
B[loc].ZeroField();
175 ArrayXXd Dyperp_array =
B[loc].ZeroHopping();
178 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
181 if (P.HAS(
"Jxyfull"))
183 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {
B[loc].Sp(0),
B[loc].Sm(0)};
184 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > Sp_ranges(
N_sites);
185 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > Sm_ranges(
N_sites);
186 for (
size_t i=0; i<
N_sites; i++) {Sp_ranges[i] =
B[i].Sp(0); Sm_ranges[i] =
B[i].Sm(0);}
188 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {Sm_ranges, Sp_ranges};
189 push_full(
"Jxyfull",
"Jxyᵢⱼ", first, last, {0.5,0.5});
193 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > first {
B[loc].Sz(0)};
194 vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > Sz_ranges(
N_sites);
195 for (
size_t i=0; i<
N_sites; i++) {Sz_ranges[i] =
B[i].Sz(0);}
197 vector<vector<SiteOperatorQ<Symmetry_,Eigen::MatrixXd> > > last {Sz_ranges};
198 push_full(
"Jzfull",
"Jzᵢⱼ", first, last, {1.0});
201 if (P.HAS(
"Jxyfull") or P.HAS(
"Jzfull"))
continue;
205 param2d Jxypara = P.fill_array2d<
double>(
"Jxy",
"Jxypara", {orbitals, next_orbitals}, loc%Lcell);
206 param2d Jzpara = P.fill_array2d<
double>(
"Jz",
"Jzpara", {orbitals, next_orbitals}, loc%Lcell);
208 labellist[loc].push_back(Jxypara.label);
209 labellist[loc].push_back(Jzpara.label);
216 if (loc <
N_sites-1 or !
static_cast<bool>(boundary))
218 for (std::size_t alfa=0; alfa < orbitals; ++alfa)
219 for (std::size_t beta=0; beta < next_orbitals; ++beta)
229 param2d Jxyprime = P.fill_array2d<
double>(
"Jxyprime",
"Jxyprime_array", {orbitals, nextn_orbitals}, loc%Lcell);
230 param2d Jzprime = P.fill_array2d<
double>(
"Jzprime",
"Jzprime_array", {orbitals, nextn_orbitals}, loc%Lcell);
232 labellist[loc].push_back(Jxyprime.label);
233 labellist[loc].push_back(Jzprime.label);
235 if (loc <
N_sites-2 or !
static_cast<bool>(boundary))
237 for (std::size_t alfa=0; alfa < orbitals; ++alfa)
238 for (std::size_t beta=0; beta < nextn_orbitals; ++beta)
vector< SpinBase< Sym::U1< Sym::SpinU1 > > > B
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Sym::U1< Sym::SpinU1 >, double > >::type Scomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) 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)
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)
Heisenberg Model with XXZ-coupling.
static qarray< 1 > singlet(int N=0)
Sym::U1< Sym::SpinU1 > Symmetry
static void add_operators(const std::vector< SpinBase< Symmetry_ > > &B, const ParamHandler &P, PushType< SiteOperator< Symmetry_, double >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static const std::map< string, std::any > defaults
static constexpr MODEL_FAMILY FAMILY
static void set_operators(const std::vector< SpinBase< Symmetry_ > > &B, 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)