Go to the documentation of this file.
17 #ifdef USE_FACTORY_AUTOREGISTER
23 template<
typename AFIELD>
25 =
"AFopr_Wilson_TwistedMass";
28 template<
typename AFIELD>
34 m_is_initial_step =
true;
36 vout.
general(m_vl,
"%s: construction\n", class_name.c_str());
41 m_NinF = 2 * m_Nc * m_Nd;
44 m_boundary.resize(m_Ndim);
46 std::string kernel_type;
48 m_kernel_type = kernel_type;
50 m_kernel_type =
"Wilson";
52 m_kernel_type.c_str());
61 if ((m_repr !=
"Dirac") && (m_repr !=
"Chiral")) {
62 vout.
crucial(
"Error in %s: irrelevant mult mode = %s\n",
63 class_name.c_str(), m_repr.c_str());
67 set_parameters(params);
75 m_v2.reset(m_NinF, m_Nvol, 1);
77 m_is_initial_step =
false;
85 template<
typename AFIELD>
91 m_is_initial_step =
true;
99 m_NinF = 2 * m_Nc * m_Nd;
102 m_boundary.resize(m_Ndim);
108 std::string kernel_type =
"Wilson";
111 m_v2.reset(m_NinF, m_Nvol, 1);
113 m_is_initial_step =
false;
122 template<
typename AFIELD>
130 template<
typename AFIELD>
141 double kappa, tw_mass;
150 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
155 set_parameters(kappa, tw_mass, bc);
157 if (!m_is_initial_step) {
158 m_fopr_w->set_parameters(params);
164 template<
typename AFIELD>
166 const double tw_mass,
167 const std::vector<int> bc)
171 assert(bc.size() == m_Ndim);
178 m_boundary.resize(m_Ndim);
184 vout.
general(m_vl,
"%s: input parameters\n", class_name.c_str());
185 vout.
general(m_vl,
" kernel_type = %s\n", m_kernel_type.c_str());
186 vout.
general(m_vl,
" gamma matrix type = %s\n", m_repr.c_str());
188 vout.
general(m_vl,
" tw_mass = %12.8f\n", m_tw_mass);
189 for (
int mu = 0; mu < m_Ndim; ++mu) {
190 vout.
general(m_vl,
" boundary[%d] = %2d\n", mu, m_boundary[mu]);
196 template<
typename AFIELD>
199 params.
set_double(
"hopping_parameter", m_kappa);
203 params.
set_string(
"kernel_type", m_kernel_type);
204 params.
set_string(
"gamma_matrix_type", m_repr);
211 template<
typename AFIELD>
217 if (ith == 0) m_U = (
Field_G *)U;
220 m_fopr_w->set_config(U);
225 template<
typename AFIELD>
230 }
else if (m_mode ==
"Ddag") {
232 }
else if (m_mode ==
"DdagD") {
234 }
else if (m_mode ==
"H") {
237 vout.
crucial(m_vl,
"Error at %s: irrelevant mult mode.\n",
245 template<
typename AFIELD>
250 }
else if (m_mode ==
"Ddag") {
252 }
else if (m_mode ==
"DdagD") {
254 }
else if (m_mode ==
"H") {
257 vout.
crucial(m_vl,
"Error at %s: irrelevant mult mode.\n",
265 template<
typename AFIELD>
268 m_fopr_w->mult_gm5(v, w);
273 template<
typename AFIELD>
279 if (ith == 0) m_mode = mode;
282 m_fopr_w->set_mode(mode);
287 template<
typename AFIELD>
297 m_fopr_w->mult_up(mu, m_v2, w);
298 m_fopr_w->mult_gm5(v, m_v2);
303 template<
typename AFIELD>
307 m_fopr_w->mult(v, w,
"D");
309 m_fopr_w->mult_gm5(m_v2, w);
313 const real_t tm_2K = 2.0 * m_kappa * m_tw_mass;
315 axpy(v, tm_2K, m_v2);
322 template<
typename AFIELD>
326 m_fopr_w->mult(v, w,
"Ddag");
328 m_fopr_w->mult_gm5(m_v2, w);
332 const real_t tm_2K = 2.0 * m_kappa * m_tw_mass;
334 axpy(v, -tm_2K, m_v2);
341 template<
typename AFIELD>
345 m_fopr_w->mult(v, w,
"H");
351 const real_t tm_2K = 2.0 * m_kappa * m_tw_mass;
353 axpy(v, tm_2K, m_v2);
360 template<
typename AFIELD>
364 m_fopr_w->mult(v, w,
"H");
370 const real_t tm_2K = 2.0 * m_kappa * m_tw_mass;
372 axpy(v, -tm_2K, m_v2);
379 template<
typename AFIELD>
383 m_fopr_w->mult(v, w,
"DdagD");
385 const real_t tm_2K = 2.0 * m_kappa * m_tw_mass;
387 axpy(v, tm_2K * tm_2K, w);
394 template<
typename AFIELD>
399 double gflop_w = m_fopr_w->flop_count();
401 double gflop_tm = 2.0 * double(m_NinF) * double(m_Nvol)
402 * double(NPE) * 1.0e-9;
404 if ((m_mode ==
"DdagD") || (m_mode ==
"DDdag")) gflop_tm *= 2;
406 double gflop = gflop_w + gflop_tm;
void Ddag(AFIELD &, const AFIELD &)
void set_string(const string &key, const string &value)
double flop_count()
this returns the number of floating point operations.
void set_double(const string &key, const double value)
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void copy(Field &y, const Field &x)
copy(y, x): y = x
Twisted-mass Wilson fermion operator.
void mult_gm5p(const int mu, AFIELD &v, const AFIELD &w)
void H(AFIELD &, const AFIELD &)
void set_parameters(const Parameters ¶ms)
sets parameters by a Parameter object: to be implemented in a subclass.
int fetch_int_vector(const string &key, vector< int > &value) const
void DdagD(AFIELD &, const AFIELD &)
void set_int_vector(const string &key, const vector< int > &value)
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
void D(AFIELD &, const AFIELD &)
static Bridge::VerboseLevel Vlevel()
void init(const std::string &repr)
static VerboseLevel set_verbose_level(const std::string &str)
int fetch_string(const string &key, string &value) const
int fetch_double(const string &key, double &value) const
void crucial(const char *format,...)
Container of Field-type object.
static int get_thread_id()
returns thread id.
void set_config(Field *U)
sets the gauge configuration.
void general(const char *format,...)
void get_parameters(Parameters ¶ms) const
gets parameters by a Parameter object: to be implemented in a subclass.
void Hdag(AFIELD &, const AFIELD &)
void mult_gm5(AFIELD &v, const AFIELD &w)
multiplies gamma_5 matrix.
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
static std::string get_verbose_level(const VerboseLevel vl)
void set_mode(std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...