2016-07-12 13:36:10 +01:00
|
|
|
/*
|
2016-07-31 12:37:33 +01:00
|
|
|
* Policy classes for the HMC
|
|
|
|
* Author: Guido Cossu
|
2016-07-18 12:05:23 +01:00
|
|
|
*/
|
2016-07-12 13:36:10 +01:00
|
|
|
|
|
|
|
#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 <int ncolour>
|
|
|
|
class AdjointRep {
|
|
|
|
public:
|
2016-07-18 12:05:23 +01:00
|
|
|
// typdef to be used by the Representations class in HMC to get the
|
|
|
|
// types for the higher representation fields
|
2016-07-15 13:39:47 +01:00
|
|
|
typedef typename SU_Adjoint<ncolour>::LatticeAdjMatrix LatticeMatrix;
|
|
|
|
typedef typename SU_Adjoint<ncolour>::LatticeAdjField LatticeField;
|
2016-07-18 12:05:23 +01:00
|
|
|
static const int Dimension = ncolour * ncolour - 1;
|
2018-01-17 13:46:12 +00:00
|
|
|
static const bool isFundamental = false;
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-13 17:51:18 +01:00
|
|
|
LatticeField U;
|
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
explicit AdjointRep(GridBase *grid) : U(grid) {}
|
2016-07-31 12:37:33 +01:00
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
void update_representation(const LatticeGaugeField &Uin) {
|
2016-08-30 11:31:25 +01:00
|
|
|
std::cout << GridLogDebug << "Updating adjoint representation\n";
|
2016-07-12 13:36:10 +01:00
|
|
|
// Uin is in the fundamental representation
|
|
|
|
// get the U in AdjointRep
|
|
|
|
// (U_adj)_B = tr[e^a U e^b U^dag]
|
|
|
|
// e^a = t^a/sqrt(T_F)
|
|
|
|
// where t^a is the generator in the fundamental
|
|
|
|
// T_F is 1/2 for the fundamental representation
|
|
|
|
conformable(U, Uin);
|
|
|
|
U = zero;
|
2016-07-18 12:05:23 +01:00
|
|
|
LatticeColourMatrix tmp(Uin._grid);
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
Vector<typename SU<ncolour>::Matrix> ta(Dimension);
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-31 12:37:33 +01:00
|
|
|
// Debug lines
|
2016-08-30 11:31:25 +01:00
|
|
|
// LatticeMatrix uno(Uin._grid);
|
|
|
|
// uno = 1.0;
|
2016-07-31 12:37:33 +01:00
|
|
|
////////////////
|
|
|
|
|
2016-07-13 17:51:18 +01:00
|
|
|
// FIXME probably not very efficient to get all the generators
|
|
|
|
// everytime
|
2016-07-12 13:36:10 +01:00
|
|
|
for (int a = 0; a < Dimension; a++) SU<ncolour>::generator(a, ta[a]);
|
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
for (int mu = 0; mu < Nd; mu++) {
|
|
|
|
auto Uin_mu = peekLorentz(Uin, mu);
|
2016-08-30 11:31:25 +01:00
|
|
|
auto U_mu = peekLorentz(U, mu);
|
2016-07-18 12:05:23 +01:00
|
|
|
for (int a = 0; a < Dimension; a++) {
|
|
|
|
tmp = 2.0 * adj(Uin_mu) * ta[a] * Uin_mu;
|
2016-07-28 16:44:41 +01:00
|
|
|
for (int b = 0; b < Dimension; b++)
|
2016-08-30 11:31:25 +01:00
|
|
|
pokeColour(U_mu, trace(tmp * ta[b]), a, b);
|
2016-07-12 13:36:10 +01:00
|
|
|
}
|
2016-07-31 12:37:33 +01:00
|
|
|
pokeLorentz(U, U_mu, mu);
|
2016-07-28 16:44:41 +01:00
|
|
|
// Check matrix U_mu, must be real orthogonal
|
2016-07-31 12:37:33 +01:00
|
|
|
// reality
|
|
|
|
/*
|
2016-07-28 16:44:41 +01:00
|
|
|
LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
|
2016-07-31 12:37:33 +01:00
|
|
|
std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) <<
|
|
|
|
std::endl;
|
|
|
|
|
2016-07-28 16:44:41 +01:00
|
|
|
Ucheck = U_mu * adj(U_mu) - uno;
|
2016-07-31 12:37:33 +01:00
|
|
|
std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) <<
|
|
|
|
std::endl;
|
|
|
|
*/
|
2016-07-18 12:05:23 +01:00
|
|
|
}
|
2016-07-12 13:36:10 +01:00
|
|
|
}
|
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
LatticeGaugeField RtoFundamentalProject(const LatticeField &in,
|
|
|
|
Real scale = 1.0) const {
|
|
|
|
LatticeGaugeField out(in._grid);
|
2016-07-28 16:44:41 +01:00
|
|
|
out = zero;
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
for (int mu = 0; mu < Nd; mu++) {
|
|
|
|
LatticeColourMatrix out_mu(in._grid); // fundamental representation
|
|
|
|
LatticeMatrix in_mu = peekLorentz(in, mu);
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
out_mu = zero;
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
typename SU<ncolour>::LatticeAlgebraVector h(in._grid);
|
2016-08-30 11:31:25 +01:00
|
|
|
projectOnAlgebra(h, in_mu, double(Nc) * 2.0); // factor C(r)/C(fund)
|
|
|
|
FundamentalLieAlgebraMatrix(h, out_mu); // apply scale only once
|
2016-07-18 12:05:23 +01:00
|
|
|
pokeLorentz(out, out_mu, mu);
|
2016-08-30 11:31:25 +01:00
|
|
|
// Returns traceless antihermitian matrix Nc * Nc.
|
|
|
|
// Confirmed
|
2016-07-18 12:05:23 +01:00
|
|
|
}
|
|
|
|
return out;
|
|
|
|
}
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2016-07-18 12:05:23 +01:00
|
|
|
private:
|
|
|
|
void projectOnAlgebra(typename SU<ncolour>::LatticeAlgebraVector &h_out,
|
|
|
|
const LatticeMatrix &in, Real scale = 1.0) const {
|
|
|
|
SU_Adjoint<ncolour>::projectOnAlgebra(h_out, in, scale);
|
|
|
|
}
|
|
|
|
|
|
|
|
void FundamentalLieAlgebraMatrix(
|
|
|
|
typename SU<ncolour>::LatticeAlgebraVector &h,
|
|
|
|
typename SU<ncolour>::LatticeMatrix &out, Real scale = 1.0) const {
|
|
|
|
SU<ncolour>::FundamentalLieAlgebraMatrix(h, out, scale);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef AdjointRep<Nc> AdjointRepresentation;
|
|
|
|
}
|
|
|
|
}
|
2016-07-12 13:36:10 +01:00
|
|
|
|
2017-02-22 18:09:33 +00:00
|
|
|
#endif
|