antisymtensor.cc

Go to the documentation of this file.
00001 // $Id: antisymtensor.cc,v 3.0 2006/04/03 04:59:11 edwards Exp $
00002 /*! \file
00003  *  \brief Compute anti-symmetric tensors
00004  */
00005 
00006 #include "chromabase.h"
00007 #include "util/ferm/antisymtensor.h"
00008 
00009 namespace Chroma 
00010 {
00011 
00012   //! Anonymous namespace
00013   /*! \ingroup ferm */
00014   namespace
00015   {
00016     multi3d<int> antisym_tensor3d;
00017     bool initP = false;
00018 
00019 
00020     //! Init gamma matrix multiplication table factors
00021     /*!
00022      * \ingroup ferm
00023      */
00024     void antiSymTensor3dInit()
00025     {
00026       START_CODE();
00027 
00028       antisym_tensor3d.resize(3,3,3);
00029       antisym_tensor3d = 0;
00030 
00031       // d = \epsilon^{i,j,k}
00032       // Permutations: +(0,1,2)+(1,2,0)+(2,0,1)-(1,0,2)-(0,2,1)-(2,1,0)
00033 
00034       antisym_tensor3d(0,1,2) = 1;
00035       antisym_tensor3d(1,2,0) = 1;
00036       antisym_tensor3d(2,0,1) = 1;
00037 
00038       antisym_tensor3d(1,0,2) = -1;
00039       antisym_tensor3d(0,2,1) = -1;
00040       antisym_tensor3d(2,1,0) = -1;
00041   
00042       initP = true;
00043 
00044       END_CODE();
00045     }
00046   } // end namespace
00047 
00048 
00049   //! Return 3d symmetric tensor
00050   /*!
00051    * \ingroup ferm
00052    *
00053    * \return  \f$\epsilon_{ijk}\f$
00054    */
00055   int antiSymTensor3d(int i, int j, int k)
00056   {
00057     if (! initP)
00058       antiSymTensor3dInit();
00059 
00060     if (i < 0 || i > 2 || j < 0 || j > 2 || k < 0 || k > 2)
00061     {
00062       QDPIO::cerr << __func__ << ": indices out of bounds: i,j,k=" 
00063                   << i << " " << j << " " << k << endl;
00064       QDP_abort(1);
00065     }
00066 
00067     return antisym_tensor3d(i,j,k);
00068   }
00069 
00070 }  // end namespace Chroma

Generated on Sun Nov 22 04:28:48 2009 for CHROMA by  doxygen 1.4.7