Bridge++  Ver. 2.0.2
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 
53 // strict check
54 #define CHECK_NC_3 \
55  do { \
56  if (CommonParameters::Nc() != 3) { \
57  vout.crucial(m_vl, \
58  "Error at %s: Nc = 3 is needed, but Nc = %d\n", \
59  class_name.c_str(), CommonParameters::Nc()); \
60  exit(EXIT_FAILURE); \
61  } \
62  } while (0)
63 
65 {
66  public:
67  static const std::string class_name;
68 
69  private:
71 
72  int m_Niter; // max iteration number
73  int m_Nnaive; // number of naive iterations
74  int m_Nmeas; // interval of measurements
75  int m_Nreset; // Number of iteration to reset the config.
76  double m_Enorm; // convergence criterion
77  double m_wp; // overrelaxation parameter
78 
81 
83 
84  public:
86  : m_vl(CommonParameters::Vlevel()),
87  m_rand(RandomNumberManager::getInstance())
88  {
89  CHECK_NC_3;
90  }
91 
93  : m_vl(CommonParameters::Vlevel()),
94  m_rand(rand)
95  {
96  CHECK_NC_3;
97  }
98 
100  : m_vl(CommonParameters::Vlevel()),
101  m_rand(RandomNumberManager::getInstance())
102  {
103  CHECK_NC_3;
104 
105  set_parameters(params);
106  }
107 
109  : m_vl(CommonParameters::Vlevel()),
110  m_rand(rand)
111  {
112  CHECK_NC_3;
113 
114  set_parameters(params);
115  }
116 
118 
119  void set_parameters(const Parameters& params);
120  void set_parameters(const int Niter, const int Nnaive, const int Nmeas,
121  const int Nreset, const double Enorm, const double wp);
122 
123  void get_parameters(Parameters& params) const;
124 
125  void fix(Field_G& Ufix, const Field_G& Uorg);
126 
127  private:
129  void gfix_step(Field_G& Ue, Field_G& Uo, const double wp);
130 
131  void set_randomGaugeTrans(Field_G& Geo);
132  void gauge_trans_eo(Field_G& Ue, Field_G& Uo,
133  const Field_G& Geo, const int Ieo);
134 
135  void calc_SG(double& sg, double& Fval,
136  const Field_G& Ue, const Field_G& Uo);
137  void calc_W(Field_G& Weo,
138  const Field_G& Ue, const Field_G& Uo, const int Ieo);
139  void calc_DLT(Field_G& Weo,
140  const Field_G& Ue, const Field_G& Uo, const int Ieo);
141 
142  void maxTr(Field_G&, Field_G&);
143  void maxTr1(Field_G&, Field_G&);
144  void maxTr2(Field_G&, Field_G&);
145  void maxTr3(Field_G&, Field_G&);
146 
147 #ifdef USE_FACTORY
148  private:
149  static GaugeFixing *create_object()
150  {
151  return new GaugeFixing_Landau();
152  }
153 
154  static GaugeFixing *create_object_with_params(const Parameters& params)
155  {
156  return new GaugeFixing_Landau(params);
157  }
158 
159  public:
160  static bool register_factory()
161  {
162  bool init = true;
163  init &= GaugeFixing::Factory::Register("Landau", create_object);
164  init &= GaugeFixing::Factory_params::Register("Landau", create_object_with_params);
165  return init;
166  }
167 #endif
168 };
169 
170 #undef CHECK_NC_3
171 
172 #endif
GaugeFixing_Landau::GaugeFixing_Landau
GaugeFixing_Landau(const Parameters &params)
Definition: gaugeFixing_Landau.h:99
GaugeFixing_Landau::fix
void fix(Field_G &Ufix, const Field_G &Uorg)
Definition: gaugeFixing_Landau.cpp:108
GaugeFixing_Landau::calc_SG
void calc_SG(double &sg, double &Fval, const Field_G &Ue, const Field_G &Uo)
Definition: gaugeFixing_Landau.cpp:278
GaugeFixing_Landau::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_Landau.cpp:188
GaugeFixing_Landau::gauge_trans_eo
void gauge_trans_eo(Field_G &Ue, Field_G &Uo, const Field_G &Geo, const int Ieo)
Definition: gaugeFixing_Landau.cpp:240
bridgeIO.h
CHECK_NC_3
#define CHECK_NC_3
Landau gauge fixing.
Definition: gaugeFixing_Landau.h:54
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_Landau::m_Nmeas
int m_Nmeas
Definition: gaugeFixing_Landau.h:74
Parameters
Class for parameters.
Definition: parameters.h:46
GaugeFixing_Landau::m_Nreset
int m_Nreset
Definition: gaugeFixing_Landau.h:75
GaugeFixing_Landau::maxTr2
void maxTr2(Field_G &, Field_G &)
Definition: gaugeFixing_Landau.cpp:477
GaugeFixing_Landau::m_Niter
int m_Niter
Definition: gaugeFixing_Landau.h:72
GaugeFixing_Landau::~GaugeFixing_Landau
~GaugeFixing_Landau()
Definition: gaugeFixing_Landau.h:117
GaugeFixing_Landau::maxTr
void maxTr(Field_G &, Field_G &)
Definition: gaugeFixing_Landau.cpp:412
RandomNumbers
Base class of random number generators.
Definition: randomNumbers.h:43
GaugeFixing_Landau::m_index
Index_eo m_index
Definition: gaugeFixing_Landau.h:80
Index_eo
Even-odd site index.
Definition: index_eo.h:44
GaugeFixing_Landau::m_shift
ShiftField_eo m_shift
Definition: gaugeFixing_Landau.h:82
GaugeFixing_Landau::class_name
static const std::string class_name
Definition: gaugeFixing_Landau.h:67
GaugeFixing_Landau::maxTr1
void maxTr1(Field_G &, Field_G &)
Definition: gaugeFixing_Landau.cpp:437
GaugeFixing_Landau::m_wp
double m_wp
Definition: gaugeFixing_Landau.h:77
GaugeFixing
gauge fixing.
Definition: gaugeFixing.h:36
GaugeFixing_Landau::GaugeFixing_Landau
GaugeFixing_Landau()
Definition: gaugeFixing_Landau.h:85
shiftField_eo.h
RandomNumberManager
Manager class for RandomNumbers.
Definition: randomNumberManager.h:53
GaugeFixing_Landau::maxTr3
void maxTr3(Field_G &, Field_G &)
Definition: gaugeFixing_Landau.cpp:517
GaugeFixing_Landau::calc_DLT
void calc_DLT(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
Definition: gaugeFixing_Landau.cpp:313
GaugeFixing_Landau::m_Enorm
double m_Enorm
Definition: gaugeFixing_Landau.h:76
GaugeFixing_Landau
Definition: gaugeFixing_Landau.h:64
GaugeFixing_Landau::get_parameters
void get_parameters(Parameters &params) const
Definition: gaugeFixing_Landau.cpp:56
GaugeFixing_Landau::set_parameters
void set_parameters(const Parameters &params)
Definition: gaugeFixing_Landau.cpp:27
GaugeFixing_Landau::m_rand
RandomNumbers * m_rand
Definition: gaugeFixing_Landau.h:79
GaugeFixing_Landau::m_vl
Bridge::VerboseLevel m_vl
Definition: gaugeFixing_Landau.h:70
randomNumberManager.h
GaugeFixing_Landau::m_Nnaive
int m_Nnaive
Definition: gaugeFixing_Landau.h:73
GaugeFixing_Landau::set_randomGaugeTrans
void set_randomGaugeTrans(Field_G &Geo)
Definition: gaugeFixing_Landau.cpp:222
GaugeFixing_Landau::GaugeFixing_Landau
GaugeFixing_Landau(RandomNumbers *rand, const Parameters &params)
Definition: gaugeFixing_Landau.h:108
GaugeFixing_Landau::GaugeFixing_Landau
GaugeFixing_Landau(RandomNumbers *rand)
Definition: gaugeFixing_Landau.h:92
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Field_G
SU(N) gauge field.
Definition: field_G.h:38
gaugeFixing.h
GaugeFixing_Landau::calc_W
void calc_W(Field_G &Weo, const Field_G &Ue, const Field_G &Uo, const int Ieo)
Definition: gaugeFixing_Landau.cpp:360
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512