25 for (
int i = 0; i < action.size(); ++i) {
41 std::vector<Director *> director,
46 for (
int i = 0; i < action.size(); ++i) {
50 for (
int i = 0; i < director.size(); ++i) {
72 for (
int i = 0; i < action_set.size(); ++i) {
88 std::vector<Director *> director,
95 for (
int i = 0; i < action_set.size(); ++i) {
99 for (
int i = 0; i < director.size(); ++i) {
120 for (
int i = 0; i < action.size(); ++i) {
138 std::vector<Director *> director,
144 for (
int i = 0; i < action.size(); ++i) {
148 for (
int i = 0; i < director.size(); ++i) {
173 for (
int i = 0; i < action_set.size(); ++i) {
191 std::vector<Director *> director,
199 for (
int i = 0; i < action_set.size(); ++i) {
203 for (
int i = 0; i < director.size(); ++i) {
238 bool Metropolis_test;
242 err += params.
fetch_int(
"number_of_steps", Nmdc);
243 err += params.
fetch_int(
"order_of_exp_iP", Nprec);
244 err += params.
fetch_bool(
"Metropolis_test", Metropolis_test);
247 int isset_ssize = params.
fetch_double(
"step_size", Estep);
248 int isset_trajlen = params.
fetch_double(
"trajectory_length", traj_length);
250 if ((isset_ssize != 0) && (isset_trajlen != 0)) {
253 }
else if ((isset_ssize == 0) && (isset_trajlen != 0)) {
255 }
else if ((isset_ssize != 0) && (isset_trajlen == 0)) {
257 Estep = traj_length / Nmdc;
260 double diff = Estep * Nmdc - traj_length;
294 vout.
crucial(
m_vl,
"%s: warning: integer variable for Metroplis_test is obsolete. use boolean parameter.\n",
class_name.c_str());
296 return set_parameters(Estep, Nmdc, Nprec, (Metropolis_test == 0 ?
false :
true));
309 vout.
general(
m_vl,
" Metropolis_test = %s\n", Metropolis_test ?
"true" :
"false");
329 for (
int i = 0; i <
m_action.size(); ++i) {
333 const int Nin = U.
nin();
334 const int Nvol = U.
nvol();
335 const int Nex = U.
nex();
343 const double H_total0 =
langevin(iP, U);
367 const double diff_H = H_total1 - H_total0;
368 const double exp_minus_diff_H = exp(-diff_H);
378 if (rand <= exp_minus_diff_H) {
398 const int NcA = Nc * Nc - 1;
414 vout.
general(
m_vl,
" H_kin/dof = %18.8f\n", H_iP / NcA / Nvol / NPE / Ndim);
417 double H_actions = 0.0;
418 for (
int i = 0; i <
m_action.size(); ++i) {
423 const double H_total = H_iP + H_actions;
431 const int Nin = U.
nin();
432 const int Nvol = U.
nvol();
433 const int Nex = U.
nex();
437 const int NcA = Nc * Nc - 1;
444 const double H_iP =
calcH_P(iP);
446 vout.
general(
m_vl,
" H_kin/dof = %18.8f\n", H_iP / NcA / Nvol / NPE / Nex);
448 double H_actions = 0.0;
449 for (
int i = 0; i <
m_action.size(); ++i) {
454 const double H_total = H_iP + H_actions;
463 const double hn = iP.
norm();
464 const double H_iP = 0.5 * hn * hn;
476 const double estep2 = 0.5 *
m_Estep;
486 for (
int imdc = 1; imdc <
m_Nmdc + 1; imdc++) {
503 const int Nin = U.
nin();
504 const int Nvol = U.
nvol();
505 const int Nex = U.
nex();
508 Field force(Nin, Nvol, Nex);
512 Field force1(Nin, Nvol, Nex);
514 for (
int i = 0; i <
m_action.size(); ++i) {
516 axpy(force, estep, force1);
520 axpy(iP, 1.0, force);
527 const int Nvol = U.
nvol();
528 const int Nex = U.
nex();
534 for (
int ex = 0; ex < Nex; ++ex) {
535 for (
int site = 0; site < Nvol; ++site) {
536 u0 = U.
mat(site, ex);
537 u1 = U.
mat(site, ex);
538 h1 = iP.
mat(site, ex);
540 for (
int iprec = 0; iprec <
m_Nprec; ++iprec) {
541 double exf = estep / (
m_Nprec - iprec);