Go to the documentation of this file.
17 #ifdef USE_FACTORY_AUTOREGISTER
23 template<
typename AFIELD>
25 =
"AFopr_Clover_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 =
"Clover";
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);
73 m_fopr_w->set_mode(
"D");
77 m_v1.reset(m_NinF, m_Nvol, 1);
78 m_v2.reset(m_NinF, m_Nvol, 1);
80 m_is_initial_step =
false;
88 template<
typename AFIELD>
94 m_is_initial_step =
true;
102 m_NinF = 2 * Nc * Nd;
106 m_boundary.resize(m_Ndim);
108 std::string kernel_type;
109 m_kernel_type =
"Clover";
112 if ((m_repr !=
"Dirac") && (m_repr !=
"Chiral")) {
113 vout.
crucial(
"Error in %s: irrelevant mult mode = %s\n",
114 class_name.c_str(), m_repr.c_str());
121 m_fopr_w->set_mode(
"D");
125 m_v1.reset(m_NinF, m_Nvol, 1);
126 m_v2.reset(m_NinF, m_Nvol, 1);
128 m_is_initial_step =
false;
136 template<
typename AFIELD>
144 template<
typename AFIELD>
157 double kappa, cSW, mu;
167 vout.
crucial(m_vl,
"Error at %s: input parameter not found.\n",
174 if (!m_is_initial_step) {
176 m_fopr_w->set_parameters(params);
183 template<
typename AFIELD>
188 const std::vector<int> bc)
190 assert(bc.size() == m_Ndim);
203 vout.
general(m_vl,
"%s: input parameters\n", class_name.c_str());
204 vout.
general(m_vl,
" kernel_type = %s\n", m_kernel_type.c_str());
205 vout.
general(m_vl,
" gamma matrix type = %s\n", m_repr.c_str());
209 for (
int dir = 0; dir < m_Ndim; ++dir) {
210 vout.
general(m_vl,
" boundary[%d] = %2d\n", dir, m_boundary[dir]);
216 template<
typename AFIELD>
220 params.
set_double(
"hopping_parameter", m_kappa);
221 params.
set_double(
"clover_coefficient", m_cSW);
222 params.
set_double(
"chemical_potential", m_mu);
225 params.
set_string(
"kernel_type", m_kernel_type);
226 params.
set_string(
"gamma_matrix_type", m_repr);
233 template<
typename AFIELD>
239 if (ith == 0) m_U = (
Field_G *)U;
242 m_fopr_w->set_config(U);
247 template<
typename AFIELD>
253 if (ith == 0) m_mode = mode;
256 m_fopr_w->set_mode(
"D");
261 template<
typename AFIELD>
266 }
else if (m_mode ==
"Ddag") {
268 }
else if (m_mode ==
"DdagD") {
270 }
else if (m_mode ==
"H") {
273 vout.
crucial(m_vl,
"Error at %s: irrelevant input mode:\n",
274 class_name.c_str(), m_mode.c_str());
281 template<
typename AFIELD>
286 }
else if (m_mode ==
"Ddag") {
288 }
else if (m_mode ==
"DdagD") {
290 }
else if (m_mode ==
"H") {
293 vout.
crucial(m_vl,
"Error at %s: irrelevant input mode:\n",
294 class_name.c_str(), m_mode.c_str());
301 template<
typename AFIELD>
304 m_fopr_w->mult(v, w);
309 m_fopr_w->mult_up(3, m_v1, w);
310 axpy(v, -m_kappa * (m_exp_mu - 1.0), m_v1);
315 m_fopr_w->mult_dn(3, m_v1, w);
316 axpy(v, -m_kappa * (1.0 / m_exp_mu - 1.0), m_v1);
323 template<
typename AFIELD>
326 m_fopr_w->mult(v, w);
331 m_fopr_w->mult_up(3, m_v1, w);
332 axpy(v, -m_kappa * (1.0 / m_exp_mu - 1.0), m_v1);
337 m_fopr_w->mult_dn(3, m_v1, w);
338 axpy(v, -m_kappa * (m_exp_mu - 1.0), m_v1);
345 template<
typename AFIELD>
348 m_fopr_w->mult_gm5(v, w);
353 template<
typename AFIELD>
360 m_fopr_w->mult_up(mu, m_v1, w);
361 m_fopr_w->mult_gm5(v, m_v1);
366 template<
typename AFIELD>
377 template<
typename AFIELD>
387 template<
typename AFIELD>
396 template<
typename AFIELD>
405 template<
typename AFIELD>
410 double gflop_w = m_fopr_w->flop_count();
412 double gflop_tm = 2.0 * double(m_NinF) * double(m_Nvol)
413 * double(NPE) * 1.0e-9;
415 if ((m_mode ==
"DdagD") || (m_mode ==
"DDdag")) gflop_tm *= 2;
417 double gflop = gflop_w + gflop_tm;
void init(const std::string repr)
void D(AFIELD &, const AFIELD &)
void Dminmu(AFIELD &, const AFIELD &)
void set_string(const string &key, const string &value)
double flop_count()
this returns the number of floating point operations.
void get_parameters(Parameters ¶ms) const
gets parameters by a Parameter object: to be implemented in a subclass.
void set_double(const string &key, const double value)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void DdagD(AFIELD &, const AFIELD &)
void set_parameters_impl(const real_t kappa, const real_t cSW, const real_t mu, const std::vector< int > bc)
sets parameters given as values: private for composite operator.
int fetch_int_vector(const string &key, vector< int > &value) const
void set_config(Field *U)
sets the gauge configuration.
void Ddag(AFIELD &, const AFIELD &)
void H(AFIELD &, const AFIELD &)
void Hdag(AFIELD &, const AFIELD &)
void set_int_vector(const string &key, const vector< int > &value)
static Bridge::VerboseLevel Vlevel()
static VerboseLevel set_verbose_level(const std::string &str)
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void set_parameters(const Parameters ¶ms)
sets parameters by a Parameter object: to be implemented in a subclass.
void mult_gm5(AFIELD &, const AFIELD &)
multiplies gamma_5 matrix.
int fetch_string(const string &key, string &value) const
int fetch_double(const string &key, double &value) const
void mult_gm5p(const int mu, AFIELD &v, const AFIELD &w)
void crucial(const char *format,...)
Container of Field-type object.
static int get_thread_id()
returns thread id.
void mult(AFIELD &v, const AFIELD &w)
multiplies fermion operator to a given field.
void mult_dag(AFIELD &v, const AFIELD &w)
hermitian conjugate of mult.
void general(const char *format,...)
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)
Clover fermion operator with chemical potential.