17 #ifdef USE_FACTORY_AUTOREGISTER
23 template<
typename AFIELD>
25 =
"AFopr_Wilson_Chemical<AFIELD>";
28 template<
typename AFIELD>
34 m_is_initial_step =
true;
36 vout.
general(m_vl,
"%s: construction\n", class_name.c_str());
45 m_boundary.resize(m_Ndim);
47 std::string kernel_type;
49 m_kernel_type = kernel_type;
51 m_kernel_type =
"Wilson";
53 m_kernel_type.c_str());
62 if ((m_repr !=
"Dirac") && (m_repr !=
"Chiral")) {
63 vout.
crucial(
"Error in %s: irrelevant mult mode = %s\n",
64 class_name.c_str(), m_repr.c_str());
68 set_parameters(params);
76 m_v1.reset(m_NinF, m_Nvol, 1);
77 m_v2.reset(m_NinF, m_Nvol, 1);
79 m_is_initial_step =
false;
87 template<
typename AFIELD>
93 m_is_initial_step =
true;
101 m_NinF = 2 * Nc * Nd;
105 m_boundary.resize(m_Ndim);
107 std::string kernel_type;
108 m_kernel_type =
"Wilson";
111 if ((m_repr !=
"Dirac") && (m_repr !=
"Chiral")) {
112 vout.
crucial(
"Error in %s: irrelevant mult mode = %s\n",
113 class_name.c_str(), m_repr.c_str());
123 m_v1.reset(m_NinF, m_Nvol, 1);
124 m_v2.reset(m_NinF, m_Nvol, 1);
126 m_is_initial_step =
false;
134 template<
typename AFIELD>
142 template<
typename AFIELD>
164 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
171 if (!m_is_initial_step) {
173 m_fopr_w->set_parameters(params);
180 template<
typename AFIELD>
184 const std::vector<int> bc)
186 assert(bc.size() == m_Ndim);
198 vout.
general(m_vl,
"%s: input parameters\n", class_name.c_str());
199 vout.
general(m_vl,
" kernel_type = %s\n", m_kernel_type.c_str());
200 vout.
general(m_vl,
" gamma matrix type = %s\n", m_repr.c_str());
203 for (
int dir = 0; dir < m_Ndim; ++dir) {
204 vout.
general(m_vl,
" boundary[%d] = %2d\n", dir, m_boundary[dir]);
210 template<
typename AFIELD>
214 params.
set_double(
"hopping_parameter", m_kappa);
215 params.
set_double(
"chemical_potential", m_mu);
218 params.
set_string(
"kernel_type", m_kernel_type);
219 params.
set_string(
"gamma_matrix_type", m_repr);
226 template<
typename AFIELD>
232 if (ith == 0) m_U = (
Field_G *)U;
235 m_fopr_w->set_config(U);
240 template<
typename AFIELD>
246 if (ith == 0) m_mode = mode;
249 m_fopr_w->set_mode(mode);
254 template<
typename AFIELD>
259 }
else if (m_mode ==
"Ddag") {
261 }
else if (m_mode ==
"DdagD") {
263 }
else if (m_mode ==
"H") {
266 vout.
crucial(m_vl,
"Error at %s: irrelevant input mode:\n",
267 class_name.c_str(), m_mode.c_str());
274 template<
typename AFIELD>
279 }
else if (m_mode ==
"Ddag") {
281 }
else if (m_mode ==
"DdagD") {
283 }
else if (m_mode ==
"H") {
286 vout.
crucial(m_vl,
"Error at %s: irrelevant input mode:\n",
287 class_name.c_str(), m_mode.c_str());
294 template<
typename AFIELD>
302 m_fopr_w->mult_up(3, m_v1, w);
304 axpy(v, -m_kappa * m_exp_mu, m_v1);
309 m_fopr_w->mult_dn(3, m_v1, w);
310 axpy(v, -m_kappa / m_exp_mu, m_v1);
317 template<
typename AFIELD>
325 m_fopr_w->mult_up(3, m_v1, w);
326 axpy(v, -m_kappa / m_exp_mu, m_v1);
331 m_fopr_w->mult_dn(3, m_v1, w);
332 axpy(v, -m_kappa * m_exp_mu, m_v1);
339 template<
typename AFIELD>
344 m_fopr_w->mult_up(0, v, w);
345 m_fopr_w->mult_dn(0, v, w);
347 m_fopr_w->mult_up(1, v, w);
348 m_fopr_w->mult_dn(1, v, w);
350 m_fopr_w->mult_up(2, v, w);
351 m_fopr_w->mult_dn(2, v, w);
353 aypx(-m_kappa, v, w);
361 template<
typename AFIELD>
364 m_fopr_w->mult_gm5(v, w);
369 template<
typename AFIELD>
376 m_fopr_w->mult_up(mu, m_v1, w);
377 m_fopr_w->mult_gm5(v, m_v1);
382 template<
typename AFIELD>
393 template<
typename AFIELD>
403 template<
typename AFIELD>
412 template<
typename AFIELD>
421 template<
typename AFIELD>
426 double gflop_w = m_fopr_w->flop_count();
428 double gflop_tm = 2.0 * double(m_NinF) * double(m_Nvol)
429 * double(NPE) * 1.0e-9;
431 if ((m_mode ==
"DdagD") || (m_mode ==
"DDdag")) gflop_tm *= 2;
433 double gflop = gflop_w + gflop_tm;