2016-09-13 10:43:30 +01:00
|
|
|
/*
|
|
|
|
* Policy classes for the HMC
|
2016-09-22 14:17:37 +01:00
|
|
|
* Authors: Guido Cossu, David Preti
|
2018-01-14 22:13:46 +00:00
|
|
|
*/
|
2016-09-13 10:43:30 +01:00
|
|
|
|
2016-09-22 14:17:37 +01:00
|
|
|
#ifndef SUN2INDEX_H_H
|
|
|
|
#define SUN2INDEX_H_H
|
2016-09-13 10:43:30 +01:00
|
|
|
|
2018-01-14 22:13:46 +00:00
|
|
|
NAMESPACE_BEGIN(Grid);
|
2016-09-13 10:43:30 +01:00
|
|
|
|
|
|
|
/*
|
2016-09-22 14:17:37 +01:00
|
|
|
* This is an helper class for the HMC
|
|
|
|
* Should contain only the data for the two index representations
|
|
|
|
* and the facility to convert from the fundamental -> two index
|
|
|
|
* The templated parameter TwoIndexSymmetry choses between the
|
|
|
|
* symmetric and antisymmetric representations
|
|
|
|
*
|
|
|
|
* There is an
|
|
|
|
* enum TwoIndexSymmetry { Symmetric = 1, AntiSymmetric = -1 };
|
|
|
|
* in the SUnTwoIndex.h file
|
|
|
|
*/
|
2016-09-13 10:43:30 +01:00
|
|
|
|
|
|
|
template <int ncolour, TwoIndexSymmetry S>
|
2016-09-22 14:17:37 +01:00
|
|
|
class TwoIndexRep {
|
2018-01-14 22:13:46 +00:00
|
|
|
public:
|
2016-09-13 10:43:30 +01:00
|
|
|
// typdef to be used by the Representations class in HMC to get the
|
|
|
|
// types for the higher representation fields
|
2016-09-22 14:17:37 +01:00
|
|
|
typedef typename SU_TwoIndex<ncolour, S>::LatticeTwoIndexMatrix LatticeMatrix;
|
|
|
|
typedef typename SU_TwoIndex<ncolour, S>::LatticeTwoIndexField LatticeField;
|
2016-09-13 10:43:30 +01:00
|
|
|
static const int Dimension = ncolour * (ncolour + S) / 2;
|
|
|
|
|
|
|
|
LatticeField U;
|
|
|
|
|
2016-09-22 14:17:37 +01:00
|
|
|
explicit TwoIndexRep(GridBase *grid) : U(grid) {}
|
2016-09-13 10:43:30 +01:00
|
|
|
|
|
|
|
void update_representation(const LatticeGaugeField &Uin) {
|
|
|
|
std::cout << GridLogDebug << "Updating TwoIndex representation\n";
|
|
|
|
// Uin is in the fundamental representation
|
2016-09-22 14:17:37 +01:00
|
|
|
// get the U in TwoIndexRep
|
|
|
|
// (U)_{(ij)(lk)} = tr [ adj(e^(ij)) U e^(lk) transpose(U) ]
|
2016-09-13 10:43:30 +01:00
|
|
|
conformable(U, Uin);
|
|
|
|
U = zero;
|
|
|
|
LatticeColourMatrix tmp(Uin._grid);
|
|
|
|
|
2016-09-22 14:17:37 +01:00
|
|
|
Vector<typename SU<ncolour>::Matrix> eij(Dimension);
|
2016-09-13 10:43:30 +01:00
|
|
|
|
2016-09-22 14:17:37 +01:00
|
|
|
for (int a = 0; a < Dimension; a++)
|
|
|
|
SU_TwoIndex<ncolour, S>::base(a, eij[a]);
|
2016-09-13 10:43:30 +01:00
|
|
|
|
|
|
|
for (int mu = 0; mu < Nd; mu++) {
|
|
|
|
auto Uin_mu = peekLorentz(Uin, mu);
|
|
|
|
auto U_mu = peekLorentz(U, mu);
|
2016-09-22 14:17:37 +01:00
|
|
|
for (int a = 0; a < Dimension; a++) {
|
|
|
|
tmp = transpose(Uin_mu) * adj(eij[a]) * Uin_mu;
|
|
|
|
for (int b = 0; b < Dimension; b++)
|
|
|
|
pokeColour(U_mu, trace(tmp * eij[b]), a, b);
|
|
|
|
}
|
|
|
|
pokeLorentz(U, U_mu, mu);
|
2016-09-13 10:43:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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<ncolour>::LatticeAlgebraVector h(in._grid);
|
2016-09-22 14:17:37 +01:00
|
|
|
projectOnAlgebra(h, in_mu, double(Nc + 2 * S)); // factor T(r)/T(fund)
|
|
|
|
FundamentalLieAlgebraMatrix(h, out_mu); // apply scale only once
|
2016-09-13 10:43:30 +01:00
|
|
|
pokeLorentz(out, out_mu, mu);
|
|
|
|
}
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
2018-01-14 22:13:46 +00:00
|
|
|
private:
|
2016-09-13 10:43:30 +01:00
|
|
|
void projectOnAlgebra(typename SU<ncolour>::LatticeAlgebraVector &h_out,
|
|
|
|
const LatticeMatrix &in, Real scale = 1.0) const {
|
2016-09-22 14:17:37 +01:00
|
|
|
SU_TwoIndex<ncolour, S>::projectOnAlgebra(h_out, in, scale);
|
2016-09-13 10:43:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void FundamentalLieAlgebraMatrix(
|
2018-01-14 22:13:46 +00:00
|
|
|
typename SU<ncolour>::LatticeAlgebraVector &h,
|
|
|
|
typename SU<ncolour>::LatticeMatrix &out, Real scale = 1.0) const {
|
2016-09-13 10:43:30 +01:00
|
|
|
SU<ncolour>::FundamentalLieAlgebraMatrix(h, out, scale);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-09-22 14:17:37 +01:00
|
|
|
typedef TwoIndexRep<Nc, Symmetric> TwoIndexSymmetricRepresentation;
|
|
|
|
typedef TwoIndexRep<Nc, AntiSymmetric> TwoIndexAntiSymmetricRepresentation;
|
2018-01-14 22:13:46 +00:00
|
|
|
|
|
|
|
NAMESPACE_END(Grid);
|
|
|
|
|
2016-09-13 10:43:30 +01:00
|
|
|
#endif
|