mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-14 22:07:05 +01:00
Merge branch 'feature/ddhmc' of https://github.com/paboyle/Grid into feature/ddhmc
This commit is contained in:
@ -208,6 +208,27 @@ void TestWhat(What & Ddwf,
|
||||
std::cout<<GridLogMessage <<"pDce - conj(cDpo) "<< pDce-conj(cDpo) <<std::endl;
|
||||
std::cout<<GridLogMessage <<"pDco - conj(cDpe) "<< pDco-conj(cDpe) <<std::endl;
|
||||
|
||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||
std::cout<<GridLogMessage<<"= Test MooeeDag is the dagger of Mooee by requiring "<<std::endl;
|
||||
std::cout<<GridLogMessage<<"= < phi | Deo | chi > * = < chi | Deo^dag| phi> "<<std::endl;
|
||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||
|
||||
Ddwf.Mooee(chi_e,dchi_e);
|
||||
Ddwf.Mooee(chi_o,dchi_o);
|
||||
Ddwf.MooeeDag(phi_e,dphi_e);
|
||||
Ddwf.MooeeDag(phi_o,dphi_o);
|
||||
|
||||
pDce = innerProduct(phi_e,dchi_e);
|
||||
pDco = innerProduct(phi_o,dchi_o);
|
||||
cDpe = innerProduct(chi_e,dphi_e);
|
||||
cDpo = innerProduct(chi_o,dphi_o);
|
||||
|
||||
std::cout<<GridLogMessage <<"e "<<pDce<<" "<<cDpe <<std::endl;
|
||||
std::cout<<GridLogMessage <<"o "<<pDco<<" "<<cDpo <<std::endl;
|
||||
|
||||
std::cout<<GridLogMessage <<"pDce - conj(cDpo) "<< pDce-conj(cDpe) <<std::endl;
|
||||
std::cout<<GridLogMessage <<"pDco - conj(cDpe) "<< pDco-conj(cDpo) <<std::endl;
|
||||
|
||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||
std::cout<<GridLogMessage<<"= Test MeeInv Mee = 1 "<<std::endl;
|
||||
std::cout<<GridLogMessage<<"=============================================================="<<std::endl;
|
||||
|
@ -118,8 +118,8 @@ int main (int argc, char ** argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout<<GridLogMessage <<"Using cold configuration"<<std::endl;
|
||||
// SU<Nc>::ColdConfiguration(Umu);
|
||||
std::cout<<GridLogMessage <<"Using hot configuration"<<std::endl;
|
||||
// SU<Nc>::ColdConfiguration(Umu);
|
||||
SU<Nc>::HotConfiguration(RNG4,Umu);
|
||||
}
|
||||
|
||||
|
@ -66,12 +66,9 @@ int main(int argc, char** argv)
|
||||
// Set up RNGs
|
||||
std::vector<int> seeds4({1, 2, 3, 4});
|
||||
std::vector<int> seeds5({5, 6, 7, 8});
|
||||
GridSerialRNG sRNG;
|
||||
GridParallelRNG RNG5(FGrid);
|
||||
sRNG.SeedFixedIntegers(seeds5);
|
||||
RNG5.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG4(UGrid);
|
||||
RNG4.SeedFixedIntegers(seeds4);
|
||||
GridSerialRNG SRNG; SRNG.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
|
||||
|
||||
// Random gauge field
|
||||
LatticeGaugeField Umu(UGrid);
|
||||
@ -86,7 +83,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<WilsonImplR> Meofa(Lop, Rop, CG, Params, false);
|
||||
|
||||
Meofa.refresh(Umu,sRNG, RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
@ -96,7 +93,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<WilsonImplR> Meofa(Lop, Rop, CG, Params, true);
|
||||
|
||||
Meofa.refresh(Umu,sRNG, RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
|
@ -70,13 +70,9 @@ int main(int argc, char** argv)
|
||||
// Set up RNGs
|
||||
std::vector<int> seeds4({1, 2, 3, 4});
|
||||
std::vector<int> seeds5({5, 6, 7, 8});
|
||||
GridParallelRNG RNG5(FGrid);
|
||||
RNG5.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG4(UGrid);
|
||||
RNG4.SeedFixedIntegers(seeds4);
|
||||
GridSerialRNG sRNG;
|
||||
RNG4.SeedFixedIntegers(seeds4);
|
||||
sRNG.SeedFixedIntegers(seeds5);
|
||||
GridSerialRNG SRNG; SRNG.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG5(FGrid); RNG5.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG4(UGrid); RNG4.SeedFixedIntegers(seeds4);
|
||||
|
||||
// Random gauge field
|
||||
LatticeGaugeField Umu(UGrid);
|
||||
@ -93,7 +89,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<FermionField> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<FermionImplPolicy> Meofa(Lop, Rop, CG, Params, false);
|
||||
|
||||
Meofa.refresh(Umu,sRNG, RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
@ -103,7 +99,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<FermionField> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<FermionImplPolicy> Meofa(Lop, Rop, CG, Params, true);
|
||||
|
||||
Meofa.refresh(Umu,sRNG, RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
|
@ -68,10 +68,9 @@ int main(int argc, char** argv)
|
||||
// Set up RNGs
|
||||
std::vector<int> seeds4({1, 2, 3, 4});
|
||||
std::vector<int> seeds5({5, 6, 7, 8});
|
||||
GridSerialRNG sRNG;
|
||||
GridSerialRNG SRNG; SRNG.SeedFixedIntegers(seeds4);
|
||||
GridParallelRNG RNG5(FGrid);
|
||||
RNG5.SeedFixedIntegers(seeds5);
|
||||
sRNG.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG4(UGrid);
|
||||
RNG4.SeedFixedIntegers(seeds4);
|
||||
|
||||
@ -88,7 +87,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<WilsonImplR> Meofa(Lop, Rop, CG, Params, false);
|
||||
|
||||
Meofa.refresh(Umu, sRNG,RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
@ -98,7 +97,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<LatticeFermion> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<WilsonImplR> Meofa(Lop, Rop, CG, Params, true);
|
||||
|
||||
Meofa.refresh(Umu, sRNG,RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
|
@ -72,10 +72,9 @@ int main(int argc, char** argv)
|
||||
// Set up RNGs
|
||||
std::vector<int> seeds4({1, 2, 3, 4});
|
||||
std::vector<int> seeds5({5, 6, 7, 8});
|
||||
GridSerialRNG SRNG; SRNG.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG5(FGrid);
|
||||
GridSerialRNG sRNG;
|
||||
RNG5.SeedFixedIntegers(seeds5);
|
||||
sRNG.SeedFixedIntegers(seeds5);
|
||||
GridParallelRNG RNG4(UGrid);
|
||||
RNG4.SeedFixedIntegers(seeds4);
|
||||
|
||||
@ -93,7 +92,8 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<FermionField> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<FermionImplPolicy> Meofa(Lop, Rop, CG, Params, false);
|
||||
|
||||
Meofa.refresh(Umu, sRNG, RNG5);
|
||||
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ int main(int argc, char** argv)
|
||||
ConjugateGradient<FermionField> CG(1.0e-12, 5000);
|
||||
ExactOneFlavourRatioPseudoFermionAction<FermionImplPolicy> Meofa(Lop, Rop, CG, Params, true);
|
||||
|
||||
Meofa.refresh(Umu, sRNG, RNG5);
|
||||
Meofa.refresh(Umu, SRNG, RNG5);
|
||||
printf("<Phi|Meofa|Phi> = %1.15e\n", Meofa.S(Umu));
|
||||
}
|
||||
|
||||
|
@ -52,15 +52,15 @@ int main (int argc, char ** argv)
|
||||
pRNG.SeedFixedIntegers(std::vector<int>({45,12,81,9}));
|
||||
|
||||
LatticeGaugeField U(&Grid);
|
||||
|
||||
SU<Nc>::HotConfiguration(pRNG,U);
|
||||
|
||||
|
||||
double beta = 1.0;
|
||||
double c1 = 0.331;
|
||||
|
||||
const int nu = 1;
|
||||
std::vector<int> twists(Nd,0);
|
||||
twists[nu] = 1;
|
||||
|
||||
ConjugateGimplD::setDirections(twists);
|
||||
ConjugatePlaqPlusRectangleActionR Action(beta,c1);
|
||||
//ConjugateWilsonGaugeActionR Action(beta);
|
||||
@ -70,13 +70,13 @@ int main (int argc, char ** argv)
|
||||
|
||||
// get the deriv of phidag MdagM phi with respect to "U"
|
||||
LatticeGaugeField UdSdU(&Grid);
|
||||
|
||||
|
||||
Action.deriv(U,UdSdU);
|
||||
|
||||
////////////////////////////////////
|
||||
// Modify the gauge field a little
|
||||
////////////////////////////////////
|
||||
RealD dt = 0.01;
|
||||
RealD dt = 0.001;
|
||||
|
||||
LatticeColourMatrix mommu(&Grid);
|
||||
LatticeColourMatrix forcemu(&Grid);
|
||||
|
@ -59,11 +59,13 @@ int main (int argc, char ** argv)
|
||||
std::cout<<GridLogMessage << "Grid is setup to use "<<threads<<" threads"<<std::endl;
|
||||
|
||||
std::vector<int> seeds({1,2,3,4});
|
||||
std::vector<int> serial_seeds({5,6,7,8});
|
||||
|
||||
GridSerialRNG sRNG;
|
||||
GridParallelRNG pRNG(&Grid);
|
||||
GridSerialRNG sRNG;
|
||||
pRNG.SeedFixedIntegers(seeds);
|
||||
sRNG.SeedFixedIntegers(seeds);
|
||||
sRNG.SeedFixedIntegers(serial_seeds);
|
||||
|
||||
typedef PeriodicGimplR Gimpl;
|
||||
typedef WilsonGaugeAction<Gimpl> GaugeAction;
|
||||
|
@ -95,8 +95,10 @@ int main(int argc, char **argv) {
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// HMC parameters are serialisable
|
||||
TheHMC.Parameters.MD.MDsteps = 20;
|
||||
TheHMC.Parameters.MD.MDsteps = 80;
|
||||
TheHMC.Parameters.MD.trajL = 1.0;
|
||||
TheHMC.Parameters.Trajectories = 100;
|
||||
TheHMC.Parameters.NoMetropolisUntil= 10;
|
||||
|
||||
TheHMC.ReadCommandLine(argc, argv); // these can be parameters from file
|
||||
|
||||
|
@ -51,7 +51,7 @@ int main(int argc, char **argv) {
|
||||
CheckpointerParameters CPparams;
|
||||
CPparams.config_prefix = "ckpoint_lat";
|
||||
CPparams.rng_prefix = "ckpoint_rng";
|
||||
CPparams.saveInterval = 20;
|
||||
CPparams.saveInterval = 1;
|
||||
CPparams.format = "IEEE64BIG";
|
||||
|
||||
TheHMC.Resources.LoadNerscCheckpointer(CPparams);
|
||||
@ -81,8 +81,10 @@ int main(int argc, char **argv) {
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// HMC parameters are serialisable
|
||||
TheHMC.Parameters.MD.MDsteps = 20;
|
||||
TheHMC.Parameters.MD.MDsteps = 80;
|
||||
TheHMC.Parameters.MD.trajL = 1.0;
|
||||
TheHMC.Parameters.Trajectories = 100;
|
||||
TheHMC.Parameters.NoMetropolisUntil= 10;
|
||||
|
||||
TheHMC.ReadCommandLine(argc, argv); // these can be parameters from file
|
||||
TheHMC.Run(); // no smearing
|
||||
|
@ -132,8 +132,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
// Checkpointer definition
|
||||
CheckpointerParameters CPparams(Reader);
|
||||
//TheHMC.Resources.LoadBinaryCheckpointer(CPparams);
|
||||
TheHMC.Resources.LoadScidacCheckpointer(CPparams, SPar);
|
||||
TheHMC.Resources.LoadBinaryCheckpointer(CPparams);
|
||||
//TheHMC.Resources.LoadNerscCheckpointer(CPparams, SPar);
|
||||
|
||||
RNGModuleParameters RNGpar(Reader);
|
||||
TheHMC.Resources.SetRNGSeeds(RNGpar);
|
||||
|
@ -74,10 +74,10 @@ int main(int argc, char **argv) {
|
||||
|
||||
// Checkpointer definition
|
||||
CheckpointerParameters CPparams(Reader);
|
||||
//TheHMC.Resources.LoadNerscCheckpointer(CPparams);
|
||||
TheHMC.Resources.LoadNerscCheckpointer(CPparams);
|
||||
|
||||
// Store metadata in the Scidac checkpointer
|
||||
TheHMC.Resources.LoadScidacCheckpointer(CPparams, WilsonPar);
|
||||
//TheHMC.Resources.LoadScidacCheckpointer(CPparams, WilsonPar);
|
||||
|
||||
RNGModuleParameters RNGpar(Reader);
|
||||
TheHMC.Resources.SetRNGSeeds(RNGpar);
|
||||
|
Reference in New Issue
Block a user