16 #ifdef USE_PARAMETERS_FACTORY
30 bool init = GaugeFixing::Factory::Register(
"Coulomb", create_object);
49 #ifdef USE_PARAMETERS_FACTORY
64 const string str_vlevel = params.
get_string(
"verbose_level");
69 int Niter, Nnaive, Nmeas, Nreset;
73 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
74 err += params.
fetch_int(
"number_of_naive_iteration", Nnaive);
75 err += params.
fetch_int(
"interval_of_measurement", Nmeas);
76 err += params.
fetch_int(
"iteration_to_reset", Nreset);
77 err += params.
fetch_double(
"convergence_criterion_squared", Enorm);
78 err += params.
fetch_double(
"overrelaxation_parameter", wp);
92 const int Nmeas,
const int Nreset,
93 const double Enorm,
const double wp)
131 int Nvol = Uorg.
nvol();
132 int Nex = Uorg.
nex();
135 int Nvol2 = Nvol / 2;
136 Field_G Ue(Nvol2, Nex), Uo(Nvol2, Nex);
138 Field_G Ge(Nvol2, 1), Go(Nvol2, 1);
145 valarray<double> sg(Lt);
146 valarray<double> Fval(Lt);
149 for (
int iter = 0; iter <
m_Niter; ++iter) {
155 for (
int t = 0; t < Lt; ++t) {
158 if (sg[t] > sg_max) sg_max = sg[t];
172 if (((iter % m_Nreset) == 0) && (iter > 0)) {
192 int Nvol2 = Ue.
nvol();
195 Field_G Weo(Nvol2, 1), Geo(Nvol2, 1);
201 for (
int ieo = 0; ieo < 2; ++ieo) {
207 for (
int site = 0; site < Nvol2; ++site) {
208 ut = Geo.
mat(site, 0);
231 int Nvol = Geo.
nvol();
233 assert(Geo.
nex() == 1);
234 assert(sg.size() == Lt);
238 for (
int t = 0; t < Nt; ++t) {
239 int tg = t + ipet * Nt;
242 for (
int z = 0; z < Nz; ++z) {
243 for (
int y = 0; y < Ny; ++y) {
244 for (
int x = 0; x < Nx2; ++x) {
253 for (
int z = 0; z < Nz; ++z) {
254 for (
int y = 0; y < Ny; ++y) {
255 for (
int x = 0; x < Nx2; ++x) {
273 int Nvol2 = Geo.
nvol();
279 Field_G Ut(Nvol2, 1), Gt(Nvol2, 1);
283 for (
int mu = 0; mu < Ndim; ++mu) {
292 for (
int mu = 0; mu < Ndim; ++mu) {
306 valarray<double>& Fval,
315 int Nvol2 = Nx2 * Ny * Nz * Nt;
319 assert(Ue.
nex() == Ndim);
320 assert(Ue.
nvol() == Nvol2);
321 assert(Uo.
nex() == Ndim);
322 assert(Uo.
nvol() == Nvol2);
324 valarray<double> sg_local(Nt);
325 valarray<double> Fval_local(Nt);
334 for (
int ieo = 0; ieo < 2; ++ieo) {
337 for (
int t = 0; t < Nt; ++t) {
338 for (
int z = 0; z < Nz; ++z) {
339 for (
int y = 0; y < Ny; ++y) {
340 for (
int x = 0; x < Nx2; ++x) {
342 ut = DLT.
mat(site, 0);
343 sg_local[t] += ut.
norm2();
351 for (
int t = 0; t < Lt; ++t) {
352 sg[t] = sg[t] / (Ndim * Nc * (2 * Nvol2 * NPE) / Lt);
355 for (
int mu = 0; mu < Ndim - 1; ++mu) {
356 for (
int t = 0; t < Nt; ++t) {
357 for (
int z = 0; z < Nz; ++z) {
358 for (
int y = 0; y < Ny; ++y) {
359 for (
int x = 0; x < Nx2; ++x) {
361 ut = Ue.
mat(site, mu);
362 Fval_local[t] +=
ReTr(ut);
363 ut = Uo.
mat(site, mu);
364 Fval_local[t] +=
ReTr(ut);
372 for (
int t = 0; t < Lt; ++t) {
373 Fval[t] = Fval[t] / (Ndim * (2 * Nvol2 * NPE) / Lt);
380 valarray<double>& val_local)
386 assert(val_global.size() == Lt);
387 assert(val_local.size() == Nt);
389 for (
int t = 0; t < Lt; ++t) {
393 for (
int tl = 0; tl < Nt; ++tl) {
394 val_global[tl + ipet * Nt] = val_local[tl];
397 for (
int t = 0; t < Lt; ++t) {
398 double val = val_global[t];
408 int Nvol2 = Ue.
nvol();
414 Field_G Ut1(Nvol2, 1), Ut2(Nvol2, 1);
420 for (
int mu = 0; mu < Ndim - 1; ++mu) {
422 Ut1.setpart_ex(0, Uo, mu);
427 for (
int mu = 0; mu < Ndim - 1; ++mu) {
429 Ut1.setpart_ex(0, Ue, mu);
435 for (
int site = 0; site < Nvol2; ++site) {
436 u_tmp = DLT.
mat(site, 0);
448 int Nvol2 = Ue.
nvol();
452 assert(Weo.
nex() == 1);
456 Field_G Ut1(Nvol2, 1), Ut2(Nvol2, 1);
462 for (
int mu = 0; mu < Ndim - 1; ++mu) {
464 Ut1.setpart_ex(0, Uo, mu);
465 shift.forward_h(Ut2, Ut1, mu, 0);
466 for (
int site = 0; site < Nvol2; ++site) {
471 }
else if (Ieo == 1) {
472 for (
int mu = 0; mu < Ndim - 1; ++mu) {
474 Ut1.setpart_ex(0, Ue, mu);
475 shift.forward_h(Ut2, Ut1, mu, 1);
476 for (
int site = 0; site < Nvol2; ++site) {
494 int Nvol2 = G0.
nvol();
502 for (
int site = 0; site < Nvol2; ++site) {
506 for (
int imt = 0; imt < Nmt; ++imt) {
518 int Nvol2 = W.
nvol();
520 Mat_SU_N gt(Nc), wt(Nc), gt2(Nc), wt2(Nc);
522 for (
int site = 0; site < Nvol2; ++site) {
531 double fn1 = (wt.r(0) + wt.r(4)) * (wt.r(0) + wt.r(4))
532 + (wt.i(0) - wt.i(4)) * (wt.i(0) - wt.i(4));
533 double fn2 = (wt.r(1) - wt.r(3)) * (wt.r(1) - wt.r(3))
534 + (wt.i(1) + wt.i(3)) * (wt.i(1) + wt.i(3));
535 double fn = 1.0 / sqrt(fn1 + fn2);
537 gt.set(0, fn * (wt.r(0) + wt.r(4)), fn * (-wt.i(0) + wt.i(4)));
538 gt.set(1, fn * (-wt.r(1) + wt.r(3)), fn * (-wt.i(1) - wt.i(3)));
539 gt.set(3, fn * (wt.r(1) - wt.r(3)), fn * (-wt.i(1) - wt.i(3)));
540 gt.set(4, fn * (wt.r(0) + wt.r(4)), fn * (wt.i(0) - wt.i(4)));
544 gt2 = G.
mat(site, 0);
555 int Nvol2 = W.
nvol();
557 Mat_SU_N gt(Nc), wt(Nc), gt2(Nc), wt2(Nc);
559 for (
int site = 0; site < Nvol2; ++site) {
568 double fn1 = (wt.r(8) + wt.r(0)) * (wt.r(8) + wt.r(0))
569 + (wt.i(8) - wt.i(0)) * (wt.i(8) - wt.i(0));
570 double fn2 = (wt.r(2) - wt.r(6)) * (wt.r(2) - wt.r(6))
571 + (wt.i(2) + wt.i(6)) * (wt.i(2) + wt.i(6));
572 double fn = 1.0 / sqrt(fn1 + fn2);
574 gt.set(0, fn * (wt.r(8) + wt.r(0)), fn * (wt.i(8) - wt.i(0)));
575 gt.set(2, fn * (wt.r(6) - wt.r(2)), fn * (-wt.i(6) - wt.i(2)));
576 gt.set(6, fn * (-wt.r(6) + wt.r(2)), fn * (-wt.i(6) - wt.i(2)));
577 gt.set(8, fn * (wt.r(8) + wt.r(0)), fn * (-wt.i(8) + wt.i(0)));
581 gt2 = G.
mat(site, 0);
592 int Nvol2 = W.
nvol();
594 Mat_SU_N gt(Nc), wt(Nc), gt2(Nc), wt2(Nc);
596 for (
int site = 0; site < Nvol2; ++site) {
605 double fn1 = (wt.r(4) + wt.r(8)) * (wt.r(4) + wt.r(8))
606 + (wt.i(4) - wt.i(8)) * (wt.i(4) - wt.i(8));
607 double fn2 = (wt.r(7) - wt.r(5)) * (wt.r(7) - wt.r(5))
608 + (wt.i(7) + wt.i(5)) * (wt.i(7) + wt.i(5));
609 double fn = 1.0 / sqrt(fn1 + fn2);
611 gt.set(4, fn * (wt.r(4) + wt.r(8)), fn * (-wt.i(4) + wt.i(8)));
612 gt.set(5, fn * (-wt.r(5) + wt.r(7)), fn * (-wt.i(5) - wt.i(7)));
613 gt.set(7, fn * (wt.r(5) - wt.r(7)), fn * (-wt.i(5) - wt.i(7)));
614 gt.set(8, fn * (wt.r(4) + wt.r(8)), fn * (wt.i(4) - wt.i(8)));
618 gt2 = G.
mat(site, 0);
void Register_string(const string &, const string &)
void calc_DLT(Field_G &Weo, Field_G &Ue, Field_G &Uo, int Ieo)
int siteh(const int x2, const int y, const int z, const int t) const
void general(const char *format,...)
void Register_int(const string &, const int)
static int ipe(const int dir)
logical coordinate of current proc.
Mat_SU_N & at()
antihermitian traceless
void calc_W(Field_G &Weo, Field_G &Ue, Field_G &Uo, int Ieo)
void convertField(Field &eo, const Field &lex)
void addpart_ex(int ex, const Field &w, int exw)
void maxTr3(Field_G &, Field_G &)
void gfix_step(std::valarray< double > &sg, Field_G &Ue, Field_G &Uo, double wp)
one step of gauge fixing with overrelaxation parameter wp.
int square_non_zero(const double v)
void maxTr1(Field_G &, Field_G &)
void maxTr(Field_G &, Field_G &)
void mult_Field_Gnd(Field_G &w, const int ex, const Field_G &u1, const int ex1, const Field_G &u2, const int ex2)
void fix(Field_G &Ufix, const Field_G &Uorg)
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 maxTr2(Field_G &, Field_G &)
void gauge_trans_eo(Field_G &Ue, Field_G &Uo, Field_G &Geo, int Ieo)
void paranoiac(const char *format,...)
void set_randomGaugeTrans(std::valarray< double > &sg, Field_G &Geo)
Methods to shift the even-odd field.
void crucial(const char *format,...)
Bridge::VerboseLevel m_vl
static bool Register(const std::string &realm, const creator_callback &cb)
Base class of random number generators.
void reverseField(Field &lex, const Field &eo)
int non_zero(const double v)
void calc_SG(std::valarray< double > &sg, std::valarray< double > &Fval, Field_G &Ue, Field_G &Uo)
Mat_SU_N mat_dag(const int site, const int mn=0) const
int non_negative(const int v)
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 backward_h(Field &, const Field &, const int mu, const int ieo)
static const std::string class_name
void set(int c, double re, const double &im)
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
void set_mat(const int site, const int mn, const Mat_SU_N &U)
Parameters_GaugeFixing_Coulomb()
void set_parameters(const Parameters ¶ms)
Mat_SU_N mat(const int site, const int mn=0) const
int fetch_int(const string &key, int &val) const
void add_mat(const int site, const int mn, const Mat_SU_N &U)
void forward_h(Field &, const Field &, const int mu, const int ieo)
void sum_global_t(std::valarray< double > &val_global, std::valarray< double > &val_local)
static VerboseLevel set_verbose_level(const std::string &str)
double ReTr(const Mat_SU_N &m)