Grid 0.7.0
WilsonTMFermionImplementation.h
Go to the documentation of this file.
1/*************************************************************************************
2
3 Grid physics library, www.github.com/paboyle/Grid
4
5 Source file: ./lib/qcd/action/fermion/WilsonTMFermion.cc
6
7 Copyright (C) 2015
8
9Author: paboyle <paboyle@ph.ed.ac.uk>
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License along
22 with this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25 See the full license in the file "LICENSE" in the top level distribution directory
26*************************************************************************************/
27/* END LEGAL */
30
31#pragma once
32
34
35/*
36 * BF sequence
37 *
38 void bfmbase<Float>::MooeeInv(Fermion_t psi,
39 Fermion_t chi,
40 int dag, int cb)
41
42 double m = this->mass;
43 double tm = this->twistedmass;
44 double mtil = 4.0+this->mass;
45
46 double sq = mtil*mtil + tm*tm;
47
48 double a = mtil/sq;
49 double b = -tm /sq;
50 if(dag) b=-b;
51 axpibg5x(chi,psi,a,b);
52
53 void bfmbase<Float>::Mooee(Fermion_t psi,
54 Fermion_t chi,
55 int dag,int cb)
56 double a = 4.0+this->mass;
57 double b = this->twistedmass;
58 if(dag) b=-b;
59 axpibg5x(chi,psi,a,b);
60*/
61
62template<class Impl>
63void WilsonTMFermion<Impl>::Mooee(const FermionField &in, FermionField &out) {
64 RealD a = 4.0+this->mass;
65 RealD b = this->mu;
66 out.Checkerboard() = in.Checkerboard();
67 axpibg5x(out,in,a,b);
68}
69template<class Impl>
70void WilsonTMFermion<Impl>::MooeeDag(const FermionField &in, FermionField &out) {
71 RealD a = 4.0+this->mass;
72 RealD b = -this->mu;
73 out.Checkerboard() = in.Checkerboard();
74 axpibg5x(out,in,a,b);
75}
76template<class Impl>
77void WilsonTMFermion<Impl>::MooeeInv(const FermionField &in, FermionField &out) {
78 RealD m = this->mass;
79 RealD tm = this->mu;
80 RealD mtil = 4.0+m;
81 RealD sq = mtil*mtil+tm*tm;
82 RealD a = mtil/sq;
83 RealD b = -tm /sq;
84 axpibg5x(out,in,a,b);
85}
86template<class Impl>
87void WilsonTMFermion<Impl>::MooeeInvDag(const FermionField &in, FermionField &out) {
88 RealD m = this->mass;
89 RealD tm = this->mu;
90 RealD mtil = 4.0+m;
91 RealD sq = mtil*mtil+tm*tm;
92 RealD a = mtil/sq;
93 RealD b = tm /sq;
94 axpibg5x(out,in,a,b);
95}
96template<class Impl>
97void WilsonTMFermion<Impl>::M(const FermionField &in, FermionField &out) {
98 out.Checkerboard() = in.Checkerboard();
99 this->Dhop(in, out, DaggerNo);
100 FermionField tmp(out.Grid());
101 RealD a = 4.0+this->mass;
102 RealD b = this->mu;
103 axpibg5x(tmp,in,a,b);
104 axpy(out, 1.0, tmp, out);
105}
106template<class Impl>
107void WilsonTMFermion<Impl>::Mdag(const FermionField &in, FermionField &out) {
108 out.Checkerboard() = in.Checkerboard();
109 this->Dhop(in, out, DaggerYes);
110 FermionField tmp(out.Grid());
111 RealD a = 4.0+this->mass;
112 RealD b = -this->mu;
113 axpibg5x(tmp,in,a,b);
114 axpy(out, 1.0, tmp, out);
115}
116
void axpy(Lattice< vobj > &ret, sobj a, const Lattice< vobj > &x, const Lattice< vobj > &y)
void axpibg5x(Lattice< vobj > &z, const Lattice< vobj > &x, Coeff a, Coeff b)
Definition LinalgUtils.h:42
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
static constexpr int DaggerYes
Definition QCD.h:70
static constexpr int DaggerNo
Definition QCD.h:69
double RealD
Definition Simd.h:61
void Dhop(const FermionField &in, FermionField &out, int dag)
FermionField & tmp(void)
virtual void Mooee(const FermionField &in, FermionField &out)
virtual void MooeeInv(const FermionField &in, FermionField &out)
virtual void M(const FermionField &in, FermionField &out)
virtual void Mdag(const FermionField &in, FermionField &out)
virtual void MooeeDag(const FermionField &in, FermionField &out)
virtual void MooeeInvDag(const FermionField &in, FermionField &out)