1 #ifndef ILUPREC_S_CPREC_T_WILSONLIKE_LINOP_W_H
2 #define ILUPREC_S_CPREC_T_WILSONLIKE_LINOP_W_H
4 #include "qdp_config.h"
26 class ILUPrecSCprecTWilsonLikeLinOp :
27 public ILUPrecSpaceCentralPrecTimeLinearOperator<LatticeFermion,
28 multi1d<LatticeColorMatrix>, multi1d<LatticeColorMatrix> >
32 typedef LatticeFermion
T;
33 typedef multi1d<LatticeColorMatrix>
P;
34 typedef multi1d<LatticeColorMatrix>
Q;
35 typedef PScalar<PColorMatrix<RComplex<REAL>, 3> > CMat;
36 typedef PSpinVector<PColorVector<RComplex<REAL>, 3>, 2> HVec_site;
39 virtual ~ILUPrecSCprecTWilsonLikeLinOp() {}
46 virtual void derivSpaceOp(
P& ds_u,
const T& X,
const T& Y,
enum PlusMinus isign,
int cb3d)
const = 0;
49 virtual void derivAMinusOne(
P& ds_u,
const T& X,
const T& Y,
enum PlusMinus isign)
const = 0;
52 virtual Double logDetTDagT(
void)
const = 0;
55 virtual const multi3d< int >& getTsiteArray(
void)
const = 0;
56 virtual const multi3d< CMat >& getPMatrixArray(
void)
const = 0;
57 virtual const multi3d< CMat >& getPMatrixDaggerArray(
void)
const = 0;
58 virtual const multi2d< CMat >& getQMatrixInvArray(
void)
const = 0;
59 virtual const multi2d< CMat >& getQMatrixDaggerInvArray(
void)
const = 0;
60 virtual const Real& getFactor()
const = 0;
61 virtual const Real& getInvFactor()
const = 0;
62 virtual const multi1d< LatticeColorMatrix>& getLinks(
void)
const = 0;
63 virtual int getTMax(
void)
const = 0;
67 const FermBC<T,P,Q>& getFermBC()
const = 0;
106 QDPIO::cout <<
"Unknown sign " << std::endl;
110 getFermBC().modifyF(
chi);
125 spaceLinOp(tmp1,
psi,
PLUS, 1);
143 QDPIO::cout <<
"Unknown sign " << std::endl;
146 getFermBC().modifyF(
chi);
162 invTPlusOp(tmp1,
psi,
PLUS, 1);
175 invTPlusOp(
chi, tmp1,
PLUS, 0);
204 QDPIO::cout <<
"Unknown sign " << std::endl;
207 getFermBC().modifyF(
chi);
225 invTMinusOp(tmp1,
psi,
PLUS, 0);
236 invTMinusOp(
chi, tmp1,
PLUS, 1);
267 QDPIO::cout <<
"Unknown sign " << std::endl;
271 getFermBC().modifyF(
chi);
278 virtual unsigned long nFlops()
const
288 LatticeHalfFermion tmp_minus;
289 LatticeHalfFermion tmp_plus;
290 LatticeHalfFermion tmp_T;
294 tmp_plus[ rb3[ cb3d ] ] = spinProjectDir3Plus(
psi);
295 chi[ rb3[ cb3d ] ] = spinReconstructDir3Plus(tmp_plus);
298 tmp_minus[ rb3[ cb3d ] ] = spinProjectDir3Minus(
psi);
303 CentralTPrecNoSpinUtils::TOp(tmp_T,
306 getTsiteArray()[cb3d],
311 chi[rb3[ cb3d ]] += spinReconstructDir3Minus(tmp_T);
312 chi[rb3[ cb3d ]] *= Real(0.5);
322 LatticeHalfFermion tmp_minus;
323 LatticeHalfFermion tmp_plus;
324 LatticeHalfFermion tmp_T;
329 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
330 chi[rb3[cb3d]] = spinReconstructDir3Minus(tmp_minus);
333 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
338 CentralTPrecNoSpinUtils::TOp(tmp_T,
341 getTsiteArray()[cb3d],
346 chi[rb3[cb3d]] += spinReconstructDir3Plus(tmp_T);
348 chi[rb3[cb3d]] *= Real(0.5);
358 LatticeHalfFermion tmp_minus;
359 LatticeHalfFermion tmp_plus;
360 LatticeHalfFermion tmp_T;
362 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
363 chi[rb3[cb3d]] = spinReconstructDir3Plus(tmp_plus);
365 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
369 CentralTPrecNoSpinUtils::invTOp( tmp_T,
372 getTsiteArray()[cb3d],
373 getPMatrixArray()[cb3d],
374 getPMatrixDaggerArray()[cb3d],
375 getQMatrixInvArray()[cb3d],
376 getQMatrixDaggerInvArray()[cb3d],
383 chi[rb3[cb3d]] += spinReconstructDir3Minus(tmp_T);
384 chi[rb3[cb3d]] *= Real(0.5);
394 LatticeHalfFermion tmp_minus;
395 LatticeHalfFermion tmp_plus;
396 LatticeHalfFermion tmp_T;
398 tmp_minus[rb3[cb3d]] = spinProjectDir3Minus(
psi);
399 chi[rb3[cb3d]] = spinReconstructDir3Minus(tmp_minus);
401 tmp_plus[rb3[cb3d]] = spinProjectDir3Plus(
psi);
405 CentralTPrecNoSpinUtils::invTOp( tmp_T,
408 getTsiteArray()[cb3d],
409 getPMatrixArray()[cb3d],
410 getPMatrixDaggerArray()[cb3d],
411 getQMatrixInvArray()[cb3d],
412 getQMatrixDaggerInvArray()[cb3d],
419 chi[rb3[cb3d]] += spinReconstructDir3Plus(tmp_T);
420 chi[rb3[cb3d]] *= Real(0.5);
427 void derivInvTPlusOp(
P& ds_u,
const T& X,
const T& Y,
enum PlusMinus isign)
const
432 for(
int mu=0;
mu < 3;
mu++) {
438 LatticeHalfFermion tmp1,
tmp2;
441 tmp1=spinProjectDir3Minus(Y);
442 for(
int cb3d=0; cb3d < 2; cb3d++) {
444 CentralTPrecNoSpinUtils::invTOp(
tmp2,
447 getTsiteArray()[cb3d],
448 getPMatrixArray()[cb3d],
449 getPMatrixDaggerArray()[cb3d],
450 getQMatrixInvArray()[cb3d],
451 getQMatrixDaggerInvArray()[cb3d],
458 T1 = spinReconstructDir3Minus(
tmp2);
460 tmp1=spinProjectDir3Minus(X);
462 for(
int cb3d=0; cb3d < 2; cb3d++) {
464 CentralTPrecNoSpinUtils::invTOp(
tmp2,
467 getTsiteArray()[cb3d],
468 getPMatrixArray()[cb3d],
469 getPMatrixDaggerArray()[cb3d],
470 getQMatrixInvArray()[cb3d],
471 getQMatrixDaggerInvArray()[cb3d],
482 T2 = spinReconstructDir3Minus(
tmp2);
485 LatticeFermion T3 = shift(T1,
FORWARD, 3);
490 ds_u[3] = traceSpin(outerProduct(T3, T2));
497 getFermBC().zero(ds_u);
501 void derivInvTMinusOp(
P& ds_u,
const T& X,
const T& Y,
enum PlusMinus isign)
const
505 for(
int mu=0;
mu < 3;
mu++) {
511 LatticeHalfFermion tmp1,
tmp2;
514 tmp1=spinProjectDir3Plus(Y);
515 for(
int cb3d=0; cb3d < 2; cb3d++) {
516 CentralTPrecNoSpinUtils::invTOp(
tmp2,
519 getTsiteArray()[cb3d],
520 getPMatrixArray()[cb3d],
521 getPMatrixDaggerArray()[cb3d],
522 getQMatrixInvArray()[cb3d],
523 getQMatrixDaggerInvArray()[cb3d],
529 T1 = spinReconstructDir3Plus(
tmp2);
531 tmp1=spinProjectDir3Plus(X);
532 for(
int cb3d=0; cb3d < 2; cb3d++) {
534 CentralTPrecNoSpinUtils::invTOp(
tmp2,
537 getTsiteArray()[cb3d],
538 getPMatrixArray()[cb3d],
539 getPMatrixDaggerArray()[cb3d],
540 getQMatrixInvArray()[cb3d],
541 getQMatrixDaggerInvArray()[cb3d],
551 T2 = spinReconstructDir3Plus(
tmp2);
553 LatticeFermion T3 = shift(T1,
FORWARD, 3);
558 ds_u[3] = traceSpin(outerProduct(T3, T2));
565 getFermBC().zero(ds_u);
571 T T_1, T_2, T_3, T_4;
580 invTMinusOp(T_1, Y,
PLUS, 0);
586 invTMinusOp(T_2, X,
MINUS, 1);
589 derivSpaceOp(ds_u, T_2, T_1,
PLUS, 1);
591 ds_u[
mu] *= Real(-1);
600 invTMinusOp(T_1, Y,
MINUS, 1);
607 invTMinusOp(T_2, X,
PLUS, 0);
615 spaceLinOp(T_tmp, T_1,
MINUS, 0);
616 T_3[rb3[0]] = T_1 - T_tmp;
624 spaceLinOp(T_tmp, T_2,
PLUS, 1);
625 T_4[rb3[1]] = T_2 - T_tmp;
629 derivInvTMinusOp(ds_u, T_4, T_3,
MINUS);
633 derivSpaceOp(ds_tmp, T_2, T_1,
MINUS, 0);
635 ds_u[
mu] -= ds_tmp[
mu];
641 QDPIO::cerr <<
"Bad Case. Should never get here" << std::endl;
644 getFermBC().zero(ds_u);
650 T T_1, T_2, T_3, T_4;
658 invTPlusOp(T_1, Y,
PLUS, 1);
665 invTPlusOp(T_2, X,
MINUS, 0);
673 spaceLinOp(T_tmp, T_1,
PLUS, 0);
674 T_3[rb3[0]] = T_1 - T_tmp;
682 spaceLinOp(T_tmp, T_2,
MINUS, 1);
683 T_4[rb3[1]] = T_2 - T_tmp;
687 derivSpaceOp(ds_tmp, T_2, T_1,
PLUS, 0);
688 derivInvTPlusOp(ds_u, T_4, T_3,
PLUS);
690 ds_u[
mu] -= ds_tmp[
mu];
702 invTPlusOp(T_1, Y,
MINUS, 0);
708 invTPlusOp(T_2, X,
PLUS, 1);
711 derivSpaceOp(ds_u, T_2, T_1,
MINUS, 1);
713 ds_u[
mu] *= Real(-1);
718 QDPIO::cerr <<
"Bad Case. Should never get here" << std::endl;
722 getFermBC().zero(ds_u);
738 if( !schroedingerTP() ) {
741 CentralTPrecNoSpinUtils::derivLogDet(ds_u,
743 getQMatrixInvArray(),
751 getFermBC().zero(ds_u);
Time-preconditioned Linear Operators.
Support for time preconditioning.
Include possibly optimized Wilson dslash.
multi1d< LatticeColorMatrix > P
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::Q Q
LinOpSysSolverMGProtoClover::T T
multi1d< LatticeFermion > chi(Ncb)
FloatingPoint< double > Double
multi1d< LatticeColorMatrix > P