32 assert(ex1 < U.
nex());
33 assert(ex2 < x.
nex());
37 const int Nvol = x.
nvol();
38 const int Nd = x.
nd();
39 const int Nc = x.
nc();
41 for (
int site = 0; site < Nvol; ++site) {
42 for (
int s = 0; s < Nd; ++s) {
43 y.
set_vec(s, site, ex, U.
mat(site, ex1) * x.
vec(s, site, ex2));
55 assert(ex1 < U.
nex());
56 assert(ex2 < x.
nex());
60 const int Nvol = y.
nvol();
61 const int Nd = y.
nd();
62 const int Nc = y.
nc();
64 for (
int site = 0; site < Nvol; ++site) {
65 for (
int s = 0; s < Nd; ++s) {
79 assert(ex1 < U.
nex());
80 assert(ex2 < x.
nex());
84 const int Nvol = y.
nvol();
85 const int Nd = y.
nd();
86 const int Nc = y.
nc();
90 for (
int site = 0; site < Nvol; ++site) {
91 for (
int s = 0; s < Nd; ++s) {
92 y.
add_vec(s, site, ex, U.
mat(site, ex1) * x.
vec(s, site, ex2) * a);
104 assert(ex < y.
nex());
105 assert(ex1 < U.
nex());
106 assert(ex2 < x.
nex());
110 const int Nvol = y.
nvol();
111 const int Nd = y.
nd();
112 const int Nc = y.
nc();
114 for (
int site = 0; site < Nvol; ++site) {
115 for (
int s = 0; s < Nd; ++s) {
125 assert(w.
nex() == v.
nex());
128 const int Nvol = v.
nvol();
129 const int Nex = v.
nex();
130 const int Nd = v.
nd();
131 const int Nc = v.
nc();
133 valarray<int> id(Nd);
134 valarray<int> idc_r(Nd);
135 valarray<int> idc_i(Nd);
136 valarray<double> gv_r(Nd);
137 valarray<double> gv_i(Nd);
139 for (
int s = 0; s < Nd; ++s) {
144 idc_i[s] = 1 - idc_r[s];
147 for (
int ex = 0; ex < Nex; ++ex) {
148 for (
int site = 0; site < Nvol; ++site) {
149 for (
int s = 0; s < Nd; ++s) {
150 for (
int c = 0; c < Nc; ++c) {
152 ww[0] = w.
cmp_r(c,
id[s], site, ex);
153 ww[1] = w.
cmp_i(c,
id[s], site, ex);
156 gv_r[s] * ww[idc_r[s]],
157 gv_i[s] * ww[idc_i[s]]);
168 assert(w.
nex() == v.
nex());
171 const int Nvol = v.
nvol();
172 const int Nex = v.
nex();
173 const int Nd = v.
nd();
174 const int Nc = v.
nc();
176 valarray<int> id(Nd);
177 valarray<int> idc_r(Nd);
178 valarray<int> idc_i(Nd);
179 valarray<double> gv_r(Nd);
180 valarray<double> gv_i(Nd);
182 for (
int s = 0; s < Nd; ++s) {
187 idc_i[s] = 1 - idc_r[s];
190 for (
int ex = 0; ex < Nex; ++ex) {
191 for (
int site = 0; site < Nvol; ++site) {
192 for (
int s = 0; s < Nd; ++s) {
193 for (
int c = 0; c < Nc; ++c) {
195 ww[0] = w.
cmp_r(c,
id[s], site, ex);
196 ww[1] = w.
cmp_i(c,
id[s], site, ex);
199 gv_r[s] * ww[idc_r[s]],
200 gv_i[s] * ww[idc_i[s]]);
214 assert(w.
nex() == v.
nex());
215 assert(pm == 1 || pm == -1);
222 }
else if (pm == -1) {
226 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);
238 assert(w.
nex() == v.
nex());
239 assert(pm == 1 || pm == -1);
245 }
else if (pm == -1) {
249 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);
264 assert(w.
nex() == v.
nex());
265 assert(pm == 1 || pm == -1);
272 }
else if (pm == -1) {
276 vout.
crucial(
"Error at %s: wrong pm = %d\n", __func__, pm);
void scal(Field &x, const double a)
scal(x, a): x = a * x
double cmp_i(const int cc, const int s, const int site, const int e=0) const
void set_vec(const int s, const int site, const int e, const Vec_SU_N &F)
void mult_Field_Gn(Field_F &y, const int ex, const Field_G &U, int ex1, const Field_F &x, int ex2)
void check()
check several assumptions for performance implementation.
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)
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)
Wilson-type fermion field.
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 mult_iGM(Field_F &v, const GammaMatrix &gm, const Field_F &w)
gamma matrix multiplication (i is multiplied)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void crucial(const char *format,...)
void mult_GMproj2(Field_F &v, const int pm, const GammaMatrix &gm, const Field_F &w)
projection with gamma matrix: (1 gamma)
int index_c(int row) const
void mult_GMproj(Field_F &v, const int pm, const GammaMatrix &gm, const Field_F &w)
projection with gamma matrix: (1 gamma)/2
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
double value_i(int row) const
void mult_GM(Field_F &v, const GammaMatrix &gm, const Field_F &w)
gamma matrix multiplication
void add_vec(const int s, const int site, const int e, const Vec_SU_N &F)
Mat_SU_N mat(const int site, const int mn=0) const
void mult_Field_Gd(Field_F &y, const int ex, const Field_G &U, int ex1, const Field_F &x, int ex2)
double cmp_r(const int cc, const int s, const int site, const int e=0) const