CHROMA
symtensor.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Compute symmetric tensors
3  */
4 
5 #include "chromabase.h"
6 #include "util/ferm/symtensor.h"
7 
8 namespace Chroma
9 {
10 
11  //! Anonymous namespace
12  /*! \ingroup ferm */
13  namespace
14  {
15  multi3d<int> sym_tensor3d;
16  bool initP = false;
17 
18 
19  //! Init gamma matrix multiplication table factors
20  /*!
21  * \ingroup ferm
22  */
23  void symTensor3dInit()
24  {
25  START_CODE();
26 
27  sym_tensor3d.resize(3,3,3);
28  sym_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  sym_tensor3d(0,1,2) = 1;
34  sym_tensor3d(1,2,0) = 1;
35  sym_tensor3d(2,0,1) = 1;
36 
37  sym_tensor3d(1,0,2) = 1;
38  sym_tensor3d(0,2,1) = 1;
39  sym_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$s_{ijk} = |\epsilon_{ijk}|\f$
53  */
54  int symTensor3d(int i, int j, int k)
55  {
56  if (! initP)
57  symTensor3dInit();
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 sym_tensor3d(i,j,k);
67  }
68 
69 } // end namespace Chroma
Primary include file for CHROMA library code.
int symTensor3d(int i, int j, int k)
Return 3d symmetric tensor.
Definition: symtensor.cc:54
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
Compute symmetric tensors.