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 21:53:05 +00:00
parent 59ba9ff3bb
commit f4623fd551

View File

@ -31,8 +31,8 @@ directory
/* END LEGAL */ /* END LEGAL */
#ifndef QCD_UTILS_WILSON_LOOPS_H #ifndef QCD_UTILS_WILSON_LOOPS_H
#define QCD_UTILS_WILSON_LOOPS_H #define QCD_UTILS_WILSON_LOOPS_H
namespace Grid {
namespace QCD { NAMESPACE_BEGIN(Grid);
// Common wilson loop observables // Common wilson loop observables
template <class Gimpl> class WilsonLoops : public Gimpl { template <class Gimpl> class WilsonLoops : public Gimpl {
@ -55,16 +55,16 @@ public:
// purpose of deriving // purpose of deriving
// from Gimpl. // from Gimpl.
/* /*
plaq = Gimpl::CovShiftBackward( plaq = Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftBackward( U[mu], mu, Gimpl::CovShiftBackward(
U[nu], nu, Gimpl::CovShiftForward(U[mu], mu, U[nu]))); U[nu], nu, Gimpl::CovShiftForward(U[mu], mu, U[nu])));
*/ */
// _ // _
//|< _| //|< _|
plaq = Gimpl::CovShiftForward(U[mu],mu, plaq = Gimpl::CovShiftForward(U[mu],mu,
Gimpl::CovShiftForward(U[nu],nu, Gimpl::CovShiftForward(U[nu],nu,
Gimpl::CovShiftBackward(U[mu],mu, Gimpl::CovShiftBackward(U[mu],mu,
Gimpl::CovShiftIdentityBackward(U[nu], nu)))); Gimpl::CovShiftIdentityBackward(U[nu], nu))));
@ -170,11 +170,11 @@ public:
// //
staple += Gimpl::ShiftStaple( staple += Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftIdentityBackward(U[nu], nu))), U[mu], mu, Gimpl::CovShiftIdentityBackward(U[nu], nu))),
mu); mu);
// __ // __
// | // |
@ -182,15 +182,15 @@ public:
// //
// //
staple += Gimpl::ShiftStaple( staple += Gimpl::ShiftStaple(
Gimpl::CovShiftBackward(U[nu], nu, Gimpl::CovShiftBackward(U[nu], nu,
Gimpl::CovShiftBackward(U[mu], mu, U[nu])), Gimpl::CovShiftBackward(U[mu], mu, U[nu])),
mu); mu);
} }
} }
// For the force term // For the force term
static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) { static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
GridBase *grid = Umu._grid; GridBase *grid = Umu._grid;
std::vector<GaugeMat> U(Nd, grid); std::vector<GaugeMat> U(Nd, grid);
for (int d = 0; d < Nd; d++) { for (int d = 0; d < Nd; d++) {
@ -212,7 +212,7 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
} }
} }
staple = U[mu]*staple; staple = U[mu]*staple;
} }
////////////////////////////////////////////////// //////////////////////////////////////////////////
// the sum over all staples on each site // the sum over all staples on each site
@ -241,11 +241,11 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// //
staple += Gimpl::ShiftStaple( staple += Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftIdentityBackward(U[nu], nu))), U[mu], mu, Gimpl::CovShiftIdentityBackward(U[nu], nu))),
mu); mu);
// __ // __
// | // |
@ -254,8 +254,8 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// //
staple += Gimpl::ShiftStaple( staple += Gimpl::ShiftStaple(
Gimpl::CovShiftBackward(U[nu], nu, Gimpl::CovShiftBackward(U[nu], nu,
Gimpl::CovShiftBackward(U[mu], mu, U[nu])), mu); Gimpl::CovShiftBackward(U[mu], mu, U[nu])), mu);
} }
} }
} }
@ -283,11 +283,11 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// //
staple = Gimpl::ShiftStaple( staple = Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftIdentityBackward(U[nu], nu))), U[mu], mu, Gimpl::CovShiftIdentityBackward(U[nu], nu))),
mu); mu);
} }
} }
@ -314,8 +314,8 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// //
// //
staple = Gimpl::ShiftStaple( staple = Gimpl::ShiftStaple(
Gimpl::CovShiftBackward(U[nu], nu, Gimpl::CovShiftBackward(U[nu], nu,
Gimpl::CovShiftBackward(U[mu], mu, U[nu])), mu); Gimpl::CovShiftBackward(U[mu], mu, U[nu])), mu);
} }
} }
@ -323,19 +323,19 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// Field Strength // Field Strength
////////////////////////////////////////////////////// //////////////////////////////////////////////////////
static void FieldStrength(GaugeMat &FS, const GaugeLorentz &Umu, int mu, int nu){ static void FieldStrength(GaugeMat &FS, const GaugeLorentz &Umu, int mu, int nu){
// Fmn +--<--+ Ut +--<--+ // Fmn +--<--+ Ut +--<--+
// | | | | // | | | |
// (x)+-->--+ +-->--+(x) // (x)+-->--+ +-->--+(x)
// | | | | // | | | |
// +--<--+ +--<--+ // +--<--+ +--<--+
GaugeMat Vup(Umu._grid), Vdn(Umu._grid); GaugeMat Vup(Umu._grid), Vdn(Umu._grid);
StapleUpper(Vup, Umu, mu, nu); StapleUpper(Vup, Umu, mu, nu);
StapleLower(Vdn, Umu, mu, nu); StapleLower(Vdn, Umu, mu, nu);
GaugeMat v = Vup - Vdn; GaugeMat v = Vup - Vdn;
GaugeMat u = PeekIndex<LorentzIndex>(Umu, mu); // some redundant copies GaugeMat u = PeekIndex<LorentzIndex>(Umu, mu); // some redundant copies
GaugeMat vu = v*u; GaugeMat vu = v*u;
FS = 0.25*Ta(u*v + Cshift(vu, mu, -1)); FS = 0.25*Ta(u*v + Cshift(vu, mu, -1));
} }
static Real TopologicalCharge(GaugeLorentz &U){ static Real TopologicalCharge(GaugeLorentz &U){
@ -366,14 +366,14 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
static void dirRectangle(GaugeMat &rect, const std::vector<GaugeMat> &U, static void dirRectangle(GaugeMat &rect, const std::vector<GaugeMat> &U,
const int mu, const int nu) { const int mu, const int nu) {
rect = Gimpl::CovShiftForward( rect = Gimpl::CovShiftForward(
U[mu], mu, Gimpl::CovShiftForward(U[mu], mu, U[nu])) * // ->->| U[mu], mu, Gimpl::CovShiftForward(U[mu], mu, U[nu])) * // ->->|
adj(Gimpl::CovShiftForward( adj(Gimpl::CovShiftForward(
U[nu], nu, Gimpl::CovShiftForward(U[mu], mu, U[mu]))); U[nu], nu, Gimpl::CovShiftForward(U[mu], mu, U[mu])));
rect = rect + rect = rect +
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[mu], mu, Gimpl::CovShiftForward(U[nu], nu, U[nu])) * // ->|| U[mu], mu, Gimpl::CovShiftForward(U[nu], nu, U[nu])) * // ->||
adj(Gimpl::CovShiftForward( adj(Gimpl::CovShiftForward(
U[nu], nu, Gimpl::CovShiftForward(U[nu], nu, U[mu]))); U[nu], nu, Gimpl::CovShiftForward(U[nu], nu, U[mu])));
} }
static void traceDirRectangle(ComplexField &rect, static void traceDirRectangle(ComplexField &rect,
const std::vector<GaugeMat> &U, const int mu, const std::vector<GaugeMat> &U, const int mu,
@ -537,52 +537,52 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// | __ | // | __ |
// //
Stap += Gimpl::ShiftStaple( Stap += Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftIdentityBackward(U[nu], nu))))), Gimpl::CovShiftIdentityBackward(U[nu], nu))))),
mu); mu);
// __ // __
// |__ __ | // |__ __ |
Stap += Gimpl::ShiftStaple( Stap += Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftBackward(U[mu], mu, U[nu])))), U[mu], mu, Gimpl::CovShiftBackward(U[mu], mu, U[nu])))),
mu); mu);
// __ // __
// |__ __ | // |__ __ |
Stap += Gimpl::ShiftStaple( Stap += Gimpl::ShiftStaple(
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftForward(U[nu], nu, U[mu])))), U[mu], mu, Gimpl::CovShiftForward(U[nu], nu, U[mu])))),
mu); mu);
// __ ___ // __ ___
// |__ | // |__ |
Stap += Gimpl::ShiftStaple( Stap += Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftBackward(U[nu], nu, U[mu])))), U[mu], mu, Gimpl::CovShiftBackward(U[nu], nu, U[mu])))),
mu); mu);
// -- // --
// | | // | |
@ -590,16 +590,16 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// | | // | |
Stap += Gimpl::ShiftStaple( Stap += Gimpl::ShiftStaple(
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftForward( Gimpl::CovShiftForward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, U[mu], mu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftIdentityBackward(U[nu], nu))))), Gimpl::CovShiftIdentityBackward(U[nu], nu))))),
mu); mu);
// | | // | |
// //
@ -607,13 +607,13 @@ static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
// -- // --
Stap += Gimpl::ShiftStaple( Stap += Gimpl::ShiftStaple(
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[nu], nu, U[nu], nu,
Gimpl::CovShiftBackward( Gimpl::CovShiftBackward(
U[mu], mu, Gimpl::CovShiftForward(U[nu], nu, U[nu])))), U[mu], mu, Gimpl::CovShiftForward(U[nu], nu, U[nu])))),
mu); mu);
} }
} }
} }
@ -623,7 +623,7 @@ typedef WilsonLoops<PeriodicGimplR> ColourWilsonLoops;
typedef WilsonLoops<PeriodicGimplR> U1WilsonLoops; typedef WilsonLoops<PeriodicGimplR> U1WilsonLoops;
typedef WilsonLoops<PeriodicGimplR> SU2WilsonLoops; typedef WilsonLoops<PeriodicGimplR> SU2WilsonLoops;
typedef WilsonLoops<PeriodicGimplR> SU3WilsonLoops; typedef WilsonLoops<PeriodicGimplR> SU3WilsonLoops;
}
} NAMESPACE_END(Grid);
#endif #endif