CHROMA
eoprec_clover_dumb_linop_w.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Even-odd preconditioned clover linear operator
3  */
4 
6 
7 
8 
9 namespace Chroma
10 {
11 #if 0
12  //using namespace QDP::Hints;
13 
14  //! Creation routine with Anisotropy
15  /*!
16  * \param u_ gauge field (Read)
17  * \param param_ fermion kappa (Read)
18  */
19  void EvenOddPrecDumbCloverFLinOp::create(Handle< FermState<T,P,Q> > fs,
20  const CloverFermActParams& param_)
21  {
22  START_CODE();
23 
24  // QDPIO::cout << __PRETTY_FUNCTION__ << ": enter" << std::endl;
25 
26  param = param_;
27  clov.create(fs, param);
28  invclov.create(fs,param,clov); // make a copy
29  invclov.choles(0); // invert the cb=0 part
30  D.create(fs, param.anisoParam);
31 
32  // QDPIO::cout << __PRETTY_FUNCTION__ << ": exit" << std::endl;
33  END_CODE();
34  }
35 
36 
37 
38  //! Apply even-odd preconditioned Clover fermion linear operator
39  /*!
40  * \param chi Pseudofermion field (Write)
41  * \param psi Pseudofermion field (Read)
42  * \param isign Flag ( PLUS | MINUS ) (Read)
43  */
45  const T& psi,
46  enum PlusMinus isign) const
47  {
48  START_CODE();
49 
50  T tmp1;
51  T tmp2;
52  Real mquarter = -0.25;
53 
54  // tmp1_o = D_oe A^(-1)_ee D_eo psi_o
55  D.apply(tmp1, psi, isign, 0);
56 
57  invclov.apply(tmp2, tmp1, isign, 0);
58 
59  D.apply(tmp1, tmp2, isign, 1);
60 
61  // chi_o = A_oo psi_o - tmp1_o
62  clov.apply(chi, psi, isign, 1);
63 
64  chi[rb[1]] += mquarter*tmp1;
65 
66  // Twisted Term?
67  if( param.twisted_m_usedP ){
68  // tmp1 = i mu gamma_5 tmp1
69  tmp1[rb[1]] = (GammaConst<Ns,Ns*Ns-1>() * timesI(psi));
70 
71  if( isign == PLUS ) {
72  chi[rb[1]] += param.twisted_m * tmp1;
73  }
74  else {
75  chi[rb[1]] -= param.twisted_m * tmp1;
76  }
77  }
78 
79  END_CODE();
80  }
81 
82 
83 
84  //! Return flops performed by the operator()
85  unsigned long EvenOddPrecDumbCloverFLinOp::nFlops() const
86  {
87  unsigned long cbsite_flops = 2*D.nFlops()+2*clov.nFlops()+4*Nc*Ns;
88  if( param.twisted_m_usedP ) {
89  cbsite_flops += 4*Nc*Ns; // a + mu*b : a = chi, b = g_5 I psi
90  }
91  return cbsite_flops*(Layout::sitesOnNode()/2);
92  }
93 
94  const Subset& EvenOddPrecDumbCloverFLinOp::subset() const {
95  return rb[1];
96  }
97 
98 
99  //! Creation routine with Anisotropy
100  /*!
101  * \param u_ gauge field (Read)
102  * \param param_ fermion kappa (Read)
103  */
104  void EvenOddPrecDumbCloverDLinOp::create(Handle< FermState<T,P,Q> > fs,
105  const CloverFermActParams& param_)
106  {
107  START_CODE();
108 
109  // QDPIO::cout << __PRETTY_FUNCTION__ << ": enter" << std::endl;
110 
111  param = param_;
112  clov.create(fs, param);
113  invclov.create(fs,param,clov); // make a copy
114  invclov.choles(0); // invert the cb=0 part
115  D.create(fs, param.anisoParam);
116 
117  // QDPIO::cout << __PRETTY_FUNCTION__ << ": exit" << std::endl;
118  END_CODE();
119  }
120 
121 
122 
123  //! Apply even-odd preconditioned Clover fermion linear operator
124  /*!
125  * \param chi Pseudofermion field (Write)
126  * \param psi Pseudofermion field (Read)
127  * \param isign Flag ( PLUS | MINUS ) (Read)
128  */
130  const T& psi,
131  enum PlusMinus isign) const
132  {
133  START_CODE();
134 
135  T tmp1; moveToFastMemoryHint(tmp1);
136  T tmp2; moveToFastMemoryHint(tmp2);
137  Real mquarter = -0.25;
138 
139  // tmp1_o = D_oe A^(-1)_ee D_eo psi_o
140  D.apply(tmp1, psi, isign, 0);
141 
142  invclov.apply(tmp2, tmp1, isign, 0);
143 
144  D.apply(tmp1, tmp2, isign, 1);
145 
146  // chi_o = A_oo psi_o - tmp1_o
147  clov.apply(chi, psi, isign, 1);
148 
149  chi[rb[1]] += mquarter*tmp1;
150 
151  // Twisted Term?
152  if( param.twisted_m_usedP ){
153  // tmp1 = i mu gamma_5 tmp1
154  tmp1[rb[1]] = (GammaConst<Ns,Ns*Ns-1>() * timesI(psi));
155 
156  if( isign == PLUS ) {
157  chi[rb[1]] += param.twisted_m * tmp1;
158  }
159  else {
160  chi[rb[1]] -= param.twisted_m * tmp1;
161  }
162  }
163 
164  END_CODE();
165  }
166 
167 
168 
169  //! Return flops performed by the operator()
170  unsigned long EvenOddPrecDumbCloverDLinOp::nFlops() const
171  {
172  unsigned long cbsite_flops = 2*D.nFlops()+2*clov.nFlops()+4*Nc*Ns;
173  if( param.twisted_m_usedP ) {
174  cbsite_flops += 4*Nc*Ns; // a + mu*b : a = chi, b = g_5 I psi
175  }
176  return cbsite_flops*(Layout::sitesOnNode()/2);
177  }
178 
179  const Subset& EvenOddPrecDumbCloverDLinOp::subset() const {
180  return rb[1];
181  }
182 
183 #endif
184 
185 } // End Namespace Chroma
unsigned long nFlops() const
Return flops performed by the operator()
void operator()(T &chi, const T &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
const Subset & subset() const
Return the subset on which the operator acts.
unsigned long nFlops() const
Return flops performed by the operator()
void create(Handle< FermState< T, P, Q > > fs, const CloverFermActParams &param_)
Creation routine.
unsigned long nFlops() const
Return flops performed by the operator()
const Subset & subset() const
Return the subset on which the operator acts.
void operator()(LatticeFermionF &chi, const LatticeFermionF &psi, enum PlusMinus isign) const
Apply the operator onto a source std::vector.
void create(Handle< FermState< LatticeFermionF, P, Q > > fs, const CloverFermActParams &param_)
Creation routine.
void create(Handle< FermState< T, multi1d< U >, multi1d< U > > > fs, const CloverFermActParams &param_)
Creation routine.
void apply(T &chi, const T &psi, enum PlusMinus isign, int cb) const
void choles(int cb)
Computes the inverse of the term on cb using Cholesky.
void create(Handle< FermState< T, P, Q > > state)
Creation routine.
Definition: lwldslash_w.h:161
unsigned long nFlops() const
Return flops performed by the operator()
Even-odd preconditioned Clover fermion linear operator.
void apply(T &chi, const T &psi, enum PlusMinus isign, int cb) const
General Wilson-Dirac dslash.
Definition: lwldslash_w.h:228
Double tmp2
Definition: mesq.cc:30
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
@ PLUS
Definition: chromabase.h:45
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
LatticeFermion T
Definition: t_clover.cc:11