1#ifndef STRAWBERRY_HEISENBERGXYZ
2#define STRAWBERRY_HEISENBERGXYZ
57 size_t Lcell = P.size();
59 for (
size_t l=0; l<
N_sites; ++l)
N_phys += P.get<
size_t>(
"Ly",l%Lcell);
66 template<
typename Symmetry_>
68 PushType<
SiteOperator<Symmetry_,complex<double>>,
double>& pushlist, std::vector<std::vector<std::string>>& labellist,
69 const BC boundary=BC::OPEN);
71 static const std::map<string,std::any>
defaults;
76 {
"Jx",0.}, {
"Jy",0.}, {
"Jz",0.},
77 {
"Jxrung",0.}, {
"Jyrung",0.}, {
"Jzrung",0.},
78 {
"Jxprime",0.}, {
"Jyprime",0.}, {
"Jzprime",0.},
81 {
"Dx",0.}, {
"Dy",0.}, {
"Dz",0.},
82 {
"Dxrung",0.}, {
"Dyrung",0.}, {
"Dzrung",0.},
83 {
"Dxprime",0.}, {
"Dyprime",0.}, {
"Dzprime",0.},
85 {
"Bx",0.}, {
"By",0.}, {
"Bz",0.},
86 {
"Kx",0.}, {
"Ky",0.}, {
"Kz",0.},
88 {
"D",2ul}, {
"maxPower",2ul}, {
"CYLINDER",
false}, {
"Ly",1ul},
90 {
"J",0.}, {
"Jprime",0.}, {
"Jxy",0.}, {
"mu",0.}, {
"nu",0.}, {
"R",0.}, {
"Jxyprime",0.}, {
"Jzprime",0.}, {
"Jw",0.}, {
"betaKT",0.}
100 size_t Lcell = P.size();
102 for (
size_t l=0; l<N_sites; ++l)
104 N_phys += P.get<
size_t>(
"Ly",l%Lcell);
105 setLocBasis(
B[l].get_basis().qloc(),l);
108 if(P.HAS_ANY_OF({
"Dx",
"Dy",
"Dz",
"Dxprime",
"Dyprime",
"Dzprime",
"Dxpara",
"Dypara",
"Dzpara",
"Dxperp",
"Dzperp"}))
110 this->set_name(
"Dzyaloshinsky-Moriya");
114 this->set_name(
"HeisenbergXYZ");
118 std::vector<std::vector<std::string>> labellist;
124 add_operators(
B,P,pushlist,labellist,boundary);
126 this->construct_from_pushlist(pushlist, labellist, Lcell);
129 this->precalc_TwoSiteData();
132template<
typename Symmetry_>
136 std::size_t Lcell = P.size();
140 for(std::size_t loc=0; loc<
N_sites; ++loc)
142 std::size_t orbitals =
B[loc].orbitals();
143 std::size_t next_orbitals =
B[(loc+1)%
N_sites].orbitals();
144 std::size_t nextn_orbitals =
B[(loc+2)%
N_sites].orbitals();
146 stringstream ss1, ss2;
148 ss2 <<
"Ly=" << P.get<
size_t>(
"Ly",loc%Lcell);
149 labellist[loc].push_back(ss1.str());
150 labellist[loc].push_back(ss2.str());
154 param2d Jxperp = P.fill_array2d<
double>(
"Jxrung",
"Jx",
"Jxperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
155 param2d Jyperp = P.fill_array2d<
double>(
"Jyrung",
"Jy",
"Jyperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
156 param2d Jzperp = P.fill_array2d<
double>(
"Jzrung",
"Jz",
"Jzperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
157 param2d Dxperp = P.fill_array2d<
double>(
"Dxrung",
"Dx",
"Dxperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
158 param2d Dzperp = P.fill_array2d<
double>(
"Dzrung",
"Dz",
"Dzperp", orbitals, loc%Lcell, P.get<
bool>(
"CYLINDER"));
159 param1d By = P.fill_array1d<
double>(
"By",
"Byorb", orbitals, loc%Lcell);
160 param1d Ky = P.fill_array1d<
double>(
"Ky",
"Kyorb", orbitals, loc%Lcell);
162 labellist[loc].push_back(Jxperp.label);
163 labellist[loc].push_back(Jyperp.label);
164 labellist[loc].push_back(Jzperp.label);
165 labellist[loc].push_back(Dxperp.label);
166 labellist[loc].push_back(Dzperp.label);
167 labellist[loc].push_back(By.label);
168 labellist[loc].push_back(Ky.label);
170 std::array<Eigen::ArrayXXd,3> Jperp = {Jxperp.a, Jyperp.a, Jzperp.a};
171 std::array<Eigen::ArrayXd,3> B_array = {
B[loc].ZeroField(), By.a,
B[loc].ZeroField()};
172 std::array<Eigen::ArrayXd,3> K_array = {
B[loc].ZeroField(), Ky.a,
B[loc].ZeroField()};
173 std::array<Eigen::ArrayXXd,3> Dperp = {Dxperp.a,
B[loc].ZeroHopping(), Dzperp.a};
176 pushlist.push_back(std::make_tuple(loc, Hloc, 1.));
179 param2d Jxpara = P.fill_array2d<
double>(
"Jx",
"Jxpara", {orbitals, next_orbitals}, loc%Lcell);
180 param2d Jypara = P.fill_array2d<
double>(
"Jy",
"Jypara", {orbitals, next_orbitals}, loc%Lcell);
181 param2d Jzpara = P.fill_array2d<
double>(
"Jz",
"Jzpara", {orbitals, next_orbitals}, loc%Lcell);
182 param2d Dxpara = P.fill_array2d<
double>(
"Dx",
"Dxpara", {orbitals, next_orbitals}, loc%Lcell);
183 param2d Dzpara = P.fill_array2d<
double>(
"Dz",
"Dzpara", {orbitals, next_orbitals}, loc%Lcell);
185 labellist[loc].push_back(Jxpara.label);
186 labellist[loc].push_back(Jypara.label);
187 labellist[loc].push_back(Jzpara.label);
188 labellist[loc].push_back(Dxpara.label);
189 labellist[loc].push_back(Dzpara.label);
191 if (loc <
N_sites-1 or !
static_cast<bool>(boundary))
193 for (std::size_t alfa=0; alfa<orbitals; ++alfa)
194 for (std::size_t beta=0; beta<next_orbitals; ++beta)
196 auto local_Sx =
B[loc].Scomp(
SX,alfa).template cast<complex<double> >();
197 auto local_Sy = -1.i*
B[loc].Scomp(
iSY,alfa).template cast<complex<double> >();
198 auto local_Sz =
B[loc].Scomp(
SZ,alfa).template cast<complex<double> >();
200 auto tight_Sx =
B[(loc+1)%
N_sites].
Scomp(
SX,beta).template cast<complex<double> >();
201 auto tight_Sy = -1.i*
B[(loc+1)%
N_sites].
Scomp(
iSY,beta).template cast<complex<double> >();
202 auto tight_Sz =
B[(loc+1)%
N_sites].
Scomp(
SZ,beta).template cast<complex<double> >();
216 param2d Jxprime = P.fill_array2d<
double>(
"Jxprime",
"Jxprime", {orbitals, nextn_orbitals}, loc%Lcell);
217 param2d Jyprime = P.fill_array2d<
double>(
"Jyprime",
"Jyprime", {orbitals, nextn_orbitals}, loc%Lcell);
218 param2d Jzprime = P.fill_array2d<
double>(
"Jzprime",
"Jzprime", {orbitals, nextn_orbitals}, loc%Lcell);
219 param2d Dxprime = P.fill_array2d<
double>(
"Dxprime",
"Dxprime_array", {orbitals, nextn_orbitals}, loc%Lcell);
220 param2d Dzprime = P.fill_array2d<
double>(
"Dzprime",
"Dzprime_array", {orbitals, nextn_orbitals}, loc%Lcell);
222 labellist[loc].push_back(Jxprime.label);
223 labellist[loc].push_back(Jyprime.label);
224 labellist[loc].push_back(Jzprime.label);
225 labellist[loc].push_back(Dxprime.label);
226 labellist[loc].push_back(Dzprime.label);
228 if(loc <
N_sites-2 or !
static_cast<bool>(boundary))
230 for(std::size_t alfa=0; alfa<orbitals; ++alfa)
231 for(std::size_t beta=0; beta<nextn_orbitals; ++beta)
233 auto local_Sx =
B[loc].Scomp(
SX,alfa).template cast<complex<double> >();
234 auto local_Sy = -1.i*
B[loc].Scomp(
iSY,alfa).template cast<complex<double> >();
235 auto local_Sz =
B[loc].Scomp(
SZ,alfa).template cast<complex<double> >();
236 auto tight_Id =
B[(loc+1)%
N_sites].Id().template cast<complex<double> >();
237 auto nextn_Sx =
B[(loc+2)%
N_sites].
Scomp(
SX,beta).template cast<complex<double> >();
238 auto nextn_Sy = -1.i*
B[(loc+2)%
N_sites].
Scomp(
iSY,beta).template cast<complex<double> >();
239 auto nextn_Sz =
B[(loc+2)%
N_sites].
Scomp(
SZ,beta).template cast<complex<double> >();
boost::rational< int > frac
std::string print_frac_nice(frac r)
vector< SpinBase< Sym::U0 > > B
std::enable_if<!Dummy::IS_SPIN_SU2(), Mpo< Sym::U0, double > >::type Scomp(SPINOP_LABEL Sa, size_t locx, size_t locy=0, double factor=1.) const
DMRG::VERBOSITY::OPTION VERB
static std::vector< T > get_N_site_interaction(T const &Op0, Operator const &... Ops)
void precalc_TwoSiteData(bool FORCE=false)
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)
Heisenberg Model with general XYZ coupling.
void add_operators(const std::vector< SpinBase< Symmetry_ > > &B, const ParamHandler &P, PushType< SiteOperator< Symmetry_, complex< double > >, double > &pushlist, std::vector< std::vector< std::string > > &labellist, const BC boundary=BC::OPEN)
static qarray< 0 > singlet(int N=0)
HeisenbergXYZ(Mpo< Symmetry, complex< double > > &Mpo_input, const vector< Param > ¶ms)
static constexpr MODEL_FAMILY FAMILY
static const std::map< string, std::any > defaults
static const std::map< string, std::any > sweep_defaults
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
#define MAKE_TYPEDEFS(MODEL)
void finalize(bool PRINT_STATS=false)
PushType< OtherOperator, OtherScalar > cast()