1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

Namespace

This commit is contained in:
paboyle 2018-01-14 22:16:33 +00:00
parent 049b4a4631
commit 361ce948c3

View File

@ -1,23 +1,22 @@
/* /*
* Policy classes for the HMC * Policy classes for the HMC
* Author: Guido Cossu * Author: Guido Cossu
*/ */
#ifndef ADJOINT_H #ifndef ADJOINT_H
#define ADJOINT_H #define ADJOINT_H
namespace Grid { NAMESPACE_BEGIN(Grid);
namespace QCD {
/* /*
* This is an helper class for the HMC * This is an helper class for the HMC
* Should contain only the data for the adjoint representation * Should contain only the data for the adjoint representation
* and the facility to convert from the fundamental -> adjoint * and the facility to convert from the fundamental -> adjoint
*/ */
template <int ncolour> template <int ncolour>
class AdjointRep { class AdjointRep {
public: public:
// typdef to be used by the Representations class in HMC to get the // typdef to be used by the Representations class in HMC to get the
// types for the higher representation fields // types for the higher representation fields
typedef typename SU_Adjoint<ncolour>::LatticeAdjMatrix LatticeMatrix; typedef typename SU_Adjoint<ncolour>::LatticeAdjMatrix LatticeMatrix;
@ -63,13 +62,13 @@ class AdjointRep {
// Check matrix U_mu, must be real orthogonal // Check matrix U_mu, must be real orthogonal
// reality // reality
/* /*
LatticeMatrix Ucheck = U_mu - conjugate(U_mu); LatticeMatrix Ucheck = U_mu - conjugate(U_mu);
std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) << std::cout << GridLogMessage << "Reality check: " << norm2(Ucheck) <<
std::endl; std::endl;
Ucheck = U_mu * adj(U_mu) - uno; Ucheck = U_mu * adj(U_mu) - uno;
std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) << std::cout << GridLogMessage << "orthogonality check: " << norm2(Ucheck) <<
std::endl; std::endl;
*/ */
} }
} }
@ -95,21 +94,21 @@ class AdjointRep {
return out; return out;
} }
private: private:
void projectOnAlgebra(typename SU<ncolour>::LatticeAlgebraVector &h_out, void projectOnAlgebra(typename SU<ncolour>::LatticeAlgebraVector &h_out,
const LatticeMatrix &in, Real scale = 1.0) const { const LatticeMatrix &in, Real scale = 1.0) const {
SU_Adjoint<ncolour>::projectOnAlgebra(h_out, in, scale); SU_Adjoint<ncolour>::projectOnAlgebra(h_out, in, scale);
} }
void FundamentalLieAlgebraMatrix( void FundamentalLieAlgebraMatrix(
typename SU<ncolour>::LatticeAlgebraVector &h, typename SU<ncolour>::LatticeAlgebraVector &h,
typename SU<ncolour>::LatticeMatrix &out, Real scale = 1.0) const { typename SU<ncolour>::LatticeMatrix &out, Real scale = 1.0) const {
SU<ncolour>::FundamentalLieAlgebraMatrix(h, out, scale); SU<ncolour>::FundamentalLieAlgebraMatrix(h, out, scale);
} }
}; };
typedef AdjointRep<Nc> AdjointRepresentation; typedef AdjointRep<Nc> AdjointRepresentation;
}
} NAMESPACE_END(Grid);
#endif #endif