CHROMA
mciter.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief One heatbath interation of updating the gauge field configuration
3  */
4 
5 #include "chromabase.h"
6 #include "util/gauge/reunit.h"
10 
11 namespace Chroma
12 {
13 
14  //! One heatbath interation of updating the gauge field configuration
15  /*!
16  * \ingroup heatbath
17  *
18  * Make one interation of updating the gauge field configuration:
19  * this consists of n_over overrelaxation sweeps followed
20  * by one heatbath sweep with nheat trials.
21  * In the case of SU(3), for each link we loop over the 3 SU(2) subgroups.
22 
23  * Warning: this works only for Nc = 2 and 3 !
24 
25  * \param u gauge field ( Modify )
26  * \param S_g gauge action ( Read )
27  * \param hbp heatbath parameters ( Read )
28  */
29 
30  void mciter(multi1d<LatticeColorMatrix>& u,
31  const LinearGaugeAction& S_g,
32  const HBParams& hbp)
33  {
34  START_CODE();
35 
36  LatticeColorMatrix u_mu_staple;
37  int ntrials = 0;
38  int nfails = 0;
39 
40  const Set& gauge_set = S_g.getSet();
41  const int num_subsets = gauge_set.numSubsets();
42 
43  for(int iter = 0; iter <= hbp.nOver; ++iter)
44  {
45  for(int cb = 0; cb < num_subsets; ++cb)
46  {
47  for(int mu = 0; mu < Nd; ++mu)
48  {
49  // Calculate the staple
50  {
51  typedef multi1d<LatticeColorMatrix> P;
52  typedef multi1d<LatticeColorMatrix> Q;
53 
55 
56  //staple
57  S_g.staple(u_mu_staple, state, mu, cb);
58  }
59 
60  if ( iter < hbp.nOver )
61  {
62  /* Do an overrelaxation step */
63  /*# Loop over SU(2) subgroup index */
64  for(int su2_index = 0; su2_index < Nc*(Nc-1)/2; ++su2_index)
65  su3over(u[mu], u_mu_staple, su2_index, gauge_set[cb]);
66  }
67  else
68  {
69  /* Do a heatbath step */
70  /*# Loop over SU(2) subgroup index */
71  for(int su2_index = 0; su2_index < Nc*(Nc-1)/2; ++su2_index)
72  {
73  int ntry = 0;
74  int nfail = 0;
75 
76  su2_hb_update(u[mu], u_mu_staple,
77  Real(2.0/Nc),
78  su2_index, gauge_set[cb],
79  hbp.nmax());
80 
81 // su3hb(u[mu], u_mu_staple, su2_index, nheat, ntry, nfail, gauge_set[cb]);
82  ntrials += ntry;
83  nfails += nfail;
84  }
85 
86  /* Reunitarize */
87  reunit(u[mu]);
88 
89  }
90 
91  // If using Schroedinger functional, reset the boundaries
92  // NOTE: this routine resets all links and not just those under mu,cb
93  S_g.getGaugeBC().modify(u);
94 
95  } // closes mu loop
96  } // closes cb loop
97  }
98 
99 
100  END_CODE();
101  }
102 
103 } // end namespace Chroma
Primary include file for CHROMA library code.
virtual GaugeState< P, Q > * createState(const Q &q) const
Given links, create the state.
Definition: gaugeact.h:40
virtual const Set & getSet(void) const =0
Return the set on which the gauge action is defined.
virtual const GaugeBC< P, Q > & getGaugeBC() const
Return the gauge BC object for this action.
Definition: gaugeact.h:46
virtual void modify(Q &u) const =0
Apply the BC onto the U fields in place.
Class for counted reference semantics.
Definition: handle.h:33
Base class for gauge actions with links appearing linearly in the action.
Definition: gaugeact.h:80
virtual void staple(LatticeColorMatrix &result, const Handle< GaugeState< P, Q > > &state, int mu, int cb) const =0
Compute staple.
int mu
Definition: cool.cc:24
int su2_index
Definition: cool.cc:27
void su3over(LatticeColorMatrix &u, const LatticeColorMatrix &w, int su2_index, const Subset &sub)
Do one SU(2) subgroup microcanonical overrelaxation update of SU(Nc) matrix.
Definition: su3over.cc:26
void mciter(multi1d< LatticeColorMatrix > &u, const LinearGaugeAction &S_g, const HBParams &hbp)
One heatbath interation of updating the gauge field configuration.
Definition: mciter.cc:30
One heatbath interation of updating the gauge field configuration.
Nd
Definition: meslate.cc:74
multi1d< LatticeColorMatrix > P
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::Q Q
void reunit(LatticeColorMatrixF3 &xa)
Definition: reunit.cc:467
START_CODE()
int cb
Definition: invbicg.cc:120
void su2_hb_update(LatticeColorMatrix &u_mu, const LatticeColorMatrix &u_mu_staple, Double BetaMC, const int su2_index, const Subset &sub, const int NmaxHB)
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
Reunitarize in place a color matrix to SU(N)
Heat-bath params.
Definition: hb_params.h:16
int nmax() const
Definition: hb_params.h:17
Do one SU(2) subgroup microcanonical overrelaxation update of SU(Nc)