2016-07-05 12:03:54 +01:00
|
|
|
/*************************************************************************************
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
Grid physics library, www.github.com/paboyle/Grid
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
Source file: ./lib/qcd/action/gauge/GaugeImpl.h
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
Copyright (C) 2015
|
2016-01-02 14:51:32 +00:00
|
|
|
|
|
|
|
Author: paboyle <paboyle@ph.ed.ac.uk>
|
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2016-01-02 14:51:32 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
See the full license in the file "LICENSE" in the top level distribution
|
|
|
|
directory
|
|
|
|
*************************************************************************************/
|
|
|
|
/* END LEGAL */
|
2017-01-26 15:24:49 +00:00
|
|
|
#ifndef GRID_QCD_GAUGE_IMPLEMENTATIONS_H
|
|
|
|
#define GRID_QCD_GAUGE_IMPLEMENTATIONS_H
|
|
|
|
|
|
|
|
#include "GaugeImplTypes.h"
|
2016-01-02 13:37:25 +00:00
|
|
|
|
|
|
|
namespace Grid {
|
2016-07-05 12:03:54 +01:00
|
|
|
namespace QCD {
|
|
|
|
|
|
|
|
// Composition with smeared link, bc's etc.. probably need multiple inheritance
|
|
|
|
// Variable precision "S" and variable Nc
|
|
|
|
template <class GimplTypes> class PeriodicGaugeImpl : public GimplTypes {
|
|
|
|
public:
|
|
|
|
INHERIT_GIMPL_TYPES(GimplTypes);
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Support needed for the assembly of loops including all boundary condition
|
|
|
|
// effects such as conjugate bcs
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
template <class covariant>
|
|
|
|
static inline Lattice<covariant>
|
|
|
|
CovShiftForward(const GaugeLinkField &Link, int mu,
|
|
|
|
const Lattice<covariant> &field) {
|
|
|
|
return PeriodicBC::CovShiftForward(Link, mu, field);
|
|
|
|
}
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
template <class covariant>
|
|
|
|
static inline Lattice<covariant>
|
|
|
|
CovShiftBackward(const GaugeLinkField &Link, int mu,
|
|
|
|
const Lattice<covariant> &field) {
|
|
|
|
return PeriodicBC::CovShiftBackward(Link, mu, field);
|
|
|
|
}
|
|
|
|
static inline GaugeLinkField
|
|
|
|
CovShiftIdentityBackward(const GaugeLinkField &Link, int mu) {
|
|
|
|
return Cshift(adj(Link), mu, -1);
|
|
|
|
}
|
|
|
|
static inline GaugeLinkField
|
|
|
|
CovShiftIdentityForward(const GaugeLinkField &Link, int mu) {
|
|
|
|
return Link;
|
|
|
|
}
|
|
|
|
static inline GaugeLinkField ShiftStaple(const GaugeLinkField &Link, int mu) {
|
|
|
|
return Cshift(Link, mu, 1);
|
|
|
|
}
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
static inline bool isPeriodicGaugeField(void) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// Composition with smeared link, bc's etc.. probably need multiple inheritance
|
|
|
|
// Variable precision "S" and variable Nc
|
|
|
|
template <class GimplTypes> class ConjugateGaugeImpl : public GimplTypes {
|
|
|
|
public:
|
|
|
|
INHERIT_GIMPL_TYPES(GimplTypes);
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Support needed for the assembly of loops including all boundary condition
|
|
|
|
// effects such as Gparity.
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
template <class covariant>
|
|
|
|
static Lattice<covariant> CovShiftForward(const GaugeLinkField &Link, int mu,
|
|
|
|
const Lattice<covariant> &field) {
|
|
|
|
return ConjugateBC::CovShiftForward(Link, mu, field);
|
|
|
|
}
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
template <class covariant>
|
|
|
|
static Lattice<covariant> CovShiftBackward(const GaugeLinkField &Link, int mu,
|
|
|
|
const Lattice<covariant> &field) {
|
|
|
|
return ConjugateBC::CovShiftBackward(Link, mu, field);
|
|
|
|
}
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
static inline GaugeLinkField
|
|
|
|
CovShiftIdentityBackward(const GaugeLinkField &Link, int mu) {
|
|
|
|
GridBase *grid = Link._grid;
|
|
|
|
int Lmu = grid->GlobalDimensions()[mu] - 1;
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
Lattice<iScalar<vInteger>> coor(grid);
|
|
|
|
LatticeCoordinate(coor, mu);
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
GaugeLinkField tmp(grid);
|
|
|
|
tmp = adj(Link);
|
|
|
|
tmp = where(coor == Lmu, conjugate(tmp), tmp);
|
|
|
|
return Cshift(tmp, mu, -1); // moves towards positive mu
|
|
|
|
}
|
|
|
|
static inline GaugeLinkField
|
|
|
|
CovShiftIdentityForward(const GaugeLinkField &Link, int mu) {
|
|
|
|
return Link;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline GaugeLinkField ShiftStaple(const GaugeLinkField &Link, int mu) {
|
|
|
|
GridBase *grid = Link._grid;
|
|
|
|
int Lmu = grid->GlobalDimensions()[mu] - 1;
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
Lattice<iScalar<vInteger>> coor(grid);
|
|
|
|
LatticeCoordinate(coor, mu);
|
2016-01-02 13:37:25 +00:00
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
GaugeLinkField tmp(grid);
|
|
|
|
tmp = Cshift(Link, mu, 1);
|
|
|
|
tmp = where(coor == Lmu, conjugate(tmp), tmp);
|
|
|
|
return tmp;
|
2016-01-02 13:37:25 +00:00
|
|
|
}
|
2016-07-05 12:03:54 +01:00
|
|
|
|
|
|
|
static inline bool isPeriodicGaugeField(void) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef PeriodicGaugeImpl<GimplTypesR> PeriodicGimplR; // Real.. whichever prec
|
|
|
|
typedef PeriodicGaugeImpl<GimplTypesF> PeriodicGimplF; // Float
|
|
|
|
typedef PeriodicGaugeImpl<GimplTypesD> PeriodicGimplD; // Double
|
|
|
|
|
2016-07-12 13:36:10 +01:00
|
|
|
typedef PeriodicGaugeImpl<GimplAdjointTypesR> PeriodicGimplAdjR; // Real.. whichever prec
|
|
|
|
typedef PeriodicGaugeImpl<GimplAdjointTypesF> PeriodicGimplAdjF; // Float
|
|
|
|
typedef PeriodicGaugeImpl<GimplAdjointTypesD> PeriodicGimplAdjD; // Double
|
|
|
|
|
|
|
|
typedef ConjugateGaugeImpl<GimplTypesR> ConjugateGimplR; // Real.. whichever prec
|
2016-07-05 12:03:54 +01:00
|
|
|
typedef ConjugateGaugeImpl<GimplTypesF> ConjugateGimplF; // Float
|
|
|
|
typedef ConjugateGaugeImpl<GimplTypesD> ConjugateGimplD; // Double
|
2017-01-26 15:24:49 +00:00
|
|
|
|
|
|
|
|
2016-07-05 12:03:54 +01:00
|
|
|
}
|
2016-01-02 13:37:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|