CHROMA
antisymtensor.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Compute anti-symmetric tensors
3  */
4 
5 #include "chromabase.h"
7 
8 namespace Chroma
9 {
10 
11  //! Anonymous namespace
12  /*! \ingroup ferm */
13  namespace
14  {
15  multi3d<int> antisym_tensor3d;
16  bool initP = false;
17 
18 
19  //! Init gamma matrix multiplication table factors
20  /*!
21  * \ingroup ferm
22  */
23  void antiSymTensor3dInit()
24  {
25  START_CODE();
26 
27  antisym_tensor3d.resize(3,3,3);
28  antisym_tensor3d = 0;
29 
30  // d = \epsilon^{i,j,k}
31  // Permutations: +(0,1,2)+(1,2,0)+(2,0,1)-(1,0,2)-(0,2,1)-(2,1,0)
32 
33  antisym_tensor3d(0,1,2) = 1;
34  antisym_tensor3d(1,2,0) = 1;
35  antisym_tensor3d(2,0,1) = 1;
36 
37  antisym_tensor3d(1,0,2) = -1;
38  antisym_tensor3d(0,2,1) = -1;
39  antisym_tensor3d(2,1,0) = -1;
40 
41  initP = true;
42 
43  END_CODE();
44  }
45  } // end namespace
46 
47 
48  //! Return 3d symmetric tensor
49  /*!
50  * \ingroup ferm
51  *
52  * \return \f$\epsilon_{ijk}\f$
53  */
54  int antiSymTensor3d(int i, int j, int k)
55  {
56  if (! initP)
57  antiSymTensor3dInit();
58 
59  if (i < 0 || i > 2 || j < 0 || j > 2 || k < 0 || k > 2)
60  {
61  QDPIO::cerr << __func__ << ": indices out of bounds: i,j,k="
62  << i << " " << j << " " << k << std::endl;
63  QDP_abort(1);
64  }
65 
66  return antisym_tensor3d(i,j,k);
67  }
68 
69 } // end namespace Chroma
Compute anti-symmetric tensors.
Primary include file for CHROMA library code.
int antiSymTensor3d(int i, int j, int k)
Return 3d symmetric tensor.
unsigned j
Definition: ldumul_w.cc:35
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
int i
Definition: pbg5p_w.cc:55
START_CODE()
int k
Definition: invbicg.cc:119