6 #ifndef __central_tprec_logdet_tt_monomial_h__
7 #define __central_tprec_logdet_tt_monomial_h__
9 #include "qdp_config.h"
30 template<
typename P,
typename Q,
typename Phi>
31 class CentralTimePrecLogDetTTMonomial :
public ExactMonomial<P,Q>
34 virtual ~CentralTimePrecLogDetTTMonomial() {}
36 void dsdq(
P&
F,
const AbsFieldState<P,Q>&
s)
41 push(xml_out,
"CentralTimePrecLogDetTTMonomial");
44 const CentralTimePrecFermAct<Phi,P,Q>& FA = getFermAct();
47 Handle< FermState<Phi,P,Q> >
state(FA.createState(
s.getQ()));
50 Handle< CentralTimePrecLinearOperator<Phi,P,Q> > lin(FA.linOp(
state));
52 lin->derivLogDetTDagT(
F,
PLUS);
53 F[lin->tDir()] *= Real(getNumFlavors());
65 Double S(
const AbsFieldState<P,Q>&
s)
71 push(xml_out,
"CentralTimePrecLogDetTTMonomial");
72 const CentralTimePrecFermAct<Phi,P,Q>& FA = getFermAct();
73 Handle< FermState<Phi,P,Q> > bc_g_state = FA.createState(
s.getQ());
76 Handle< CentralTimePrecLinearOperator<Phi,P,Q> > lin(FA.linOp(bc_g_state));
78 Double S_ee =(
Double(-2*getNumFlavors())*lin->logDetTDagT());
79 write(xml_out,
"S", S_ee);
88 void refreshInternalFields(
const AbsFieldState<multi1d<LatticeColorMatrix>,
89 multi1d<LatticeColorMatrix> >&
s) {
93 void setInternalFields(
const Monomial<multi1d<LatticeColorMatrix>,
94 multi1d<LatticeColorMatrix> >&
m) {
99 virtual const CentralTimePrecFermAct<Phi,P,Q>& getFermAct()
const = 0;
100 virtual int getNumFlavors()
const = 0;
105 namespace CentralTimePrecLogDetTTMonomial4DEnv
112 struct CentralTimePrecLogDetTTMonomialParams
115 CentralTimePrecLogDetTTMonomialParams();
118 CentralTimePrecLogDetTTMonomialParams(XMLReader&
in,
const std::string& path);
124 void read(XMLReader&
r,
const std::string& path, CentralTimePrecLogDetTTMonomialParams&
p);
127 void write(XMLWriter& xml,
const std::string& path,
const CentralTimePrecLogDetTTMonomialParams&
p);
135 class CentralTimePrecLogDetTTMonomial4D :
136 public CentralTimePrecLogDetTTMonomial<multi1d<LatticeColorMatrix>,
137 multi1d<LatticeColorMatrix>,
142 typedef LatticeFermion
T;
143 typedef multi1d<LatticeColorMatrix>
P;
144 typedef multi1d<LatticeColorMatrix>
Q;
147 CentralTimePrecLogDetTTMonomial4D(
const CentralTimePrecLogDetTTMonomialParams&
p);
150 CentralTimePrecLogDetTTMonomial4D(
const CentralTimePrecLogDetTTMonomial4D&
m) : num_flavors(
m.num_flavors), fermact(
m.fermact) {}
153 ~CentralTimePrecLogDetTTMonomial4D() {}
157 const CentralTimePrecFermAct<T,P,Q> & getFermAct(
void)
const {
161 int getNumFlavors()
const {
167 Handle< CentralTimePrecFermAct<T,P,Q> > fermact;
Monomials - gauge action or fermion binlinear contributions for HMC.
Helper function for calculating forces.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void write(XMLWriter &xml, const std::string &path, const AsqtadFermActParams ¶m)
Writer parameters.
void monitorForces(XMLWriter &xml_out, const std::string &path, const multi1d< LatticeColorMatrix > &F)
Calculate and write out forces.
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > P
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::Q Q
push(xml_out,"Condensates")
LinOpSysSolverMGProtoClover::T T
const WilsonTypeFermAct< multi1d< LatticeFermion > > Handle< const ConnectState > state
static QDP_ColorVector * in
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
multi1d< LatticeColorMatrix > P
Singleton instances of xml output.
static INTERNAL_PRECISION F