1#ifndef STOUT_SMEAR_NCH_H_
2#define STOUT_SMEAR_NCH_H_
28 U[d2].start_gather(d1,
ALL);
30 onsites(
ALL) staples[d1][X] = 0;
36 mult_aa(U[d1][X], U[d2][X + d1], tF1[X]);
38 mult(tF1[X], U[d2][X], lw1[X]);
45 mult_add(U[d1][X + d2], tF1[X], staples[d2][X]);
48 staples[d1][X] += lw1[X - d2];
53template <
typename T,
typename atype = hila::arithmetic_type<T>>
55 nch_staplesums(U, stout);
59 exp((U[d][X] * stout[d][X]).project_to_algebra_scaled(-coeff).expand()) * U[d][X];
60 stout[d][X].reunitarize();
65template <
typename T,
typename atype = hila::arithmetic_type<T>>
68 nch_staplesums(U, stap);
72 exp((U[d][X] * stap[d][X]).project_to_algebra_scaled(-coeff).expand()) * U[d][X];
73 stout[d][X].reunitarize();
79template <
typename T,
typename atype = hila::arithmetic_type<T>>
84 for (
int i = 0; i < iter / 2; ++i) {
85 nch_stout_smear1(stout, tmp, coeff);
86 nch_stout_smear1(tmp, stout, coeff);
90 for (
int i = 0; i < iter / 2; ++i) {
91 nch_stout_smear1(tmp, stout, coeff);
92 nch_stout_smear1(stout, tmp, coeff);
94 nch_stout_smear1(tmp, stout, coeff);
99template <
typename T,
typename atype = hila::arithmetic_type<T>>
105 for (
int i = 1; i < stoutlist.size(); ++i) {
106 nch_stout_smear1(stoutlist[i - 1], stoutlist[i], staplist[i - 1], coeff);
110template <
typename T,
typename atype = hila::arithmetic_type<T>>
111void nch_stout_smear_force(
const std::vector<
GaugeField<T>> &stoutlist,
126 for (
int i = stoutlist.size() - 2; i >= 0; --i) {
141 T tplaqs = U[d1][X] * staps[d1][X];
148 mult_exp(tplaqs.project_to_algebra_scaled(-coeff).expand(),
149 U[d1][X] * U0[d1][X].dagger() * KS[d1][X].expand(), mtexp, mdtexp);
153 K1[d1][X] = mdtexp.project_to_algebra_scaled(coeff).expand();
157 KS[d1][X] = (mtexp - tplaqs * K1[d1][X]).project_to_algebra();
160 K1[d1][X] *= U[d1][X];
170 U4 = U[d2][X].dagger();
172 tM1 = U2 * U[d1][X + d2].dagger();
173 K21[X] = U4 * K1[d1][X] * tM1;
175 K22[X] = tM1 * K1[d1][X];
176 K24[X] = K1[d1][X] * tM1;
178 tM1 = U2 * K1[d1][X + d2].
dagger() * U4;
179 K23[X] = U[d1][X] * tM1;
180 K22[X] += tM1 * U[d1][X];
186 KS[d2][X] -= (K22[X - d1] - K24[X]).project_to_algebra();
187 KS[d1][X] -= (K23[X] - K21[X - d2]).project_to_algebra();
Array< n, m, T > exp(Array< n, m, T > a)
Exponential.
The field class implements the standard methods for accessing Fields. Hilapp replaces the parity acce...
Field< A > dagger() const
Returns dagger or Hermitian conjugate of Field depending on how it is defined for Field type T.
dir_mask_t start_gather(Direction d, Parity p=ALL) const
#define foralldir(d)
Macro to loop over (all) Direction(s)
constexpr Parity ALL
bit pattern: 011
void mult_exp(const Matrix_t< n, m, T, MT > &mat, const Matrix_t< n, m, T, MT > &mmat, Matrix_t< n, m, T, MT > &r, Matrix_t< n, m, T, MT > &dr, const int order=20)
Calculate mmat*exp(mat) and trace(mmat*dexp(mat))
void mult_add(const Mt1 &a, const Mt2 &b, Mt3 &res)
compute product of two matrices and add result to existing matrix
void mult_aa(const Mt1 &a, const Mt2 &b, Mt3 &res)
compute hermitian conjugate of product of two matrices and write result to existing matrix
void mult(const Mt1 &a, const Mt2 &b, Mt3 &res)
compute product of two matrices and write result to existing matrix