5 #include "qdp_config.h"
14 using namespace QDP::Hints;
26 void ILU2PrecSCprecTWilsonLinOp::create(Handle< FermState<T,P,Q> > fs_,
28 const AnisoParam_t& anisoParam_)
35 QDPIO::cout <<
"This class (ILU2PrecSCprecTWilsonLinOp) only works in 4D" << std::endl;
40 if ( anisoParam_.t_dir != 3 ) {
41 QDPIO::cout <<
"This class (ILU2PrecSCprecTWilsonLinOp) 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 (ILU2PrecSCprecTWilsonLinOp) 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);
128 const FermBC<T,P,Q>& fbc = getFermBC();
129 if( fbc.nontrivialP() ) {
131 const SchrFermBC& schr_ref =
dynamic_cast<const SchrFermBC&
>(fbc);
132 schrTP = ( schr_ref.getDir() ==
tDir() );
134 catch(std::bad_cast) {
149 P_mat.resize(2, Nspaceby2, Nt);
150 P_mat_dag.resize(2, Nspaceby2, Nt);
152 Q_mat_inv.resize(2,Nspaceby2);
153 Q_mat_dag_inv.resize(2,Nspaceby2);
155 for(
int cb3=0; cb3 < 2; cb3++) {
156 for(
int site=0; site < Nspaceby2; site++) {
159 Real minvfact = Real(-1)*invfact;
162 P_mat(cb3, site, Nt-1) =
u[t_index].elem( tsite(cb3,site,Nt-1) );
163 P_mat(cb3, site, Nt-1) *= minvfact.elem();
166 for(
int t=Nt-2;
t >=0;
t--) {
167 P_mat(cb3, site,
t) =
u[t_index].elem( tsite(cb3, site,
t) ) * P_mat(cb3, site,
t+1);
168 P_mat(cb3, site,
t) *= invfact.elem();
173 P_mat_dag(cb3, site, 0) = adj(
u[t_index].elem( tsite(cb3, site, Nt-1) ) );
174 P_mat_dag(cb3, site, 0) *= minvfact.elem();
176 for(
int t=1;
t < Nt;
t++) {
177 P_mat_dag(cb3, site,
t) = adj(
u[t_index].elem( tsite(cb3, site,
t-1) ) )*P_mat_dag(cb3,site,
t-1) ;
178 P_mat_dag(cb3, site,
t) *= invfact.elem();
185 CMat one_plus_P0 =
one.elem() + P_mat(cb3, site,0);
186 CentralTPrecNoSpinUtils::invert3by3( Q_mat_inv(cb3, site), one_plus_P0 );
191 CMat one_plus_P0_dag =
one.elem() + P_mat_dag(cb3, site,Nt-1);
192 CentralTPrecNoSpinUtils::invert3by3( Q_mat_dag_inv(cb3, site), one_plus_P0_dag);
194 CMat prod = one_plus_P0_dag*one_plus_P0;
195 logDetTSq += CentralTPrecNoSpinUtils::logDet(prod);
202 Dw3D.create(fs_, anisoParam_);
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