mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-18 09:45:55 +01:00
Correcting the M and Mdag in the clover term
This commit is contained in:
parent
5553b8d2b8
commit
99a73f4287
@ -30,8 +30,10 @@
|
|||||||
#include <Grid/Eigen/Dense>
|
#include <Grid/Eigen/Dense>
|
||||||
#include <Grid/qcd/spin/Dirac.h>
|
#include <Grid/qcd/spin/Dirac.h>
|
||||||
|
|
||||||
namespace Grid {
|
namespace Grid
|
||||||
namespace QCD {
|
{
|
||||||
|
namespace QCD
|
||||||
|
{
|
||||||
|
|
||||||
//WilsonLoop::CloverPlaquette
|
//WilsonLoop::CloverPlaquette
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -54,37 +56,44 @@ namespace QCD {
|
|||||||
// U[nu], nu, Gimpl::CovShiftBackward(U[mu], mu, U[nu] )));
|
// U[nu], nu, Gimpl::CovShiftBackward(U[mu], mu, U[nu] )));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// *NOT* EO
|
// *NOT* EO
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
RealD WilsonCloverFermion<Impl>::M(const FermionField& in, FermionField& out) {
|
RealD WilsonCloverFermion<Impl>::M(const FermionField &in, FermionField &out)
|
||||||
|
{
|
||||||
// Wilson term
|
// Wilson term
|
||||||
out.checkerboard = in.checkerboard;
|
out.checkerboard = in.checkerboard;
|
||||||
this->Dhop(in, out, DaggerNo);
|
this->Dhop(in, out, DaggerNo);
|
||||||
// Clover term
|
// Clover term
|
||||||
// apply the sigma and Fmunu
|
// apply the sigma and Fmunu
|
||||||
Mooee(in, out);
|
FermionField temp(out._grid);
|
||||||
|
Mooee(in, temp);
|
||||||
// overall factor
|
// overall factor
|
||||||
|
out += temp;
|
||||||
return axpy_norm(out, 4 + this->mass, in, out);
|
return axpy_norm(out, 4 + this->mass, in, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
RealD WilsonCloverFermion<Impl>::Mdag(const FermionField& in, FermionField& out) {
|
RealD WilsonCloverFermion<Impl>::Mdag(const FermionField &in, FermionField &out)
|
||||||
|
{
|
||||||
// Wilson term
|
// Wilson term
|
||||||
out.checkerboard = in.checkerboard;
|
out.checkerboard = in.checkerboard;
|
||||||
this->Dhop(in, out, DaggerYes);
|
this->Dhop(in, out, DaggerYes);
|
||||||
// Clover term
|
// Clover term
|
||||||
// apply the sigma and Fmunu
|
// apply the sigma and Fmunu
|
||||||
MooeeDag(in, out);
|
FermionField temp(out._grid);
|
||||||
|
MooeeDag(in, temp);
|
||||||
|
out+=temp;
|
||||||
return axpy_norm(out, 4 + this->mass, in, out);
|
return axpy_norm(out, 4 + this->mass, in, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::ImportGauge(const GaugeField& _Umu) {
|
void WilsonCloverFermion<Impl>::ImportGauge(const GaugeField &_Umu)
|
||||||
|
{
|
||||||
this->ImportGauge(_Umu);
|
this->ImportGauge(_Umu);
|
||||||
GridBase *grid = _Umu._grid;
|
GridBase *grid = _Umu._grid;
|
||||||
assert(Nd == 4); // only works in 4 dim
|
assert(Nd == 4); // only works in 4 dim
|
||||||
typename Impl::GaugeLinkField Bx(grid), By(grid), Bz(grid), Ex(grid), Ey(grid), Ez(grid);
|
typename Impl::GaugeLinkField Bx(grid), By(grid), Bz(grid), Ex(grid), Ey(grid), Ez(grid);
|
||||||
|
|
||||||
// Compute the field strength terms
|
// Compute the field strength terms
|
||||||
WilsonLoops<Impl>::FieldStrength(Bx, _Umu, Ydir, Zdir);
|
WilsonLoops<Impl>::FieldStrength(Bx, _Umu, Ydir, Zdir);
|
||||||
WilsonLoops<Impl>::FieldStrength(By, _Umu, Zdir, Xdir);
|
WilsonLoops<Impl>::FieldStrength(By, _Umu, Zdir, Xdir);
|
||||||
@ -102,7 +111,6 @@ namespace QCD {
|
|||||||
CloverTerm += fillClover(Ez) * (Gamma(Gamma::Algebra::MinusSigmaZT));
|
CloverTerm += fillClover(Ez) * (Gamma(Gamma::Algebra::MinusSigmaZT));
|
||||||
CloverTerm *= csw;
|
CloverTerm *= csw;
|
||||||
|
|
||||||
|
|
||||||
int lvol = _Umu._grid->lSites();
|
int lvol = _Umu._grid->lSites();
|
||||||
int DimRep = Impl::Dimension;
|
int DimRep = Impl::Dimension;
|
||||||
|
|
||||||
@ -112,7 +120,8 @@ namespace QCD {
|
|||||||
std::vector<int> lcoor;
|
std::vector<int> lcoor;
|
||||||
typename SiteCloverType::scalar_object Qx = zero, Qxinv = zero;
|
typename SiteCloverType::scalar_object Qx = zero, Qxinv = zero;
|
||||||
|
|
||||||
for (int site = 0; site < lvol; site++){
|
for (int site = 0; site < lvol; site++)
|
||||||
|
{
|
||||||
grid->LocalIndexToLocalCoor(site, lcoor);
|
grid->LocalIndexToLocalCoor(site, lcoor);
|
||||||
EigenCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep);
|
EigenCloverOp = Eigen::MatrixXcd::Zero(Ns * DimRep, Ns * DimRep);
|
||||||
peekLocalSite(Qx, CloverTerm, lcoor);
|
peekLocalSite(Qx, CloverTerm, lcoor);
|
||||||
@ -135,28 +144,32 @@ namespace QCD {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::Mooee(const FermionField &in, FermionField &out){
|
void WilsonCloverFermion<Impl>::Mooee(const FermionField &in, FermionField &out)
|
||||||
|
{
|
||||||
this->MooeeInternal(in, out, DaggerNo, InverseNo);
|
this->MooeeInternal(in, out, DaggerNo, InverseNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MooeeDag(const FermionField &in, FermionField &out){
|
void WilsonCloverFermion<Impl>::MooeeDag(const FermionField &in, FermionField &out)
|
||||||
|
{
|
||||||
this->MooeeInternal(in, out, DaggerNo, InverseYes);
|
this->MooeeInternal(in, out, DaggerNo, InverseYes);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MooeeInv(const FermionField &in, FermionField &out){
|
void WilsonCloverFermion<Impl>::MooeeInv(const FermionField &in, FermionField &out)
|
||||||
|
{
|
||||||
this->MooeeInternal(in, out, DaggerNo, InverseYes);
|
this->MooeeInternal(in, out, DaggerNo, InverseYes);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MooeeInvDag(const FermionField &in, FermionField &out){
|
void WilsonCloverFermion<Impl>::MooeeInvDag(const FermionField &in, FermionField &out)
|
||||||
|
{
|
||||||
this->MooeeInternal(in, out, DaggerNo, InverseYes);
|
this->MooeeInternal(in, out, DaggerNo, InverseYes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MooeeInternal(const FermionField &in, FermionField &out, int dag, int inv){
|
void WilsonCloverFermion<Impl>::MooeeInternal(const FermionField &in, FermionField &out, int dag, int inv)
|
||||||
|
{
|
||||||
out.checkerboard = in.checkerboard;
|
out.checkerboard = in.checkerboard;
|
||||||
CloverFieldType *Clover;
|
CloverFieldType *Clover;
|
||||||
|
|
||||||
@ -166,7 +179,8 @@ namespace QCD {
|
|||||||
|
|
||||||
// Derivative parts
|
// Derivative parts
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MDeriv(GaugeField&mat, const FermionField&U, const FermionField&V, int dag){
|
void WilsonCloverFermion<Impl>::MDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
|
||||||
|
{
|
||||||
GaugeField tmp(mat._grid);
|
GaugeField tmp(mat._grid);
|
||||||
|
|
||||||
conformable(U._grid, V._grid);
|
conformable(U._grid, V._grid);
|
||||||
@ -182,14 +196,16 @@ namespace QCD {
|
|||||||
|
|
||||||
// Derivative parts
|
// Derivative parts
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MooDeriv(GaugeField&mat, const FermionField&U, const FermionField&V, int dag){
|
void WilsonCloverFermion<Impl>::MooDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
|
||||||
|
{
|
||||||
// Compute the 8 terms of the derivative
|
// Compute the 8 terms of the derivative
|
||||||
assert(0); // not implemented yet
|
assert(0); // not implemented yet
|
||||||
}
|
}
|
||||||
|
|
||||||
// Derivative parts
|
// Derivative parts
|
||||||
template <class Impl>
|
template <class Impl>
|
||||||
void WilsonCloverFermion<Impl>::MeeDeriv(GaugeField&mat, const FermionField&U, const FermionField&V, int dag){
|
void WilsonCloverFermion<Impl>::MeeDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag)
|
||||||
|
{
|
||||||
assert(0); // not implemented yet
|
assert(0); // not implemented yet
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +213,5 @@ FermOpTemplateInstantiate(WilsonCloverFermion); // now only for the fundamental
|
|||||||
//AdjointFermOpTemplateInstantiate(WilsonCloverFermion);
|
//AdjointFermOpTemplateInstantiate(WilsonCloverFermion);
|
||||||
//TwoIndexFermOpTemplateInstantiate(WilsonCloverFermion);
|
//TwoIndexFermOpTemplateInstantiate(WilsonCloverFermion);
|
||||||
//GparityFermOpTemplateInstantiate(WilsonCloverFermion);
|
//GparityFermOpTemplateInstantiate(WilsonCloverFermion);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user