29#ifndef QCD_PSEUDOFERMION_TWO_FLAVOUR_EVEN_ODD_RATIO_H
30#define QCD_PSEUDOFERMION_TWO_FLAVOUR_EVEN_ODD_RATIO_H
71 PhiEven(_NumOp.FermionRedBlackGrid()),
72 PhiOdd(_NumOp.FermionRedBlackGrid())
81 std::stringstream sstream;
82 sstream<<
"TwoFlavourEvenOddRatioPseudoFermionAction det("<<
DenOp.Mass()<<
") / det("<<
NumOp.Mass()<<
")";
87 std::stringstream sstream;
100 RealD scale = std::sqrt(0.5);
102 FermionField eta (
NumOp.FermionGrid());
103 gaussian(pRNG,eta); eta = eta * scale;
108 void refresh(
const GaugeField &
U,
const FermionField &eta) {
115 FermionField etaOdd (
NumOp.FermionRedBlackGrid());
116 FermionField etaEven(
NumOp.FermionRedBlackGrid());
117 FermionField tmp (
NumOp.FermionRedBlackGrid());
124 std::cout <<
" TwoFlavourRefresh: Imported gauge "<<std::endl;
129 std::cout <<
" TwoFlavourRefresh: Diff ops "<<std::endl;
132 std::cout <<
" TwoFlavourRefresh: MpcDag "<<std::endl;
134 std::cout <<
" TwoFlavourRefresh: Zero() guess "<<std::endl;
136 std::cout <<
" TwoFlavourRefresh: Heatbath solver "<<std::endl;
138 std::cout <<
" TwoFlavourRefresh: Mpc "<<std::endl;
141 DenOp.MooeeDag(etaEven,tmp);
143 std::cout <<
" TwoFlavourRefresh: Mee "<<std::endl;
164 FermionField X(
NumOp.FermionRedBlackGrid());
165 FermionField Y(
NumOp.FermionRedBlackGrid());
181 DenOp.MooeeInvDag(X,Y);
182 action = action +
norm2(Y);
192 virtual void deriv(
const GaugeField &
U,GaugeField & dSdU) {
200 FermionField X(
NumOp.FermionRedBlackGrid());
201 FermionField Y(
NumOp.FermionRedBlackGrid());
204 GaugeField force(dSdU.Grid());
227 Mpc.
MpcDeriv(force,Y,X); dSdU = dSdU-force;
234 assert(
NumOp.ConstEE() == 1);
235 assert(
DenOp.ConstEE() == 1);
Lattice< vobj > real(const Lattice< vobj > &lhs)
ComplexD innerProduct(const Lattice< vobj > &left, const Lattice< vobj > &right)
RealD norm2(const Lattice< vobj > &arg)
void gaussian(GridParallelRNG &rng, Lattice< vobj > &l)
void pickCheckerboard(int cb, Lattice< vobj > &half, const Lattice< vobj > &full)
GridLogger GridLogMessage(1, "Message", GridLogColours, "NORMAL")
#define NAMESPACE_BEGIN(A)
static INTERNAL_PRECISION U
Base class for all actions.
virtual GridBase * GaugeGrid(void)=0
virtual GridBase * FermionRedBlackGrid(void)=0
virtual GridBase * GaugeRedBlackGrid(void)=0
virtual GridBase * FermionGrid(void)=0
virtual void MpcDag(const Field &in, Field &out)
virtual void Mpc(const Field &in, Field &out)
void MpcDagDeriv(GaugeField &Force, const FermionField &U, const FermionField &V)
void MpcDeriv(GaugeField &Force, const FermionField &U, const FermionField &V)
virtual void deriv(const GaugeField &U, GaugeField &dSdU)
virtual std::string action_name()
Report the name of the action.
virtual RealD Sinitial(const GaugeField &U)
Get the action at the start of the trajectory.
OperatorFunction< FermionField > & ActionSolver
OperatorFunction< FermionField > & DerivativeSolver
virtual std::string LogParameters()
Print the parameters of the action.
const FermionField & getPhiOdd() const
void refresh(const GaugeField &U, const FermionField &eta)
virtual RealD S(const GaugeField &U)
Evaluate this action with the given gauge field.
OperatorFunction< FermionField > & HeatbathSolver
TwoFlavourEvenOddRatioPseudoFermionAction(FermionOperator< Impl > &_NumOp, FermionOperator< Impl > &_DenOp, OperatorFunction< FermionField > &DS, OperatorFunction< FermionField > &AS, OperatorFunction< FermionField > &HS)
TwoFlavourEvenOddRatioPseudoFermionAction(FermionOperator< Impl > &_NumOp, FermionOperator< Impl > &_DenOp, OperatorFunction< FermionField > &DS, OperatorFunction< FermionField > &AS)
FermionOperator< Impl > & DenOp
FermionOperator< Impl > & NumOp
virtual void refresh(const GaugeField &U, GridSerialRNG &sRNG, GridParallelRNG &pRNG)
Refresh pseudofermion fields.