CHROMA
expmat.cc
Go to the documentation of this file.
1 /*! \file
2  * \brief Exponentiate a SU(n) lie algebra element by some method,
3  */
4 
5 #include "chromabase.h"
6 #include "util/gauge/expmat.h"
7 #include "util/gauge/expm12.h"
8 #include "util/gauge/expsu3.h"
9 #include "util/gauge/eeu1.h"
10 #include "util/gauge/eesu2.h"
11 #include "util/gauge/eesu3.h"
12 #include "util/gauge/reunit.h"
13 //#include "util/gauge/eesu3.h"
14 
15 
16 namespace Chroma {
17 
18  namespace ExpMatEnv {
19  static double time_spent = 0;
20 
21  double getTime() { return time_spent ; }
22 
23  }
24 
25 
26 //! Exponentiate a SU(n) lie algebra element by some method.
27 /*!
28  * \ingroup gauge
29  *
30  * This routine is a driver for other routines. For example, expsu3
31  * will exponentiate EFFICIENTLY an SU(3) matrix and, if desired,
32  * check for errors in the truncation of the Taylor series.
33  * The routine eesu3 EXACTLY exponentiates a SU(3) matrix.
34  *
35  * \param a LatticeColorMatrix (Modify)
36  * \param opt Method of exponentiation (Read)
37  */
38 
39 void expmat(LatticeColorMatrix& a,
40  enum ExpMat_t opt)
41 {
42  START_CODE();
43  QDP::StopWatch swatch;
44  swatch.reset();
45  swatch.start();
46 
47  switch (Nc)
48  {
49  case 1:
50  eeu1(a);
51  break;
52 
53  case 2:
54  eesu2(a);
55  break;
56 
57  default:
58  switch (opt)
59  {
60  case EXP_TWELFTH_ORDER:
61  switch (Nc)
62  {
63  case 3:
65  break;
66 
67  default:
68  expm12(a);
69  break;
70  }
71  break;
72 
73  case EXP_EXACT:
74  switch (Nc)
75  {
76  case 3:
77  eesu3(a);
78  break;
79 
80  default:
81  QDPIO::cerr << __func__ << ": exact exponentation not implemented for this Nc=" << Nc << std::endl;
82  QDP_abort(1);
83  }
84  break;
85 
86  default:
87  QDPIO::cerr << __func__ << ": unknown option = " << opt << std::endl;
88  QDP_abort(1);
89  }
90  }
91 
92  swatch.stop();
93  ExpMatEnv::time_spent += swatch.getTimeInSeconds();
94  END_CODE();
95 }
96 
97 } // End namespace Chroma
Primary include file for CHROMA library code.
Exactly exponentiate a SU(2) lie algebra element.
Exactly exponentiate a SU(3) lie algebra element.
Exactly exponentiate a U(1) lie algebra element.
12-th order exponentiation of a lattice color matrix
Exponentiate a SU(n) lie algebra element by some method,.
void eesu3(LatticeColorMatrix &iQ)
Exact exponentiation of SU(3) matrix.
Definition: eesu3.cc:20
void expm12(LatticeColorMatrix &a)
12-th order exponentiation of a lattice color matrix
Definition: expm12.cc:21
void expmat(LatticeColorMatrix &a, enum ExpMat_t opt)
Exponentiate a SU(n) lie algebra element by some method.
Definition: expmat.cc:39
void eesu2(LatticeColorMatrix &m)
Exactly exponentiate a SU(2) lie algebra element.
Definition: eesu2.cc:18
void eeu1(LatticeColorMatrix &lambda)
Exactly exponentiate a U(1) lie algebra element.
Definition: eeu1.cc:18
double getTime()
Definition: expmat.cc:21
static double time_spent
Definition: expmat.cc:19
Asqtad Staggered-Dirac operator.
Definition: klein_gord.cc:10
void expsu3(LatticeColorMatrix &a, Reunitarize cflag)
Definition: expsu3.cc:16
Complex a
Definition: invbicg.cc:95
@ REUNITARIZE_LABEL
Definition: reunit.h:29
START_CODE()
ExpMat_t
Definition: expmat.h:11
@ EXP_EXACT
Definition: expmat.h:11
@ EXP_TWELFTH_ORDER
Definition: expmat.h:11
Reunitarize in place a color matrix to SU(N)