CHROMA
seoprec_constdet_two_flavor_monomial_w.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*! @file
3  * @brief Two-flavor collection of even-odd preconditioned 4D ferm monomials
4  */
5 
6 #ifndef __seoprec_two_flavor_monomial_w_h__
7 #define __seoprec_two_flavor_monomial_w_h__
8 
12 
13 namespace Chroma
14 {
15 
16  /*! @ingroup monomial */
17  namespace SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomialEnv
18  {
19  bool registerAll();
20  }
21 
22 
23  //! Wrapper class for 2-flavor even-odd prec ferm monomials
24  /*! @ingroup monomial
25  *
26  * Monomial is expected to be the same for these fermacts
27  */
30  multi1d<LatticeColorMatrix>,
31  multi1d<LatticeColorMatrix>,
32  LatticeFermion>
33  {
34  public:
35  // Typedefs to save typing
36  typedef LatticeFermion T;
37  typedef multi1d<LatticeColorMatrix> P;
38  typedef multi1d<LatticeColorMatrix> Q;
39 
40  // Construct out of a parameter struct. Check against the desired FermAct name
42 
43  // Copy Constructor
45 
46 
47  //! Even even contribution (eg ln det Clover)
48  Double S_even_even(const AbsFieldState<multi1d<LatticeColorMatrix>,
49  multi1d<LatticeColorMatrix> >& s) {
50  return Double(0);
51  }
52 
53 #if 1
54  //! Compute the odd odd contribution (eg
55  Double S_odd_odd(const AbsFieldState<multi1d<LatticeColorMatrix>,
56  multi1d<LatticeColorMatrix> >& s) {
57  START_CODE();
58 
59  XMLWriter& xml_out = TheXMLLogWriter::Instance();
60  push(xml_out, "S_odd_odd");
61 
63 
65 
66  // Get system solver
68 
69  // Need way to get gauge state from AbsFieldState<P,Q>
71  // Get the X fields
72  T X;
73 
74  // Action calc doesnt use chrono predictor use zero guess
75  X[ lin->subset() ] = zero;
76 
77  // No predictor used here.
78  QDPIO::cout << "TwoFlavWilson4DMonomial: resetting Predictor before energy calc solve" << std::endl;
80 
81  SystemSolverResults_t res = (*invMdagM)(X, getPhi());
82  QDPIO::cout << "2Flav::invert, n_count = " << res.n_count << std::endl;
83 
84  LatticeDouble site_action=zero;
85  site_action[ lin->subset() ] = Double(-12);
86  site_action[ lin->subset() ] += localInnerProductReal(getPhi(),X);
87 
88  //Double action = innerProductReal(getPhi(), X, lin->subset());
89  Double action = sum(site_action, lin->subset());
90 
91  write(xml_out, "n_count", res.n_count);
92  write(xml_out, "S_oo", action);
93  pop(xml_out);
94 
95  END_CODE();
96 
97  return action;
98  }
99 #endif
100  protected:
101 
102  T& getPhi(void) {
103  return phi;
104  }
105 
106  const T& getPhi(void) const {
107  return phi;
108  }
109 
111  return *fermact;
112  }
113 
114  //! Get parameters for the inverter
115  const GroupXML_t& getInvParams(void) const {
116  return inv_param;
117  }
118 
120  return *chrono_predictor;
121  };
122 
123 
124  private:
125 
126  // Hide empty constructor and =
129 
130  // Pseudofermion field phi
132 
133  // A handle for the SymEvenOddPrecWilsonFermAct
135 
136  // The parameters for the inversion
138 
140  };
141 
142 
143 } //end namespace chroma
144 
145 #endif
Abstract interface for a Chronological Solution predictor.
Abstract field state.
Definition: field_state.h:27
virtual FermState< T, P, Q > * createState(const Q &q) const
Given links (coordinates Q) create the state needed for the linear operators.
Definition: fermact.h:59
Class for counted reference semantics.
Definition: handle.h:33
static T & Instance()
Definition: singleton.h:432
Double S_odd_odd(const AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s)
Compute the odd odd contribution (eg.
const SymEvenOddPrecWilsonTypeFermAct< T, P, Q > & getFermAct(void) const
Get at fermion action For now the prototype is the same as before – wait until we refactor these befo...
SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial(const SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial &m)
AbsChronologicalPredictor4D< T > & getMDSolutionPredictor(void)
Get the initial guess predictor.
Handle< const SymEvenOddPrecWilsonTypeFermAct< T, P, Q > > fermact
const T & getPhi(void) const
Accessor for pseudofermion with Pf index i (read only)
void operator=(const SymEvenOddPrecConstDetTwoFlavorWilsonTypeFermMonomial &)
const GroupXML_t & getInvParams(void) const
Get parameters for the inverter.
Double S_even_even(const AbsFieldState< multi1d< LatticeColorMatrix >, multi1d< LatticeColorMatrix > > &s)
Even even contribution (eg ln det Clover)
Symmetric even-odd preconditioned Wilson-like fermion actions including derivatives.
virtual SymEvenOddPrecLinearOperator< T, P, Q > * linOp(Handle< FermState< T, P, Q > > state) const =0
Override to produce an even-odd prec. linear operator for this action.
Exact 2 degen flavor even-odd preconditioned fermact monomial.
virtual MdagMSystemSolver< T > * invMdagM(Handle< FermState< T, P, Q > > state, const GroupXML_t &invParam) const
Return a linear operator solver for this action to solve MdagM*psi=chi.
Field state.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams &param)
Writer parameters.
void reset()
Reset the default gauge field state.
static int m[4]
Definition: make_seeds.cc:16
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
push(xml_out,"Condensates")
pop(xml_out)
START_CODE()
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
Definition: pbg5p_w.cc:28
Double zero
Definition: invbicg.cc:106
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Definition: gtest.h:7351
Double sum
Definition: qtopcor.cc:37
Hold group xml and type id.
Holds return info from SystemSolver call.
Definition: syssolver.h:17
Two-flavor monomial params.
Two flavor Monomials - gauge action or fermion binlinear contributions for HMC.