mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Checked the hermiticity of the op in derivative, ok
Still CG fails to converge
This commit is contained in:
parent
089f0ab582
commit
49b5c49851
File diff suppressed because one or more lines are too long
@ -134,7 +134,7 @@ class TwoFlavourPseudoFermionAction : public Action<typename Impl::GaugeField> {
|
||||
MdagMOp.Op(X, Y);
|
||||
|
||||
// Check hermiticity
|
||||
/*
|
||||
|
||||
std::vector<int> seeds({1,2,3,4});
|
||||
GridParallelRNG RNG(U._grid); RNG.SeedFixedIntegers(seeds);
|
||||
FermionField RNGphi(FermOp.FermionGrid());
|
||||
@ -144,8 +144,8 @@ class TwoFlavourPseudoFermionAction : public Action<typename Impl::GaugeField> {
|
||||
|
||||
random(RNG, RNGphi);
|
||||
random(RNG, RNGchi);
|
||||
MdagMOp.Op(RNGchi, Achi);
|
||||
MdagMOp.Op(RNGphi, Aphi);
|
||||
MdagMOp.HermOp(RNGchi, Achi);
|
||||
MdagMOp.HermOp(RNGphi, Aphi);
|
||||
ComplexD pAc = innerProduct(RNGphi, Achi);
|
||||
ComplexD cAp = innerProduct(RNGchi, Aphi);
|
||||
//these should be real
|
||||
@ -153,8 +153,9 @@ class TwoFlavourPseudoFermionAction : public Action<typename Impl::GaugeField> {
|
||||
ComplexD cAc = innerProduct(RNGchi, Achi);
|
||||
|
||||
std::cout<<GridLogMessage<< "pAc "<<pAc<<" cAp "<< cAp<< " diff "<<pAc-adj(cAp)<<std::endl;
|
||||
// These ones should be real
|
||||
std::cout << GridLogMessage << "pAp " << pAp << " cAc " << cAc << std::endl;
|
||||
*/
|
||||
|
||||
// Our conventions really make this UdSdU; We do not differentiate wrt Udag
|
||||
// here.
|
||||
// So must take dSdU - adj(dSdU) and left multiply by mom to get dS/dt.
|
||||
|
@ -109,12 +109,12 @@ class NerscHmcRunnerTemplate {
|
||||
int Nsmear = 1; // number of smearing levels
|
||||
Smear_Stout<Gimpl> Stout(rho);
|
||||
std::cout << GridLogDebug << " Creating the SmearedConfiguration class\n";
|
||||
SmearedConfiguration<Gimpl> SmearingPolicy(UGrid, Nsmear, Stout);
|
||||
//SmearedConfiguration<Gimpl> SmearingPolicy(UGrid, Nsmear, Stout);
|
||||
std::cout << GridLogDebug << " done\n";
|
||||
|
||||
//////////////
|
||||
//NoSmearing<Gimpl> SmearingPolicy;
|
||||
typedef MinimumNorm2<GaugeField, SmearedConfiguration<Gimpl>, RepresentationsPolicy >
|
||||
NoSmearing<Gimpl> SmearingPolicy;
|
||||
typedef MinimumNorm2<GaugeField, NoSmearing<Gimpl>, RepresentationsPolicy >
|
||||
IntegratorType; // change here to change the algorithm
|
||||
IntegratorParameters MDpar(20, 1.0);
|
||||
IntegratorType MDynamics(UGrid, MDpar, TheAction, SmearingPolicy);
|
||||
|
@ -149,7 +149,7 @@ class Integrator {
|
||||
}
|
||||
|
||||
// Force from the other representations
|
||||
//as[level].apply(update_P_hireps, Representations, Mom, U, ep);
|
||||
as[level].apply(update_P_hireps, Representations, Mom, U, ep);
|
||||
}
|
||||
|
||||
void update_U(GaugeField& U, double ep) {
|
||||
@ -167,13 +167,12 @@ class Integrator {
|
||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
auto Pmu = PeekIndex<LorentzIndex>(Mom, mu);
|
||||
Umu = expMat(Pmu, ep, Params.Nexp) * Umu;
|
||||
ProjectOnGroup(Umu);
|
||||
PokeIndex<LorentzIndex>(U, Umu, mu);
|
||||
PokeIndex<LorentzIndex>(U, ProjectOnGroup(Umu), mu);
|
||||
}
|
||||
// Update the smeared fields, can be implemented as observer
|
||||
Smearer.set_GaugeField(U);
|
||||
// Update the higher representations fields
|
||||
//Representations.update(U); // void functions if fundamental representation
|
||||
Representations.update(U); // void functions if fundamental representation
|
||||
}
|
||||
|
||||
virtual void step(GaugeField& U, int level, int first, int last) = 0;
|
||||
@ -217,7 +216,7 @@ class Integrator {
|
||||
// of the Metropolis
|
||||
Smearer.set_GaugeField(U);
|
||||
// Set the (eventual) representations gauge fields
|
||||
//Representations.update(U);
|
||||
Representations.update(U);
|
||||
|
||||
// The Smearer is attached to a pointer of the gauge field
|
||||
// automatically gets the correct field
|
||||
@ -232,7 +231,7 @@ class Integrator {
|
||||
}
|
||||
|
||||
// Refresh the higher representation actions
|
||||
//as[level].apply(refresh_hireps, Representations, pRNG);
|
||||
as[level].apply(refresh_hireps, Representations, pRNG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,7 +280,7 @@ class Integrator {
|
||||
<< actionID << " H = " << Hterm << std::endl;
|
||||
H += Hterm;
|
||||
}
|
||||
//as[level].apply(S_hireps, Representations, level, H);
|
||||
as[level].apply(S_hireps, Representations, level, H);
|
||||
}
|
||||
|
||||
return H;
|
||||
|
@ -27,6 +27,7 @@ class AdjointRep {
|
||||
LatticeField U;
|
||||
|
||||
explicit AdjointRep(GridBase *grid) : U(grid) {}
|
||||
|
||||
void update_representation(const LatticeGaugeField &Uin) {
|
||||
std::cout << GridLogDebug << "Updating adjoint representation\n" ;
|
||||
// Uin is in the fundamental representation
|
||||
@ -41,6 +42,11 @@ class AdjointRep {
|
||||
|
||||
Vector<typename SU<ncolour>::Matrix> ta(Dimension);
|
||||
|
||||
// Debug lines
|
||||
//LatticeMatrix uno(Uin._grid);
|
||||
//uno = 1.0;
|
||||
////////////////
|
||||
|
||||
// FIXME probably not very efficient to get all the generators
|
||||
// everytime
|
||||
for (int a = 0; a < Dimension; a++) SU<ncolour>::generator(a, ta[a]);
|
||||
@ -51,18 +57,21 @@ class AdjointRep {
|
||||
for (int a = 0; a < Dimension; a++) {
|
||||
tmp = 2.0 * adj(Uin_mu) * ta[a] * Uin_mu;
|
||||
for (int b = 0; b < Dimension; b++)
|
||||
pokeColour(U_mu, trace(tmp * ta[b]), a, b);
|
||||
pokeColour(U_mu, trace(tmp * ta[b]), b, a);
|
||||
}
|
||||
// Check matrix U_mu, must be real orthogonal
|
||||
//reality
|
||||
LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
|
||||
std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) << std::endl;
|
||||
LatticeMatrix uno(Uin._grid);
|
||||
uno = 1.0;
|
||||
Ucheck = U_mu * adj(U_mu) - uno;
|
||||
std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) << std::endl;
|
||||
|
||||
pokeLorentz(U, U_mu, mu);
|
||||
// Check matrix U_mu, must be real orthogonal
|
||||
// reality
|
||||
/*
|
||||
LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
|
||||
std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) <<
|
||||
std::endl;
|
||||
|
||||
Ucheck = U_mu * adj(U_mu) - uno;
|
||||
std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) <<
|
||||
std::endl;
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@ namespace Grid {
|
||||
namespace QCD {
|
||||
|
||||
// Here change the allowed (higher) representations
|
||||
//typedef Representations< FundamentalRepresentation, AdjointRepresentation > TheRepresentations;
|
||||
typedef Representations< FundamentalRepresentation > TheRepresentations;
|
||||
typedef Representations< FundamentalRepresentation, AdjointRepresentation > TheRepresentations;
|
||||
//typedef Representations< FundamentalRepresentation > TheRepresentations;
|
||||
|
||||
|
||||
class HmcRunner : public NerscHmcRunnerHirep< TheRepresentations > {
|
||||
@ -48,8 +48,8 @@ class HmcRunner : public NerscHmcRunnerHirep< TheRepresentations > {
|
||||
void BuildTheAction(int argc, char **argv)
|
||||
|
||||
{
|
||||
typedef WilsonImplR ImplPolicy; // gauge field implemetation for the pseudofermions
|
||||
typedef WilsonFermionR FermionAction; // type of lattice fermions (Wilson, DW, ...)
|
||||
typedef WilsonAdjImplR ImplPolicy; // gauge field implemetation for the pseudofermions
|
||||
typedef WilsonAdjFermionR FermionAction; // type of lattice fermions (Wilson, DW, ...)
|
||||
typedef typename FermionAction::FermionField FermionField;
|
||||
|
||||
UGrid = SpaceTimeGrid::makeFourDimGrid(
|
||||
@ -61,8 +61,8 @@ class HmcRunner : public NerscHmcRunnerHirep< TheRepresentations > {
|
||||
FrbGrid = UrbGrid;
|
||||
|
||||
// temporarily need a gauge field
|
||||
LatticeGaugeField U(UGrid);
|
||||
//AdjointRepresentation::LatticeField U(UGrid);
|
||||
//LatticeGaugeField U(UGrid);
|
||||
AdjointRepresentation::LatticeField U(UGrid);
|
||||
|
||||
// Gauge action
|
||||
WilsonGaugeActionR Waction(5.6);
|
||||
|
Loading…
Reference in New Issue
Block a user