Bridge++  Version 1.6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gaugeFixing_Landau.h
Go to the documentation of this file.
1 
14 #ifndef GAUGEFIXING_LANDAU_INCLUDED
15 #define GAUGEFIXING_LANDAU_INCLUDED
16 
17 #include "gaugeFixing.h"
18 #include "Field/shiftField_eo.h"
19 #include "Tools/randomNumbers.h"
21 
22 #include "IO/bridgeIO.h"
23 using Bridge::vout;
24 
25 
27 
28 /*
29  This class fixes the gauge of configuration to the Landau gauge.
30  The algorithm is that developed by the Los Alamos group [see the
31  implementation note].
32  Overrelaxation is incorporated.
33  To escape the Gribov copy, if convergence is not reached within
34  the iterations specified by Nreset, random gauge transformation
35  is performed to reset the configuration.
36  This is the reason that random number generator is needed at the
37  construction of this class.
38 
39  The implementation is not complete:
40  - only applies to SU(3) case: because of specific implementation
41  of maxTr function (Cabibbo-Marinari maximization).
42  This should be improved in the version beyond test phase.
43  [16 Feb 2012 H.Matsufuru]
44  (Coding history will be recovered from trac.)
45  Implement YAML. [14 Nov 2012 Y.Namekawa]
46  Introduce unique_ptr to avoid memory leaks.
47  [21 Mar 2015 Y.Namekawa]
48  Move Staple and RandomNumbers into gaugeFixing.
49  [30 Mar 2016 Y.Namekawa]
50  Add Nc check for USE_GROUP_SU_N. [31 May 2021 Y.Namekawa]
51  */
52 
54 {
55  public:
56  static const std::string class_name;
57 
58  private:
59  int m_Niter; // max iteration number
60  int m_Nnaive; // number of naive iterations
61  int m_Nmeas; // interval of measurements
62  int m_Nreset; // Number of iteration to reset the config.
63  double m_Enorm; // convergence criterion
64  double m_wp; // overrelaxation parameter
65 
68 
69  public:
71  : GaugeFixing(),
72  m_rand(RandomNumberManager::getInstance())
73  {
74  // strict check
75  if (CommonParameters::Nc() != 3) {
76  vout.crucial(m_vl, "Error at %s: Nc = 3 is needed, but Nc = %d\n", class_name.c_str(), CommonParameters::Nc());
77  exit(EXIT_FAILURE);
78  }
79  }
80 
82  : GaugeFixing(),
83  m_rand(rand)
84  {
85  // strict check
86  if (CommonParameters::Nc() != 3) {
87  vout.crucial(m_vl, "Error at %s: Nc = 3 is needed, but Nc = %d\n", class_name.c_str(), CommonParameters::Nc());
88  exit(EXIT_FAILURE);
89  }
90  }
91 
93  : GaugeFixing(),
94  m_rand(rand.get())
95  {
96  // strict check
97  if (CommonParameters::Nc() != 3) {
98  vout.crucial(m_vl, "Error at %s: Nc = 3 is needed, but Nc = %d\n", class_name.c_str(), CommonParameters::Nc());
99  exit(EXIT_FAILURE);
100  }
101  }
102 
104 
105  void set_parameters(const Parameters& params);
106  void set_parameters(const int Niter, const int Nnaive, const int Nmeas,
107  const int Nreset, const double Enorm, const double wp);
108 
109  void fix(Field_G& Ufix, const Field_G& Uorg);
110 
111  private:
113  void gfix_step(Field_G& Ue, Field_G& Uo, const double wp);
114 
115  void set_randomGaugeTrans(Field_G& Geo);
116  void gauge_trans_eo(Field_G& Ue, Field_G& Uo,
117  const Field_G& Geo, const int Ieo);
118 
119  void calc_SG(double& sg, double& Fval,
120  const Field_G& Ue, const Field_G& Uo);
121  void calc_W(Field_G& Weo,
122  const Field_G& Ue, const Field_G& Uo, const int Ieo);
123  void calc_DLT(Field_G& Weo,
124  const Field_G& Ue, const Field_G& Uo, const int Ieo);
125 
126  void maxTr(Field_G&, Field_G&);
127  void maxTr1(Field_G&, Field_G&);
128  void maxTr2(Field_G&, Field_G&);
129  void maxTr3(Field_G&, Field_G&);
130 
131 #ifdef USE_FACTORY
132  private:
133  static GaugeFixing *create_object()
134  {
135  return new GaugeFixing_Landau();
136  }
137 
138  public:
139  static bool register_factory()
140  {
141  return GaugeFixing::Factory::Register("Landau", create_object);
142  }
143 #endif
144 };
145 #endif
BridgeIO vout
Definition: bridgeIO.cpp:503
void maxTr2(Field_G &, Field_G &)
static const std::string class_name
Class for parameters.
Definition: parameters.h:46
Even-odd site index.
Definition: index_eo.h:40
GaugeFixing_Landau(unique_ptr< RandomNumbers > &rand)
void gauge_trans_eo(Field_G &Ue, Field_G &Uo, const Field_G &Geo, const int Ieo)
SU(N) gauge field.
Definition: field_G.h:38
void maxTr1(Field_G &, Field_G &)
void calc_DLT(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
void maxTr3(Field_G &, Field_G &)
void set_parameters(const Parameters &params)
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
RandomNumbers * m_rand
Landau gauge fixing.
void calc_W(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
gauge fixing.
Definition: gaugeFixing.h:36
void fix(Field_G &Ufix, const Field_G &Uorg)
void maxTr(Field_G &, Field_G &)
GaugeFixing_Landau(RandomNumbers *rand)
void calc_SG(double &sg, double &Fval, const Field_G &Ue, const Field_G &Uo)
void gfix_step(Field_G &Ue, Field_G &Uo, const double wp)
one step of gauge fixing with overrelaxation parameter wp.
void set_randomGaugeTrans(Field_G &Geo)