Bridge++  Version 1.6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
60 {
61  public:
62  static const std::string class_name;
63 
64  private:
65  int m_Niter; // max iteration number
66  int m_Nnaive; // number of naive iterations
67  int m_Nmeas; // interval of measurements
68  int m_Nreset; // Number of iteration to reset the config.
69  double m_Enorm; // convergence criterion
70  double m_wp; // overrelaxation parameter
71 
74 
75  public:
77  : GaugeFixing(),
78  m_rand(RandomNumberManager::getInstance())
79  {
80  // strict check
81  if (CommonParameters::Nc() != 3) {
82  vout.crucial(m_vl, "Error at %s: Nc = 3 is needed, but Nc = %d\n", class_name.c_str(), CommonParameters::Nc());
83  exit(EXIT_FAILURE);
84  }
85  }
86 
88  : GaugeFixing(),
89  m_rand(rand)
90  {
91  // strict check
92  if (CommonParameters::Nc() != 3) {
93  vout.crucial(m_vl, "Error at %s: Nc = 3 is needed, but Nc = %d\n", class_name.c_str(), CommonParameters::Nc());
94  exit(EXIT_FAILURE);
95  }
96  }
97 
99  : GaugeFixing(),
100  m_rand(rand.get())
101  {
102  // strict check
103  if (CommonParameters::Nc() != 3) {
104  vout.crucial(m_vl, "Error at %s: Nc = 3 is needed, but Nc = %d\n", class_name.c_str(), CommonParameters::Nc());
105  exit(EXIT_FAILURE);
106  }
107  }
108 
110 
111  void set_parameters(const Parameters& params);
112  void set_parameters(const int Niter, const int Nnaive,
113  const int Nmeas, const int Nreset,
114  const double Enorm, const double wp);
115 
116  void fix(Field_G& Ufix, const Field_G& Uorg);
117 
118  private:
120  void gfix_step(Field_G& Ue, Field_G& Uo, const double wp);
121 
122  void set_randomGaugeTrans(const std::valarray<double>& sg, Field_G& Geo);
123  void gauge_trans_eo(Field_G& Ue, Field_G& Uo,
124  const Field_G& Geo, const int Ieo);
125 
126  void calc_SG(std::valarray<double>& sg, std::valarray<double>& Fval,
127  const Field_G& Ue, const Field_G& Uo);
128  void calc_DLT(Field_G& Weo,
129  const Field_G& Ue, const Field_G& Uo, const int Ieo);
130  void calc_W(Field_G& Weo,
131  const Field_G& Ue, const Field_G& Uo, const int Ieo);
132 
133  void maxTr(Field_G&, Field_G&);
134  void maxTr1(Field_G&, Field_G&);
135  void maxTr2(Field_G&, Field_G&);
136  void maxTr3(Field_G&, Field_G&);
137 
138  void sum_global_t(std::valarray<double>& val_global,
139  const std::valarray<double>& val_local);
140 
141 #ifdef USE_FACTORY
142  private:
143  static GaugeFixing *create_object()
144  {
145  return new GaugeFixing_Coulomb();
146  }
147 
148  public:
149  static bool register_factory()
150  {
151  return GaugeFixing::Factory::Register("Coulomb", create_object);
152  }
153 #endif
154 };
155 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
void gfix_step(Field_G &Ue, Field_G &Uo, const double wp)
one step of gauge fixing with overrelaxation parameter wp.
Coulomb gauge fixing.
void gauge_trans_eo(Field_G &Ue, Field_G &Uo, const Field_G &Geo, const int Ieo)
void calc_DLT(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
RandomNumbers * m_rand
Class for parameters.
Definition: parameters.h:46
Even-odd site index.
Definition: index_eo.h:40
void set_randomGaugeTrans(const std::valarray< double > &sg, Field_G &Geo)
void maxTr3(Field_G &, Field_G &)
void sum_global_t(std::valarray< double > &val_global, const std::valarray< double > &val_local)
SU(N) gauge field.
Definition: field_G.h:38
void maxTr1(Field_G &, Field_G &)
void maxTr(Field_G &, Field_G &)
GaugeFixing_Coulomb(RandomNumbers *rand)
void fix(Field_G &Ufix, const Field_G &Uorg)
void maxTr2(Field_G &, Field_G &)
GaugeFixing_Coulomb(unique_ptr< RandomNumbers > &rand)
void crucial(const char *format,...)
Definition: bridgeIO.cpp:178
Bridge::VerboseLevel m_vl
Definition: gaugeFixing.h:57
Manager class for RandomNumbers.
Base class of random number generators.
Definition: randomNumbers.h:43
static const std::string class_name
gauge fixing.
Definition: gaugeFixing.h:36
void calc_SG(std::valarray< double > &sg, std::valarray< double > &Fval, const Field_G &Ue, const Field_G &Uo)
void set_parameters(const Parameters &params)
void calc_W(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)