18 #ifdef USE_FACTORY_AUTOREGISTER
20 bool init = GaugeFixing_Coulomb::register_factory();
29 const string str_vlevel = params.
get_string(
"verbose_level");
34 int Niter, Nnaive, Nmeas, Nreset;
38 err += params.
fetch_int(
"maximum_number_of_iteration", Niter);
39 err += params.
fetch_int(
"number_of_naive_iteration", Nnaive);
40 err += params.
fetch_int(
"interval_of_measurement", Nmeas);
41 err += params.
fetch_int(
"iteration_to_reset", Nreset);
42 err += params.
fetch_double(
"convergence_criterion_squared", Enorm);
43 err += params.
fetch_double(
"overrelaxation_parameter", wp);
57 const int Nmeas,
const int Nreset,
58 const double Enorm,
const double wp)
96 const int Nvol = Uorg.
nvol();
97 const int Nex = Uorg.
nex();
100 const int Nvol2 = Nvol / 2;
112 const double plaq = staple.
plaquette(Uorg);
118 for (
int iter = 0; iter <
m_Niter; ++iter) {
119 std::valarray<double> sg(Lt);
120 std::valarray<double> Fval(Lt);
126 for (
int t = 0; t < Lt; ++t) {
127 if (sg[t] > sg_max) sg_max = sg[t];
132 for (
int t = 0; t < Lt; ++t) {
148 if (((iter % m_Nreset) == 0) && (iter > 0)) {
171 const double plaq2 = staple.
plaquette(Ufix);
172 const double plaq_diff = std::abs(plaq - plaq2);
177 if (plaq_diff > sqrt(
m_Enorm)) {
189 const int Nvol2 = Ue.
nvol();
196 for (
int ieo = 0; ieo < 2; ++ieo) {
205 for (
int site = 0; site < Nvol2; ++site) {
207 ut = Geo.
mat(site, 0);
230 assert(Geo.
nex() == 1);
231 assert(sg.size() == Lt);
233 for (
int t = 0; t < Nt; ++t) {
234 int tg = t + ipe_t * Nt;
237 for (
int z = 0; z < Nz; ++z) {
238 for (
int y = 0; y < Ny; ++y) {
239 for (
int x = 0; x < Nx2; ++x) {
249 for (
int z = 0; z < Nz; ++z) {
250 for (
int y = 0; y < Ny; ++y) {
251 for (
int x = 0; x < Nx2; ++x) {
267 const Field_G& Geo,
const int Ieo)
272 const int Nvol2 = Geo.
nvol();
278 for (
int mu = 0; mu < Ndim; ++mu) {
289 for (
int mu = 0; mu < Ndim; ++mu) {
305 std::valarray<double>& Fval,
314 const int Nvol2 = Nx2 * Ny * Nz * Nt;
318 assert(Ue.
nex() == Ndim);
319 assert(Ue.
nvol() == Nvol2);
320 assert(Uo.
nex() == Ndim);
321 assert(Uo.
nvol() == Nvol2);
326 std::valarray<double> sg_local(Nt);
329 for (
int ieo = 0; ieo < 2; ++ieo) {
333 for (
int t = 0; t < Nt; ++t) {
334 for (
int z = 0; z < Nz; ++z) {
335 for (
int y = 0; y < Ny; ++y) {
336 for (
int x = 0; x < Nx2; ++x) {
340 ut = DLT.
mat(site, 0);
341 sg_local[t] += ut.
norm2();
349 for (
int t = 0; t < Lt; ++t) {
350 sg[t] = sg[t] / (Ndim * Nc * (2 * Nvol2 * NPE) / Lt);
354 std::valarray<double> Fval_local(Nt);
357 for (
int mu = 0; mu < Ndim - 1; ++mu) {
358 for (
int t = 0; t < Nt; ++t) {
359 for (
int z = 0; z < Nz; ++z) {
360 for (
int y = 0; y < Ny; ++y) {
361 for (
int x = 0; x < Nx2; ++x) {
365 ut = Ue.
mat(site, mu);
366 Fval_local[t] +=
ReTr(ut);
367 ut = Uo.
mat(site, mu);
368 Fval_local[t] +=
ReTr(ut);
376 for (
int t = 0; t < Lt; ++t) {
377 Fval[t] = Fval[t] / (Ndim * (2 * Nvol2 * NPE) / Lt);
384 const std::valarray<double>& val_local)
390 assert(val_global.size() == Lt);
391 assert(val_local.size() == Nt);
393 for (
int t_global = 0; t_global < Lt; ++t_global) {
394 val_global[t_global] = 0.0;
397 for (
int t = 0; t < Nt; ++t) {
398 int t_global = t + ipe_t * Nt;
399 val_global[t_global] = val_local[t];
402 for (
int t_global = 0; t_global < Lt; ++t_global) {
403 double val = val_global[t_global];
414 const int Nvol2 = Ue.
nvol();
423 for (
int mu = 0; mu < Ndim - 1; ++mu) {
434 for (
int mu = 0; mu < Ndim - 1; ++mu) {
446 for (
int site = 0; site < Nvol2; ++site) {
449 u_tmp = DLT.
mat(site, 0);
462 const int Nvol2 = Ue.
nvol();
466 assert(Weo.
nex() == 1);
473 for (
int mu = 0; mu < Ndim - 1; ++mu) {
480 shift.forward_h(Ut2, Ut1, mu, 0);
481 for (
int site = 0; site < Nvol2; ++site) {
487 }
else if (Ieo == 1) {
488 for (
int mu = 0; mu < Ndim - 1; ++mu) {
495 shift.forward_h(Ut2, Ut1, mu, 1);
496 for (
int site = 0; site < Nvol2; ++site) {
514 const int Nvol2 = G0.
nvol();
522 for (
int site = 0; site < Nvol2; ++site) {
526 for (
int imt = 0; imt < Nmt; ++imt) {
538 const int Nvol2 = W.
nvol();
540 for (
int site = 0; site < Nvol2; ++site) {
551 double fn1 = (wt.
r(0) + wt.
r(4)) * (wt.
r(0) + wt.
r(4))
552 + (wt.
i(0) - wt.
i(4)) * (wt.
i(0) - wt.
i(4));
553 double fn2 = (wt.
r(1) - wt.
r(3)) * (wt.
r(1) - wt.
r(3))
554 + (wt.
i(1) + wt.
i(3)) * (wt.
i(1) + wt.
i(3));
555 double fn = 1.0 / sqrt(fn1 + fn2);
557 gt.
set(0, fn * (wt.
r(0) + wt.
r(4)), fn * (-wt.
i(0) + wt.
i(4)));
558 gt.
set(1, fn * (-wt.
r(1) + wt.
r(3)), fn * (-wt.
i(1) - wt.
i(3)));
559 gt.
set(3, fn * (wt.
r(1) - wt.
r(3)), fn * (-wt.
i(1) - wt.
i(3)));
560 gt.
set(4, fn * (wt.
r(0) + wt.
r(4)), fn * (wt.
i(0) - wt.
i(4)));
567 gt2 = G.
mat(site, 0);
578 const int Nvol2 = W.
nvol();
582 for (
int site = 0; site < Nvol2; ++site) {
593 double fn1 = (wt.
r(8) + wt.
r(0)) * (wt.
r(8) + wt.
r(0))
594 + (wt.
i(8) - wt.
i(0)) * (wt.
i(8) - wt.
i(0));
595 double fn2 = (wt.
r(2) - wt.
r(6)) * (wt.
r(2) - wt.
r(6))
596 + (wt.
i(2) + wt.
i(6)) * (wt.
i(2) + wt.
i(6));
597 double fn = 1.0 / sqrt(fn1 + fn2);
599 gt.
set(0, fn * (wt.
r(8) + wt.
r(0)), fn * (wt.
i(8) - wt.
i(0)));
600 gt.
set(2, fn * (wt.
r(6) - wt.
r(2)), fn * (-wt.
i(6) - wt.
i(2)));
601 gt.
set(6, fn * (-wt.
r(6) + wt.
r(2)), fn * (-wt.
i(6) - wt.
i(2)));
602 gt.
set(8, fn * (wt.
r(8) + wt.
r(0)), fn * (-wt.
i(8) + wt.
i(0)));
609 gt2 = G.
mat(site, 0);
620 const int Nvol2 = W.
nvol();
624 for (
int site = 0; site < Nvol2; ++site) {
635 double fn1 = (wt.
r(4) + wt.
r(8)) * (wt.
r(4) + wt.
r(8))
636 + (wt.
i(4) - wt.
i(8)) * (wt.
i(4) - wt.
i(8));
637 double fn2 = (wt.
r(7) - wt.
r(5)) * (wt.
r(7) - wt.
r(5))
638 + (wt.
i(7) + wt.
i(5)) * (wt.
i(7) + wt.
i(5));
639 double fn = 1.0 / sqrt(fn1 + fn2);
641 gt.
set(4, fn * (wt.
r(4) + wt.
r(8)), fn * (-wt.
i(4) + wt.
i(8)));
642 gt.
set(5, fn * (-wt.
r(5) + wt.
r(7)), fn * (-wt.
i(5) - wt.
i(7)));
643 gt.
set(7, fn * (wt.
r(5) - wt.
r(7)), fn * (-wt.
i(5) - wt.
i(7)));
644 gt.
set(8, fn * (wt.
r(4) + wt.
r(8)), fn * (wt.
i(4) - wt.
i(8)));
651 gt2 = G.
mat(site, 0);
void scal(Field &x, const double a)
scal(x, a): x = a * x
void detailed(const char *format,...)
Mat_SU_N & set_random(RandomNumbers *rand)
void gfix_step(Field_G &Ue, Field_G &Uo, const double wp)
one step of gauge fixing with overrelaxation parameter wp.
void set(const int jin, const int site, const int jex, double v)
int siteh(const int x2, const int y, const int z, const int t) const
void gauge_trans_eo(Field_G &Ue, Field_G &Uo, const Field_G &Geo, const int Ieo)
void general(const char *format,...)
int fetch_double(const string &key, double &value) const
double plaquette(const Field_G &)
calculates plaquette value.
void calc_DLT(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
static int ipe(const int dir)
logical coordinate of current proc.
Mat_SU_N & at()
antihermitian traceless
void convertField(Field &eo, const Field &lex)
void addpart_ex(int ex, const Field &w, int exw)
void set_randomGaugeTrans(const std::valarray< double > &sg, Field_G &Geo)
void maxTr3(Field_G &, Field_G &)
int square_non_zero(const double v)
void sum_global_t(std::valarray< double > &val_global, const std::valarray< double > &val_local)
void maxTr1(Field_G &, Field_G &)
void maxTr(Field_G &, Field_G &)
void fix(Field_G &Ufix, const Field_G &Uorg)
int fetch_int(const string &key, int &value) const
void maxTr2(Field_G &, Field_G &)
void paranoiac(const char *format,...)
Methods to shift the even-odd field.
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 crucial(const char *format,...)
Bridge::VerboseLevel m_vl
void reverseField(Field &lex, const Field &eo)
int non_zero(const double v)
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 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)
string get_string(const string &key) const
void set_mat(const int site, const int mn, const Mat_SU_N &U)
void calc_SG(std::valarray< double > &sg, std::valarray< double > &Fval, const Field_G &Ue, const Field_G &Uo)
void set_parameters(const Parameters ¶ms)
Mat_SU_N mat(const int site, const int mn=0) const
void calc_W(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
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)
static VerboseLevel set_verbose_level(const std::string &str)
double ReTr(const Mat_SU_N &m)
void mult_Field_Gnd(Field_G &W, const int ex, const Field_G &U1, const int ex1, const Field_G &U2, const int ex2)