5 #include "qdp_config.h"
14 using namespace QDP::Hints;
26 void EO3DPrecSCprecTWilsonLinOp::create(Handle< FermState<T,P,Q> > fs_,
28 const AnisoParam_t& anisoParam_)
35 QDPIO::cout <<
"This class (EO3DPrecSCprecTWilsonLinOp) only works in 4D" << std::endl;
40 if ( anisoParam_.t_dir != 3 ) {
41 QDPIO::cout <<
"This class (EO3DPrecSCprecTWilsonLinOp) is hardwired for t_dir=3"<< std::endl;
46 const multi1d<int>& s_size = QDP::Layout::subgridLattSize();
47 const multi1d<int>& t_size = QDP::Layout::lattSize();
48 if( t_size[3] != s_size[3] ) {
49 QDPIO::cout <<
"This class (EO3DPrecSCprecTWilsonLinOp) needs time to be local" << std::endl;
59 Real ff = where(aniso.anisoP, aniso.nu / aniso.xi_0, Real(1));
60 fact = 1 + (
Nd-1)*ff +
Mass;
61 invfact = Real(1)/fact;
68 for(
int mu=0;
mu <
u.size(); ++
mu)
70 if (
mu != aniso.t_dir)
77 int Nx = QDP::Layout::subgridLattSize()[0];
78 int Ny = QDP::Layout::subgridLattSize()[1];
79 int Nz = QDP::Layout::subgridLattSize()[2];
80 int Nt = QDP::Layout::subgridLattSize()[3];
85 int Nspaceby2 = Nx*Ny*Nz/2;
87 tsite.resize(2, Nspaceby2, Nt);
97 for(
int z=0;
z < Nz;
z++) {
98 for(
int y=0;
y < Ny;
y++) {
99 for(
int x=0;
x < Nx;
x++) {
106 color = (
x +
y +
z) & 1;
109 for(
int t=0;
t < Nt;
t++) {
111 tsite(0,ssite_even,
t) = QDP::Layout::linearSiteIndex(
coords);
117 for(
int t=0;
t < Nt;
t++) {
119 tsite(1,ssite_odd,
t) = QDP::Layout::linearSiteIndex(
coords);
129 P_mat.resize(2, Nspaceby2, Nt);
130 P_mat_dag.resize(2, Nspaceby2, Nt);
132 Q_mat_inv.resize(2,Nspaceby2);
133 Q_mat_dag_inv.resize(2,Nspaceby2);
135 for(
int cb3=0; cb3 < 2; cb3++) {
136 for(
int site=0; site < Nspaceby2; site++) {
139 Real minvfact = Real(-1)*invfact;
142 P_mat(cb3, site, Nt-1) =
u[t_index].elem( tsite(cb3,site,Nt-1) );
143 P_mat(cb3, site, Nt-1) *= minvfact.elem();
146 for(
int t=Nt-2;
t >=0;
t--) {
147 P_mat(cb3, site,
t) =
u[t_index].elem( tsite(cb3, site,
t) ) * P_mat(cb3, site,
t+1);
148 P_mat(cb3, site,
t) *= invfact.elem();
153 P_mat_dag(cb3, site, 0) = adj(
u[t_index].elem( tsite(cb3, site, Nt-1) ) );
154 P_mat_dag(cb3, site, 0) *= minvfact.elem();
156 for(
int t=1;
t < Nt;
t++) {
157 P_mat_dag(cb3, site,
t) = adj(
u[t_index].elem( tsite(cb3, site,
t-1) ) )*P_mat_dag(cb3,site,
t-1) ;
158 P_mat_dag(cb3, site,
t) *= invfact.elem();
165 CMat
tmp =
one.elem() + P_mat(cb3, site,0);
166 CentralTPrecNoSpinUtils::invert3by3( Q_mat_inv(cb3, site),
tmp );
171 tmp =
one.elem() + P_mat_dag(cb3, site,Nt-1);
172 CentralTPrecNoSpinUtils::invert3by3( Q_mat_dag_inv(cb3, site),
tmp);
177 Dw3D.create(fs_, anisoParam_);
184 void EO3DPrecSCprecTWilsonLinOp::invCLeftLinOp(
T&
chi,
190 LatticeHalfFermion tmp_minus;
191 LatticeHalfFermion tmp_plus;
192 LatticeHalfFermion tmp_T;
196 tmp_plus[ rb3[ cb3d ] ] = spinProjectDir3Plus(
psi);
197 chi[ rb3[ cb3d ] ] = spinReconstructDir3Plus(tmp_plus);
200 tmp_minus[ rb3[ cb3d ] ] = spinProjectDir3Minus(
psi);
205 CentralTPrecNoSpinUtils::TOp(tmp_T,
212 chi[rb3[ cb3d ]] += spinReconstructDir3Minus(tmp_T);
213 chi[rb3[ cb3d ]] *= Real(0.5);
214 getFermBC().modifyF(
chi, rb3[cb3d]);
218 void EO3DPrecSCprecTWilsonLinOp::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);
251 getFermBC().modifyF(
chi, rb3[cb3d]);
259 LatticeHalfFermion tmp_minus;
260 LatticeHalfFermion tmp_plus;
261 LatticeHalfFermion tmp_T;
263 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
264 chi[rb3[cb3d]] = spinReconstructDir3Plus(tmp_plus);
266 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
270 CentralTPrecNoSpinUtils::invTOp( tmp_T,
283 chi[rb3[cb3d]] += spinReconstructDir3Minus(tmp_T);
284 chi[rb3[cb3d]] *= Real(0.5);
285 getFermBC().modifyF(
chi, rb3[cb3d]);
293 LatticeHalfFermion tmp_minus;
294 LatticeHalfFermion tmp_plus;
295 LatticeHalfFermion tmp_T;
297 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
298 chi[rb3[cb3d]] = spinReconstructDir3Minus(tmp_minus);
300 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
304 CentralTPrecNoSpinUtils::invTOp( tmp_T,
317 chi[rb3[cb3d]] += spinReconstructDir3Plus(tmp_T);
318 chi[rb3[cb3d]] *= Real(0.5);
319 getFermBC().modifyF(
chi, rb3[cb3d]);
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