14 #include "Field/index_lex_alt.h"
17 template<
typename AFIELD>
19 =
"Action_F_Standard_lex_alt";
22 template<
typename AFIELD>
30 template<
typename AFIELD>
38 template<
typename AFIELD>
41 const string str_vlevel = params.
get_string(
"verbose_level");
47 template<
typename AFIELD>
52 m_fopr->set_config(U);
53 m_fopr_force->set_config(U);
58 template<
typename AFIELD>
64 int NinF = m_fopr->field_nin();
65 int NvolF = m_fopr->field_nvol();
66 int NexF = m_fopr->field_nex();
69 assert(NvolF == Nvol);
70 m_psf.reset(NinF, NvolF, NexF);
72 vout.
general(m_vl,
" %s: %s\n", class_name.c_str(), m_label.c_str());
74 Field xi(NinF, NvolF, NexF);
77 AFIELD xiA(NinF, NvolF, NexF);
79 Index_lex_alt<real_t> index_alt;
83 if (m_fopr->needs_convert()) {
84 m_fopr->convert(xiA, xi);
90 m_fopr->set_config(m_U);
91 m_fopr->set_mode(
"Ddag");
93 m_fopr->mult(m_psf, xiA);
95 double xi2 = xi.
norm();
96 double H_psf = xi2 * xi2;
98 vout.
general(m_vl,
" H_Fstandard = %18.8f\n", H_psf);
99 vout.
general(m_vl,
" H_F/dof = %18.8f\n", H_psf / size_psf);
106 template<
typename AFIELD>
112 int NinF = m_fopr->field_nin();
113 int NvolF = m_fopr->field_nvol();
114 int NexF = m_fopr->field_nex();
117 vout.
general(m_vl,
" %s: %s\n", class_name.c_str(), m_label.c_str());
119 AFIELD v1(NinF, NvolF, NexF);
123 m_fprop_H->set_config(m_U);
124 m_fprop_H->set_mode(
"DdagD");
125 m_fprop_H->invert(v1, m_psf, Nconv, diff);
127 vout.
general(m_vl,
" Fprop_H: %6d %18.15e\n", Nconv, diff);
129 const double H_psf =
dot(v1, m_psf);
131 vout.
general(m_vl,
" H_Fstandard = %18.8f\n", H_psf);
132 vout.
general(m_vl,
" H_F/dof = %18.8f\n", H_psf / size_psf);
139 template<
typename AFIELD>
142 const int Nin = m_U->nin();
143 const int Nvol = m_U->nvol();
144 const int Nex = m_U->nex();
148 assert(force.
nin() == Nin);
149 assert(force.
nvol() == Nvol);
150 assert(force.
nex() == Nex);
152 AFIELD force1(Nin, Nvol, Nex);
154 const int NinF = m_fopr->field_nin();
155 const int NvolF = m_fopr->field_nvol();
156 const int NexF = m_fopr->field_nex();
162 vout.
general(m_vl,
" %s: %s\n", class_name.c_str(), m_label.c_str());
164 AFIELD eta(NinF, NvolF, NexF);
168 m_fprop_MD->set_config(m_U);
169 m_fprop_MD->set_mode(
"DdagD");
170 m_fprop_MD->invert(eta, m_psf, Nconv, diff);
172 vout.
general(m_vl,
" Fprop_MD: %6d %18.15e\n", Nconv, diff);
174 m_fopr->set_config(m_U);
175 m_fopr_force->set_config(m_U);
177 m_fopr_force->force_core(force1, eta);
179 Index_lex_alt<real_t> index_lex;
185 double Fave, Fmax, Fdev;
186 force.
stat(Fave, Fmax, Fdev);
187 vout.
general(m_vl,
" Fave = %12.6f Fmax = %12.6f Fdev = %12.6f\n",
192 vout.
general(m_vl,
" elapsed time: %12.6f [sec]\n", elapsed_time);