4 #include "qdp_config.h"
13 using namespace QDP::Hints;
25 void EO3DPrecSCprecTCloverLinOp::create(Handle< FermState<T,P,Q> > fs_,
26 const CloverFermActParams& param_)
36 QDPIO::cout <<
"This class (EO3DPrecSCprecTCloverLinOp) only works in 4D" << std::endl;
41 if ( param.anisoParam.t_dir != 3 ) {
42 QDPIO::cout <<
"This class (EO3DPrecSCprecTCloverLinOp) is hardwired for t_dir=3"<< std::endl;
47 const multi1d<int>& s_size = QDP::Layout::subgridLattSize();
48 const multi1d<int>& t_size = QDP::Layout::lattSize();
49 if( t_size[3] != s_size[3] ) {
50 QDPIO::cout <<
"This class (EO3DPrecSCprecTCloverLinOp) needs time to be local" << std::endl;
58 Real ff = where(param.anisoParam.anisoP, param.anisoParam.nu / param.anisoParam.xi_0, Real(1));
59 fact = 1 + (
Nd-1)*ff + param.Mass;
60 invfact = Real(1)/fact;
64 if (param.anisoParam.anisoP)
67 for(
int mu=0;
mu <
u.size(); ++
mu)
69 if (
mu != aniso.t_dir)
76 int Nx = QDP::Layout::subgridLattSize()[0];
77 int Ny = QDP::Layout::subgridLattSize()[1];
78 int Nz = QDP::Layout::subgridLattSize()[2];
79 int Nt = QDP::Layout::subgridLattSize()[3];
84 int Nspaceby2 = Nx*Ny*Nz/2;
86 tsite.resize(2, Nspaceby2, Nt);
96 for(
int z=0;
z < Nz;
z++) {
97 for(
int y=0;
y < Ny;
y++) {
98 for(
int x=0;
x < Nx;
x++) {
105 color = (
x +
y +
z) & 1;
108 for(
int t=0;
t < Nt;
t++) {
110 tsite(0,ssite_even,
t) = QDP::Layout::linearSiteIndex(
coords);
116 for(
int t=0;
t < Nt;
t++) {
118 tsite(1,ssite_odd,
t) = QDP::Layout::linearSiteIndex(
coords);
128 P_mat.resize(2, Nspaceby2, Nt);
129 P_mat_dag.resize(2, Nspaceby2, Nt);
131 Q_mat_inv.resize(2,Nspaceby2);
132 Q_mat_dag_inv.resize(2,Nspaceby2);
134 for(
int cb3=0; cb3 < 2; cb3++) {
135 for(
int site=0; site < Nspaceby2; site++) {
138 Real minvfact = Real(-1)*invfact;
141 P_mat(cb3, site, Nt-1) =
u[t_index].elem( tsite(cb3,site,Nt-1) );
142 P_mat(cb3, site, Nt-1) *= minvfact.elem();
145 for(
int t=Nt-2;
t >=0;
t--) {
146 P_mat(cb3, site,
t) =
u[t_index].elem( tsite(cb3, site,
t) ) * P_mat(cb3, site,
t+1);
147 P_mat(cb3, site,
t) *= invfact.elem();
152 P_mat_dag(cb3, site, 0) = adj(
u[t_index].elem( tsite(cb3, site, Nt-1) ) );
153 P_mat_dag(cb3, site, 0) *= minvfact.elem();
155 for(
int t=1;
t < Nt;
t++) {
156 P_mat_dag(cb3, site,
t) = adj(
u[t_index].elem( tsite(cb3, site,
t-1) ) )*P_mat_dag(cb3,site,
t-1) ;
157 P_mat_dag(cb3, site,
t) *= invfact.elem();
164 CMat
tmp =
one.elem() + P_mat(cb3, site,0);
165 CentralTPrecNoSpinUtils::invert3by3( Q_mat_inv(cb3, site),
tmp );
170 tmp =
one.elem() + P_mat_dag(cb3, site,Nt-1);
171 CentralTPrecNoSpinUtils::invert3by3( Q_mat_dag_inv(cb3, site),
tmp);
176 APlusFact.create(fs, param);
178 Dw3D.create(fs_, param_.anisoParam);
185 void EO3DPrecSCprecTCloverLinOp::invCLeftLinOp(
T&
chi,
191 LatticeHalfFermion tmp_minus;
192 LatticeHalfFermion tmp_plus;
193 LatticeHalfFermion tmp_T;
197 tmp_plus[ rb3[ cb3d ] ] = spinProjectDir3Plus(
psi);
198 chi[ rb3[ cb3d ] ] = spinReconstructDir3Plus(tmp_plus);
201 tmp_minus[ rb3[ cb3d ] ] = spinProjectDir3Minus(
psi);
206 CentralTPrecNoSpinUtils::TOp(tmp_T,
213 chi[rb3[ cb3d ]] += spinReconstructDir3Minus(tmp_T);
214 chi[rb3[ cb3d ]] *= Real(0.5);
218 void EO3DPrecSCprecTCloverLinOp::invCRightLinOp(
T&
chi,
225 LatticeHalfFermion tmp_minus;
226 LatticeHalfFermion tmp_plus;
227 LatticeHalfFermion tmp_T;
232 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
233 chi[rb3[cb3d]] = spinReconstructDir3Minus(tmp_minus);
236 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
241 CentralTPrecNoSpinUtils::TOp(tmp_T,
248 chi[rb3[cb3d]] += spinReconstructDir3Plus(tmp_T);
250 chi[rb3[cb3d]] *= Real(0.5);
258 LatticeHalfFermion tmp_minus;
259 LatticeHalfFermion tmp_plus;
260 LatticeHalfFermion tmp_T;
262 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
263 chi[rb3[cb3d]] = spinReconstructDir3Plus(tmp_plus);
265 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
269 CentralTPrecNoSpinUtils::invTOp( tmp_T,
282 chi[rb3[cb3d]] += spinReconstructDir3Minus(tmp_T);
283 chi[rb3[cb3d]] *= Real(0.5);
291 LatticeHalfFermion tmp_minus;
292 LatticeHalfFermion tmp_plus;
293 LatticeHalfFermion tmp_T;
295 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
296 chi[rb3[cb3d]] = spinReconstructDir3Minus(tmp_minus);
298 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
302 CentralTPrecNoSpinUtils::invTOp( tmp_T,
315 chi[rb3[cb3d]] += spinReconstructDir3Plus(tmp_T);
316 chi[rb3[cb3d]] *= Real(0.5);
Support for time preconditioning.
Primary include file for CHROMA library code.
multi1d< int > coords(const int x, const int y, const int z, const int t)
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u