/* * Policy classes for the HMC * Author: Guido Cossu */ #ifndef ADJOINT_H #define ADJOINT_H namespace Grid { namespace QCD { /* * This is an helper class for the HMC * Should contain only the data for the adjoint representation * and the facility to convert from the fundamental -> adjoint */ template class TwoIndexSymmetricRep { public: // typdef to be used by the Representations class in HMC to get the // types for the higher representation fields typedef typename SU_TwoIndex::LatticeTwoIndexMatrix LatticeMatrix; typedef typename SU_TwoIndex::LatticeTwoIndexField LatticeField; static const int Dimension = ncolour * (ncolour + S) / 2; LatticeField U; explicit TwoIndexSymmetricRep(GridBase *grid) : U(grid) {} void update_representation(const LatticeGaugeField &Uin) { std::cout << GridLogDebug << "Updating TwoIndex representation\n"; // Uin is in the fundamental representation // get the U in AdjointRep // (U)(ij)_(lk) = // e^a = conformable(U, Uin); U = zero; LatticeColourMatrix tmp(Uin._grid); Vector::Matrix> ta(Dimension); // FIXME probably not very efficient to get all the generators // everytime for (int a = 0; a < Dimension; a++) SU::generator(a, ta[a]); for (int mu = 0; mu < Nd; mu++) { auto Uin_mu = peekLorentz(Uin, mu); auto U_mu = peekLorentz(U, mu); } } LatticeGaugeField RtoFundamentalProject(const LatticeField &in, Real scale = 1.0) const { LatticeGaugeField out(in._grid); out = zero; for (int mu = 0; mu < Nd; mu++) { LatticeColourMatrix out_mu(in._grid); // fundamental representation LatticeMatrix in_mu = peekLorentz(in, mu); out_mu = zero; typename SU::LatticeAlgebraVector h(in._grid); projectOnAlgebra(h, in_mu, double(Nc + 2*S) ); // factor T(r)/T(fund) FundamentalLieAlgebraMatrix(h, out_mu); // apply scale only once pokeLorentz(out, out_mu, mu); } return out; } private: void projectOnAlgebra(typename SU::LatticeAlgebraVector &h_out, const LatticeMatrix &in, Real scale = 1.0) const { SU_TwoIndex::projectOnAlgebra(h_out, in, scale); } void FundamentalLieAlgebraMatrix( typename SU::LatticeAlgebraVector &h, typename SU::LatticeMatrix &out, Real scale = 1.0) const { SU::FundamentalLieAlgebraMatrix(h, out, scale); } }; typedef TwoIndexRep< Nc, Symmetric > TwoIndexSymmetricRepresentation; typedef TwoIndexRep< Nc, AntiSymmetric > TwoIndexAntiSymmetricRepresentation; } } #endif