Bridge++  Ver. 2.0.2
gaugeFixing_Coulomb.h
Go to the documentation of this file.
1 
14 #ifndef GAUGEFIXING_COULOMB_INCLUDED
15 #define GAUGEFIXING_COULOMB_INCLUDED
16 
17 #include "gaugeFixing.h"
18 
19 #include "Field/shiftField_eo.h"
20 #include "Tools/randomNumbers.h"
22 
23 #include "IO/bridgeIO.h"
24 using Bridge::vout;
25 
26 
28 
29 /*
30  This class fixes the gauge of configuration to the Coulomb gauge.
31  The implementation assumes that the dimension is 4 and the
32  Coulomb gauge fixing is performed within each time slice.
33  The algorithm is that developed by the Los Alamos group [see the
34  implementation note].
35  Overrelaxation is incorporated.
36  To escape the Gribov copy, if convergence is not reached on some
37  timeslices within the iterations specified by Nreset, random
38  gauge transformation is performed to reset the configuration on
39  that timeslice.
40  This is the reason that random number generator is needed at the
41  construction of this class.
42 
43  The implementation is not complete:
44  - only applies to SU(3) case: because of specific implementation
45  of maxTr function (Cabibbo-Marinari maximization).
46  - unnecessary arithmetic operations exist for the timeslices
47  on which the gauge is already fixed to good precision.
48  These should be improved in the version beyond test phase.
49  [16 Feb 2012 H.Matsufuru]
50  (Coding history will be recovered from trac.)
51  Implement YAML. [14 Nov 2012 Y.Namekawa]
52  Introduce unique_ptr to avoid memory leaks.
53  [21 Mar 2015 Y.Namekawa]
54  Move Staple and RandomNumbers into gaugeFixing.
55  [30 Mar 2016 Y.Namekawa]
56  Add Nc check for USE_GROUP_SU_N. [31 May 2021 Y.Namekawa]
57 */
58 
59 // strict check
60 #define CHECK_NC_3 \
61  do { \
62  if (CommonParameters::Nc() != 3) { \
63  vout.crucial(m_vl, \
64  "Error at %s: Nc = 3 is needed, but Nc = %d\n", \
65  class_name.c_str(), CommonParameters::Nc()); \
66  exit(EXIT_FAILURE); \
67  } \
68  } while (0)
69 
71 {
72  public:
73  static const std::string class_name;
74 
75  private:
77 
78  int m_Niter; // max iteration number
79  int m_Nnaive; // number of naive iterations
80  int m_Nmeas; // interval of measurements
81  int m_Nreset; // Number of iteration to reset the config.
82  double m_Enorm; // convergence criterion
83  double m_wp; // overrelaxation parameter
84 
87 
89 
90  public:
92  : m_vl(CommonParameters::Vlevel()),
93  m_rand(RandomNumberManager::getInstance())
94  {
95  CHECK_NC_3;
96  }
97 
99  : m_vl(CommonParameters::Vlevel()),
100  m_rand(rand)
101  {
102  CHECK_NC_3;
103  }
104 
106  : m_vl(CommonParameters::Vlevel()),
107  m_rand(RandomNumberManager::getInstance())
108  {
109  CHECK_NC_3;
110 
111  set_parameters(params);
112  }
113 
115  : m_vl(CommonParameters::Vlevel()),
116  m_rand(rand)
117  {
118  CHECK_NC_3;
119 
120  set_parameters(params);
121  }
122 
124 
125  void set_parameters(const Parameters& params);
126  void set_parameters(const int Niter, const int Nnaive,
127  const int Nmeas, const int Nreset,
128  const double Enorm, const double wp);
129 
130  void get_parameters(Parameters& params) const;
131 
132  void fix(Field_G& Ufix, const Field_G& Uorg);
133 
134  private:
136  void gfix_step(Field_G& Ue, Field_G& Uo, const double wp);
137 
138  void set_randomGaugeTrans(const std::valarray<double>& sg, Field_G& Geo);
139  void gauge_trans_eo(Field_G& Ue, Field_G& Uo,
140  const Field_G& Geo, const int Ieo);
141 
142  void calc_SG(std::valarray<double>& sg, std::valarray<double>& Fval,
143  const Field_G& Ue, const Field_G& Uo);
144  void calc_DLT(Field_G& Weo,
145  const Field_G& Ue, const Field_G& Uo, const int Ieo);
146  void calc_W(Field_G& Weo,
147  const Field_G& Ue, const Field_G& Uo, const int Ieo);
148 
149  void maxTr(Field_G&, Field_G&);
150  void maxTr1(Field_G&, Field_G&);
151  void maxTr2(Field_G&, Field_G&);
152  void maxTr3(Field_G&, Field_G&);
153 
154  void sum_global_t(std::valarray<double>& val_global,
155  const std::valarray<double>& val_local);
156 
157 #ifdef USE_FACTORY
158  private:
159  static GaugeFixing *create_object()
160  {
161  return new GaugeFixing_Coulomb();
162  }
163 
164  static GaugeFixing *create_object_with_params(const Parameters& params)
165  {
166  return new GaugeFixing_Coulomb(params);
167  }
168 
169  public:
170  static bool register_factory()
171  {
172  bool init = true;
173  init &= GaugeFixing::Factory::Register("Coulomb", create_object);
174  init &= GaugeFixing::Factory_params::Register("Coulomb", create_object_with_params);
175  return init;
176  }
177 #endif
178 };
179 #endif
GaugeFixing_Coulomb::m_Enorm
double m_Enorm
Definition: gaugeFixing_Coulomb.h:82
GaugeFixing_Coulomb::m_Nreset
int m_Nreset
Definition: gaugeFixing_Coulomb.h:81
GaugeFixing_Coulomb::m_wp
double m_wp
Definition: gaugeFixing_Coulomb.h:83
bridgeIO.h
GaugeFixing_Coulomb::maxTr1
void maxTr1(Field_G &, Field_G &)
Definition: gaugeFixing_Coulomb.cpp:550
ShiftField_eo
Methods to shift the even-odd field.
Definition: shiftField_eo.h:49
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
randomNumbers.h
GaugeFixing_Coulomb::GaugeFixing_Coulomb
GaugeFixing_Coulomb(const Parameters &params)
Definition: gaugeFixing_Coulomb.h:105
GaugeFixing_Coulomb::gauge_trans_eo
void gauge_trans_eo(Field_G &Ue, Field_G &Uo, const Field_G &Geo, const int Ieo)
Definition: gaugeFixing_Coulomb.cpp:281
Parameters
Class for parameters.
Definition: parameters.h:46
GaugeFixing_Coulomb::calc_W
void calc_W(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
Definition: gaugeFixing_Coulomb.cpp:473
GaugeFixing_Coulomb::fix
void fix(Field_G &Ufix, const Field_G &Uorg)
Definition: gaugeFixing_Coulomb.cpp:109
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
Index_eo
Even-odd site index.
Definition: index_eo.h:44
GaugeFixing_Coulomb::maxTr3
void maxTr3(Field_G &, Field_G &)
Definition: gaugeFixing_Coulomb.cpp:632
GaugeFixing_Coulomb::m_Niter
int m_Niter
Definition: gaugeFixing_Coulomb.h:78
GaugeFixing_Coulomb::get_parameters
void get_parameters(Parameters &params) const
Definition: gaugeFixing_Coulomb.cpp:57
GaugeFixing
gauge fixing.
Definition: gaugeFixing.h:36
shiftField_eo.h
RandomNumberManager
Manager class for RandomNumbers.
Definition: randomNumberManager.h:53
GaugeFixing_Coulomb::maxTr2
void maxTr2(Field_G &, Field_G &)
Definition: gaugeFixing_Coulomb.cpp:590
GaugeFixing_Coulomb::m_index
Index_eo m_index
Definition: gaugeFixing_Coulomb.h:86
GaugeFixing_Coulomb::maxTr
void maxTr(Field_G &, Field_G &)
Definition: gaugeFixing_Coulomb.cpp:525
GaugeFixing_Coulomb
Definition: gaugeFixing_Coulomb.h:70
GaugeFixing_Coulomb::m_shift
ShiftField_eo m_shift
Definition: gaugeFixing_Coulomb.h:88
GaugeFixing_Coulomb::set_randomGaugeTrans
void set_randomGaugeTrans(const std::valarray< double > &sg, Field_G &Geo)
Definition: gaugeFixing_Coulomb.cpp:234
CHECK_NC_3
#define CHECK_NC_3
Coulomb gauge fixing.
Definition: gaugeFixing_Coulomb.h:60
GaugeFixing_Coulomb::set_parameters
void set_parameters(const Parameters &params)
Definition: gaugeFixing_Coulomb.cpp:27
GaugeFixing_Coulomb::m_Nmeas
int m_Nmeas
Definition: gaugeFixing_Coulomb.h:80
GaugeFixing_Coulomb::calc_SG
void calc_SG(std::valarray< double > &sg, std::valarray< double > &Fval, const Field_G &Ue, const Field_G &Uo)
Definition: gaugeFixing_Coulomb.cpp:319
randomNumberManager.h
GaugeFixing_Coulomb::sum_global_t
void sum_global_t(std::valarray< double > &val_global, const std::valarray< double > &val_local)
Definition: gaugeFixing_Coulomb.cpp:398
GaugeFixing_Coulomb::gfix_step
void gfix_step(Field_G &Ue, Field_G &Uo, const double wp)
one step of gauge fixing with overrelaxation parameter wp.
Definition: gaugeFixing_Coulomb.cpp:201
GaugeFixing_Coulomb::GaugeFixing_Coulomb
GaugeFixing_Coulomb(RandomNumbers *rand)
Definition: gaugeFixing_Coulomb.h:98
GaugeFixing_Coulomb::GaugeFixing_Coulomb
GaugeFixing_Coulomb(RandomNumbers *rand, const Parameters &params)
Definition: gaugeFixing_Coulomb.h:114
GaugeFixing_Coulomb::m_Nnaive
int m_Nnaive
Definition: gaugeFixing_Coulomb.h:79
GaugeFixing_Coulomb::m_vl
Bridge::VerboseLevel m_vl
Definition: gaugeFixing_Coulomb.h:76
GaugeFixing_Coulomb::GaugeFixing_Coulomb
GaugeFixing_Coulomb()
Definition: gaugeFixing_Coulomb.h:91
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
gaugeFixing.h
GaugeFixing_Coulomb::calc_DLT
void calc_DLT(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
Definition: gaugeFixing_Coulomb.cpp:425
GaugeFixing_Coulomb::m_rand
RandomNumbers * m_rand
Definition: gaugeFixing_Coulomb.h:85
GaugeFixing_Coulomb::~GaugeFixing_Coulomb
~GaugeFixing_Coulomb()
Definition: gaugeFixing_Coulomb.h:123
GaugeFixing_Coulomb::class_name
static const std::string class_name
Definition: gaugeFixing_Coulomb.h:73
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512