Grid 0.7.0
adjoint.h
Go to the documentation of this file.
1/*
2 * Policy classes for the HMC
3 * Author: Guido Cossu
4 */
5
6#ifndef ADJOINT_H
7#define ADJOINT_H
8
10
11/*
12 * This is an helper class for the HMC
13 * Should contain only the data for the adjoint representation
14 * and the facility to convert from the fundamental -> adjoint
15 */
16
17template <int ncolour>
19public:
20 // typdef to be used by the Representations class in HMC to get the
21 // types for the higher representation fields
24 static const int Dimension = ncolour * ncolour - 1;
25 static const bool isFundamental = false;
26
28
29 explicit AdjointRep(GridBase *grid) : U(grid) {}
30
32 std::cout << GridLogDebug << "Updating adjoint representation\n";
33 // Uin is in the fundamental representation
34 // get the U in AdjointRep
35 // (U_adj)_B = tr[e^a U e^b U^dag]
36 // e^a = t^a/sqrt(T_F)
37 // where t^a is the generator in the fundamental
38 // T_F is 1/2 for the fundamental representation
39 conformable(U, Uin);
40 U = Zero();
41 LatticeColourMatrix tmp(Uin.Grid());
42
43 std::vector<typename SU<ncolour>::Matrix> ta(Dimension);
44
45 // Debug lines
46 // LatticeMatrix uno(Uin.Grid());
47 // uno = 1.0;
49
50 // FIXME probably not very efficient to get all the generators
51 // everytime
52 for (int a = 0; a < Dimension; a++) SU<ncolour>::generator(a, ta[a]);
53
54 for (int mu = 0; mu < Nd; mu++) {
55 auto Uin_mu = peekLorentz(Uin, mu);
56 auto U_mu = peekLorentz(U, mu);
57 for (int a = 0; a < Dimension; a++) {
58 tmp = 2.0 * adj(Uin_mu) * ta[a] * Uin_mu;
59 for (int b = 0; b < Dimension; b++)
60 pokeColour(U_mu, trace(tmp * ta[b]), a, b);
61 }
62 pokeLorentz(U, U_mu, mu);
63 // Check matrix U_mu, must be real orthogonal
64 // reality
65 /*
66 LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
67 std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) <<
68 std::endl;
69
70 Ucheck = U_mu * adj(U_mu) - uno;
71 std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) <<
72 std::endl;
73 */
74 }
75 }
76
78 Real scale = 1.0) const {
79 LatticeGaugeField out(in.Grid());
80 out = Zero();
81
82 for (int mu = 0; mu < Nd; mu++) {
83 LatticeColourMatrix out_mu(in.Grid()); // fundamental representation
84 LatticeMatrix in_mu = peekLorentz(in, mu);
85
86 out_mu = Zero();
87
89 projectOnAlgebra(h, in_mu, double(Nc) * 2.0); // factor C(r)/C(fund)
90 FundamentalLieAlgebraMatrix(h, out_mu); // apply scale only once
91 pokeLorentz(out, out_mu, mu);
92 // Returns traceless antihermitian matrix Nc * Nc.
93 // Confirmed
94 }
95 return out;
96 }
97
98private:
100 const LatticeMatrix &in, Real scale = 1.0) const {
102 }
103
106 typename SU<ncolour>::LatticeMatrix &out, Real scale = 1.0) const {
108 }
109};
110
112
114
115#endif
accelerator_inline Grid_simd2< S, V > trace(const Grid_simd2< S, V > &arg)
void conformable(const Lattice< obj1 > &lhs, const Lattice< obj2 > &rhs)
Lattice< vobj > adj(const Lattice< vobj > &lhs)
GridLogger GridLogDebug(1, "Debug", GridLogColours, "PURPLE")
#define NAMESPACE_BEGIN(A)
Definition Namespace.h:35
#define NAMESPACE_END(A)
Definition Namespace.h:36
void pokeLorentz(Lattice< vobj > &lhs, const Lattice< decltype(peekIndex< LorentzIndex >(vobj(), 0))> &rhs, int i)
Definition QCD.h:487
static constexpr int Nd
Definition QCD.h:52
static constexpr int Nc
Definition QCD.h:50
Lattice< vColourMatrix > LatticeColourMatrix
Definition QCD.h:295
LatticeLorentzColourMatrix LatticeGaugeField
Definition QCD.h:385
void pokeColour(Lattice< vobj > &lhs, const Lattice< decltype(peekIndex< ColourIndex >(vobj(), 0))> &rhs, int i)
Definition QCD.h:459
auto peekLorentz(const vobj &rhs, int i) -> decltype(PeekIndex< LorentzIndex >(rhs, 0))
Definition QCD.h:446
RealF Real
Definition Simd.h:65
AdjointRep< Nc > AdjointRepresentation
Definition adjoint.h:111
SU_Adjoint< ncolour >::LatticeAdjMatrix LatticeMatrix
Definition adjoint.h:22
SU_Adjoint< ncolour >::LatticeAdjField LatticeField
Definition adjoint.h:23
LatticeGaugeField RtoFundamentalProject(const LatticeField &in, Real scale=1.0) const
Definition adjoint.h:77
void projectOnAlgebra(typename SU< ncolour >::LatticeAlgebraVector &h_out, const LatticeMatrix &in, Real scale=1.0) const
Definition adjoint.h:99
void FundamentalLieAlgebraMatrix(typename SU< ncolour >::LatticeAlgebraVector &h, typename SU< ncolour >::LatticeMatrix &out, Real scale=1.0) const
Definition adjoint.h:104
static const bool isFundamental
Definition adjoint.h:25
void update_representation(const LatticeGaugeField &Uin)
Definition adjoint.h:31
AdjointRep(GridBase *grid)
Definition adjoint.h:29
LatticeField U
Definition adjoint.h:27
static const int Dimension
Definition adjoint.h:24
Lattice< vAlgebraVector > LatticeAlgebraVector
Definition GaugeGroup.h:135
static void FundamentalLieAlgebraMatrix(const LatticeAlgebraVector &h, LatticeMatrix &out, Real scale=1.0)
Definition GaugeGroup.h:246
GridBase * Grid(void) const
Lattice< vAMatrix > LatticeAdjMatrix
Definition SUnAdjoint.h:46
Lattice< iVector< iScalar< iMatrix< vComplex, Dimension > >, Nd > > LatticeAdjField
Definition SUnAdjoint.h:50
static void projectOnAlgebra(typename SU< ncolour >::LatticeAlgebraVector &h_out, const LatticeAdjMatrix &in, Real scale=1.0)
Definition SUnAdjoint.h:130
Definition Simd.h:194