CHROMA
asq_dsl_s.cc
Go to the documentation of this file.
1 /* $Id: asq_dsl_s.cc,v 3.1 2006-11-18 02:33:03 kostas Exp $ */
2 
3 #include "chromabase.h"
5 
6 
7 namespace Chroma
8 {
9  //! Creation routine
10  /*!
11  *
12  * This routine is specific to staggered fermions!
13  *
14  * Description:
15  *
16  * This routine applies the "asq" or "asqtad" operator D' to Psi,
17  * putting the result in Chi.
18  *
19  * Nd-1
20  * ---
21  * \ F
22  * chi(x) := > isign eta (x) [U (x) psi(x+mu)
23  * / mu mu
24  * ---
25  * mu=0
26  *
27  * + c_3 U (x) U (x+mu) U (x+2mu) psi(x+3mu) ]
28  * mu mu mu
29  *
30  * Nd-1
31  * ---
32  * \ +F
33  * - > isign eta (x) [U (x-mu) psi(x-mu)
34  * / mu mu
35  * ---
36  * mu=0
37  *
38  * + + +
39  * + c_3 U (x) U (x-2mu) U (x-3mu) psi(x-3mu) ]
40  * mu mu mu
41  * Note the KS phase factors are already included in the U's!
42  *
43  * Arguments:
44  *
45  *
46  * U_fat 'fat link' Gauge field (Read)
47  * U_triple 'triple-links' UUU (Read)
48  * Psi Pseudofermion field (Read)
49  * Chi Pseudofermion field (Write)
50  * +
51  * ISign D' or D' ( +1 | -1 ) respectively (Read)
52  * CB Checkerboard of OUTPUT std::vector (Read)
53  *
54  * NOTE: the coefficient c_3 is included in u_triple!
55  *
56  *
57  * recoded by mcneile
58  */
60  {
61  START_CODE();
62 
63  state = state_;
64 
65  // XMLFileWriter xml_out("output2.xml");
66  // push(xml_out, "more_tests");
67  // write(xml_out, "u_fat", u_fat);
68  // write(xml_out,"u_triple", u_triple);
69  // pop(xml_out);
70 
71  END_CODE();
72  }
73 
74  void QDPStaggeredDslash::apply (LatticeStaggeredFermion& chi, const LatticeStaggeredFermion& psi, enum PlusMinus isign, int cb) const
75  {
76  START_CODE();
77 
78  const multi1d<LatticeColorMatrix>& u_fat = state->getFatLinks();
79  const multi1d<LatticeColorMatrix>& u_triple = state->getTripleLinks();
80 
81  // need convention on isign
82  //
83  // isign == PLUS is normal isign == MINUS is daggered
84  //
85 
86  LatticeStaggeredFermion tmp_0 = zero;
87  LatticeStaggeredFermion tmp_1 = zero;
88  LatticeStaggeredFermion tmp_2 = zero;
89 
90  int mu;
91 
92  /* Forward one-hop and three-hop neigbhors */
93  /* Note the KS phase factors are already included in the U's! */
94  mu = 0;
95  tmp_0 = shift(psi, FORWARD, mu);
96  chi[rb[cb]] = u_fat[mu] * tmp_0; // Color matrix X color std::vector : 66 flops
97  // NEIGHBOUR(tmp_0, tmp_1, FORWARD, mu, 1);
98  tmp_1 = shift(tmp_0, FORWARD, mu);
99  tmp_2 = shift(tmp_1, FORWARD, mu);
100  chi[rb[cb]] += u_triple[mu] * tmp_2; // +66 + 6 flops
101 
102  for(mu = 1;mu <= ( Nd - 1); ++mu )
103  {
104  tmp_0 = shift(psi, FORWARD, mu);
105  chi[rb[cb]] += u_fat[mu] * tmp_0; //+66 + 6 flops
106  // NEIGHBOUR(tmp_0, tmp_1, FORWARD, mu, 1);
107  tmp_1 = shift(tmp_0, FORWARD, mu);
108  tmp_2 = shift(tmp_1, FORWARD, mu);
109  chi[rb[cb]] += u_triple[mu] * tmp_2; //+66 + 6 flops
110  }
111 
112  // Up to now 570 flops
113 
114  /* Backward one-hop and three-hop neigbhors */
115  /* Note the KS phase factors are already included in the U's! */
116  for(mu = 0;mu <= ( Nd - 1); ++mu )
117  {
118  chi[rb[cb]] -= shift(adj(u_fat[mu]), BACKWARD, mu) * shift(psi,BACKWARD, mu);
119  // +66 + 6 flops
120  tmp_0 = shift(adj(u_triple[mu]), BACKWARD, mu) * shift(psi, BACKWARD, mu);
121  // +66 flops
122  // NEIGHBOUR(tmp_0, tmp_1, BACKWARD, mu, 1);
123  tmp_1 = shift(tmp_0, BACKWARD, mu);
124  tmp_2 = shift(tmp_1, BACKWARD, mu);
125 
126  chi[rb[cb]] -= tmp_2; //+6 flops
127  }
128 
129 
130  // this requires more thought
131  // No it doesnt
132  // const int MINUS = -1 ;
133 
134  if(isign == MINUS)
135  chi = -chi;
136 
137  END_CODE();
138  }
139 
140 } // End Namespace Chroma
The "asq" or "asqtad" dslash operator D'.
Primary include file for CHROMA library code.
Class for counted reference semantics.
Definition: handle.h:33
void apply(LatticeStaggeredFermion &chi, const LatticeStaggeredFermion &psi, enum PlusMinus isign, int cb) const
Definition: asq_dsl_s.cc:74
Handle< AsqtadConnectStateBase > state
Definition: asq_dsl_s.h:92
void create(Handle< AsqtadConnectStateBase > state_)
Creation routine
Definition: asq_dsl_s.cc:59
int mu
Definition: cool.cc:24
LatticeColorMatrix tmp_2
Definition: meslate.cc:51
LatticeColorMatrix tmp_1
Definition: meslate.cc:50
Nd
Definition: meslate.cc:74
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
@ MINUS
Definition: chromabase.h:45
multi1d< LatticeFermion > chi(Ncb)
LatticeFermion psi
Definition: mespbg5p_w.cc:35
START_CODE()
int cb
Definition: invbicg.cc:120
Double zero
Definition: invbicg.cc:106
#define FORWARD
Definition: primitives.h:82
#define BACKWARD
Definition: primitives.h:83