1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 15:55:37 +00:00
Grid/lib/qcd/action/fermion/WilsonCloverFermion.cc

155 lines
5.0 KiB
C++
Raw Normal View History

2017-03-27 07:12:57 +01:00
/*************************************************************************************
2017-03-24 03:43:28 +00:00
2017-03-27 07:12:57 +01:00
Grid physics library, www.github.com/paboyle/Grid
2017-03-24 03:43:28 +00:00
2017-03-27 07:12:57 +01:00
Source file: ./lib/qcd/action/fermion/WilsonCloverFermion.cc
2017-03-24 03:43:28 +00:00
2017-03-27 07:12:57 +01:00
Copyright (C) 2017
2017-03-24 03:43:28 +00:00
2017-03-27 07:12:57 +01:00
Author: paboyle <paboyle@ph.ed.ac.uk>
Author: Guido Cossu <guido.cossu@ed.ac.uk>
2017-03-24 03:43:28 +00:00
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/
2017-03-27 07:12:57 +01:00
/* END LEGAL */
2017-03-24 03:43:28 +00:00
#include <Grid/Grid.h>
2017-03-27 07:12:57 +01:00
#include <Grid/qcd/spin/Dirac.h>
2017-03-24 03:43:28 +00:00
namespace Grid {
namespace QCD {
2017-03-27 07:12:57 +01:00
template <class Impl>
void WilsonCloverFermion<Impl>::AddCloverTerm(const FermionField& in,
FermionField& out){
FermionField tmp(out._grid);
tmp = zero;
// 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
2017-03-24 03:43:28 +00:00
2017-03-27 07:12:57 +01:00
}
template <class Impl>
RealD WilsonCloverFermion<Impl>::M(const FermionField& in, FermionField& out) {
// Wilson term
2017-03-24 03:43:28 +00:00
out.checkerboard = in.checkerboard;
2017-03-27 07:12:57 +01:00
this->Dhop(in, out, DaggerNo);
// Clover term
// apply the sigma and Fmunu
AddCloverTerm(in, out);
// overall factor
return axpy_norm(out, 4 + this->mass, in, out);
}
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
2017-03-27 08:43:15 +01:00
WilsonLoops<Impl>::FieldStrength(Bx, _Umu, Ydir, Zdir);
WilsonLoops<Impl>::FieldStrength(By, _Umu, Zdir, Xdir);
WilsonLoops<Impl>::FieldStrength(Bz, _Umu, Xdir, Ydir);
WilsonLoops<Impl>::FieldStrength(Ex, _Umu, Tdir, Xdir);
WilsonLoops<Impl>::FieldStrength(Ey, _Umu, Tdir, Ydir);
WilsonLoops<Impl>::FieldStrength(Ez, _Umu, Tdir, Zdir);
2017-03-30 11:14:27 +01:00
// Save the contracted term with sigma
// into a dense matrix site by site
2017-03-27 07:12:57 +01:00
2017-03-30 11:14:27 +01:00
// Invert the Moo, Mee terms (using Eigen)
2017-03-24 03:43:28 +00:00
}
2017-03-27 07:12:57 +01:00
2017-03-24 03:43:28 +00:00
template<class Impl>
2017-03-27 07:12:57 +01:00
void WilsonCloverFermion<Impl>::Mooee(const FermionField &in, FermionField &out) {
2017-03-24 03:43:28 +00:00
out.checkerboard = in.checkerboard;
2017-03-27 08:43:15 +01:00
assert(0); // to be completed
2017-03-27 07:12:57 +01:00
}
template<class Impl>
void WilsonCloverFermion<Impl>::MooeeDag(const FermionField &in, FermionField &out) {
assert(0); // not implemented yet
2017-03-24 03:43:28 +00:00
}
template<class Impl>
2017-03-27 07:12:57 +01:00
void WilsonCloverFermion<Impl>::MooeeInv(const FermionField &in, FermionField &out) {
assert(0); // not implemented yet
2017-03-24 03:43:28 +00:00
}
template<class Impl>
2017-03-27 07:12:57 +01:00
void WilsonCloverFermion<Impl>::MooeeInvDag(const FermionField &in, FermionField &out) {
assert(0); // not implemented yet
2017-03-24 03:43:28 +00:00
}
2017-03-27 08:43:15 +01:00
// Derivative parts
template<class Impl>
void WilsonCloverFermion<Impl>::MDeriv(GaugeField&mat, const FermionField&U, const FermionField&V, int dag){
GaugeField tmp(mat._grid);
2017-03-30 11:14:27 +01:00
conformable(U._grid, V._grid);
conformable(U._grid, mat._grid);
mat.checkerboard = U.checkerboard;
tmp.checkerboard = U.checkerboard;
2017-03-27 08:43:15 +01:00
this->DhopDeriv(mat, U, V, dag);
MooDeriv(tmp, U, V, dag);
mat += tmp;
}
// Derivative parts
template<class Impl>
void WilsonCloverFermion<Impl>::MooDeriv(GaugeField&mat, const FermionField&U, const FermionField&V, int dag){
2017-04-05 10:51:44 +01:00
// Compute the 8 terms of the derivative
2017-04-14 13:30:14 +01:00
// Pseudocode
// Using Chroma as a template
// for loop on mu and nu, but upper matrix
// take the outer product factor * U x (sigma_mu_nu V)
// derivative of loops
// end of loop
2017-03-27 08:43:15 +01:00
assert(0); // not implemented yet
}
// Derivative parts
template<class Impl>
void WilsonCloverFermion<Impl>::MeeDeriv(GaugeField&mat, const FermionField&U, const FermionField&V, int dag){
assert(0); // not implemented yet
}
2017-03-27 07:12:57 +01:00
FermOpTemplateInstantiate(WilsonCloverFermion);
2017-03-24 03:43:28 +00:00
}
}