1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-22 17:52:02 +01:00

Compare commits

...

3 Commits

Author SHA1 Message Date
bbec7f9fa9 Debug code 2023-04-20 14:54:36 -04:00
3aa43e6065 Debug info 2023-04-20 14:21:13 -04:00
78ac4044ff HMC 2023-04-20 13:28:07 -04:00
5 changed files with 22 additions and 6 deletions

View File

@ -196,7 +196,6 @@ void WilsonFermion5D<Impl>::DhopDir(const FermionField &in, FermionField &out,in
uint64_t Nsite = Umu.Grid()->oSites(); uint64_t Nsite = Umu.Grid()->oSites();
Kernels::DhopDirKernel(Stencil,Umu,Stencil.CommBuf(),Ls,Nsite,in,out,dirdisp,gamma); Kernels::DhopDirKernel(Stencil,Umu,Stencil.CommBuf(),Ls,Nsite,in,out,dirdisp,gamma);
}; };
template<class Impl> template<class Impl>
void WilsonFermion5D<Impl>::DhopDirAll(const FermionField &in, std::vector<FermionField> &out) void WilsonFermion5D<Impl>::DhopDirAll(const FermionField &in, std::vector<FermionField> &out)
@ -247,10 +246,14 @@ void WilsonFermion5D<Impl>::DerivInternal(StencilImpl & st,
Kernels::DhopDirKernel(st, U, st.CommBuf(), Ls, Usites, B, Btilde, mu,gamma); Kernels::DhopDirKernel(st, U, st.CommBuf(), Ls, Usites, B, Btilde, mu,gamma);
std::cout << " InsertForce Btilde "<< norm2(Btilde)<<std::endl;
//////////////////////////// ////////////////////////////
// spin trace outer product // spin trace outer product
//////////////////////////// ////////////////////////////
Impl::InsertForce5D(mat, Btilde, Atilde, mu); Impl::InsertForce5D(mat, Btilde, Atilde, mu);
std::cout << " InsertForce "<< norm2(mat)<<std::endl;
} }
} }

View File

@ -119,13 +119,19 @@ public:
// X^dag Der_oe MeeInv Meo Y // X^dag Der_oe MeeInv Meo Y
// Use Mooee as nontrivial but gauge field indept // Use Mooee as nontrivial but gauge field indept
this->_Mat.MeooeDag (V,tmp1); // odd->even -- implicit -0.5 factor to be applied this->_Mat.MeooeDag (V,tmp1); // odd->even -- implicit -0.5 factor to be applied
std::cout << " tmp 1" << norm2(tmp1)<<std::endl;
this->_Mat.MooeeInvDag(tmp1,tmp2); // even->even this->_Mat.MooeeInvDag(tmp1,tmp2); // even->even
std::cout << " tmp 1" << norm2(tmp2)<<std::endl;
this->_Mat.MoeDeriv(ForceO,U,tmp2,DaggerYes); this->_Mat.MoeDeriv(ForceO,U,tmp2,DaggerYes);
std::cout << " ForceO " << norm2(ForceO)<<std::endl;
// Accumulate X^dag M_oe MeeInv Der_eo Y // Accumulate X^dag M_oe MeeInv Der_eo Y
this->_Mat.Meooe (U,tmp1); // even->odd -- implicit -0.5 factor to be applied this->_Mat.Meooe (U,tmp1); // even->odd -- implicit -0.5 factor to be applied
std::cout << " tmp 1" << norm2(tmp1)<<std::endl;
this->_Mat.MooeeInv(tmp1,tmp2); // even->even this->_Mat.MooeeInv(tmp1,tmp2); // even->even
std::cout << " tmp 2" << norm2(tmp2)<<std::endl;
this->_Mat.MeoDeriv(ForceE,tmp2,V,DaggerYes); this->_Mat.MeoDeriv(ForceE,tmp2,V,DaggerYes);
std::cout << " ForceE " << norm2(ForceE)<<std::endl;
assert(ForceE.Checkerboard()==Even); assert(ForceE.Checkerboard()==Even);
assert(ForceO.Checkerboard()==Odd); assert(ForceO.Checkerboard()==Odd);

View File

