9 using namespace QDP::Hints;
23 QDPIO::cout <<
"Using Twisted Mass: " << param.
twisted_m_usedP << std::endl;
24 if( param.twisted_m_usedP) {
25 QDPIO::cout <<
"Twisted Mass is " << param.twisted_m << std::endl;
28 clov.create(fs, param);
30 invclov.create(fs,param,clov);
34 D.create(fs, param.anisoParam);
102 const LatticeFermion&
psi,
125 const LatticeFermion&
psi,
151 T tmp1; moveToFastMemoryHint(tmp1);
153 Real mquarter = -0.25;
174 if( param.twisted_m_usedP ){
176 tmp1[rb[1]] = (GammaConst<Ns,Ns*Ns-1>() * timesI(
psi));
179 chi[rb[1]] += param.twisted_m * tmp1;
182 chi[rb[1]] -= param.twisted_m * tmp1;
186 getFermBC().modifyF(
chi);
194 const LatticeFermion&
chi,
const LatticeFermion&
psi,
209 const LatticeFermion&
chi,
const LatticeFermion&
psi,
226 invclov.derivTrLn(ds_u,
isign, 0);
238 invclov.derivTrLn(ds_u,
isign, 1);
246 const LatticeFermion&
chi,
const LatticeFermion&
psi,
253 ds_u[
mu] *= Real(-0.5);
261 const LatticeFermion&
chi,
const LatticeFermion&
psi,
269 ds_u[
mu] *= Real(-0.5);
278 T M_eo_psi; moveToFastMemoryHint(M_eo_psi);
279 T M_oe_dag_chi; moveToFastMemoryHint(M_oe_dag_chi);
288 invclov.apply(M_eo_psi,
tmp,
PLUS, 0);
298 invclov.apply(M_oe_dag_chi,
tmp,
PLUS,0);
300 M_eo_psi[rb[0]] *= Real(-0.5);
301 M_oe_dag_chi[rb[0]] *= Real(-0.5);
313 invclov.apply(Ainv_right,
tmp,
PLUS,1);
314 invclov.apply(Ainv_left,
chi,
MINUS,1);
315 clov.deriv(ds_u,Ainv_left,Ainv_right,
PLUS, 1);
319 D.deriv(ds_tmp,
tmp,M_eo_psi,
PLUS,1);
324 invclov.apply(Ainv_right,
tmp,
PLUS,0);
325 invclov.apply(Ainv_left, M_oe_dag_chi,
PLUS,0);
326 clov.deriv(ds_tmp,Ainv_left, Ainv_right,
PLUS,0);
330 invclov.apply(
tmp, M_oe_dag_chi,
MINUS,0);
336 invclov.apply(Ainv_left,
tmp,
PLUS,0);
337 invclov.apply(Ainv_right,M_eo_psi,
MINUS,0);
338 clov.deriv(ds_u,Ainv_left,Ainv_right,
MINUS,0);
340 invclov.apply(
tmp, M_eo_psi,
MINUS,0);
345 D.deriv(ds_tmp, M_oe_dag_chi,
tmp,
MINUS,0);
348 D.apply(
tmp,M_oe_dag_chi,
PLUS,1);
349 invclov.apply(Ainv_left,
tmp,
PLUS,1);
350 invclov.apply(Ainv_right,
psi,
MINUS,1);
351 clov.deriv(ds_tmp, Ainv_left,Ainv_right,
MINUS,1);
356 ds_u[
mu] *= Real(-0.5);
358 getFermBC().zero(ds_u);
364 const multi1d<T>&
psi,
367 if(
chi.size() !=
psi.size() ) {
368 QDPIO::cerr <<
"Incompatible array sizes in SymEvenOddPrecCloverOp::derivMultipole" << std::endl;
371 int n_poles=
psi.size();
372 multi1d<T> M_eo_psi(n_poles);
373 multi1d<T> M_oe_dag_chi(n_poles);
375 multi1d<T> Ainv_left(n_poles);
376 multi1d<T> Ainv_right(n_poles);
381 for(
int i=0;
i < n_poles; ++
i) {
383 invclov.apply(M_eo_psi[
i],
tmp,
PLUS, 0);
390 for(
int i=0;
i < n_poles; ++
i) {
395 invclov.apply(M_oe_dag_chi[
i],
tmp,
PLUS,0);
398 for(
int i=0;
i < n_poles; ++
i) {
399 (M_eo_psi[
i])[rb[0]] *= Real(-0.5);
400 (M_oe_dag_chi[
i])[rb[0]] *= Real(-0.5);
410 for(
int i=0;
i < n_poles; ++
i) {
412 invclov.apply(Ainv_right[
i],
tmp,
PLUS,1);
415 clov.derivMultipole(ds_u,Ainv_left,Ainv_right,
PLUS, 1);
417 for(
int i=0;
i < n_poles; ++
i) {
419 D.deriv(ds_tmp,
tmp,M_eo_psi[
i],
PLUS,1);
423 for(
int i=0;
i < n_poles; ++
i) {
425 invclov.apply(Ainv_right[
i],
tmp,
PLUS,0);
426 invclov.apply(Ainv_left[
i], M_oe_dag_chi[
i],
PLUS,0);
428 clov.derivMultipole(ds_tmp,Ainv_left, Ainv_right,
PLUS,0);
431 for(
int i=0;
i < n_poles; ++
i) {
432 invclov.apply(
tmp, M_oe_dag_chi[
i],
MINUS,0);
438 for(
int i=0;
i < n_poles; ++
i) {
440 invclov.apply(Ainv_left[
i],
tmp,
PLUS,0);
441 invclov.apply(Ainv_right[
i],M_eo_psi[
i],
MINUS,0);
443 clov.derivMultipole(ds_u,Ainv_left,Ainv_right,
MINUS,0);
445 for(
int i=0;
i < n_poles; ++
i) {
446 invclov.apply(
tmp, M_eo_psi[
i],
MINUS,0);
452 D.deriv(ds_tmp, M_oe_dag_chi[
i],
tmp,
MINUS,0);
456 for(
int i=0;
i < n_poles; ++
i) {
457 D.apply(
tmp,M_oe_dag_chi[
i],
PLUS,1);
458 invclov.apply(Ainv_left[
i],
tmp,
PLUS,1);
461 clov.derivMultipole(ds_tmp, Ainv_left,Ainv_right,
MINUS,1);
466 ds_u[
mu] *= Real(-0.5);
468 getFermBC().zero(ds_u);
475 unsigned long cbsite_flops = 2*D.nFlops()+2*clov.nFlops()+4*Nc*Ns;
476 if( param.twisted_m_usedP ) {
477 cbsite_flops += 4*Nc*Ns;
479 return cbsite_flops*(Layout::sitesOnNode()/2);
485 return invclov.cholesDet(0);
491 return invclov.cholesDet(1);
Support class for fermion actions and linear operators.
Class for counted reference semantics.
multi1d< LatticeColorMatrix > P
void operator()(T &chi, const T &psi, enum PlusMinus isign) const override
Apply even-odd preconditioned Clover fermion linear operator.
void unprecEvenEvenLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the even-even block onto a source std::vector.
void unprecOddEvenLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
Double logDetEvenEvenLinOp(void) const
Get the log det of the even even part.
void derivMultipole(P &ds_u, const multi1d< T > &chi, const multi1d< T > &psi, enum PlusMinus isign) const override
Deriv.
void create(Handle< FermState< T, P, Q > > fs, const CloverFermActParams ¶m_)
Creation routine.
void unprecOddOddInvLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the inverse of the odd-odd block onto a source std::vector.
void derivLogDetEvenEvenLinOp(P &ds_u, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
virtual void derivUnprecEvenEvenLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the even-even block onto a source std::vector.
virtual void derivUnprecEvenOddLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
virtual void derivUnprecOddOddLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void derivLogDetOddOddLinOp(P &ds_u, enum PlusMinus isign) const
Apply the odd-odd block onto a source std::vector.
void unprecEvenEvenInvLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the inverse of the even-even block onto a source std::vector.
unsigned long nFlops() const
Return flops performed by the operator()
void unprecOddOddLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-odd block onto a source std::vector.
void unprecEvenOddLinOp(T &chi, const T &psi, enum PlusMinus isign) const
Apply the the even-odd block onto a source std::vector.
Double logDetOddOddLinOp(void) const
Get the log det of the odd odd part.
void deriv(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const override
Deriv.
virtual void derivUnprecOddEvenLinOp(P &ds_u, const T &chi, const T &psi, enum PlusMinus isign) const
Apply the the odd-even block onto a source std::vector.
Asqtad Staggered-Dirac operator.
multi1d< LatticeFermion > chi(Ncb)
FloatingPoint< double > Double
Symmetric even-odd preconditioned Clover fermion linear operator.
Params for clover ferm acts.