CHROMA
lcm_sts_force_grad_recursive.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: lcm_sts_force_grad_recursive.h,v 3.2 2017-12-20 11:20:00 boram Exp $
3 
4 /*! @file
5  * @brief Lat Col Mat force-gradient integrator
6  *
7  * Force-gradient integrator given in Kennedy and Clark, 2007 (arXiv:0710.3611)
8  * Implementation adopted the Taylor expansion trick proposed in
9  * Yin and Mawhinney, 2011 (arXiv:1111.5059)
10  */
11 
12 #ifndef LCM_FORCE_GRAD_RECURSIVE_H
13 #define LCM_FORCE_GRAD_RECURSIVE_H
14 
15 
16 #include "chromabase.h"
20 
21 namespace Chroma
22 {
23 
24  /*! @ingroup integrator */
25  namespace LatColMatSTSForceGradRecursiveIntegratorEnv
26  {
27  extern const std::string name;
28  bool registerAll();
29  }
30 
31 
32  /*! @ingroup integrator */
34  {
37  int n_steps;
38  multi1d<std::string> monomial_ids;
40  };
41 
42  /*! @ingroup integrator */
43  void read(XMLReader& xml_in,
44  const std::string& path,
46 
47  /*! @ingroup integrator */
48  void write(XMLWriter& xml_out,
49  const std::string& path,
51 
52  //! MD integrator interface for PQP leapfrog
53  /*! @ingroup integrator
54  * Specialised to multi1d<LatticeColorMatrix>
55  */
57  : public AbsRecursiveIntegrator<multi1d<LatticeColorMatrix>,
58  multi1d<LatticeColorMatrix> >
59  {
60  public:
61 
62  // Simplest Constructor
64  const multi1d<std::string>& monomial_ids_,
65 
66  Handle< AbsComponentIntegrator< multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> > >& SubIntegrator_) : n_steps(n_steps_), SubIntegrator(SubIntegrator_) {
67 
69  };
70 
71  // Construct from params struct and Hamiltonian
73  const LatColMatSTSForceGradRecursiveIntegratorParams& p) : n_steps(p.n_steps), SubIntegrator(IntegratorShared::createSubIntegrator(p.subintegrator_xml)) {
74 
76 
77  }
78 
79 
80  // Copy constructor
83 
84  // ! Destruction is automagic
86 
87 
88  void operator()( AbsFieldState<multi1d<LatticeColorMatrix>,
89  multi1d<LatticeColorMatrix> >& s,
90  const Real& traj_length) const;
91 
93  multi1d<LatticeColorMatrix> >& getSubIntegrator() const {
94  return (*SubIntegrator);
95  }
96 
97  protected:
98  //! Refresh fields in just this level
99  void refreshFieldsThisLevel(AbsFieldState<multi1d<LatticeColorMatrix>,
100  multi1d<LatticeColorMatrix> >& s) const {
101  for(int i=0; i < monomials.size(); i++) {
102  monomials[i].mon->refreshInternalFields(s);
103  }
104  }
105 
106  //! Reset Predictors in just this level
107  void resetPredictorsThisLevel(void) const {
108  for(int i=0; i < monomials.size(); ++i) {
109  monomials[i].mon->resetPredictors();
110  }
111  }
112 
113  private:
114 
115  int n_steps;
116 
117  multi1d< IntegratorShared::MonomialPair > monomials;
118 
120  multi1d<LatticeColorMatrix> > > SubIntegrator;
121 
122  void fg_update(
123  AbsFieldState<multi1d<LatticeColorMatrix>,
124  multi1d<LatticeColorMatrix> >& s,
125  const Real& traj_length1, const Real& traj_length2) const;
126 
127  };
128 
129 }
130 
131 
132 #endif
Abstract Hamiltonian.
Integrators.
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 component integrator that has a sub integrator (recursive)
Class for counted reference semantics.
Definition: handle.h:33
multi1d< IntegratorShared::MonomialPair > monomials
LatColMatSTSForceGradRecursiveIntegrator(const LatColMatSTSForceGradRecursiveIntegrator &l)
Handle< AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > SubIntegrator
void operator()(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s, const Real &traj_length) const
Do an integration of lenght n*delta tau in n steps.
void resetPredictorsThisLevel(void) const
Reset Predictors in just this level.
LatColMatSTSForceGradRecursiveIntegrator(const LatColMatSTSForceGradRecursiveIntegratorParams &p)
AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > & getSubIntegrator() const
Return the next level down integrator.
void refreshFieldsThisLevel(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s) const
Refresh fields in just this level.
void fg_update(AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s, const Real &traj_length1, const Real &traj_length2) const
LatColMatSTSForceGradRecursiveIntegrator(int n_steps_, const multi1d< std::string > &monomial_ids_, Handle< AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > > &SubIntegrator_)
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.
AbsComponentIntegrator< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > * createSubIntegrator(const std::string &subintegrator_xml)
A routine to create a sub integrator from a generic piece of subintegrator XML.
void bindMonomials(const multi1d< std::string > &monomial_ids, multi1d< MonomialPair > &monomials)
A routine to bind Monomial IDs to an array of Monomial Handles.
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