Go to the documentation of this file.
33 assert(ex1 < U.
nex());
34 assert(ex2 < x.
nex());
38 const int Nvol = x.
nvol();
39 const int Nd = x.
nd();
40 const int Nc = x.
nc();
43 set_threadtask(ith, nth, is, ns, Nvol);
45 for (
int site = is; site < ns; ++site) {
46 for (
int s = 0; s < Nd; ++s) {
47 y.
set_vec(s, site, ex, U.
mat(site, ex1) * x.
vec(s, site, ex2));
59 assert(ex1 < U.
nex());
60 assert(ex2 < x.
nex());
64 const int Nvol = y.
nvol();
65 const int Nd = y.
nd();
66 const int Nc = y.
nc();
69 set_threadtask(ith, nth, is, ns, Nvol);
71 for (
int site = is; site < ns; ++site) {
72 for (
int s = 0; s < Nd; ++s) {
86 assert(ex1 < U.
nex());
87 assert(ex2 < x.
nex());
91 const int Nvol = y.
nvol();
92 const int Nd = y.
nd();
93 const int Nc = y.
nc();
98 set_threadtask(ith, nth, is, ns, Nvol);
100 for (
int site = is; site < ns; ++site) {
101 for (
int s = 0; s < Nd; ++s) {
102 y.
add_vec(s, site, ex, U.
mat(site, ex1) * x.
vec(s, site, ex2) * a);
114 assert(ex < y.
nex());
115 assert(ex1 < U.
nex());
116 assert(ex2 < x.
nex());
120 const int Nvol = y.
nvol();
121 const int Nd = y.
nd();
122 const int Nc = y.
nc();
124 int ith, nth, is, ns;
125 set_threadtask(ith, nth, is, ns, Nvol);
127 for (
int site = is; site < ns; ++site) {
128 for (
int s = 0; s < Nd; ++s) {
138 assert(w.
nex() == v.
nex());
141 const int Nvol = v.
nvol();
142 const int Nex = v.
nex();
143 const int Nd = v.
nd();
144 const int Nc = v.
nc();
146 valarray<int> id(Nd);
147 valarray<int> idc_r(Nd);
148 valarray<int> idc_i(Nd);
149 valarray<double> gv_r(Nd);
150 valarray<double> gv_i(Nd);
152 for (
int s = 0; s < Nd; ++s) {
157 idc_i[s] = 1 - idc_r[s];
160 int ith, nth, is, ns;
161 set_threadtask(ith, nth, is, ns, Nvol);
163 for (
int ex = 0; ex < Nex; ++ex) {
164 for (
int site = is; site < ns; ++site) {
165 for (
int s = 0; s < Nd; ++s) {
166 for (
int c = 0; c < Nc; ++c) {
168 ww[0] = w.
cmp_r(c,
id[s], site, ex);
169 ww[1] = w.
cmp_i(c,
id[s], site, ex);
172 gv_r[s] * ww[idc_r[s]],
173 gv_i[s] * ww[idc_i[s]]);
184 assert(w.
nex() == v.
nex());
187 const int Nvol = v.
nvol();
188 const int Nex = v.
nex();
189 const int Nd = v.
nd();
190 const int Nc = v.
nc();
192 valarray<int> id(Nd);
193 valarray<int> idc_r(Nd);
194 valarray<int> idc_i(Nd);
195 valarray<double> gv_r(Nd);
196 valarray<double> gv_i(Nd);
198 for (
int s = 0; s < Nd; ++s) {
203 idc_i[s] = 1 - idc_r[s];
206 int ith, nth, is, ns;
207 set_threadtask(ith, nth, is, ns, Nvol);
209 for (
int ex = 0; ex < Nex; ++ex) {
210 for (
int site = is; site < ns; ++site) {
211 for (
int s = 0; s < Nd; ++s) {
212 for (
int c = 0; c < Nc; ++c) {
214 ww[0] = w.
cmp_r(c,
id[s], site, ex);
215 ww[1] = w.
cmp_i(c,
id[s], site, ex);
218 gv_r[s] * ww[idc_r[s]],
219 gv_i[s] * ww[idc_i[s]]);
233 assert(w.
nex() == v.
nex());
234 assert(pm == 1 || pm == -1);
241 }
else if (pm == -1) {
245 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);
257 assert(w.
nex() == v.
nex());
258 assert(pm == 1 || pm == -1);
264 }
else if (pm == -1) {
268 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);
283 assert(w.
nex() == v.
nex());
284 assert(pm == 1 || pm == -1);
291 }
else if (pm == -1) {
295 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);
void mult_GM(Field_F &v, const GammaMatrix &gm, const Field_F &w)
gamma matrix multiplication
void set_vec(const int s, const int site, const int e, const Vec_SU_N &F)
int index_c(int row) const
double cmp_i(const int cc, const int s, const int site, const int e=0) const
Vec_SU_N vec(const int s, const int site, const int e=0) const
Mat_SU_N mat_dag(const int site, const int mn=0) const
void mult_Field_Gn(Field_F &y, const int ex, const Field_G &U, int ex1, const Field_F &x, int ex2)
double value_i(int row) const
void multadd_Field_Gd(Field_F &y, const int ex, const Field_G &U, int ex1, const Field_F &x, int ex2, const double a)
double value_r(int row) const
void set_ri(const int cc, const int s, const int site, const int e, const double re, const double im)
void add_vec(const int s, const int site, const int e, const Vec_SU_N &F)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void check()
check several assumptions for performance implementation.
void mult_Field_Gd(Field_F &y, const int ex, const Field_G &U, int ex1, const Field_F &x, int ex2)
void mult_GMproj2(Field_F &v, const int pm, const GammaMatrix &gm, const Field_F &w)
projection with gamma matrix: (1 \pm gamma)
void multadd_Field_Gn(Field_F &y, const int ex, const Field_G &U, int ex1, const Field_F &x, int ex2, const double a)
double cmp_r(const int cc, const int s, const int site, const int e=0) const
void mult_iGM(Field_F &v, const GammaMatrix &gm, const Field_F &w)
gamma matrix multiplication (i is multiplied)
void scal(Field &x, const double a)
scal(x, a): x = a * x
Wilson-type fermion field.
void crucial(const char *format,...)
void mult_GMproj(Field_F &v, const int pm, const GammaMatrix &gm, const Field_F &w)
projection with gamma matrix: (1 \pm gamma)/2
Mat_SU_N mat(const int site, const int mn=0) const