#ifndef SCALAR_IMPL #define SCALAR_IMPL namespace Grid { //namespace QCD { template class ScalarImplTypes { public: typedef S Simd; template using iImplField = iScalar > >; typedef iImplField SiteField; typedef Lattice Field; static inline void generate_momenta(Field& P, GridParallelRNG& pRNG) { gaussian(pRNG, P); } static inline Field projectForce(Field& P){return P;} static inline void update_field(Field& P, Field& U, double ep) { U += P*ep; } static inline RealD FieldSquareNorm(Field& U) { return (- sum(trace(U*U))/2.0); } static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U) { gaussian(pRNG, U); } static inline void TepidConfiguration(GridParallelRNG &pRNG, Field &U) { gaussian(pRNG, U); } static inline void ColdConfiguration(GridParallelRNG &pRNG, Field &U) { U = 1.0; } }; template class ScalarAdjMatrixImplTypes { public: typedef S Simd; template using iImplField = iScalar > >; typedef iImplField SiteField; typedef Lattice Field; static inline void generate_momenta(Field& P, GridParallelRNG& pRNG) { QCD::SU::GaussianFundamentalLieAlgebraMatrix(pRNG, P); } static inline Field projectForce(Field& P) {return P;} static inline void update_field(Field& P, Field& U, double ep) { U += P*ep; } static inline RealD FieldSquareNorm(Field& U) { return (TensorRemove(sum(trace(U*U))).real()); } static inline void HotConfiguration(GridParallelRNG &pRNG, Field &U) { QCD::SU::LieRandomize(pRNG, U); } static inline void TepidConfiguration(GridParallelRNG &pRNG, Field &U) { QCD::SU::LieRandomize(pRNG, U, 0.01); } static inline void ColdConfiguration(GridParallelRNG &pRNG, Field &U) { U = zero; } }; typedef ScalarImplTypes ScalarImplR; typedef ScalarImplTypes ScalarImplF; typedef ScalarImplTypes ScalarImplD; // Hardcoding here the size of the matrices typedef ScalarAdjMatrixImplTypes ScalarAdjImplR; typedef ScalarAdjMatrixImplTypes ScalarAdjImplF; typedef ScalarAdjMatrixImplTypes ScalarAdjImplD; template using ScalarNxNAdjImplR = ScalarAdjMatrixImplTypes; template using ScalarNxNAdjImplF = ScalarAdjMatrixImplTypes; template using ScalarNxNAdjImplD = ScalarAdjMatrixImplTypes; //} } #endif