25 bool init = Action::Factory::Register(
"Action_G_Rectangle", create_object);
42 #ifdef USE_PARAMETERS_FACTORY
57 const string str_vlevel = params.
get_string(
"verbose_level");
62 double beta, c_plaq, c_rect;
81 double c_plaq,
double c_rect)
101 int NinG = 2 * Nc * Nc;
108 double H_U =
calcH();
122 int Ndim2 = Ndim * (Ndim - 1) / 2;
123 int size_U = Lvol * Ndim2;
125 Field_G Cup1(Nvol, 1), Cup2(Nvol, 1);
126 Field_G Cdn1(Nvol, 1), Cdn2(Nvol, 1);
127 Field_G Umu(Nvol, 1), Unu(Nvol, 1);
128 Field_G v(Nvol, 1), w(Nvol, 1), c(Nvol, 1);
135 for (
int mu = 0; mu < Ndim; ++mu) {
136 for (
int nu = mu + 1; nu < Ndim; ++nu) {
141 for (
int site = 0; site < Nvol; ++site) {
142 plaqF +=
ReTr(
m_U->
mat(site, mu) * Cup1.mat_dag(site));
151 Umu.setpart_ex(0, *
m_U, mu);
159 for (
int site = 0; site < Nvol; ++site) {
174 for (
int site = 0; site < Nvol; ++site) {
183 double plaq = plaqF / Nc;
186 double H_U =
m_c_plaq * (Ndim2 * Lvol - plaqF / Nc)
187 +
m_c_rect * (Ndim2 * Lvol * 2 - rectF / Nc);
205 assert(
m_U->
nin() == Nc * Nc * 2);
207 assert(
m_U->
nex() == Ndim);
209 assert(force.
nin() == Nc * Nc * 2);
210 assert(force.
nvol() == Nvol);
211 assert(force.
nex() == Ndim);
215 double betaNc =
m_beta / Nc;
218 Field_G force1(Nvol, 1), force2(Nvol, 1);
220 Field_G Cup1(Nvol, 1), Cup2(Nvol, 1);
221 Field_G Cdn1(Nvol, 1), Cdn2(Nvol, 1);
222 Field_G Umu(Nvol, 1), Unu(Nvol, 1);
223 Field_G v(Nvol, 1), w(Nvol, 1), c(Nvol, 1);
227 for (
int mu = 0; mu < Ndim; ++mu) {
229 for (
int nu = 0; nu < Ndim; ++nu) {
230 if (nu == mu)
continue;
238 force1.addpart_ex(0, Cup1, 0,
m_c_plaq);
239 force1.addpart_ex(0, Cdn1, 0,
m_c_plaq);
243 Umu.setpart_ex(0, *
m_U, mu);
256 force1.addpart_ex(0, c, 0,
m_c_rect);
270 force1.addpart_ex(0, c, 0,
m_c_rect);
282 force1.addpart_ex(0, c, 0,
m_c_rect);
295 force1.addpart_ex(0, c, 0,
m_c_rect);
310 force1.addpart_ex(0, c, 0,
m_c_rect);
323 force1.addpart_ex(0, c, 0,
m_c_rect);
328 axpy(force, mu, -betaNc, force2, 0);
331 double Fave, Fmax, Fdev;
332 force.
stat(Fave, Fmax, Fdev);
333 vout.
general(
m_vl,
" Frectangle_ave = %12.6f Frectangle_max = %12.6f Frectangle_dev = %12.6f\n",
double langevin(RandomNumbers *)
Langevis step.
void Register_string(const string &, const string &)
void set(const int jin, const int site, const int jex, double v)
void mult_Field_Gdn(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
void general(const char *format,...)
Container of Field-type object.
Base class of HMC action class family.
double calcH()
calculate Hamiltonian of this action term.
static const std::string class_name
void mult_Field_Gnd(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
Parameters_Action_G_Rectangle()
void mult_Field_Gnn(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
void backward(Field &, const Field &, const int mu)
void set_parameters(const Parameters ¶ms)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void at_Field_G(Field_G &w, const int ex)
void crucial(const char *format,...)
void lower(Field_G &, const Field_G &, const int mu, const int nu)
constructs lower staple in mu-nu plane.
static bool Register(const std::string &realm, const creator_callback &cb)
Bridge::VerboseLevel m_vl
Base class of random number generators.
void stat(double &Fave, double &Fmax, double &Fdev) const
determines the statistics of the field. average, maximum value, and deviation is determined over glob...
Mat_SU_N mat_dag(const int site, const int mn=0) const
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
void Register_double(const string &, const double)
void setpart_ex(int ex, const Field &w, int exw)
int fetch_double(const string &key, double &val) const
string get_string(const string &key) const
Mat_SU_N mat(const int site, const int mn=0) const
void upper(Field_G &, const Field_G &, const int mu, const int nu)
constructs upper staple in mu-nu plane.
void force(Field &)
returns force for molcular dynamical update of conjugate momenta.
static VerboseLevel set_verbose_level(const std::string &str)
double ReTr(const Mat_SU_N &m)
void forward(Field &, const Field &, const int mu)