2016-01-02 14:51:32 +00:00
|
|
|
/*************************************************************************************
|
|
|
|
|
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
|
|
|
|
|
|
|
Source file: ./lib/qcd/action/fermion/WilsonCompressor.h
|
|
|
|
|
|
|
|
Copyright (C) 2015
|
|
|
|
|
|
|
|
Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|
|
|
Author: Peter Boyle <peterboyle@Peters-MacBook-Pro-2.local>
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
|
|
|
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
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2015-05-31 15:09:02 +01:00
|
|
|
#ifndef GRID_QCD_WILSON_COMPRESSOR_H
|
|
|
|
#define GRID_QCD_WILSON_COMPRESSOR_H
|
|
|
|
|
|
|
|
namespace Grid {
|
|
|
|
namespace QCD {
|
|
|
|
|
2015-08-10 20:47:44 +01:00
|
|
|
template<class SiteHalfSpinor,class SiteSpinor>
|
2015-05-31 15:09:02 +01:00
|
|
|
class WilsonCompressor {
|
|
|
|
public:
|
|
|
|
int mu;
|
|
|
|
int dag;
|
|
|
|
|
|
|
|
WilsonCompressor(int _dag){
|
|
|
|
mu=0;
|
|
|
|
dag=_dag;
|
|
|
|
assert((dag==0)||(dag==1));
|
|
|
|
}
|
|
|
|
void Point(int p) {
|
|
|
|
mu=p;
|
|
|
|
};
|
|
|
|
|
2015-08-11 06:22:20 +01:00
|
|
|
virtual SiteHalfSpinor operator () (const SiteSpinor &in,int dim,int plane,int osite,GridBase *grid) {
|
2015-08-10 20:47:44 +01:00
|
|
|
return spinproject(in);
|
|
|
|
}
|
|
|
|
|
|
|
|
SiteHalfSpinor spinproject(const SiteSpinor &in)
|
2015-05-31 15:09:02 +01:00
|
|
|
{
|
2015-08-10 20:47:44 +01:00
|
|
|
SiteHalfSpinor ret;
|
2015-05-31 15:09:02 +01:00
|
|
|
int mudag=mu;
|
2015-12-29 23:49:41 +00:00
|
|
|
if (!dag) {
|
2015-05-31 15:09:02 +01:00
|
|
|
mudag=(mu+Nd)%(2*Nd);
|
|
|
|
}
|
|
|
|
switch(mudag) {
|
|
|
|
case Xp:
|
|
|
|
spProjXp(ret,in);
|
|
|
|
break;
|
|
|
|
case Yp:
|
|
|
|
spProjYp(ret,in);
|
|
|
|
break;
|
|
|
|
case Zp:
|
|
|
|
spProjZp(ret,in);
|
|
|
|
break;
|
|
|
|
case Tp:
|
|
|
|
spProjTp(ret,in);
|
|
|
|
break;
|
|
|
|
case Xm:
|
|
|
|
spProjXm(ret,in);
|
|
|
|
break;
|
|
|
|
case Ym:
|
|
|
|
spProjYm(ret,in);
|
|
|
|
break;
|
|
|
|
case Zm:
|
|
|
|
spProjZm(ret,in);
|
|
|
|
break;
|
|
|
|
case Tm:
|
|
|
|
spProjTm(ret,in);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
};
|
2015-08-10 20:47:44 +01:00
|
|
|
|
|
|
|
|
2015-05-31 15:09:02 +01:00
|
|
|
}} // namespace close
|
|
|
|
#endif
|