1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-12 20:27:06 +01:00

HMC for Wilson Gauge action works

Fixed bug in momenta generation
This commit is contained in:
neo
2015-07-06 12:58:49 +09:00
parent 0ffcdf6204
commit 808f5820fa
9 changed files with 24 additions and 40 deletions

View File

@ -15,10 +15,12 @@ namespace Grid{
void MDutils::generate_momenta_su3(LatticeLorentzColourMatrix& P,GridParallelRNG& pRNG){
LatticeColourMatrix Pmu(P._grid);
Pmu = zero;
for(int mu=0;mu<Nd;mu++){
SU3::GaussianLieAlgebraMatrix(pRNG, Pmu);
pokeLorentz(P, Pmu, mu);
}
}

View File

@ -71,14 +71,13 @@ namespace Grid{
void update_U(LatticeLorentzColourMatrix&U, double ep){
//rewrite exponential to deal with the lorentz index?
//rewrite exponential to deal automatically with the lorentz index?
LatticeColourMatrix Umu(U._grid);
LatticeColourMatrix Pmu(U._grid);
for (int mu = 0; mu < Nd; mu++){
Umu=peekLorentz(U, mu);
Pmu=peekLorentz(*P, mu);
std::cout << "U norm ["<<mu<<"] = "<< norm2(Umu) << " : Pmu "<< norm2(Pmu)<<"\n";
Umu = expMat(Pmu, Complex(ep, 0.0))*Umu;
Umu = expMat(Pmu, ep)*Umu;
pokeLorentz(U, Umu, mu);
}
@ -105,14 +104,10 @@ namespace Grid{
GridParallelRNG& pRNG){
std::cout<< "Integrator init\n";
if (!P){
std::unique_ptr<LatticeLorentzColourMatrix> Pnew(new LatticeLorentzColourMatrix(U._grid));
std::unique_ptr<LatticeLorentzColourMatrix> Pnew(new LatticeLorentzColourMatrix(U._grid));
P = std::move(Pnew);
}
MDutils::generate_momenta(*P,pRNG);
for(int level=0; level< as.size(); ++level){
for(int actionID=0; actionID<as.at(level).size(); ++actionID){
as[level].at(actionID)->init(U, pRNG);
@ -128,7 +123,7 @@ namespace Grid{
// Momenta
for (int mu=0; mu <Nd; mu++){
LatticeColourMatrix Pmu = peekLorentz(*P, mu);
Hloc -= trace(Pmu*adj(Pmu));
Hloc -= trace(Pmu*Pmu);
}
Complex Hsum = sum(Hloc);