CHROMA
lcm_exp_sdt.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*! @file
4  * @brief Intgrator for exp(S dt)
5  *
6  * A component integrator to integrate exp(Sdt) for some
7  * monomial list S (ie this is a leapP like component)
8  */
9 
10 #ifndef LCM_EXPSDT_H
11 #define LCM_EXPSDT_H
12 
13 
14 #include "chromabase.h"
15 #include "handle.h"
19 
20 
21 namespace Chroma
22 {
23 
24  /*! @ingroup integrator */
25  namespace LatColMatExpSdtIntegratorEnv
26  {
27  extern const std::string name;
28  bool registerAll();
29  }
30 
31 
32  /*! @ingroup integrator */
34  {
36  LatColMatExpSdtIntegratorParams(XMLReader& xml, const std::string& path);
37  int n_steps;
38  multi1d<std::string> monomial_list;
39  };
40 
41  /*! @ingroup integrator */
42  void read(XMLReader& xml_in,
43  const std::string& path,
45 
46  /*! @ingroup integrator */
47  void write(XMLWriter& xml_out,
48  const std::string& path,
50 
51  //! MD integrator interface for PQP leapfrog
52  /*! @ingroup integrator
53  * Specialised to multi1d<LatticeColorMatrix>
54  */
56  : public AbsComponentIntegrator<multi1d<LatticeColorMatrix>,
57  multi1d<LatticeColorMatrix> >
58  {
59  public:
60 
61  // Simplest Constructor
62  LatColMatExpSdtIntegrator(const int n_steps_,
63  const multi1d<std::string>& monomial_id_list) : n_steps(n_steps_) {
64  create(monomial_id_list);
65  }
66 
67 
68  // Construct from nsteps and monomial_handle array
69  LatColMatExpSdtIntegrator(const int n_steps_,
70  const multi1d< IntegratorShared::MonomialPair>& monomials_) : n_steps(n_steps_), monomials(monomials_) {}
71 
72  // Construct from params struct and Hamiltonian
74  create(p.monomial_list);
75  }
76 
77  // Copy constructor
80 
81  // ! Destruction is automagic
83 
84  void operator()( AbsFieldState<multi1d<LatticeColorMatrix>,
85  multi1d<LatticeColorMatrix> >& s,
86  const Real& traj_length) const;
87 
88 
89  void refreshFields(AbsFieldState<multi1d<LatticeColorMatrix>,
90  multi1d<LatticeColorMatrix> >& s) const {
91  for(int i=0; i < monomials.size(); i++) {
92  monomials[i].mon->refreshInternalFields(s);
93  }
94  }
95 
96  //! Reset Predictors in just this level
97  void resetPredictors(void) const {
98  for(int i=0; i < monomials.size(); ++i) {
99  monomials[i].mon->resetPredictors();
100  }
101  }
102 
103  private:
104  int n_steps;
105 
106  typedef multi1d<LatticeColorMatrix> LCM;
107  // Use the shared routine to bind the monomial list
108  void create(const multi1d<std::string>& monomial_id_list) {
109  IntegratorShared::bindMonomials(monomial_id_list, monomials);
110  }
111 
112 
113 
114  multi1d< IntegratorShared::MonomialPair > monomials;
115  };
116 
117 }
118 
119 
120 #endif
Integrators.
Monomials - gauge action or fermion binlinear contributions for HMC.
Primary include file for CHROMA library code.
MD integrator that can be used as a component for other integrators.
Abstract field state.
Definition: field_state.h:27
MD integrator interface for PQP leapfrog.
Definition: lcm_exp_sdt.h:58
LatColMatExpSdtIntegrator(const int n_steps_, const multi1d< std::string > &monomial_id_list)
Definition: lcm_exp_sdt.h:62
LatColMatExpSdtIntegrator(const LatColMatExpSdtIntegratorParams &p)
Definition: lcm_exp_sdt.h:73
void operator()(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s, const Real &traj_length) const
Do an integration of length n*delta tau in n steps.
Definition: lcm_exp_sdt.cc:77
multi1d< LatticeColorMatrix > LCM
Definition: lcm_exp_sdt.h:106
LatColMatExpSdtIntegrator(const LatColMatExpSdtIntegrator &l)
Definition: lcm_exp_sdt.h:78
void resetPredictors(void) const
Reset Predictors in just this level.
Definition: lcm_exp_sdt.h:97
void create(const multi1d< std::string > &monomial_id_list)
Definition: lcm_exp_sdt.h:108
multi1d< IntegratorShared::MonomialPair > monomials
Definition: lcm_exp_sdt.h:114
LatColMatExpSdtIntegrator(const int n_steps_, const multi1d< IntegratorShared::MonomialPair > &monomials_)
Definition: lcm_exp_sdt.h:69
void refreshFields(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s) const
Refresh fields in this level of the integrator (for R like algorithms)
Definition: lcm_exp_sdt.h:89
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams &param)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
Class for counted reference semantics.
void bindMonomials(const multi1d< std::string > &monomial_ids, multi1d< MonomialPair > &monomials)
A routine to bind Monomial IDs to an array of Monomial Handles.
bool registerAll()
Register all the factories.
Definition: lcm_exp_sdt.cc:35
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int i
Definition: pbg5p_w.cc:55
multi1d< LatticeFermion > s(Ncb)
::std::string string
Definition: gtest.h:1979
int l
Definition: pade_trln_w.cc:111
multi1d< std::string > monomial_list
Definition: lcm_exp_sdt.h:38