@ -207,20 +207,27 @@ NAMESPACE_BEGIN(Grid);
//X = (Mdag M)^-1 V^dag phi //X = (Mdag M)^-1 V^dag phi
//Y = (Mdag)^-1 V^dag phi //Y = (Mdag)^-1 V^dag phi
Vpc.MpcDag(PhiOdd,Y); // Y= Vdag phi Vpc.MpcDag(PhiOdd,Y); // Y= Vdag phi
std::cout << GridLogMessage <<" Y "<<norm2(Y)<<std::endl;
X=Zero(); X=Zero();
DerivativeSolver(Mpc,Y,X); // X= (MdagM)^-1 Vdag phi DerivativeSolver(Mpc,Y,X); // X= (MdagM)^-1 Vdag phi
std::cout << GridLogMessage <<" X "<<norm2(X)<<std::endl;
Mpc.Mpc(X,Y); // Y= Mdag^-1 Vdag phi Mpc.Mpc(X,Y); // Y= Mdag^-1 Vdag phi
std::cout << GridLogMessage <<" Y "<<norm2(Y)<<std::endl;
// phi^dag V (Mdag M)^-1 dV^dag phi // phi^dag V (Mdag M)^-1 dV^dag phi
Vpc.MpcDagDeriv(force , X, PhiOdd ); dSdU = force; Vpc.MpcDagDeriv(force , X, PhiOdd ); dSdU = force;
std::cout << GridLogMessage <<" deriv "<<norm2(force)<<std::endl;
// phi^dag dV (Mdag M)^-1 V^dag phi // phi^dag dV (Mdag M)^-1 V^dag phi
Vpc.MpcDeriv(force , PhiOdd, X ); dSdU = dSdU+force; Vpc.MpcDeriv(force , PhiOdd, X ); dSdU = dSdU+force;
std::cout << GridLogMessage <<" deriv "<<norm2(force)<<std::endl;
// - phi^dag V (Mdag M)^-1 Mdag dM (Mdag M)^-1 V^dag phi // - phi^dag V (Mdag M)^-1 Mdag dM (Mdag M)^-1 V^dag phi
// - phi^dag V (Mdag M)^-1 dMdag M (Mdag M)^-1 V^dag phi // - phi^dag V (Mdag M)^-1 dMdag M (Mdag M)^-1 V^dag phi
Mpc.MpcDeriv(force,Y,X); dSdU = dSdU-force; Mpc.MpcDeriv(force,Y,X); dSdU = dSdU-force;
std::cout << GridLogMessage <<" deriv "<<norm2(force)<<std::endl;
Mpc.MpcDagDeriv(force,X,Y); dSdU = dSdU-force; Mpc.MpcDagDeriv(force,X,Y); dSdU = dSdU-force;
std::cout << GridLogMessage <<" deriv "<<norm2(force)<<std::endl;
// FIXME No force contribution from EvenEven assumed here // FIXME No force contribution from EvenEven assumed here
// Needs a fix for clover. // Needs a fix for clover.

View File

@ -299,11 +299,11 @@ int main(int argc, char **argv) {
// Probably dominates the force - back to EOFA. // Probably dominates the force - back to EOFA.
OneFlavourRationalParams SFRp; OneFlavourRationalParams SFRp;
SFRp.lo = 0.1; SFRp.lo = 0.1;
SFRp.hi = 25.0; SFRp.hi = 30.0;
SFRp.MaxIter = 10000; SFRp.MaxIter = 10000;
SFRp.tolerance= 1.0e-5; SFRp.tolerance= 1.0e-8;
SFRp.mdtolerance= 2.0e-4; SFRp.mdtolerance= 2.0e-6;
SFRp.degree = 8; SFRp.degree = 10;
SFRp.precision= 50; SFRp.precision= 50;
MobiusEOFAFermionD Strange_Op_L (U , *FGrid , *FrbGrid , *GridPtr , *GridRBPtr , strange_mass, strange_mass, pv_mass, 0.0, -1, M5, b, c); MobiusEOFAFermionD Strange_Op_L (U , *FGrid , *FrbGrid , *GridPtr , *GridRBPtr , strange_mass, strange_mass, pv_mass, 0.0, -1, M5, b, c);

View File

@ -85,7 +85,7 @@ int main(int argc, char **argv) {
TheHMC.Resources.AddObservable<PlaqObs>(); TheHMC.Resources.AddObservable<PlaqObs>();
////////////////////////////////////////////// //////////////////////////////////////////////
const int Ls = 4; const int Ls = 8;
Real beta = 2.13; Real beta = 2.13;
Real light_mass = 0.01; Real light_mass = 0.01;
Real strange_mass = 0.04; Real strange_mass = 0.04;