mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-11 22:50:45 +01:00
Populating Clover fermions methods
This commit is contained in:
parent
5fdc05782b
commit
fff484eca5
@ -142,11 +142,10 @@ typedef SymanzikGaugeAction<ConjugateGimplD> ConjugateSymanzikGaugeAction
|
|||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
|
|
||||||
#include <Grid/qcd/action/fermion/WilsonFermion.h> // 4d wilson like
|
#include <Grid/qcd/action/fermion/WilsonFermion.h> // 4d wilson like
|
||||||
#include <Grid/qcd/action/fermion/WilsonTMFermion.h> // 4d wilson like
|
#include <Grid/qcd/action/fermion/WilsonTMFermion.h> // 4d wilson like
|
||||||
|
#include <Grid/qcd/action/fermion/WilsonCloverFermion.h> // 4d wilson like
|
||||||
#include <Grid/qcd/action/fermion/WilsonFermion5D.h> // 5d base used by all 5d overlap types
|
#include <Grid/qcd/action/fermion/WilsonFermion5D.h> // 5d base used by all 5d overlap types
|
||||||
|
|
||||||
//#include <Grid/qcd/action/fermion/CloverFermion.h>
|
|
||||||
|
|
||||||
#include <Grid/qcd/action/fermion/CayleyFermion5D.h> // Cayley types
|
#include <Grid/qcd/action/fermion/CayleyFermion5D.h> // Cayley types
|
||||||
#include <Grid/qcd/action/fermion/DomainWallFermion.h>
|
#include <Grid/qcd/action/fermion/DomainWallFermion.h>
|
||||||
#include <Grid/qcd/action/fermion/DomainWallFermion.h>
|
#include <Grid/qcd/action/fermion/DomainWallFermion.h>
|
||||||
@ -188,10 +187,16 @@ typedef WilsonFermion<WilsonTwoIndexSymmetricImplR> WilsonTwoIndexSymmetricFermi
|
|||||||
typedef WilsonFermion<WilsonTwoIndexSymmetricImplF> WilsonTwoIndexSymmetricFermionF;
|
typedef WilsonFermion<WilsonTwoIndexSymmetricImplF> WilsonTwoIndexSymmetricFermionF;
|
||||||
typedef WilsonFermion<WilsonTwoIndexSymmetricImplD> WilsonTwoIndexSymmetricFermionD;
|
typedef WilsonFermion<WilsonTwoIndexSymmetricImplD> WilsonTwoIndexSymmetricFermionD;
|
||||||
|
|
||||||
|
// Twisted mass fermion
|
||||||
typedef WilsonTMFermion<WilsonImplR> WilsonTMFermionR;
|
typedef WilsonTMFermion<WilsonImplR> WilsonTMFermionR;
|
||||||
typedef WilsonTMFermion<WilsonImplF> WilsonTMFermionF;
|
typedef WilsonTMFermion<WilsonImplF> WilsonTMFermionF;
|
||||||
typedef WilsonTMFermion<WilsonImplD> WilsonTMFermionD;
|
typedef WilsonTMFermion<WilsonImplD> WilsonTMFermionD;
|
||||||
|
|
||||||
|
// Clover fermions
|
||||||
|
typedef WilsonCloverFermion<WilsonImplR> WilsonCloverFermionR;
|
||||||
|
typedef WilsonCloverFermion<WilsonImplF> WilsonCloverFermionF;
|
||||||
|
typedef WilsonCloverFermion<WilsonImplD> WilsonCloverFermionD;
|
||||||
|
|
||||||
typedef DomainWallFermion<WilsonImplR> DomainWallFermionR;
|
typedef DomainWallFermion<WilsonImplR> DomainWallFermionR;
|
||||||
typedef DomainWallFermion<WilsonImplF> DomainWallFermionF;
|
typedef DomainWallFermion<WilsonImplF> DomainWallFermionF;
|
||||||
typedef DomainWallFermion<WilsonImplD> DomainWallFermionD;
|
typedef DomainWallFermion<WilsonImplD> DomainWallFermionD;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
/*************************************************************************************
|
/*************************************************************************************
|
||||||
|
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
Source file: ./lib/qcd/action/fermion/WilsonTMFermion.cc
|
Source file: ./lib/qcd/action/fermion/WilsonCloverFermion.cc
|
||||||
|
|
||||||
Copyright (C) 2015
|
Copyright (C) 2017
|
||||||
|
|
||||||
Author: paboyle <paboyle@ph.ed.ac.uk>
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||||
|
Author: Guido Cossu <guido.cossu@ed.ac.uk>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -24,75 +25,82 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
|||||||
|
|
||||||
See the full license in the file "LICENSE" in the top level distribution directory
|
See the full license in the file "LICENSE" in the top level distribution directory
|
||||||
*************************************************************************************/
|
*************************************************************************************/
|
||||||
/* END LEGAL */
|
/* END LEGAL */
|
||||||
#include <Grid/Grid.h>
|
#include <Grid/Grid.h>
|
||||||
|
#include <Grid/qcd/spin/Dirac.h>
|
||||||
|
|
||||||
namespace Grid {
|
namespace Grid {
|
||||||
namespace QCD {
|
namespace QCD {
|
||||||
|
|
||||||
/*
|
template <class Impl>
|
||||||
* BF sequence
|
void WilsonCloverFermion<Impl>::AddCloverTerm(const FermionField& in,
|
||||||
*
|
FermionField& out){
|
||||||
void bfmbase<Float>::MooeeInv(Fermion_t psi,
|
FermionField tmp(out._grid);
|
||||||
Fermion_t chi,
|
tmp = zero;
|
||||||
int dag, int cb)
|
// the product sigma_munu Fmunu is hermitian
|
||||||
|
tmp += Bx*(Gamma(Gamma::Algebra::SigmaYZ)*in);
|
||||||
|
tmp += By*(Gamma(Gamma::Algebra::MinusSigmaXZ)*in);
|
||||||
|
tmp += Bz*(Gamma(Gamma::Algebra::SigmaXY)*in);
|
||||||
|
tmp += Ex*(Gamma(Gamma::Algebra::MinusSigmaXT)*in);
|
||||||
|
tmp += Ey*(Gamma(Gamma::Algebra::MinusSigmaYT)*in);
|
||||||
|
tmp += Ez*(Gamma(Gamma::Algebra::MinusSigmaZT)*in);
|
||||||
|
out += tmp*csw; // check signs
|
||||||
|
|
||||||
double m = this->mass;
|
}
|
||||||
double tm = this->twistedmass;
|
|
||||||
double mtil = 4.0+this->mass;
|
|
||||||
|
|
||||||
double sq = mtil*mtil + tm*tm;
|
|
||||||
|
|
||||||
double a = mtil/sq;
|
template <class Impl>
|
||||||
double b = -tm /sq;
|
RealD WilsonCloverFermion<Impl>::M(const FermionField& in, FermionField& out) {
|
||||||
if(dag) b=-b;
|
// Wilson term
|
||||||
axpibg5x(chi,psi,a,b);
|
|
||||||
|
|
||||||
void bfmbase<Float>::Mooee(Fermion_t psi,
|
|
||||||
Fermion_t chi,
|
|
||||||
int dag,int cb)
|
|
||||||
double a = 4.0+this->mass;
|
|
||||||
double b = this->twistedmass;
|
|
||||||
if(dag) b=-b;
|
|
||||||
axpibg5x(chi,psi,a,b);
|
|
||||||
*/
|
|
||||||
|
|
||||||
template<class Impl>
|
|
||||||
void WilsonTMFermion<Impl>::Mooee(const FermionField &in, FermionField &out) {
|
|
||||||
RealD a = 4.0+this->mass;
|
|
||||||
RealD b = this->mu;
|
|
||||||
out.checkerboard = in.checkerboard;
|
out.checkerboard = in.checkerboard;
|
||||||
axpibg5x(out,in,a,b);
|
this->Dhop(in, out, DaggerNo);
|
||||||
}
|
// Clover term
|
||||||
template<class Impl>
|
// apply the sigma and Fmunu
|
||||||
void WilsonTMFermion<Impl>::MooeeDag(const FermionField &in, FermionField &out) {
|
AddCloverTerm(in, out);
|
||||||
RealD a = 4.0+this->mass;
|
// overall factor
|
||||||
RealD b = -this->mu;
|
return axpy_norm(out, 4 + this->mass, in, out);
|
||||||
out.checkerboard = in.checkerboard;
|
|
||||||
axpibg5x(out,in,a,b);
|
|
||||||
}
|
|
||||||
template<class Impl>
|
|
||||||
void WilsonTMFermion<Impl>::MooeeInv(const FermionField &in, FermionField &out) {
|
|
||||||
RealD m = this->mass;
|
|
||||||
RealD tm = this->mu;
|
|
||||||
RealD mtil = 4.0+this->mass;
|
|
||||||
RealD sq = mtil*mtil+tm*tm;
|
|
||||||
RealD a = mtil/sq;
|
|
||||||
RealD b = -tm /sq;
|
|
||||||
axpibg5x(out,in,a,b);
|
|
||||||
}
|
|
||||||
template<class Impl>
|
|
||||||
void WilsonTMFermion<Impl>::MooeeInvDag(const FermionField &in, FermionField &out) {
|
|
||||||
RealD m = this->mass;
|
|
||||||
RealD tm = this->mu;
|
|
||||||
RealD mtil = 4.0+this->mass;
|
|
||||||
RealD sq = mtil*mtil+tm*tm;
|
|
||||||
RealD a = mtil/sq;
|
|
||||||
RealD b = tm /sq;
|
|
||||||
axpibg5x(out,in,a,b);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FermOpTemplateInstantiate(WilsonTMFermion);
|
template <class Impl>
|
||||||
|
RealD WilsonCloverFermion<Impl>::Mdag(const FermionField& in, FermionField& out) {
|
||||||
|
// Wilson term
|
||||||
|
out.checkerboard = in.checkerboard;
|
||||||
|
this->Dhop(in, out, DaggerYes);
|
||||||
|
// Clover term
|
||||||
|
// apply the sigma and Fmunu
|
||||||
|
AddCloverTerm(in, out);
|
||||||
|
return axpy_norm(out, 4 + this->mass, in, out);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Impl>
|
||||||
|
void WilsonCloverFermion<Impl>::ImportGauge(const GaugeField& _Umu) {
|
||||||
|
this->ImportGauge(_Umu);
|
||||||
|
// Compute the field strength terms
|
||||||
|
|
||||||
|
// Invert the Moo, Mee terms (?)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Impl>
|
||||||
|
void WilsonCloverFermion<Impl>::Mooee(const FermionField &in, FermionField &out) {
|
||||||
|
out.checkerboard = in.checkerboard;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class Impl>
|
||||||
|
void WilsonCloverFermion<Impl>::MooeeDag(const FermionField &in, FermionField &out) {
|
||||||
|
assert(0); // not implemented yet
|
||||||
|
}
|
||||||
|
template<class Impl>
|
||||||
|
void WilsonCloverFermion<Impl>::MooeeInv(const FermionField &in, FermionField &out) {
|
||||||
|
assert(0); // not implemented yet
|
||||||
|
}
|
||||||
|
template<class Impl>
|
||||||
|
void WilsonCloverFermion<Impl>::MooeeInvDag(const FermionField &in, FermionField &out) {
|
||||||
|
assert(0); // not implemented yet
|
||||||
|
}
|
||||||
|
|
||||||
|
FermOpTemplateInstantiate(WilsonCloverFermion);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
Source file: ./lib/qcd/action/fermion/WilsonTMFermion.h
|
Source file: ./lib/qcd/action/fermion/WilsonCloverFermion.h
|
||||||
|
|
||||||
Copyright (C) 2017
|
Copyright (C) 2017
|
||||||
|
|
||||||
Author: paboyle <paboyle@ph.ed.ac.uk>
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||||
Author: Guido Cossu <guido.cossu@ed.ac.uk>
|
Author: Guido Cossu <guido.cossu@ed.ac.uk>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -40,6 +40,8 @@ public:
|
|||||||
INHERIT_IMPL_TYPES(Impl);
|
INHERIT_IMPL_TYPES(Impl);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
typedef WilsonFermion<Impl> WilsonBase;
|
||||||
|
|
||||||
virtual void Instantiatable(void){};
|
virtual void Instantiatable(void){};
|
||||||
// Constructors
|
// Constructors
|
||||||
WilsonCloverFermion(GaugeField &_Umu, GridCartesian &Fgrid,
|
WilsonCloverFermion(GaugeField &_Umu, GridCartesian &Fgrid,
|
||||||
@ -49,9 +51,17 @@ public:
|
|||||||
const ImplParams &p = ImplParams()) : WilsonFermion<Impl>(_Umu,
|
const ImplParams &p = ImplParams()) : WilsonFermion<Impl>(_Umu,
|
||||||
Fgrid,
|
Fgrid,
|
||||||
Hgrid,
|
Hgrid,
|
||||||
_mass, p)
|
_mass, p),
|
||||||
|
Bx(_Umu._grid),
|
||||||
|
By(_Umu._grid),
|
||||||
|
Bz(_Umu._grid),
|
||||||
|
Ex(_Umu._grid),
|
||||||
|
Ey(_Umu._grid),
|
||||||
|
Ez(_Umu._grid)
|
||||||
{
|
{
|
||||||
csw = _csw;
|
csw = _csw;
|
||||||
|
assert(Nd == 4); // require 4 dimensions
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual RealD M(const FermionField& in, FermionField& out);
|
virtual RealD M(const FermionField& in, FermionField& out);
|
||||||
@ -62,8 +72,18 @@ public:
|
|||||||
virtual void MooeeInv(const FermionField &in, FermionField &out);
|
virtual void MooeeInv(const FermionField &in, FermionField &out);
|
||||||
virtual void MooeeInvDag(const FermionField &in, FermionField &out);
|
virtual void MooeeInvDag(const FermionField &in, FermionField &out);
|
||||||
|
|
||||||
|
void ImportGauge(const GaugeField &_Umu);
|
||||||
private:
|
private:
|
||||||
|
// here fixing the 4 dimensions, make it more general?
|
||||||
|
|
||||||
|
// Field strengths
|
||||||
|
GaugeLinkField Bx, By, Bz, Ex, Ey, Ez;
|
||||||
|
|
||||||
RealD csw; // Clover coefficient
|
RealD csw; // Clover coefficient
|
||||||
|
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
void AddCloverTerm(const FermionField& in, FermionField& out);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user