mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-12 20:27:06 +01:00
_grid becomes private ; use Grid()§
This commit is contained in:
@ -238,7 +238,7 @@ void CayleyFermion5D<Impl>::MeooeDag5D (const FermionField &psi, FermionField
|
||||
template<class Impl>
|
||||
RealD CayleyFermion5D<Impl>::M (const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
// Assemble Din
|
||||
Meooe5D(psi,Din);
|
||||
@ -258,7 +258,7 @@ RealD CayleyFermion5D<Impl>::Mdag (const FermionField &psi, FermionField &chi)
|
||||
//D1+ D1- P- -> D1+^dag P+ D2-^dag
|
||||
//D2- P+ D2+ P-D1-^dag D2+dag
|
||||
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
// Apply Dw
|
||||
this->DW(psi,Din,DaggerYes);
|
||||
|
||||
@ -305,7 +305,7 @@ void CayleyFermion5D<Impl>::Mdir (const FermionField &psi, FermionField &chi,in
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||
{
|
||||
FermionField Din(V._grid);
|
||||
FermionField Din(V.Grid());
|
||||
|
||||
if ( dag == DaggerNo ) {
|
||||
// U d/du [D_w D5] V = U d/du DW D5 V
|
||||
@ -320,7 +320,7 @@ void CayleyFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField &U,const
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||
{
|
||||
FermionField Din(V._grid);
|
||||
FermionField Din(V.Grid());
|
||||
|
||||
if ( dag == DaggerNo ) {
|
||||
// U d/du [D_w D5] V = U d/du DW D5 V
|
||||
@ -335,7 +335,7 @@ void CayleyFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField &U,const
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionField &U,const FermionField &V,int dag)
|
||||
{
|
||||
FermionField Din(V._grid);
|
||||
FermionField Din(V.Grid());
|
||||
|
||||
if ( dag == DaggerNo ) {
|
||||
// U d/du [D_w D5] V = U d/du DW D5 V
|
||||
|
@ -46,7 +46,7 @@ void CayleyFermion5D<Impl>::M5D(const FermionField &psi,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls =this->Ls;
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
// Flops = 6.0*(Nc*Ns) *Ls*vol
|
||||
@ -89,7 +89,7 @@ void CayleyFermion5D<Impl>::M5Ddag(const FermionField &psi,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls =this->Ls;
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
@ -127,7 +127,7 @@ void CayleyFermion5D<Impl>::M5Ddag(const FermionField &psi,
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInv (const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls=this->Ls;
|
||||
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
@ -172,7 +172,7 @@ void CayleyFermion5D<Impl>::MooeeInv (const FermionField &psi, FermionField &
|
||||
template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInvDag (const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls=this->Ls;
|
||||
|
||||
assert(psi.Checkerboard() == psi.Checkerboard());
|
||||
|
@ -54,8 +54,8 @@ template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInternal(const FermionField &psi, FermionField &chi,int dag, int inv)
|
||||
{
|
||||
int Ls=this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
|
@ -58,7 +58,7 @@ void CayleyFermion5D<Impl>::M5D(const FermionField &psi,
|
||||
std::vector<Coeff_t> &diag,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd= Simd::Nsimd();
|
||||
@ -202,7 +202,7 @@ void CayleyFermion5D<Impl>::M5Ddag(const FermionField &psi,
|
||||
std::vector<Coeff_t> &diag,
|
||||
std::vector<Coeff_t> &upper)
|
||||
{
|
||||
GridBase *grid=psi._grid;
|
||||
GridBase *grid=psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd= Simd::Nsimd();
|
||||
@ -762,8 +762,8 @@ template<class Impl>
|
||||
void CayleyFermion5D<Impl>::MooeeInternal(const FermionField &psi, FermionField &chi,int dag, int inv)
|
||||
{
|
||||
int Ls=this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
|
@ -96,7 +96,7 @@ RealD ContinuedFractionFermion5D<Impl>::M (const FermionField &psi, F
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(psi._grid);
|
||||
FermionField D(psi.Grid());
|
||||
|
||||
this->DW(psi,D,DaggerNo);
|
||||
|
||||
@ -226,7 +226,7 @@ void ContinuedFractionFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionFie
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int sign=1;
|
||||
for(int s=0;s<Ls;s++){
|
||||
@ -244,7 +244,7 @@ void ContinuedFractionFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionFie
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int sign=1;
|
||||
for(int s=0;s<Ls;s++){
|
||||
@ -262,7 +262,7 @@ void ContinuedFractionFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionFie
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int sign=1;
|
||||
for(int s=0;s<Ls;s++){
|
||||
|
@ -89,7 +89,7 @@ void DomainWallEOFAFermion<Impl>::DtildeInv(const FermionField& psi, FermionFiel
|
||||
template<class Impl>
|
||||
RealD DomainWallEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->Meooe5D(psi, Din);
|
||||
this->DW(Din, chi, DaggerNo);
|
||||
@ -101,7 +101,7 @@ RealD DomainWallEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
template<class Impl>
|
||||
RealD DomainWallEOFAFermion<Impl>::Mdag(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->DW(psi, Din, DaggerYes);
|
||||
this->MeooeDag5D(Din, chi);
|
||||
|
@ -44,7 +44,7 @@ void DomainWallEOFAFermion<Impl>::M5D(const FermionField& psi, const FermionFiel
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -82,7 +82,7 @@ void DomainWallEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionF
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard()=psi.Checkerboard();
|
||||
|
||||
@ -118,7 +118,7 @@ void DomainWallEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionF
|
||||
template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInv(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -166,7 +166,7 @@ void DomainWallEOFAFermion<Impl>::MooeeInv(const FermionField& psi, FermionField
|
||||
template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInvDag(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
assert(psi.Checkerboard() == psi.Checkerboard());
|
||||
|
@ -55,8 +55,8 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
||||
|
@ -86,7 +86,7 @@ void DomainWallEOFAFermion<Impl>::MooeeInv(const FermionField& psi, FermionField
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (L^{\prime})^{-1}
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
@ -120,7 +120,7 @@ void DomainWallEOFAFermion<Impl>::MooeeInvDag(const FermionField& psi, FermionFi
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (U^{\prime})^{-dagger}
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
|
@ -55,7 +55,7 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::M5D(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd = Simd::Nsimd();
|
||||
@ -200,7 +200,7 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd = Simd::Nsimd();
|
||||
@ -533,8 +533,8 @@ template<class Impl>
|
||||
void DomainWallEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
||||
|
@ -96,10 +96,10 @@ public:
|
||||
virtual void MomentumSpacePropagator(FermionField &out,const FermionField &in,RealD _m) { assert(0);};
|
||||
|
||||
virtual void FreePropagator(const FermionField &in,FermionField &out,RealD mass) {
|
||||
FFT theFFT((GridCartesian *) in._grid);
|
||||
FFT theFFT((GridCartesian *) in.Grid());
|
||||
|
||||
FermionField in_k(in._grid);
|
||||
FermionField prop_k(in._grid);
|
||||
FermionField in_k(in.Grid());
|
||||
FermionField prop_k(in.Grid());
|
||||
|
||||
theFFT.FFT_all_dim(in_k,in,FFT::forward);
|
||||
this->MomentumSpacePropagator(prop_k,in_k,mass);
|
||||
|
@ -230,8 +230,8 @@ public:
|
||||
{
|
||||
typedef typename Simd::scalar_type scalar_type;
|
||||
|
||||
conformable(Uds._grid, GaugeGrid);
|
||||
conformable(Umu._grid, GaugeGrid);
|
||||
conformable(Uds.Grid(), GaugeGrid);
|
||||
conformable(Umu.Grid(), GaugeGrid);
|
||||
|
||||
GaugeLinkField U(GaugeGrid);
|
||||
GaugeLinkField tmp(GaugeGrid);
|
||||
@ -257,18 +257,18 @@ public:
|
||||
}
|
||||
|
||||
inline void InsertForce4D(GaugeField &mat, FermionField &Btilde, FermionField &A,int mu){
|
||||
GaugeLinkField link(mat._grid);
|
||||
GaugeLinkField link(mat.Grid());
|
||||
link = TraceIndex<SpinIndex>(outerProduct(Btilde,A));
|
||||
PokeIndex<LorentzIndex>(mat,link,mu);
|
||||
}
|
||||
|
||||
inline void InsertForce5D(GaugeField &mat, FermionField &Btilde, FermionField Ã,int mu){
|
||||
|
||||
int Ls=Btilde._grid->_fdimensions[0];
|
||||
GaugeLinkField tmp(mat._grid);
|
||||
int Ls=Btilde.Grid()->_fdimensions[0];
|
||||
GaugeLinkField tmp(mat.Grid());
|
||||
tmp = zero;
|
||||
|
||||
parallel_for(int sss=0;sss<tmp._grid->oSites();sss++){
|
||||
parallel_for(int sss=0;sss<tmp.Grid()->oSites();sss++){
|
||||
int sU=sss;
|
||||
for(int s=0;s<Ls;s++){
|
||||
int sF = s+Ls*sU;
|
||||
@ -365,8 +365,8 @@ public:
|
||||
SiteScalarGaugeField ScalarUmu;
|
||||
SiteDoubledGaugeField ScalarUds;
|
||||
|
||||
GaugeLinkField U(Umu._grid);
|
||||
GaugeField Uadj(Umu._grid);
|
||||
GaugeLinkField U(Umu.Grid());
|
||||
GaugeField Uadj(Umu.Grid());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
U = PeekIndex<LorentzIndex>(Umu, mu);
|
||||
U = adj(Cshift(U, mu, -1));
|
||||
@ -399,10 +399,10 @@ public:
|
||||
// missing put lane...
|
||||
/*
|
||||
typedef decltype(traceIndex<SpinIndex>(outerProduct(Btilde[0], Atilde[0]))) result_type;
|
||||
unsigned int LLs = Btilde._grid->_rdimensions[0];
|
||||
conformable(Atilde._grid,Btilde._grid);
|
||||
GridBase* grid = mat._grid;
|
||||
GridBase* Bgrid = Btilde._grid;
|
||||
unsigned int LLs = Btilde.Grid()->_rdimensions[0];
|
||||
conformable(Atilde.Grid(),Btilde.Grid());
|
||||
GridBase* grid = mat.Grid();
|
||||
GridBase* Bgrid = Btilde.Grid();
|
||||
unsigned int dimU = grid->Nd();
|
||||
unsigned int dimF = Bgrid->Nd();
|
||||
GaugeLinkField tmp(grid);
|
||||
@ -416,7 +416,7 @@ public:
|
||||
for (int so = 0; so < grid->oSites(); so++) {
|
||||
std::vector<typename result_type::scalar_object> vres(Bgrid->Nsimd());
|
||||
std::vector<int> ocoor; grid->oCoorFromOindex(ocoor,so);
|
||||
for (int si = 0; si < tmp._grid->iSites(); si++){
|
||||
for (int si = 0; si < tmp.Grid()->iSites(); si++){
|
||||
typename result_type::scalar_object scalar_object; scalar_object = zero;
|
||||
std::vector<int> local_coor;
|
||||
std::vector<int> icoor; grid->iCoorFromIindex(icoor,si);
|
||||
@ -496,14 +496,14 @@ public:
|
||||
vobj vtmp;
|
||||
sobj stmp;
|
||||
|
||||
GridBase *grid = St._grid;
|
||||
GridBase *grid = St.Grid();
|
||||
|
||||
const int Nsimd = grid->Nsimd();
|
||||
|
||||
int direction = St._directions[mu];
|
||||
int distance = St._distances[mu];
|
||||
int ptype = St._permute_type[mu];
|
||||
int sl = St._grid->_simd_layout[direction];
|
||||
int sl = St.Grid()->_simd_layout[direction];
|
||||
|
||||
// Fixme X.Y.Z.T hardcode in stencil
|
||||
int mmu = mu % Nd;
|
||||
@ -569,8 +569,8 @@ public:
|
||||
|
||||
inline void DoubleStore(GridBase *GaugeGrid,DoubledGaugeField &Uds,const GaugeField &Umu)
|
||||
{
|
||||
conformable(Uds._grid,GaugeGrid);
|
||||
conformable(Umu._grid,GaugeGrid);
|
||||
conformable(Uds.Grid(),GaugeGrid);
|
||||
conformable(Umu.Grid(),GaugeGrid);
|
||||
|
||||
GaugeLinkField Utmp (GaugeGrid);
|
||||
GaugeLinkField U (GaugeGrid);
|
||||
@ -624,7 +624,7 @@ public:
|
||||
inline void InsertForce4D(GaugeField &mat, FermionField &Btilde, FermionField &A, int mu) {
|
||||
|
||||
// DhopDir provides U or Uconj depending on coor/flavour.
|
||||
GaugeLinkField link(mat._grid);
|
||||
GaugeLinkField link(mat.Grid());
|
||||
// use lorentz for flavour as hack.
|
||||
auto tmp = TraceIndex<SpinIndex>(outerProduct(Btilde, A));
|
||||
parallel_for(auto ss = tmp.begin(); ss < tmp.end(); ss++) {
|
||||
@ -636,11 +636,11 @@ public:
|
||||
|
||||
inline void InsertForce5D(GaugeField &mat, FermionField &Btilde, FermionField Ã, int mu) {
|
||||
|
||||
int Ls = Btilde._grid->_fdimensions[0];
|
||||
int Ls = Btilde.Grid()->_fdimensions[0];
|
||||
|
||||
GaugeLinkField tmp(mat._grid);
|
||||
GaugeLinkField tmp(mat.Grid());
|
||||
tmp = zero;
|
||||
parallel_for(int ss = 0; ss < tmp._grid->oSites(); ss++) {
|
||||
parallel_for(int ss = 0; ss < tmp.Grid()->oSites(); ss++) {
|
||||
for (int s = 0; s < Ls; s++) {
|
||||
int sF = s + Ls * ss;
|
||||
auto ttmp = traceIndex<SpinIndex>(outerProduct(Btilde[sF], Atilde[sF]));
|
||||
@ -718,9 +718,9 @@ public:
|
||||
DoubledGaugeField &Uds,
|
||||
const GaugeField &Uthin,
|
||||
const GaugeField &Ufat) {
|
||||
conformable(Uds._grid, GaugeGrid);
|
||||
conformable(Uthin._grid, GaugeGrid);
|
||||
conformable(Ufat._grid, GaugeGrid);
|
||||
conformable(Uds.Grid(), GaugeGrid);
|
||||
conformable(Uthin.Grid(), GaugeGrid);
|
||||
conformable(Ufat.Grid(), GaugeGrid);
|
||||
GaugeLinkField U(GaugeGrid);
|
||||
GaugeLinkField UU(GaugeGrid);
|
||||
GaugeLinkField UUU(GaugeGrid);
|
||||
@ -771,7 +771,7 @@ public:
|
||||
}
|
||||
|
||||
inline void InsertForce4D(GaugeField &mat, FermionField &Btilde, FermionField &A,int mu){
|
||||
GaugeLinkField link(mat._grid);
|
||||
GaugeLinkField link(mat.Grid());
|
||||
link = TraceIndex<SpinIndex>(outerProduct(Btilde,A));
|
||||
PokeIndex<LorentzIndex>(mat,link,mu);
|
||||
}
|
||||
@ -864,8 +864,8 @@ public:
|
||||
const GaugeField &Ufat)
|
||||
{
|
||||
|
||||
GridBase * InputGrid = Uthin._grid;
|
||||
conformable(InputGrid,Ufat._grid);
|
||||
GridBase * InputGrid = Uthin.Grid();
|
||||
conformable(InputGrid,Ufat.Grid());
|
||||
|
||||
GaugeLinkField U(InputGrid);
|
||||
GaugeLinkField UU(InputGrid);
|
||||
|
@ -238,8 +238,8 @@ void ImprovedStaggeredFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGauge
|
||||
|
||||
Compressor compressor;
|
||||
|
||||
FermionField Btilde(B._grid);
|
||||
FermionField Atilde(B._grid);
|
||||
FermionField Btilde(B.Grid());
|
||||
FermionField Atilde(B.Grid());
|
||||
Atilde = A;
|
||||
|
||||
st.HaloExchange(B, compressor);
|
||||
@ -249,7 +249,7 @@ void ImprovedStaggeredFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGauge
|
||||
////////////////////////
|
||||
// Call the single hop
|
||||
////////////////////////
|
||||
thread_loop( (int sss = 0; sss < B._grid->oSites(); sss++), {
|
||||
thread_loop( (int sss = 0; sss < B.Grid()->oSites(); sss++), {
|
||||
Kernels::DhopDirK(st, U, UUU, st.CommBuf(), sss, sss, B, Btilde, mu,1);
|
||||
});
|
||||
|
||||
@ -281,9 +281,9 @@ void ImprovedStaggeredFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGauge
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
|
||||
conformable(U._grid, _grid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _grid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
mat.Checkerboard() = U.Checkerboard();
|
||||
|
||||
@ -293,9 +293,9 @@ void ImprovedStaggeredFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionFie
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
assert(V.Checkerboard() == Even);
|
||||
assert(U.Checkerboard() == Odd);
|
||||
@ -307,9 +307,9 @@ void ImprovedStaggeredFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionF
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
assert(V.Checkerboard() == Odd);
|
||||
assert(U.Checkerboard() == Even);
|
||||
@ -320,8 +320,8 @@ void ImprovedStaggeredFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionF
|
||||
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::Dhop(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _grid); // verifies full grid
|
||||
conformable(in._grid, out._grid);
|
||||
conformable(in.Grid(), _grid); // verifies full grid
|
||||
conformable(in.Grid(), out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
@ -330,8 +330,8 @@ void ImprovedStaggeredFermion<Impl>::Dhop(const FermionField &in, FermionField &
|
||||
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopOE(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -341,8 +341,8 @@ void ImprovedStaggeredFermion<Impl>::DhopOE(const FermionField &in, FermionField
|
||||
|
||||
template <class Impl>
|
||||
void ImprovedStaggeredFermion<Impl>::DhopEO(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -361,7 +361,7 @@ void ImprovedStaggeredFermion<Impl>::DhopDir(const FermionField &in, FermionFiel
|
||||
Compressor compressor;
|
||||
Stencil.HaloExchange(in, compressor);
|
||||
|
||||
thread_loop( (int sss = 0; sss < in._grid->oSites(); sss++) , {
|
||||
thread_loop( (int sss = 0; sss < in.Grid()->oSites(); sss++) , {
|
||||
Kernels::DhopDirK(Stencil, Umu, UUUmu, Stencil.CommBuf(), sss, sss, in, out, dir, disp);
|
||||
});
|
||||
};
|
||||
@ -378,11 +378,11 @@ void ImprovedStaggeredFermion<Impl>::DhopInternal(StencilImpl &st, LebesgueOrder
|
||||
st.HaloExchange(in, compressor);
|
||||
|
||||
if (dag == DaggerYes) {
|
||||
thread_loop( (int sss = 0; sss < in._grid->oSites(); sss++), {
|
||||
thread_loop( (int sss = 0; sss < in.Grid()->oSites(); sss++), {
|
||||
Kernels::DhopSiteDag(st, lo, U, UUU, st.CommBuf(), 1, sss, in, out);
|
||||
});
|
||||
} else {
|
||||
thread_loop( (int sss = 0; sss < in._grid->oSites(); sss++), {
|
||||
thread_loop( (int sss = 0; sss < in.Grid()->oSites(); sss++), {
|
||||
Kernels::DhopSite(st, lo, U, UUU, st.CommBuf(), 1, sss, in, out);
|
||||
});
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ void ImprovedStaggeredFermion5D<Impl>::DhopDir(const FermionField &in, FermionFi
|
||||
Compressor compressor;
|
||||
Stencil.HaloExchange(in,compressor);
|
||||
|
||||
parallel_for(int ss=0;ss<Umu._grid->oSites();ss++){
|
||||
parallel_for(int ss=0;ss<Umu.Grid()->oSites();ss++){
|
||||
for(int s=0;s<Ls;s++){
|
||||
int sU=ss;
|
||||
int sF = s+Ls*sU;
|
||||
@ -228,7 +228,7 @@ void ImprovedStaggeredFermion5D<Impl>::DhopInternal(StencilImpl & st, LebesgueOr
|
||||
const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
Compressor compressor;
|
||||
int LLs = in._grid->_rdimensions[0];
|
||||
int LLs = in.Grid()->_rdimensions[0];
|
||||
|
||||
|
||||
|
||||
@ -240,12 +240,12 @@ void ImprovedStaggeredFermion5D<Impl>::DhopInternal(StencilImpl & st, LebesgueOr
|
||||
DhopComputeTime -= usecond();
|
||||
// Dhop takes the 4d grid from U, and makes a 5d index for fermion
|
||||
if (dag == DaggerYes) {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU=ss;
|
||||
Kernels::DhopSiteDag(st, lo, U, UUU, st.CommBuf(), LLs, sU,in, out);
|
||||
}
|
||||
} else {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU=ss;
|
||||
Kernels::DhopSite(st,lo,U,UUU,st.CommBuf(),LLs,sU,in,out);
|
||||
}
|
||||
@ -259,8 +259,8 @@ template<class Impl>
|
||||
void ImprovedStaggeredFermion5D<Impl>::DhopOE(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=1;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -271,8 +271,8 @@ template<class Impl>
|
||||
void ImprovedStaggeredFermion5D<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=1;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -283,8 +283,8 @@ template<class Impl>
|
||||
void ImprovedStaggeredFermion5D<Impl>::Dhop(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=2;
|
||||
conformable(in._grid,FermionGrid()); // verifies full grid
|
||||
conformable(in._grid,out._grid);
|
||||
conformable(in.Grid(),FermionGrid()); // verifies full grid
|
||||
conformable(in.Grid(),out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
|
@ -167,7 +167,7 @@ void MobiusEOFAFermion<Impl>::DtildeInv(const FermionField& psi, FermionField& c
|
||||
template<class Impl>
|
||||
RealD MobiusEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->Meooe5D(psi, Din);
|
||||
this->DW(Din, chi, DaggerNo);
|
||||
@ -179,7 +179,7 @@ RealD MobiusEOFAFermion<Impl>::M(const FermionField& psi, FermionField& chi)
|
||||
template<class Impl>
|
||||
RealD MobiusEOFAFermion<Impl>::Mdag(const FermionField& psi, FermionField& chi)
|
||||
{
|
||||
FermionField Din(psi._grid);
|
||||
FermionField Din(psi.Grid());
|
||||
|
||||
this->DW(psi, Din, DaggerYes);
|
||||
this->MeooeDag5D(Din, chi);
|
||||
|
@ -41,7 +41,7 @@ void MobiusEOFAFermion<Impl>::M5D(const FermionField &psi, const FermionField &p
|
||||
std::vector<Coeff_t> &lower, std::vector<Coeff_t> &diag, std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -82,7 +82,7 @@ void MobiusEOFAFermion<Impl>::M5D_shift(const FermionField &psi, const FermionFi
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int shift_s = (this->pm == 1) ? (Ls-1) : 0; // s-component modified by shift operator
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -124,7 +124,7 @@ void MobiusEOFAFermion<Impl>::M5Ddag(const FermionField &psi, const FermionField
|
||||
std::vector<Coeff_t> &lower, std::vector<Coeff_t> &diag, std::vector<Coeff_t> &upper)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -165,7 +165,7 @@ void MobiusEOFAFermion<Impl>::M5Ddag_shift(const FermionField &psi, const Fermio
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int shift_s = (this->pm == 1) ? (Ls-1) : 0; // s-component modified by shift operator
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
|
||||
assert(phi.Checkerboard() == psi.Checkerboard());
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -208,7 +208,7 @@ void MobiusEOFAFermion<Impl>::MooeeInv(const FermionField &psi, FermionField &ch
|
||||
{
|
||||
if(this->shift != 0.0){ MooeeInv_shift(psi,chi); return; }
|
||||
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -253,7 +253,7 @@ void MobiusEOFAFermion<Impl>::MooeeInv(const FermionField &psi, FermionField &ch
|
||||
template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInv_shift(const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -310,7 +310,7 @@ void MobiusEOFAFermion<Impl>::MooeeInvDag(const FermionField &psi, FermionField
|
||||
{
|
||||
if(this->shift != 0.0){ MooeeInvDag_shift(psi,chi); return; }
|
||||
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
@ -355,7 +355,7 @@ void MobiusEOFAFermion<Impl>::MooeeInvDag(const FermionField &psi, FermionField
|
||||
template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInvDag_shift(const FermionField &psi, FermionField &chi)
|
||||
{
|
||||
GridBase *grid = psi._grid;
|
||||
GridBase *grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
@ -67,8 +67,8 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
int pm = this->pm;
|
||||
RealD shift = this->shift;
|
||||
|
@ -165,7 +165,7 @@ void MobiusEOFAFermion<Impl>::MooeeInv_shift(const FermionField& psi, FermionFie
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (L^{\prime})^{-1}
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
@ -237,7 +237,7 @@ void MobiusEOFAFermion<Impl>::MooeeInvDag_shift(const FermionField& psi, Fermion
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
// Apply (U^{\prime})^{-dagger} and accumulate (MooeeInvDag_shift_lc)_{j} \psi_{j} in tmp[0]
|
||||
axpby_ssp(chi, one, psi, czero, psi, 0, 0); // chi[0]=psi[0]
|
||||
|
@ -66,7 +66,7 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::M5D(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd = Simd::Nsimd();
|
||||
@ -226,7 +226,7 @@ void MobiusEOFAFermion<Impl>::M5D_shift(const FermionField& psi, const FermionFi
|
||||
|
||||
#else
|
||||
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
const int nsimd = Simd::Nsimd();
|
||||
@ -392,7 +392,7 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::M5Ddag(const FermionField& psi, const FermionField& phi,
|
||||
FermionField& chi, std::vector<Coeff_t>& lower, std::vector<Coeff_t>& diag, std::vector<Coeff_t>& upper)
|
||||
{
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd = Simd::Nsimd();
|
||||
@ -549,7 +549,7 @@ void MobiusEOFAFermion<Impl>::M5Ddag_shift(const FermionField& psi, const Fermio
|
||||
|
||||
#else
|
||||
|
||||
GridBase* grid = psi._grid;
|
||||
GridBase* grid = psi.Grid();
|
||||
int Ls = this->Ls;
|
||||
int LLs = grid->_rdimensions[0];
|
||||
int nsimd = Simd::Nsimd();
|
||||
@ -910,8 +910,8 @@ template<class Impl>
|
||||
void MobiusEOFAFermion<Impl>::MooeeInternal(const FermionField& psi, FermionField& chi, int dag, int inv)
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
int LLs = psi._grid->_rdimensions[0];
|
||||
int vol = psi._grid->oSites()/LLs;
|
||||
int LLs = psi.Grid()->_rdimensions[0];
|
||||
int vol = psi.Grid()->oSites()/LLs;
|
||||
|
||||
chi.Checkerboard() = psi.Checkerboard();
|
||||
|
||||
|
@ -105,7 +105,7 @@ void PartialFractionFermion5D<Impl>::MooeeInv_internal(const FermionField &psi
|
||||
int sign = dag ? (-1) : 1;
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField tmp(psi._grid);
|
||||
FermionField tmp(psi.Grid());
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//Linv
|
||||
@ -164,7 +164,7 @@ void PartialFractionFermion5D<Impl>::MooeeInv_internal(const FermionField &psi
|
||||
template<class Impl>
|
||||
void PartialFractionFermion5D<Impl>::M_internal(const FermionField &psi, FermionField &chi,int dag)
|
||||
{
|
||||
FermionField D(psi._grid);
|
||||
FermionField D(psi.Grid());
|
||||
|
||||
int Ls = this->Ls;
|
||||
int sign = dag ? (-1) : 1;
|
||||
@ -303,7 +303,7 @@ void PartialFractionFermion5D<Impl>::MDeriv (GaugeField &mat,const FermionField
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int nblock=(Ls-1)/2;
|
||||
for(int b=0;b<nblock;b++){
|
||||
@ -320,7 +320,7 @@ void PartialFractionFermion5D<Impl>::MoeDeriv(GaugeField &mat,const FermionField
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int nblock=(Ls-1)/2;
|
||||
for(int b=0;b<nblock;b++){
|
||||
@ -337,7 +337,7 @@ void PartialFractionFermion5D<Impl>::MeoDeriv(GaugeField &mat,const FermionField
|
||||
{
|
||||
int Ls = this->Ls;
|
||||
|
||||
FermionField D(V._grid);
|
||||
FermionField D(V.Grid());
|
||||
|
||||
int nblock=(Ls-1)/2;
|
||||
for(int b=0;b<nblock;b++){
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
|
||||
template<typename vobj>
|
||||
void sscale(const Lattice<vobj>& in, Lattice<vobj>& out, Coeff_t* s) {
|
||||
GridBase *grid=out._grid;
|
||||
GridBase *grid=out.Grid();
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
assert(grid->_simd_layout[0] == 1); // should be fine for ZMobius for now
|
||||
int Ls = grid->_rdimensions[0];
|
||||
@ -81,7 +81,7 @@ public:
|
||||
SchurDiagTwoKappaOperator (Matrix &Mat): _S(Mat), _Mat(Mat) {};
|
||||
|
||||
virtual RealD Mpc (const Field &in, Field &out) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
|
||||
_S.MInv(in,out);
|
||||
_Mat.Mpc(out,tmp);
|
||||
@ -89,7 +89,7 @@ public:
|
||||
|
||||
}
|
||||
virtual RealD MpcDag (const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
|
||||
_S.MDag(in,out);
|
||||
_Mat.MpcDag(out,tmp);
|
||||
|
@ -343,7 +343,7 @@ public:
|
||||
this->_grid->StencilBarrier();
|
||||
this->mpi3synctime_g+=usecond();
|
||||
|
||||
assert(source._grid==this->_grid);
|
||||
assert(source.Grid()==this->_grid);
|
||||
this->halogtime-=usecond();
|
||||
|
||||
this->u_comm_offset=0;
|
||||
|
@ -66,7 +66,7 @@ WilsonFermion<Impl>::WilsonFermion(GaugeField &_Umu, GridCartesian &Fgrid,
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::ImportGauge(const GaugeField &_Umu) {
|
||||
GaugeField HUmu(_Umu._grid);
|
||||
GaugeField HUmu(_Umu.Grid());
|
||||
HUmu = _Umu * (-0.5);
|
||||
Impl::DoubleStore(GaugeGrid(), Umu, HUmu);
|
||||
pickCheckerboard(Even, UmuEven, Umu);
|
||||
@ -141,7 +141,7 @@ void WilsonFermion<Impl>::MomentumSpacePropagator(FermionField &out, const Fermi
|
||||
typedef Lattice<iSinglet<vector_type> > LatComplex;
|
||||
|
||||
// what type LatticeComplex
|
||||
conformable(_grid,out._grid);
|
||||
conformable(_grid,out.Grid());
|
||||
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
@ -200,8 +200,8 @@ void WilsonFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGaugeField &U,
|
||||
|
||||
Compressor compressor(dag);
|
||||
|
||||
FermionField Btilde(B._grid);
|
||||
FermionField Atilde(B._grid);
|
||||
FermionField Btilde(B.Grid());
|
||||
FermionField Atilde(B.Grid());
|
||||
Atilde = A;
|
||||
|
||||
st.HaloExchange(B, compressor);
|
||||
@ -216,7 +216,7 @@ void WilsonFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGaugeField &U,
|
||||
////////////////////////
|
||||
// Call the single hop
|
||||
////////////////////////
|
||||
parallel_for (int sss = 0; sss < B._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < B.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopDirK(st, U, st.CommBuf(), sss, sss, B, Btilde, mu, gamma);
|
||||
}
|
||||
|
||||
@ -229,9 +229,9 @@ void WilsonFermion<Impl>::DerivInternal(StencilImpl &st, DoubledGaugeField &U,
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
conformable(U._grid, _grid);
|
||||
conformable(U._grid, V._grid);
|
||||
conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _grid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
conformable(U.Grid(), mat.Grid());
|
||||
|
||||
mat.Checkerboard() = U.Checkerboard();
|
||||
|
||||
@ -240,9 +240,9 @@ void WilsonFermion<Impl>::DhopDeriv(GaugeField &mat, const FermionField &U, cons
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
//conformable(U._grid, mat._grid); not general, leaving as a comment (Guido)
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
//conformable(U.Grid(), mat.Grid()); not general, leaving as a comment (Guido)
|
||||
// Motivation: look at the SchurDiff operator
|
||||
|
||||
assert(V.Checkerboard() == Even);
|
||||
@ -254,9 +254,9 @@ void WilsonFermion<Impl>::DhopDerivOE(GaugeField &mat, const FermionField &U, co
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionField &U, const FermionField &V, int dag) {
|
||||
conformable(U._grid, _cbgrid);
|
||||
conformable(U._grid, V._grid);
|
||||
//conformable(U._grid, mat._grid);
|
||||
conformable(U.Grid(), _cbgrid);
|
||||
conformable(U.Grid(), V.Grid());
|
||||
//conformable(U.Grid(), mat.Grid());
|
||||
|
||||
assert(V.Checkerboard() == Odd);
|
||||
assert(U.Checkerboard() == Even);
|
||||
@ -267,8 +267,8 @@ void WilsonFermion<Impl>::DhopDerivEO(GaugeField &mat, const FermionField &U, co
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::Dhop(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _grid); // verifies full grid
|
||||
conformable(in._grid, out._grid);
|
||||
conformable(in.Grid(), _grid); // verifies full grid
|
||||
conformable(in.Grid(), out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
@ -277,8 +277,8 @@ void WilsonFermion<Impl>::Dhop(const FermionField &in, FermionField &out, int da
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopOE(const FermionField &in, FermionField &out, int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -288,8 +288,8 @@ void WilsonFermion<Impl>::DhopOE(const FermionField &in, FermionField &out, int
|
||||
|
||||
template <class Impl>
|
||||
void WilsonFermion<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag) {
|
||||
conformable(in._grid, _cbgrid); // verifies half grid
|
||||
conformable(in._grid, out._grid); // drops the cb check
|
||||
conformable(in.Grid(), _cbgrid); // verifies half grid
|
||||
conformable(in.Grid(), out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard() == Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -317,7 +317,7 @@ void WilsonFermion<Impl>::DhopDirDisp(const FermionField &in, FermionField &out,
|
||||
|
||||
Stencil.HaloExchange(in, compressor);
|
||||
|
||||
parallel_for (int sss = 0; sss < in._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < in.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopDirK(Stencil, Umu, Stencil.CommBuf(), sss, sss, in, out, dirdisp, gamma);
|
||||
}
|
||||
};
|
||||
@ -333,11 +333,11 @@ void WilsonFermion<Impl>::DhopInternal(StencilImpl &st, LebesgueOrder &lo,
|
||||
st.HaloExchange(in, compressor);
|
||||
|
||||
if (dag == DaggerYes) {
|
||||
parallel_for (int sss = 0; sss < in._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < in.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopSiteDag(st, lo, U, st.CommBuf(), sss, sss, 1, 1, in, out);
|
||||
}
|
||||
} else {
|
||||
parallel_for (int sss = 0; sss < in._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < in.Grid()->oSites(); sss++) {
|
||||
Kernels::DhopSite(st, lo, U, st.CommBuf(), sss, sss, 1, 1, in, out);
|
||||
}
|
||||
}
|
||||
@ -356,9 +356,9 @@ void WilsonFermion<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
unsigned int mu)
|
||||
{
|
||||
Gamma g5(Gamma::Algebra::Gamma5);
|
||||
conformable(_grid, q_in_1._grid);
|
||||
conformable(_grid, q_in_2._grid);
|
||||
conformable(_grid, q_out._grid);
|
||||
conformable(_grid, q_in_1.Grid());
|
||||
conformable(_grid, q_in_2.Grid());
|
||||
conformable(_grid, q_out.Grid());
|
||||
PropagatorField tmp1(_grid), tmp2(_grid);
|
||||
q_out = zero;
|
||||
|
||||
@ -366,7 +366,7 @@ void WilsonFermion<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
// Inefficient comms method but not performance critical.
|
||||
tmp1 = Cshift(q_in_1, mu, 1);
|
||||
tmp2 = Cshift(q_in_2, mu, 1);
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
Kernels::ContractConservedCurrentSiteFwd(tmp1[sU],
|
||||
q_in_2[sU],
|
||||
@ -388,8 +388,8 @@ void WilsonFermion<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
unsigned int tmin,
|
||||
unsigned int tmax)
|
||||
{
|
||||
conformable(_grid, q_in._grid);
|
||||
conformable(_grid, q_out._grid);
|
||||
conformable(_grid, q_in.Grid());
|
||||
conformable(_grid, q_out.Grid());
|
||||
Lattice<iSinglet<Simd>> ph(_grid), coor(_grid);
|
||||
Complex i(0.0,1.0);
|
||||
PropagatorField tmpFwd(_grid), tmpBwd(_grid), tmp(_grid);
|
||||
@ -415,7 +415,7 @@ void WilsonFermion<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
tmp = ph*q_in;
|
||||
tmpBwd = Cshift(tmp, mu, -1);
|
||||
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
// Compute the sequential conserved current insertion only if our simd
|
||||
// object contains a timeslice we need.
|
||||
|
@ -219,7 +219,7 @@ void WilsonFermion5D<Impl>::ZeroCounters(void) {
|
||||
template<class Impl>
|
||||
void WilsonFermion5D<Impl>::ImportGauge(const GaugeField &_Umu)
|
||||
{
|
||||
GaugeField HUmu(_Umu._grid);
|
||||
GaugeField HUmu(_Umu.Grid());
|
||||
HUmu = _Umu*(-0.5);
|
||||
Impl::DoubleStore(GaugeGrid(),Umu,HUmu);
|
||||
pickCheckerboard(Even,UmuEven,Umu);
|
||||
@ -244,7 +244,7 @@ void WilsonFermion5D<Impl>::DhopDir(const FermionField &in, FermionField &out,in
|
||||
assert(dirdisp<=7);
|
||||
assert(dirdisp>=0);
|
||||
|
||||
parallel_for(int ss=0;ss<Umu._grid->oSites();ss++){
|
||||
parallel_for(int ss=0;ss<Umu.Grid()->oSites();ss++){
|
||||
for(int s=0;s<Ls;s++){
|
||||
int sU=ss;
|
||||
int sF = s+Ls*sU;
|
||||
@ -264,20 +264,20 @@ void WilsonFermion5D<Impl>::DerivInternal(StencilImpl & st,
|
||||
DerivCalls++;
|
||||
assert((dag==DaggerNo) ||(dag==DaggerYes));
|
||||
|
||||
conformable(st._grid,A._grid);
|
||||
conformable(st._grid,B._grid);
|
||||
conformable(st.Grid(),A.Grid());
|
||||
conformable(st.Grid(),B.Grid());
|
||||
|
||||
Compressor compressor(dag);
|
||||
|
||||
FermionField Btilde(B._grid);
|
||||
FermionField Atilde(B._grid);
|
||||
FermionField Btilde(B.Grid());
|
||||
FermionField Atilde(B.Grid());
|
||||
|
||||
DerivCommTime-=usecond();
|
||||
st.HaloExchange(B,compressor);
|
||||
DerivCommTime+=usecond();
|
||||
|
||||
Atilde=A;
|
||||
int LLs = B._grid->_rdimensions[0];
|
||||
int LLs = B.Grid()->_rdimensions[0];
|
||||
|
||||
|
||||
DerivComputeTime-=usecond();
|
||||
@ -293,13 +293,13 @@ void WilsonFermion5D<Impl>::DerivInternal(StencilImpl & st,
|
||||
////////////////////////
|
||||
|
||||
DerivDhopComputeTime -= usecond();
|
||||
parallel_for (int sss = 0; sss < U._grid->oSites(); sss++) {
|
||||
parallel_for (int sss = 0; sss < U.Grid()->oSites(); sss++) {
|
||||
for (int s = 0; s < Ls; s++) {
|
||||
int sU = sss;
|
||||
int sF = s + Ls * sU;
|
||||
|
||||
assert(sF < B._grid->oSites());
|
||||
assert(sU < U._grid->oSites());
|
||||
assert(sF < B.Grid()->oSites());
|
||||
assert(sU < U.Grid()->oSites());
|
||||
|
||||
Kernels::DhopDirK(st, U, st.CommBuf(), sF, sU, B, Btilde, mu, gamma);
|
||||
|
||||
@ -323,10 +323,10 @@ void WilsonFermion5D<Impl>::DhopDeriv(GaugeField &mat,
|
||||
const FermionField &B,
|
||||
int dag)
|
||||
{
|
||||
conformable(A._grid,FermionGrid());
|
||||
conformable(A._grid,B._grid);
|
||||
conformable(A.Grid(),FermionGrid());
|
||||
conformable(A.Grid(),B.Grid());
|
||||
|
||||
//conformable(GaugeGrid(),mat._grid);// this is not general! leaving as a comment
|
||||
//conformable(GaugeGrid(),mat.Grid());// this is not general! leaving as a comment
|
||||
|
||||
mat.Checkerboard() = A.Checkerboard();
|
||||
|
||||
@ -339,8 +339,8 @@ void WilsonFermion5D<Impl>::DhopDerivEO(GaugeField &mat,
|
||||
const FermionField &B,
|
||||
int dag)
|
||||
{
|
||||
conformable(A._grid,FermionRedBlackGrid());
|
||||
conformable(A._grid,B._grid);
|
||||
conformable(A.Grid(),FermionRedBlackGrid());
|
||||
conformable(A.Grid(),B.Grid());
|
||||
|
||||
assert(B.Checkerboard()==Odd);
|
||||
assert(A.Checkerboard()==Even);
|
||||
@ -356,8 +356,8 @@ void WilsonFermion5D<Impl>::DhopDerivOE(GaugeField &mat,
|
||||
const FermionField &B,
|
||||
int dag)
|
||||
{
|
||||
conformable(A._grid,FermionRedBlackGrid());
|
||||
conformable(A._grid,B._grid);
|
||||
conformable(A.Grid(),FermionRedBlackGrid());
|
||||
conformable(A.Grid(),B.Grid());
|
||||
|
||||
assert(B.Checkerboard()==Even);
|
||||
assert(A.Checkerboard()==Odd);
|
||||
@ -392,8 +392,8 @@ void WilsonFermion5D<Impl>::DhopInternalOverlappedComms(StencilImpl & st, Lebesg
|
||||
|
||||
Compressor compressor(dag);
|
||||
|
||||
int LLs = in._grid->_rdimensions[0];
|
||||
int len = U._grid->oSites();
|
||||
int LLs = in.Grid()->_rdimensions[0];
|
||||
int len = U.Grid()->oSites();
|
||||
|
||||
DhopFaceTime-=usecond();
|
||||
st.HaloExchangeOptGather(in,compressor);
|
||||
@ -417,7 +417,7 @@ void WilsonFermion5D<Impl>::DhopInternalOverlappedComms(StencilImpl & st, Lebesg
|
||||
double start = usecond();
|
||||
nthreads -= ncomms;
|
||||
int ttid = tid - ncomms;
|
||||
int n = U._grid->oSites();
|
||||
int n = U.Grid()->oSites();
|
||||
int chunk = n / nthreads;
|
||||
int rem = n % nthreads;
|
||||
int myblock, myn;
|
||||
@ -492,7 +492,7 @@ void WilsonFermion5D<Impl>::DhopInternalSerialComms(StencilImpl & st, LebesgueOr
|
||||
// assert((dag==DaggerNo) ||(dag==DaggerYes));
|
||||
Compressor compressor(dag);
|
||||
|
||||
int LLs = in._grid->_rdimensions[0];
|
||||
int LLs = in.Grid()->_rdimensions[0];
|
||||
|
||||
DhopCommTime-=usecond();
|
||||
st.HaloExchangeOpt(in,compressor);
|
||||
@ -502,13 +502,13 @@ void WilsonFermion5D<Impl>::DhopInternalSerialComms(StencilImpl & st, LebesgueOr
|
||||
// Dhop takes the 4d grid from U, and makes a 5d index for fermion
|
||||
|
||||
if (dag == DaggerYes) {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU = ss;
|
||||
int sF = LLs * sU;
|
||||
Kernels::DhopSiteDag(st,lo,U,st.CommBuf(),sF,sU,LLs,1,in,out);
|
||||
}
|
||||
} else {
|
||||
parallel_for (int ss = 0; ss < U._grid->oSites(); ss++) {
|
||||
parallel_for (int ss = 0; ss < U.Grid()->oSites(); ss++) {
|
||||
int sU = ss;
|
||||
int sF = LLs * sU;
|
||||
Kernels::DhopSite(st,lo,U,st.CommBuf(),sF,sU,LLs,1,in,out);
|
||||
@ -522,8 +522,8 @@ template<class Impl>
|
||||
void WilsonFermion5D<Impl>::DhopOE(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls++;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Even);
|
||||
out.Checkerboard() = Odd;
|
||||
@ -534,8 +534,8 @@ template<class Impl>
|
||||
void WilsonFermion5D<Impl>::DhopEO(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls++;
|
||||
conformable(in._grid,FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in._grid,out._grid); // drops the cb check
|
||||
conformable(in.Grid(),FermionRedBlackGrid()); // verifies half grid
|
||||
conformable(in.Grid(),out.Grid()); // drops the cb check
|
||||
|
||||
assert(in.Checkerboard()==Odd);
|
||||
out.Checkerboard() = Even;
|
||||
@ -546,8 +546,8 @@ template<class Impl>
|
||||
void WilsonFermion5D<Impl>::Dhop(const FermionField &in, FermionField &out,int dag)
|
||||
{
|
||||
DhopCalls+=2;
|
||||
conformable(in._grid,FermionGrid()); // verifies full grid
|
||||
conformable(in._grid,out._grid);
|
||||
conformable(in.Grid(),FermionGrid()); // verifies full grid
|
||||
conformable(in.Grid(),out.Grid());
|
||||
|
||||
out.Checkerboard() = in.Checkerboard();
|
||||
|
||||
@ -566,7 +566,7 @@ void WilsonFermion5D<Impl>::MomentumSpacePropagatorHt(FermionField &out,const Fe
|
||||
{
|
||||
// what type LatticeComplex
|
||||
GridBase *_grid = _FourDimGrid;
|
||||
conformable(_grid,out._grid);
|
||||
conformable(_grid,out.Grid());
|
||||
|
||||
typedef typename FermionField::vector_type vector_type;
|
||||
typedef typename FermionField::scalar_type ScalComplex;
|
||||
@ -651,7 +651,7 @@ void WilsonFermion5D<Impl>::MomentumSpacePropagatorHw(FermionField &out,const Fe
|
||||
};
|
||||
|
||||
GridBase *_grid = _FourDimGrid;
|
||||
conformable(_grid,out._grid);
|
||||
conformable(_grid,out.Grid());
|
||||
|
||||
typedef typename FermionField::vector_type vector_type;
|
||||
typedef typename FermionField::scalar_type ScalComplex;
|
||||
@ -728,18 +728,18 @@ void WilsonFermion5D<Impl>::ContractConservedCurrent(PropagatorField &q_in_1,
|
||||
Current curr_type,
|
||||
unsigned int mu)
|
||||
{
|
||||
conformable(q_in_1._grid, FermionGrid());
|
||||
conformable(q_in_1._grid, q_in_2._grid);
|
||||
conformable(_FourDimGrid, q_out._grid);
|
||||
conformable(q_in_1.Grid(), FermionGrid());
|
||||
conformable(q_in_1.Grid(), q_in_2.Grid());
|
||||
conformable(_FourDimGrid, q_out.Grid());
|
||||
PropagatorField tmp1(FermionGrid()), tmp2(FermionGrid());
|
||||
unsigned int LLs = q_in_1._grid->_rdimensions[0];
|
||||
unsigned int LLs = q_in_1.Grid()->_rdimensions[0];
|
||||
q_out = zero;
|
||||
|
||||
// Forward, need q1(x + mu, s), q2(x, Ls - 1 - s). Backward, need q1(x, s),
|
||||
// q2(x + mu, Ls - 1 - s). 5D lattice so shift 4D coordinate mu by one.
|
||||
tmp1 = Cshift(q_in_1, mu + 1, 1);
|
||||
tmp2 = Cshift(q_in_2, mu + 1, 1);
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
unsigned int sF1 = sU * LLs;
|
||||
unsigned int sF2 = (sU + 1) * LLs - 1;
|
||||
@ -786,14 +786,14 @@ void WilsonFermion5D<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
unsigned int tmin,
|
||||
unsigned int tmax)
|
||||
{
|
||||
conformable(q_in._grid, FermionGrid());
|
||||
conformable(q_in._grid, q_out._grid);
|
||||
conformable(q_in.Grid(), FermionGrid());
|
||||
conformable(q_in.Grid(), q_out.Grid());
|
||||
Lattice<iSinglet<Simd>> ph(FermionGrid()), coor(FermionGrid());
|
||||
PropagatorField tmpFwd(FermionGrid()), tmpBwd(FermionGrid()),
|
||||
tmp(FermionGrid());
|
||||
Complex i(0.0, 1.0);
|
||||
unsigned int tshift = (mu == Tp) ? 1 : 0;
|
||||
unsigned int LLs = q_in._grid->_rdimensions[0];
|
||||
unsigned int LLs = q_in.Grid()->_rdimensions[0];
|
||||
unsigned int LLt = GridDefaultLatt()[Tp];
|
||||
|
||||
// Momentum projection.
|
||||
@ -817,7 +817,7 @@ void WilsonFermion5D<Impl>::SeqConservedCurrent(PropagatorField &q_in,
|
||||
tmp = ph*q_in;
|
||||
tmpBwd = Cshift(tmp, mu + 1, -1);
|
||||
|
||||
parallel_for (unsigned int sU = 0; sU < Umu._grid->oSites(); ++sU)
|
||||
parallel_for (unsigned int sU = 0; sU < Umu.Grid()->oSites(); ++sU)
|
||||
{
|
||||
// Compute the sequential conserved current insertion only if our simd
|
||||
// object contains a timeslice we need.
|
||||
|
@ -134,7 +134,7 @@
|
||||
|
||||
COMPLEX_SIGNS(isigns);
|
||||
MASK_REGS;
|
||||
int nmax=U._grid->oSites();
|
||||
int nmax=U.Grid()->oSites();
|
||||
for(int site=0;site<Ns;site++) {
|
||||
#ifndef EXTERIOR
|
||||
int sU =lo.Reorder(ssU);
|
||||
|
@ -92,7 +92,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
g = F; \
|
||||
direction = st._directions[DIR]; \
|
||||
distance = st._distances[DIR]; \
|
||||
sl = st._grid->_simd_layout[direction]; \
|
||||
sl = st.Grid()->_simd_layout[direction]; \
|
||||
inplace_twist = 0; \
|
||||
if(SE->_around_the_world && this->Params.twists[DIR % 4]){ \
|
||||
if(sl == 1){ \
|
||||
|
@ -45,12 +45,12 @@ public:
|
||||
HermOp(in,out);
|
||||
}
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdiag(in,tmp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdir(in,tmp,dir,disp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
@ -67,7 +67,7 @@ public:
|
||||
n2=real(dot);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.M(in,tmp);
|
||||
G5R5(out,tmp);
|
||||
}
|
||||
@ -87,12 +87,12 @@ public:
|
||||
HermOp(in,out);
|
||||
}
|
||||
void OpDiag (const Field &in, Field &out) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdiag(in,tmp);
|
||||
out=g5*tmp;
|
||||
}
|
||||
void OpDir (const Field &in, Field &out,int dir,int disp) {
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.Mdir(in,tmp,dir,disp);
|
||||
out=g5*tmp;
|
||||
}
|
||||
@ -109,7 +109,7 @@ public:
|
||||
n2=real(dot);
|
||||
}
|
||||
void HermOp(const Field &in, Field &out){
|
||||
Field tmp(in._grid);
|
||||
Field tmp(in.Grid());
|
||||
_Mat.M(in,tmp);
|
||||
out=g5*tmp;
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
// Move this elsewhere? FIXME
|
||||
static inline void AddLink(Field &U, LinkField &W,
|
||||
int mu) { // U[mu] += W
|
||||
thread_loop ( (auto ss = 0; ss < U._grid->oSites(); ss++),{
|
||||
thread_loop ( (auto ss = 0; ss < U.Grid()->oSites(); ss++),{
|
||||
U[ss]._internal[mu] =
|
||||
U[ss]._internal[mu] + W[ss]._internal;
|
||||
});
|
||||
@ -87,7 +87,7 @@ public:
|
||||
// HMC auxiliary functions
|
||||
static inline void generate_momenta(Field &P, GridParallelRNG &pRNG) {
|
||||
// specific for SU gauge fields
|
||||
LinkField Pmu(P._grid);
|
||||
LinkField Pmu(P.Grid());
|
||||
Pmu = zero;
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
SU<Nrepresentation>::GaussianFundamentalLieAlgebraMatrix(pRNG, Pmu);
|
||||
@ -101,7 +101,7 @@ public:
|
||||
//static std::chrono::duration<double> diff;
|
||||
|
||||
//auto start = std::chrono::high_resolution_clock::now();
|
||||
parallel_for(int ss=0;ss<P._grid->oSites();ss++){
|
||||
parallel_for(int ss=0;ss<P.Grid()->oSites();ss++){
|
||||
for (int mu = 0; mu < Nd; mu++)
|
||||
U[ss]._internal[mu] = ProjectOnGroup(Exponentiate(P[ss]._internal[mu], ep, Nexp) * U[ss]._internal[mu]);
|
||||
}
|
||||
@ -112,7 +112,7 @@ public:
|
||||
}
|
||||
|
||||
static inline RealD FieldSquareNorm(Field& U){
|
||||
LatticeComplex Hloc(U._grid);
|
||||
LatticeComplex Hloc(U.Grid());
|
||||
Hloc = zero;
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
auto Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
|
@ -96,7 +96,7 @@ public:
|
||||
|
||||
static inline GaugeLinkField
|
||||
CovShiftIdentityBackward(const GaugeLinkField &Link, int mu) {
|
||||
GridBase *grid = Link._grid;
|
||||
GridBase *grid = Link.Grid();
|
||||
int Lmu = grid->GlobalDimensions()[mu] - 1;
|
||||
|
||||
Lattice<iScalar<vInteger>> coor(grid);
|
||||
@ -113,7 +113,7 @@ public:
|
||||
}
|
||||
|
||||
static inline GaugeLinkField ShiftStaple(const GaugeLinkField &Link, int mu) {
|
||||
GridBase *grid = Link._grid;
|
||||
GridBase *grid = Link.Grid();
|
||||
int Lmu = grid->GlobalDimensions()[mu] - 1;
|
||||
|
||||
Lattice<iScalar<vInteger>> coor(grid);
|
||||
|
@ -86,10 +86,10 @@ Photon<Gimpl>::Photon(Gauge gauge, ZmScheme zmScheme)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::FreePropagator (const GaugeField &in,GaugeField &out)
|
||||
{
|
||||
FFT theFFT(in._grid);
|
||||
FFT theFFT(in.Grid());
|
||||
|
||||
GaugeField in_k(in._grid);
|
||||
GaugeField prop_k(in._grid);
|
||||
GaugeField in_k(in.Grid());
|
||||
GaugeField prop_k(in.Grid());
|
||||
|
||||
theFFT.FFT_all_dim(in_k,in,FFT::forward);
|
||||
MomentumSpacePropagator(prop_k,in_k);
|
||||
@ -99,7 +99,7 @@ void Photon<Gimpl>::FreePropagator (const GaugeField &in,GaugeField &out)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::invKHatSquared(GaugeLinkField &out)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
GaugeLinkField kmu(grid), one(grid);
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
std::vector<int> &l = grid->_fdimensions;
|
||||
@ -125,7 +125,7 @@ void Photon<Gimpl>::invKHatSquared(GaugeLinkField &out)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::zmSub(GaugeLinkField &out)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
|
||||
switch (zmScheme_)
|
||||
@ -163,7 +163,7 @@ template<class Gimpl>
|
||||
void Photon<Gimpl>::MomentumSpacePropagator(const GaugeField &in,
|
||||
GaugeField &out)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
LatticeComplex k2Inv(grid);
|
||||
|
||||
invKHatSquared(k2Inv);
|
||||
@ -175,7 +175,7 @@ void Photon<Gimpl>::MomentumSpacePropagator(const GaugeField &in,
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::StochasticWeight(GaugeLinkField &weight)
|
||||
{
|
||||
auto *grid = dynamic_cast<GridCartesian *>(weight._grid);
|
||||
auto *grid = dynamic_cast<GridCartesian *>(weight.Grid());
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
std::vector<int> latt_size = grid->_fdimensions;
|
||||
|
||||
@ -192,7 +192,7 @@ void Photon<Gimpl>::StochasticWeight(GaugeLinkField &weight)
|
||||
template<class Gimpl>
|
||||
void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng)
|
||||
{
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out._grid);
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out.Grid());
|
||||
GaugeLinkField weight(grid);
|
||||
|
||||
StochasticWeight(weight);
|
||||
@ -203,7 +203,7 @@ template<class Gimpl>
|
||||
void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||
const GaugeLinkField &weight)
|
||||
{
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out._grid);
|
||||
auto *grid = dynamic_cast<GridCartesian *>(out.Grid());
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
GaugeLinkField r(grid);
|
||||
GaugeField aTilde(grid);
|
||||
@ -226,7 +226,7 @@ void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||
//
|
||||
// FeynmanGaugeMomentumSpacePropagator_TL(out,in);
|
||||
//
|
||||
// GridBase *grid = out._grid;
|
||||
// GridBase *grid = out.Grid();
|
||||
// LatticeInteger coor(grid);
|
||||
// GaugeField zz(grid); zz=zero;
|
||||
//
|
||||
@ -243,7 +243,7 @@ void Photon<Gimpl>::StochasticField(GaugeField &out, GridParallelRNG &rng,
|
||||
// {
|
||||
//
|
||||
// // what type LatticeComplex
|
||||
// GridBase *grid = out._grid;
|
||||
// GridBase *grid = out.Grid();
|
||||
// int nd = grid->_ndimension;
|
||||
//
|
||||
// typedef typename GaugeField::vector_type vector_type;
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
|
||||
|
||||
virtual RealD S(const GaugeField &U) {
|
||||
RealD vol = U._grid->gSites();
|
||||
RealD vol = U.Grid()->gSites();
|
||||
|
||||
RealD plaq = WilsonLoops<Gimpl>::avgPlaquette(U);
|
||||
RealD rect = WilsonLoops<Gimpl>::avgRectangle(U);
|
||||
@ -76,7 +76,7 @@ public:
|
||||
RealD factor_p = c_plaq/RealD(Nc)*0.5;
|
||||
RealD factor_r = c_rect/RealD(Nc)*0.5;
|
||||
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeLinkField> U (Nd,grid);
|
||||
std::vector<GaugeLinkField> U2(Nd,grid);
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
|
||||
virtual RealD S(const GaugeField &U) {
|
||||
RealD plaq = WilsonLoops<Gimpl>::avgPlaquette(U);
|
||||
RealD vol = U._grid->gSites();
|
||||
RealD vol = U.Grid()->gSites();
|
||||
RealD action = beta * (1.0 - plaq) * (Nd * (Nd - 1.0)) * vol * 0.5;
|
||||
return action;
|
||||
};
|
||||
@ -70,8 +70,8 @@ public:
|
||||
|
||||
RealD factor = 0.5 * beta / RealD(Nc);
|
||||
|
||||
//GaugeLinkField Umu(U._grid);
|
||||
GaugeLinkField dSdU_mu(U._grid);
|
||||
//GaugeLinkField Umu(U.Grid());
|
||||
GaugeLinkField dSdU_mu(U.Grid());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
//Umu = PeekIndex<LorentzIndex>(U, mu);
|
||||
|
||||
|
@ -57,8 +57,8 @@ public:
|
||||
FermionField tmp1(fcbgrid);
|
||||
FermionField tmp2(fcbgrid);
|
||||
|
||||
conformable(fcbgrid,U._grid);
|
||||
conformable(fcbgrid,V._grid);
|
||||
conformable(fcbgrid,U.Grid());
|
||||
conformable(fcbgrid,V.Grid());
|
||||
|
||||
// Assert the checkerboard?? or code for either
|
||||
assert(U.Checkerboard()==Odd);
|
||||
@ -68,7 +68,7 @@ public:
|
||||
// it is not conformable with the HMC force field
|
||||
// Case: Ls vectorised fields
|
||||
// INHERIT FROM THE Force field instead
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force._grid);
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force.Grid());
|
||||
GaugeField ForceO(forcecb);
|
||||
GaugeField ForceE(forcecb);
|
||||
|
||||
@ -102,8 +102,8 @@ public:
|
||||
FermionField tmp1(fcbgrid);
|
||||
FermionField tmp2(fcbgrid);
|
||||
|
||||
conformable(fcbgrid,U._grid);
|
||||
conformable(fcbgrid,V._grid);
|
||||
conformable(fcbgrid,U.Grid());
|
||||
conformable(fcbgrid,V.Grid());
|
||||
|
||||
// Assert the checkerboard?? or code for either
|
||||
assert(V.Checkerboard()==Odd);
|
||||
@ -112,7 +112,7 @@ public:
|
||||
// NOTE Guido: WE DO NOT WANT TO USE THE ucbgrid GRID FOR THE FORCE
|
||||
// it is not conformable with the HMC force field
|
||||
// INHERIT FROM THE Force field instead
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force._grid);
|
||||
GridRedBlackCartesian* forcecb = new GridRedBlackCartesian(Force.Grid());
|
||||
GaugeField ForceO(forcecb);
|
||||
GaugeField ForceE(forcecb);
|
||||
|
||||
|
@ -173,7 +173,7 @@ public:
|
||||
FermionField Y(NumOp.FermionRedBlackGrid());
|
||||
|
||||
// This assignment is necessary to be compliant with the HMC grids
|
||||
GaugeField force(dSdU._grid);
|
||||
GaugeField force(dSdU.Grid());
|
||||
|
||||
//Y=Vdag phi
|
||||
//X = (Mdag M)^-1 V^dag phi
|
||||
|
@ -65,8 +65,8 @@ public:
|
||||
|
||||
virtual void deriv(const Field &p,
|
||||
Field &force) {
|
||||
Field tmp(p._grid);
|
||||
Field p2(p._grid);
|
||||
Field tmp(p.Grid());
|
||||
Field p2(p.Grid());
|
||||
ScalarObs<Impl>::phisquared(p2, p);
|
||||
tmp = -(Cshift(p, 0, -1) + Cshift(p, 0, 1));
|
||||
for (int mu = 1; mu < Nd; mu++) tmp -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
|
||||
static void MomentumSpacePropagator(Field &out, RealD m)
|
||||
{
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
Field kmu(grid), one(grid);
|
||||
const unsigned int nd = grid->_ndimension;
|
||||
std::vector<int> &l = grid->_fdimensions;
|
||||
@ -69,8 +69,8 @@ public:
|
||||
static void FreePropagator(const Field &in, Field &out,
|
||||
const Field &momKernel)
|
||||
{
|
||||
FFT fft((GridCartesian *)in._grid);
|
||||
Field inFT(in._grid);
|
||||
FFT fft((GridCartesian *)in.Grid());
|
||||
Field inFT(in.Grid());
|
||||
|
||||
fft.FFT_all_dim(inFT, in, FFT::forward);
|
||||
inFT = inFT*momKernel;
|
||||
@ -79,7 +79,7 @@ public:
|
||||
|
||||
static void FreePropagator(const Field &in, Field &out, RealD m)
|
||||
{
|
||||
Field momKernel(in._grid);
|
||||
Field momKernel(in.Grid());
|
||||
|
||||
MomentumSpacePropagator(momKernel, m);
|
||||
FreePropagator(in, out, momKernel);
|
||||
|
@ -74,15 +74,15 @@ public:
|
||||
virtual void refresh(const Field &U, GridParallelRNG &pRNG) {}
|
||||
|
||||
virtual RealD S(const Field &p) {
|
||||
assert(p._grid->Nd() == Ndim);
|
||||
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
||||
assert(p.Grid()->Nd() == Ndim);
|
||||
static Stencil phiStencil(p.Grid(), npoint, 0, directions, displacements);
|
||||
phiStencil.HaloExchange(p, compressor);
|
||||
Field action(p._grid), pshift(p._grid), phisquared(p._grid);
|
||||
Field action(p.Grid()), pshift(p.Grid()), phisquared(p.Grid());
|
||||
phisquared = p*p;
|
||||
action = (2.0*Ndim + mass_square)*phisquared - lambda/24.*phisquared*phisquared;
|
||||
for (int mu = 0; mu < Ndim; mu++) {
|
||||
// pshift = Cshift(p, mu, +1); // not efficient, implement with stencils
|
||||
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
||||
parallel_for (int i = 0; i < p.Grid()->oSites(); i++) {
|
||||
int permute_type;
|
||||
StencilEntry *SE;
|
||||
vobj temp2;
|
||||
@ -110,15 +110,15 @@ public:
|
||||
};
|
||||
|
||||
virtual void deriv(const Field &p, Field &force) {
|
||||
assert(p._grid->Nd() == Ndim);
|
||||
assert(p.Grid()->Nd() == Ndim);
|
||||
force = (2.0*Ndim + mass_square)*p - lambda/12.*p*p*p;
|
||||
// move this outside
|
||||
static Stencil phiStencil(p._grid, npoint, 0, directions, displacements);
|
||||
static Stencil phiStencil(p.Grid(), npoint, 0, directions, displacements);
|
||||
phiStencil.HaloExchange(p, compressor);
|
||||
|
||||
//for (int mu = 0; mu < Nd; mu++) force -= Cshift(p, mu, -1) + Cshift(p, mu, 1);
|
||||
for (int point = 0; point < npoint; point++) {
|
||||
parallel_for (int i = 0; i < p._grid->oSites(); i++) {
|
||||
parallel_for (int i = 0; i < p.Grid()->oSites(); i++) {
|
||||
const vobj *temp;
|
||||
vobj temp2;
|
||||
int permute_type;
|
||||
|
@ -189,7 +189,7 @@ public:
|
||||
void evolve(void) {
|
||||
Real DeltaH;
|
||||
|
||||
Field Ucopy(Ucur._grid);
|
||||
Field Ucopy(Ucur.Grid());
|
||||
|
||||
Params.print_parameters();
|
||||
TheIntegrator.print_actions();
|
||||
|
@ -98,11 +98,11 @@ protected:
|
||||
void operator()(std::vector<Action<FieldType>*> repr_set, Repr& Rep,
|
||||
GF& Mom, GF& U, double ep) {
|
||||
for (int a = 0; a < repr_set.size(); ++a) {
|
||||
FieldType forceR(U._grid);
|
||||
FieldType forceR(U.Grid());
|
||||
// Implement smearing only for the fundamental representation now
|
||||
repr_set.at(a)->deriv(Rep.U, forceR);
|
||||
GF force = Rep.RtoFundamentalProject(forceR); // Ta for the fundamental rep
|
||||
Real force_abs = std::sqrt(norm2(force)/(U._grid->gSites()));
|
||||
Real force_abs = std::sqrt(norm2(force)/(U.Grid()->gSites()));
|
||||
std::cout << GridLogIntegrator << "Hirep Force average: " << force_abs << std::endl;
|
||||
Mom -= force * ep ;
|
||||
}
|
||||
@ -114,15 +114,15 @@ protected:
|
||||
// Fundamental updates, include smearing
|
||||
|
||||
for (int a = 0; a < as[level].actions.size(); ++a) {
|
||||
Field force(U._grid);
|
||||
conformable(U._grid, Mom._grid);
|
||||
Field force(U.Grid());
|
||||
conformable(U.Grid(), Mom.Grid());
|
||||
Field& Us = Smearer.get_U(as[level].actions.at(a)->is_smeared);
|
||||
as[level].actions.at(a)->deriv(Us, force); // deriv should NOT include Ta
|
||||
|
||||
std::cout << GridLogIntegrator << "Smearing (on/off): " << as[level].actions.at(a)->is_smeared << std::endl;
|
||||
if (as[level].actions.at(a)->is_smeared) Smearer.smeared_force(force);
|
||||
force = FieldImplementation::projectForce(force); // Ta for gauge fields
|
||||
Real force_abs = std::sqrt(norm2(force)/U._grid->gSites());
|
||||
Real force_abs = std::sqrt(norm2(force)/U.Grid()->gSites());
|
||||
std::cout << GridLogIntegrator << "Force average: " << force_abs << std::endl;
|
||||
Mom -= force * ep;
|
||||
}
|
||||
@ -210,7 +210,7 @@ public:
|
||||
|
||||
// Initialization of momenta and actions
|
||||
void refresh(Field& U, GridParallelRNG& pRNG) {
|
||||
assert(P._grid == U._grid);
|
||||
assert(P.Grid() == U.Grid());
|
||||
std::cout << GridLogIntegrator << "Integrator refresh\n";
|
||||
|
||||
FieldImplementation::generate_momenta(P, pRNG);
|
||||
|
@ -226,8 +226,8 @@ public:
|
||||
std::string integrator_name(){return "ForceGradient";}
|
||||
|
||||
void FG_update_P(Field& U, int level, double fg_dt, double ep) {
|
||||
Field Ufg(U._grid);
|
||||
Field Pfg(U._grid);
|
||||
Field Ufg(U.Grid());
|
||||
Field Pfg(U.Grid());
|
||||
Ufg = U;
|
||||
Pfg = zero;
|
||||
std::cout << GridLogIntegrator << "FG update " << fg_dt << " " << ep
|
||||
|
@ -37,12 +37,12 @@ public:
|
||||
// T_F is 1/2 for the fundamental representation
|
||||
conformable(U, Uin);
|
||||
U = zero;
|
||||
LatticeColourMatrix tmp(Uin._grid);
|
||||
LatticeColourMatrix tmp(Uin.Grid());
|
||||
|
||||
Vector<typename SU<ncolour>::Matrix> ta(Dimension);
|
||||
|
||||
// Debug lines
|
||||
// LatticeMatrix uno(Uin._grid);
|
||||
// LatticeMatrix uno(Uin.Grid());
|
||||
// uno = 1.0;
|
||||
////////////////
|
||||
|
||||
@ -75,16 +75,16 @@ public:
|
||||
|
||||
LatticeGaugeField RtoFundamentalProject(const LatticeField &in,
|
||||
Real scale = 1.0) const {
|
||||
LatticeGaugeField out(in._grid);
|
||||
LatticeGaugeField out(in.Grid());
|
||||
out = zero;
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
LatticeColourMatrix out_mu(in._grid); // fundamental representation
|
||||
LatticeColourMatrix out_mu(in.Grid()); // fundamental representation
|
||||
LatticeMatrix in_mu = peekLorentz(in, mu);
|
||||
|
||||
out_mu = zero;
|
||||
|
||||
typename SU<ncolour>::LatticeAlgebraVector h(in._grid);
|
||||
typename SU<ncolour>::LatticeAlgebraVector h(in.Grid());
|
||||
projectOnAlgebra(h, in_mu, double(Nc) * 2.0); // factor C(r)/C(fund)
|
||||
FundamentalLieAlgebraMatrix(h, out_mu); // apply scale only once
|
||||
pokeLorentz(out, out_mu, mu);
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
// (U)_{(ij)(lk)} = tr [ adj(e^(ij)) U e^(lk) transpose(U) ]
|
||||
conformable(U, Uin);
|
||||
U = zero;
|
||||
LatticeColourMatrix tmp(Uin._grid);
|
||||
LatticeColourMatrix tmp(Uin.Grid());
|
||||
|
||||
Vector<typename SU<ncolour>::Matrix> eij(Dimension);
|
||||
|
||||
@ -61,16 +61,16 @@ public:
|
||||
|
||||
LatticeGaugeField RtoFundamentalProject(const LatticeField &in,
|
||||
Real scale = 1.0) const {
|
||||
LatticeGaugeField out(in._grid);
|
||||
LatticeGaugeField out(in.Grid());
|
||||
out = zero;
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
LatticeColourMatrix out_mu(in._grid); // fundamental representation
|
||||
LatticeColourMatrix out_mu(in.Grid()); // fundamental representation
|
||||
LatticeMatrix in_mu = peekLorentz(in, mu);
|
||||
|
||||
out_mu = zero;
|
||||
|
||||
typename SU<ncolour>::LatticeAlgebraVector h(in._grid);
|
||||
typename SU<ncolour>::LatticeAlgebraVector h(in.Grid());
|
||||
projectOnAlgebra(h, in_mu, double(Nc + 2 * S)); // factor T(r)/T(fund)
|
||||
FundamentalLieAlgebraMatrix(h, out_mu); // apply scale only once
|
||||
pokeLorentz(out, out_mu, mu);
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void smear(GaugeField& u_smr, const GaugeField& U)const{
|
||||
GridBase *grid = U._grid;
|
||||
GridBase *grid = U.Grid();
|
||||
GaugeLinkField Cup(grid), tmp_stpl(grid);
|
||||
WilsonLoops<Gimpl> WL;
|
||||
u_smr = zero;
|
||||
@ -93,7 +93,7 @@ public:
|
||||
// Computing Sigma_mu, derivative of S[fat links] with respect to the thin links
|
||||
// Output SigmaTerm
|
||||
|
||||
GridBase *grid = U._grid;
|
||||
GridBase *grid = U.Grid();
|
||||
|
||||
WilsonLoops<Gimpl> WL;
|
||||
GaugeLinkField staple(grid), u_tmp(grid);
|
||||
|
@ -81,7 +81,7 @@ private:
|
||||
//====================================================================
|
||||
GaugeField AnalyticSmearedForce(const GaugeField& SigmaKPrime,
|
||||
const GaugeField& GaugeK) const {
|
||||
GridBase* grid = GaugeK._grid;
|
||||
GridBase* grid = GaugeK.Grid();
|
||||
GaugeField C(grid), SigmaK(grid), iLambda(grid);
|
||||
GaugeLinkField iLambda_mu(grid);
|
||||
GaugeLinkField iQ(grid), e_iQ(grid);
|
||||
@ -115,7 +115,7 @@ private:
|
||||
void set_iLambda(GaugeLinkField& iLambda, GaugeLinkField& e_iQ,
|
||||
const GaugeLinkField& iQ, const GaugeLinkField& Sigmap,
|
||||
const GaugeLinkField& GaugeK) const {
|
||||
GridBase* grid = iQ._grid;
|
||||
GridBase* grid = iQ.Grid();
|
||||
GaugeLinkField iQ2(grid), iQ3(grid), B1(grid), B2(grid), USigmap(grid);
|
||||
GaugeLinkField unity(grid);
|
||||
unity = 1.0;
|
||||
@ -230,7 +230,7 @@ public:
|
||||
void smeared_force(GaugeField& SigmaTilde) const {
|
||||
if (smearingLevels > 0) {
|
||||
GaugeField force = SigmaTilde; // actually = U*SigmaTilde
|
||||
GaugeLinkField tmp_mu(SigmaTilde._grid);
|
||||
GaugeLinkField tmp_mu(SigmaTilde.Grid());
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
// to get just SigmaTilde
|
||||
|
@ -28,8 +28,8 @@ public:
|
||||
~Smear_Stout() {} // delete SmearBase...
|
||||
|
||||
void smear(GaugeField& u_smr, const GaugeField& U) const {
|
||||
GaugeField C(U._grid);
|
||||
GaugeLinkField tmp(U._grid), iq_mu(U._grid), Umu(U._grid);
|
||||
GaugeField C(U.Grid());
|
||||
GaugeLinkField tmp(U.Grid()), iq_mu(U.Grid()), Umu(U.Grid());
|
||||
|
||||
std::cout << GridLogDebug << "Stout smearing started\n";
|
||||
|
||||
@ -70,7 +70,7 @@ public:
|
||||
// the i sign is coming from outside
|
||||
// input matrix is anti-hermitian NOT hermitian
|
||||
|
||||
GridBase* grid = iQ._grid;
|
||||
GridBase* grid = iQ.Grid();
|
||||
GaugeLinkField unity(grid);
|
||||
unity = 1.0;
|
||||
|
||||
@ -92,7 +92,7 @@ public:
|
||||
Complex one_over_three = 1.0 / 3.0;
|
||||
Complex one_over_two = 1.0 / 2.0;
|
||||
|
||||
GridBase* grid = u._grid;
|
||||
GridBase* grid = u.Grid();
|
||||
LatticeComplex c0(grid), c1(grid), tmp(grid), c0max(grid), theta(grid);
|
||||
|
||||
// sign in c0 from the conventions on the Ta
|
||||
@ -111,7 +111,7 @@ public:
|
||||
|
||||
void set_fj(LatticeComplex& f0, LatticeComplex& f1, LatticeComplex& f2,
|
||||
const LatticeComplex& u, const LatticeComplex& w) const {
|
||||
GridBase* grid = u._grid;
|
||||
GridBase* grid = u.Grid();
|
||||
LatticeComplex xi0(grid), u2(grid), w2(grid), cosw(grid);
|
||||
LatticeComplex fden(grid);
|
||||
LatticeComplex h0(grid), h1(grid), h2(grid);
|
||||
|
@ -85,8 +85,8 @@ public:
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
template <class Gimpl>
|
||||
void WilsonFlow<Gimpl>::evolve_step(typename Gimpl::GaugeField &U) const{
|
||||
GaugeField Z(U._grid);
|
||||
GaugeField tmp(U._grid);
|
||||
GaugeField Z(U.Grid());
|
||||
GaugeField tmp(U.Grid());
|
||||
SG.deriv(U, Z);
|
||||
Z *= 0.25; // Z0 = 1/4 * F(U)
|
||||
Gimpl::update_field(Z, U, -2.0*epsilon); // U = W1 = exp(ep*Z0)*W0
|
||||
@ -108,9 +108,9 @@ void WilsonFlow<Gimpl>::evolve_step_adaptive(typename Gimpl::GaugeField &U, Real
|
||||
epsilon = maxTau-taus;
|
||||
}
|
||||
//std::cout << GridLogMessage << "Integration epsilon : " << epsilon << std::endl;
|
||||
GaugeField Z(U._grid);
|
||||
GaugeField Zprime(U._grid);
|
||||
GaugeField tmp(U._grid), Uprime(U._grid);
|
||||
GaugeField Z(U.Grid());
|
||||
GaugeField Zprime(U.Grid());
|
||||
GaugeField tmp(U.Grid()), Uprime(U.Grid());
|
||||
Uprime = U;
|
||||
SG.deriv(U, Z);
|
||||
Zprime = -Z;
|
||||
@ -147,12 +147,12 @@ void WilsonFlow<Gimpl>::evolve_step_adaptive(typename Gimpl::GaugeField &U, Real
|
||||
template <class Gimpl>
|
||||
RealD WilsonFlow<Gimpl>::energyDensityPlaquette(unsigned int step, const GaugeField& U) const {
|
||||
RealD td = tau(step);
|
||||
return 2.0 * td * td * SG.S(U)/U._grid->gSites();
|
||||
return 2.0 * td * td * SG.S(U)/U.Grid()->gSites();
|
||||
}
|
||||
|
||||
template <class Gimpl>
|
||||
RealD WilsonFlow<Gimpl>::energyDensityPlaquette(const GaugeField& U) const {
|
||||
return 2.0 * taus * taus * SG.S(U)/U._grid->gSites();
|
||||
return 2.0 * taus * taus * SG.S(U)/U.Grid()->gSites();
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace PeriodicBC {
|
||||
int mu,
|
||||
const Lattice<covariant> &field)
|
||||
{
|
||||
Lattice<covariant> tmp(field._grid);
|
||||
Lattice<covariant> tmp(field.Grid());
|
||||
tmp = adj(Link)*field;
|
||||
return Cshift(tmp,mu,-1);// moves towards positive mu
|
||||
}
|
||||
@ -87,7 +87,7 @@ namespace ConjugateBC {
|
||||
int mu,
|
||||
const Lattice<covariant> &field)
|
||||
{
|
||||
GridBase * grid = Link._grid;
|
||||
GridBase * grid = Link.Grid();
|
||||
|
||||
int Lmu = grid->GlobalDimensions()[mu]-1;
|
||||
|
||||
@ -106,7 +106,7 @@ namespace ConjugateBC {
|
||||
int mu,
|
||||
const Lattice<covariant> &field)
|
||||
{
|
||||
GridBase * grid = field._grid;
|
||||
GridBase * grid = field.Grid();
|
||||
|
||||
int Lmu = grid->GlobalDimensions()[mu]-1;
|
||||
|
||||
|
@ -108,14 +108,14 @@ public:
|
||||
//GaugeField herm = in + adj(in);
|
||||
//std::cout << "AHermiticity: " << norm2(herm) << std::endl;
|
||||
|
||||
GaugeLinkField tmp(in._grid);
|
||||
GaugeLinkField tmp2(in._grid);
|
||||
GaugeLinkField sum(in._grid);
|
||||
GaugeLinkField tmp(in.Grid());
|
||||
GaugeLinkField tmp2(in.Grid());
|
||||
GaugeLinkField sum(in.Grid());
|
||||
|
||||
for (int nu = 0; nu < Nd; nu++) {
|
||||
sum = zero;
|
||||
GaugeLinkField in_nu = PeekIndex<LorentzIndex>(in, nu);
|
||||
GaugeLinkField out_nu(out._grid);
|
||||
GaugeLinkField out_nu(out.Grid());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
tmp = U[mu] * Cshift(in_nu, mu, +1) * adj(U[mu]);
|
||||
tmp2 = adj(U[mu]) * in_nu * U[mu];
|
||||
@ -131,7 +131,7 @@ public:
|
||||
RealD factor = -kappa / (double(4 * Nd));
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++){
|
||||
GaugeLinkField der_mu(der._grid);
|
||||
GaugeLinkField der_mu(der.Grid());
|
||||
der_mu = zero;
|
||||
for (int nu = 0; nu < Nd; nu++){
|
||||
GaugeLinkField in_nu = PeekIndex<LorentzIndex>(in, nu);
|
||||
@ -150,7 +150,7 @@ public:
|
||||
RealD factor = -kappa / (double(4 * Nd));
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
GaugeLinkField der_mu(der._grid);
|
||||
GaugeLinkField der_mu(der.Grid());
|
||||
der_mu = zero;
|
||||
for (int nu = 0; nu < Nd; nu++) {
|
||||
GaugeLinkField left_nu = PeekIndex<LorentzIndex>(left, nu);
|
||||
@ -168,7 +168,7 @@ public:
|
||||
}
|
||||
|
||||
void MSquareRoot(GaugeField& P){
|
||||
GaugeField Gp(P._grid);
|
||||
GaugeField Gp(P.Grid());
|
||||
HermitianLinearOperator<LaplacianAdjointField<Impl>,GaugeField> HermOp(*this);
|
||||
ConjugateGradientMultiShift<GaugeField> msCG(param.MaxIter,PowerHalf);
|
||||
msCG(HermOp,P,Gp);
|
||||
@ -176,7 +176,7 @@ public:
|
||||
}
|
||||
|
||||
void MInvSquareRoot(GaugeField& P){
|
||||
GaugeField Gp(P._grid);
|
||||
GaugeField Gp(P.Grid());
|
||||
HermitianLinearOperator<LaplacianAdjointField<Impl>,GaugeField> HermOp(*this);
|
||||
ConjugateGradientMultiShift<GaugeField> msCG(param.MaxIter,PowerInvHalf);
|
||||
msCG(HermOp,P,Gp);
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
}
|
||||
}
|
||||
static void SteepestDescentGaugeFix(GaugeLorentz &Umu,Real & alpha,int maxiter,Real Omega_tol, Real Phi_tol,bool Fourier=false) {
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
Real org_plaq =WilsonLoops<Gimpl>::avgPlaquette(Umu);
|
||||
Real org_link_trace=WilsonLoops<Gimpl>::linkTrace(Umu);
|
||||
@ -97,7 +97,7 @@ public:
|
||||
}
|
||||
};
|
||||
static Real SteepestDescentStep(std::vector<GaugeMat> &U,Real & alpha, GaugeMat & dmuAmu) {
|
||||
GridBase *grid = U[0]._grid;
|
||||
GridBase *grid = U[0].Grid();
|
||||
|
||||
std::vector<GaugeMat> A(Nd,grid);
|
||||
GaugeMat g(grid);
|
||||
@ -116,7 +116,7 @@ public:
|
||||
|
||||
static Real FourierAccelSteepestDescentStep(std::vector<GaugeMat> &U,Real & alpha, GaugeMat & dmuAmu) {
|
||||
|
||||
GridBase *grid = U[0]._grid;
|
||||
GridBase *grid = U[0].Grid();
|
||||
|
||||
Real vol = grid->gSites();
|
||||
|
||||
@ -179,7 +179,7 @@ public:
|
||||
}
|
||||
|
||||
static void ExpiAlphaDmuAmu(const std::vector<GaugeMat> &A,GaugeMat &g,Real & alpha, GaugeMat &dmuAmu) {
|
||||
GridBase *grid = g._grid;
|
||||
GridBase *grid = g.Grid();
|
||||
Complex cialpha(0.0,-alpha);
|
||||
GaugeMat ciadmam(grid);
|
||||
DmuAmu(A,dmuAmu);
|
||||
|
@ -45,7 +45,7 @@ void axpibg5x(Lattice<vobj> &z,const Lattice<vobj> &x,Coeff a,Coeff b)
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,z);
|
||||
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
parallel_for(int ss=0;ss<grid->oSites();ss++){
|
||||
@ -62,7 +62,7 @@ void axpby_ssp(Lattice<vobj> &z, Coeff a,const Lattice<vobj> &x,Coeff b,const La
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,y);
|
||||
conformable(x,z);
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
int Ls = grid->_rdimensions[0];
|
||||
parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
|
||||
vobj tmp = a*x[ss+s]+b*y[ss+sp];
|
||||
@ -76,7 +76,7 @@ void ag5xpby_ssp(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,const L
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,y);
|
||||
conformable(x,z);
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
int Ls = grid->_rdimensions[0];
|
||||
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
@ -94,7 +94,7 @@ void axpbg5y_ssp(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,const L
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,y);
|
||||
conformable(x,z);
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
int Ls = grid->_rdimensions[0];
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
|
||||
@ -111,7 +111,7 @@ void ag5xpbg5y_ssp(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,const
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,y);
|
||||
conformable(x,z);
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
int Ls = grid->_rdimensions[0];
|
||||
|
||||
Gamma G5(Gamma::Algebra::Gamma5);
|
||||
@ -130,7 +130,7 @@ void axpby_ssp_pminus(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,co
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,y);
|
||||
conformable(x,z);
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
int Ls = grid->_rdimensions[0];
|
||||
parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
|
||||
vobj tmp;
|
||||
@ -146,7 +146,7 @@ void axpby_ssp_pplus(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,con
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,y);
|
||||
conformable(x,z);
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
int Ls = grid->_rdimensions[0];
|
||||
parallel_for(int ss=0;ss<grid->oSites();ss+=Ls){ // adds Ls
|
||||
vobj tmp;
|
||||
@ -159,7 +159,7 @@ void axpby_ssp_pplus(Lattice<vobj> &z,Coeff a,const Lattice<vobj> &x,Coeff b,con
|
||||
template<class vobj>
|
||||
void G5R5(Lattice<vobj> &z,const Lattice<vobj> &x)
|
||||
{
|
||||
GridBase *grid=x._grid;
|
||||
GridBase *grid=x.Grid();
|
||||
z.Checkerboard() = x.Checkerboard();
|
||||
conformable(x,z);
|
||||
int Ls = grid->_rdimensions[0];
|
||||
|
@ -107,7 +107,7 @@ public:
|
||||
if (1) {
|
||||
// Auxiliary momenta
|
||||
// do nothing if trivial, so hide in the metric
|
||||
MomentaField AuxMomTemp(Mom._grid);
|
||||
MomentaField AuxMomTemp(Mom.Grid());
|
||||
Implementation::generate_momenta(AuxMom, pRNG);
|
||||
Implementation::generate_momenta(AuxField, pRNG);
|
||||
// Modify the distribution with the metric
|
||||
@ -118,10 +118,10 @@ public:
|
||||
|
||||
// Correct
|
||||
RealD MomentaAction(){
|
||||
MomentaField inv(Mom._grid);
|
||||
MomentaField inv(Mom.Grid());
|
||||
inv = zero;
|
||||
M.Minv(Mom, inv);
|
||||
LatticeComplex Hloc(Mom._grid);
|
||||
LatticeComplex Hloc(Mom.Grid());
|
||||
Hloc = zero;
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
// This is not very general
|
||||
@ -155,8 +155,8 @@ public:
|
||||
|
||||
// Compute the derivative of the kinetic term
|
||||
// with respect to the gauge field
|
||||
MomentaField MDer(in._grid);
|
||||
MomentaField X(in._grid);
|
||||
MomentaField MDer(in.Grid());
|
||||
MomentaField X(in.Grid());
|
||||
X = zero;
|
||||
M.Minv(in, X); // X = G in
|
||||
M.MDeriv(X, MDer); // MDer = U * dS/dU
|
||||
@ -168,8 +168,8 @@ public:
|
||||
der = zero;
|
||||
if (1){
|
||||
// Auxiliary fields
|
||||
MomentaField der_temp(der._grid);
|
||||
MomentaField X(der._grid);
|
||||
MomentaField der_temp(der.Grid());
|
||||
MomentaField X(der.Grid());
|
||||
X=zero;
|
||||
//M.M(AuxMom, X); // X = M Aux
|
||||
// Two derivative terms
|
||||
@ -200,8 +200,8 @@ public:
|
||||
|
||||
void update_auxiliary_fields(RealD ep){
|
||||
if (1) {
|
||||
MomentaField tmp(AuxMom._grid);
|
||||
MomentaField tmp2(AuxMom._grid);
|
||||
MomentaField tmp(AuxMom.Grid());
|
||||
MomentaField tmp2(AuxMom.Grid());
|
||||
M.M(AuxMom, tmp);
|
||||
// M.M(tmp, tmp2);
|
||||
AuxField += ep * tmp; // M^2 AuxMom
|
||||
|
@ -217,7 +217,7 @@ public:
|
||||
Lattice<iSU2Matrix<vcplx> > &subgroup,
|
||||
const Lattice<iSUnMatrix<vcplx> > &source,
|
||||
int su2_index) {
|
||||
GridBase *grid(source._grid);
|
||||
GridBase *grid(source.Grid());
|
||||
conformable(subgroup, source);
|
||||
conformable(subgroup, Determinant);
|
||||
int i0, i1;
|
||||
@ -247,7 +247,7 @@ public:
|
||||
template <class vcplx>
|
||||
static void su2Insert(const Lattice<iSU2Matrix<vcplx> > &subgroup,
|
||||
Lattice<iSUnMatrix<vcplx> > &dest, int su2_index) {
|
||||
GridBase *grid(dest._grid);
|
||||
GridBase *grid(dest.Grid());
|
||||
conformable(subgroup, dest);
|
||||
int i0, i1;
|
||||
su2SubGroupIndex(i0, i1, su2_index);
|
||||
@ -277,7 +277,7 @@ public:
|
||||
LatticeMatrix &link,
|
||||
const LatticeMatrix &barestaple, // multiplied by action coeffs so th
|
||||
int su2_subgroup, int nheatbath, LatticeInteger &wheremask) {
|
||||
GridBase *grid = link._grid;
|
||||
GridBase *grid = link.Grid();
|
||||
|
||||
const RealD twopi = 2.0 * M_PI;
|
||||
|
||||
@ -604,7 +604,7 @@ public:
|
||||
template <typename LatticeMatrixType>
|
||||
static void LieRandomize(GridParallelRNG &pRNG, LatticeMatrixType &out,
|
||||
double scale = 1.0) {
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
|
||||
typedef typename LatticeMatrixType::vector_type vector_type;
|
||||
typedef typename LatticeMatrixType::scalar_type scalar_type;
|
||||
@ -641,7 +641,7 @@ public:
|
||||
static void GaussianFundamentalLieAlgebraMatrix(GridParallelRNG &pRNG,
|
||||
LatticeMatrix &out,
|
||||
Real scale = 1.0) {
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
LatticeReal ca(grid);
|
||||
LatticeMatrix la(grid);
|
||||
Complex ci(0.0, scale);
|
||||
@ -661,7 +661,7 @@ public:
|
||||
LatticeMatrix &out,
|
||||
Real scale = 1.0) {
|
||||
conformable(h, out);
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
LatticeMatrix la(grid);
|
||||
Matrix ta;
|
||||
|
||||
@ -678,8 +678,8 @@ public:
|
||||
|
||||
template<typename GaugeField,typename GaugeMat>
|
||||
static void GaugeTransform( GaugeField &Umu, GaugeMat &g){
|
||||
GridBase *grid = Umu._grid;
|
||||
conformable(grid,g._grid);
|
||||
GridBase *grid = Umu.Grid();
|
||||
conformable(grid,g.Grid());
|
||||
|
||||
GaugeMat U(grid);
|
||||
GaugeMat ag(grid); ag = adj(g);
|
||||
@ -692,7 +692,7 @@ public:
|
||||
}
|
||||
template<typename GaugeMat>
|
||||
static void GaugeTransform( std::vector<GaugeMat> &U, GaugeMat &g){
|
||||
GridBase *grid = g._grid;
|
||||
GridBase *grid = g.Grid();
|
||||
GaugeMat ag(grid); ag = adj(g);
|
||||
for(int mu=0;mu<Nd;mu++){
|
||||
U[mu] = g*U[mu]*Cshift(ag, mu, 1);
|
||||
@ -724,7 +724,7 @@ public:
|
||||
typedef iSUnMatrix<vector_type> vMatrixType;
|
||||
typedef Lattice<vMatrixType> LatticeMatrixType;
|
||||
|
||||
LatticeMatrixType Umu(out._grid);
|
||||
LatticeMatrixType Umu(out.Grid());
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
LieRandomize(pRNG, Umu, 1.0);
|
||||
PokeIndex<LorentzIndex>(out, Umu, mu);
|
||||
@ -736,7 +736,7 @@ public:
|
||||
typedef iSUnMatrix<vector_type> vMatrixType;
|
||||
typedef Lattice<vMatrixType> LatticeMatrixType;
|
||||
|
||||
LatticeMatrixType Umu(out._grid);
|
||||
LatticeMatrixType Umu(out.Grid());
|
||||
for(int mu=0;mu<Nd;mu++){
|
||||
LieRandomize(pRNG,Umu,0.01);
|
||||
PokeIndex<LorentzIndex>(out,Umu,mu);
|
||||
@ -748,7 +748,7 @@ public:
|
||||
typedef iSUnMatrix<vector_type> vMatrixType;
|
||||
typedef Lattice<vMatrixType> LatticeMatrixType;
|
||||
|
||||
LatticeMatrixType Umu(out._grid);
|
||||
LatticeMatrixType Umu(out.Grid());
|
||||
Umu=1.0;
|
||||
for(int mu=0;mu<Nd;mu++){
|
||||
PokeIndex<LorentzIndex>(out,Umu,mu);
|
||||
@ -767,7 +767,7 @@ public:
|
||||
static void taExp(const LatticeMatrixType &x, LatticeMatrixType &ex) {
|
||||
typedef typename LatticeMatrixType::scalar_type ComplexType;
|
||||
|
||||
LatticeMatrixType xn(x._grid);
|
||||
LatticeMatrixType xn(x.Grid());
|
||||
RealD nfac = 1.0;
|
||||
|
||||
xn = x;
|
||||
|
@ -114,7 +114,7 @@ public:
|
||||
const typename SU<ncolour>::LatticeAlgebraVector &h,
|
||||
LatticeAdjMatrix &out, Real scale = 1.0) {
|
||||
conformable(h, out);
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
LatticeAdjMatrix la(grid);
|
||||
AMatrix iTa;
|
||||
|
||||
|
@ -199,7 +199,7 @@ public:
|
||||
const typename SU<ncolour>::LatticeAlgebraVector &h,
|
||||
LatticeTwoIndexMatrix &out, Real scale = 1.0) {
|
||||
conformable(h, out);
|
||||
GridBase *grid = out._grid;
|
||||
GridBase *grid = out.Grid();
|
||||
LatticeTwoIndexMatrix la(grid);
|
||||
TIMatrix i2indTa;
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
static RealD sumphider(const typename Impl::Field &f) {
|
||||
typename Impl::Field tmp(f._grid);
|
||||
typename Impl::Field tmp(f.Grid());
|
||||
tmp = Cshift(f, 0, -1) * f;
|
||||
for (int mu = 1; mu < Nd; mu++) {
|
||||
tmp += Cshift(f, mu, -1) * f;
|
||||
@ -76,13 +76,13 @@ public:
|
||||
}
|
||||
|
||||
static RealD sumphisquared(const typename Impl::Field &f) {
|
||||
typename Impl::Field tmp(f._grid);
|
||||
typename Impl::Field tmp(f.Grid());
|
||||
tmp = f * f;
|
||||
return sum(trace(tmp));
|
||||
}
|
||||
|
||||
static RealD sumphifourth(const typename Impl::Field &f) {
|
||||
typename Impl::Field tmp(f._grid);
|
||||
typename Impl::Field tmp(f.Grid());
|
||||
phifourth(tmp, f);
|
||||
return sum(trace(tmp));
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
static void traceDirPlaquette(ComplexField &plaq,
|
||||
const std::vector<GaugeMat> &U, const int mu,
|
||||
const int nu) {
|
||||
GaugeMat sp(U[0]._grid);
|
||||
GaugeMat sp(U[0].Grid());
|
||||
dirPlaquette(sp, U, mu, nu);
|
||||
plaq = trace(sp);
|
||||
}
|
||||
@ -85,7 +85,7 @@ public:
|
||||
//////////////////////////////////////////////////
|
||||
static void sitePlaquette(ComplexField &Plaq,
|
||||
const std::vector<GaugeMat> &U) {
|
||||
ComplexField sitePlaq(U[0]._grid);
|
||||
ComplexField sitePlaq(U[0].Grid());
|
||||
Plaq = zero;
|
||||
for (int mu = 1; mu < Nd; mu++) {
|
||||
for (int nu = 0; nu < mu; nu++) {
|
||||
@ -98,13 +98,13 @@ public:
|
||||
// sum over all x,y,z,t and over all planes of plaquette
|
||||
//////////////////////////////////////////////////
|
||||
static RealD sumPlaquette(const GaugeLorentz &Umu) {
|
||||
std::vector<GaugeMat> U(Nd, Umu._grid);
|
||||
std::vector<GaugeMat> U(Nd, Umu.Grid());
|
||||
// inefficient here
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
|
||||
}
|
||||
|
||||
ComplexField Plaq(Umu._grid);
|
||||
ComplexField Plaq(Umu.Grid());
|
||||
|
||||
sitePlaquette(Plaq, U);
|
||||
auto Tp = sum(Plaq);
|
||||
@ -118,7 +118,7 @@ public:
|
||||
//////////////////////////////////////////////////
|
||||
static RealD avgPlaquette(const GaugeLorentz &Umu) {
|
||||
RealD sumplaq = sumPlaquette(Umu);
|
||||
double vol = Umu._grid->gSites();
|
||||
double vol = Umu.Grid()->gSites();
|
||||
double faces = (1.0 * Nd * (Nd - 1)) / 2.0;
|
||||
return sumplaq / vol / faces / Nc; // Nd , Nc dependent... FIXME
|
||||
}
|
||||
@ -127,9 +127,9 @@ public:
|
||||
// average over traced single links
|
||||
//////////////////////////////////////////////////
|
||||
static RealD linkTrace(const GaugeLorentz &Umu) {
|
||||
std::vector<GaugeMat> U(Nd, Umu._grid);
|
||||
std::vector<GaugeMat> U(Nd, Umu.Grid());
|
||||
|
||||
ComplexField Tr(Umu._grid);
|
||||
ComplexField Tr(Umu.Grid());
|
||||
Tr = zero;
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
|
||||
@ -139,7 +139,7 @@ public:
|
||||
auto Tp = sum(Tr);
|
||||
auto p = TensorRemove(Tp);
|
||||
|
||||
double vol = Umu._grid->gSites();
|
||||
double vol = Umu.Grid()->gSites();
|
||||
|
||||
return p.real() / vol / 4.0 / 3.0;
|
||||
};
|
||||
@ -150,7 +150,7 @@ public:
|
||||
static void Staple(GaugeMat &staple, const GaugeLorentz &Umu, int mu,
|
||||
int nu) {
|
||||
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeMat> U(Nd, grid);
|
||||
for (int d = 0; d < Nd; d++) {
|
||||
@ -191,7 +191,7 @@ public:
|
||||
|
||||
// For the force term
|
||||
static void StapleMult(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
std::vector<GaugeMat> U(Nd, grid);
|
||||
for (int d = 0; d < Nd; d++) {
|
||||
// this operation is taking too much time
|
||||
@ -219,7 +219,7 @@ public:
|
||||
//////////////////////////////////////////////////
|
||||
static void Staple(GaugeMat &staple, const GaugeLorentz &Umu, int mu) {
|
||||
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeMat> U(Nd, grid);
|
||||
for (int d = 0; d < Nd; d++) {
|
||||
@ -266,7 +266,7 @@ public:
|
||||
static void StapleUpper(GaugeMat &staple, const GaugeLorentz &Umu, int mu,
|
||||
int nu) {
|
||||
if (nu != mu) {
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeMat> U(Nd, grid);
|
||||
for (int d = 0; d < Nd; d++) {
|
||||
@ -297,7 +297,7 @@ public:
|
||||
static void StapleLower(GaugeMat &staple, const GaugeLorentz &Umu, int mu,
|
||||
int nu) {
|
||||
if (nu != mu) {
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeMat> U(Nd, grid);
|
||||
for (int d = 0; d < Nd; d++) {
|
||||
@ -329,7 +329,7 @@ public:
|
||||
// | | | |
|
||||
// +--<--+ +--<--+
|
||||
|
||||
GaugeMat Vup(Umu._grid), Vdn(Umu._grid);
|
||||
GaugeMat Vup(Umu.Grid()), Vdn(Umu.Grid());
|
||||
StapleUpper(Vup, Umu, mu, nu);
|
||||
StapleLower(Vdn, Umu, mu, nu);
|
||||
GaugeMat v = Vup - Vdn;
|
||||
@ -342,13 +342,13 @@ public:
|
||||
// 4d topological charge
|
||||
assert(Nd==4);
|
||||
// Bx = -iF(y,z), By = -iF(z,y), Bz = -iF(x,y)
|
||||
GaugeMat Bx(U._grid), By(U._grid), Bz(U._grid);
|
||||
GaugeMat Bx(U.Grid()), By(U.Grid()), Bz(U.Grid());
|
||||
FieldStrength(Bx, U, Ydir, Zdir);
|
||||
FieldStrength(By, U, Zdir, Xdir);
|
||||
FieldStrength(Bz, U, Xdir, Ydir);
|
||||
|
||||
// Ex = -iF(t,x), Ey = -iF(t,y), Ez = -iF(t,z)
|
||||
GaugeMat Ex(U._grid), Ey(U._grid), Ez(U._grid);
|
||||
GaugeMat Ex(U.Grid()), Ey(U.Grid()), Ez(U.Grid());
|
||||
FieldStrength(Ex, U, Tdir, Xdir);
|
||||
FieldStrength(Ey, U, Tdir, Ydir);
|
||||
FieldStrength(Ez, U, Tdir, Zdir);
|
||||
@ -378,13 +378,13 @@ public:
|
||||
static void traceDirRectangle(ComplexField &rect,
|
||||
const std::vector<GaugeMat> &U, const int mu,
|
||||
const int nu) {
|
||||
GaugeMat sp(U[0]._grid);
|
||||
GaugeMat sp(U[0].Grid());
|
||||
dirRectangle(sp, U, mu, nu);
|
||||
rect = trace(sp);
|
||||
}
|
||||
static void siteRectangle(ComplexField &Rect,
|
||||
const std::vector<GaugeMat> &U) {
|
||||
ComplexField siteRect(U[0]._grid);
|
||||
ComplexField siteRect(U[0].Grid());
|
||||
Rect = zero;
|
||||
for (int mu = 1; mu < Nd; mu++) {
|
||||
for (int nu = 0; nu < mu; nu++) {
|
||||
@ -398,13 +398,13 @@ public:
|
||||
// sum over all x,y,z,t and over all planes of plaquette
|
||||
//////////////////////////////////////////////////
|
||||
static RealD sumRectangle(const GaugeLorentz &Umu) {
|
||||
std::vector<GaugeMat> U(Nd, Umu._grid);
|
||||
std::vector<GaugeMat> U(Nd, Umu.Grid());
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++) {
|
||||
U[mu] = PeekIndex<LorentzIndex>(Umu, mu);
|
||||
}
|
||||
|
||||
ComplexField Rect(Umu._grid);
|
||||
ComplexField Rect(Umu.Grid());
|
||||
|
||||
siteRectangle(Rect, U);
|
||||
|
||||
@ -419,7 +419,7 @@ public:
|
||||
|
||||
RealD sumrect = sumRectangle(Umu);
|
||||
|
||||
double vol = Umu._grid->gSites();
|
||||
double vol = Umu.Grid()->gSites();
|
||||
|
||||
double faces = (1.0 * Nd * (Nd - 1)); // 2 distinct orientations summed
|
||||
|
||||
@ -445,7 +445,7 @@ public:
|
||||
|
||||
Stap = zero;
|
||||
|
||||
GridBase *grid = U[0]._grid;
|
||||
GridBase *grid = U[0].Grid();
|
||||
|
||||
GaugeMat Staple2x1(grid);
|
||||
GaugeMat tmp(grid);
|
||||
@ -522,7 +522,7 @@ public:
|
||||
|
||||
static void RectStapleUnoptimised(GaugeMat &Stap, const GaugeLorentz &Umu,
|
||||
int mu) {
|
||||
GridBase *grid = Umu._grid;
|
||||
GridBase *grid = Umu.Grid();
|
||||
|
||||
std::vector<GaugeMat> U(Nd, grid);
|
||||
for (int d = 0; d < Nd; d++) {
|
||||
|
Reference in New Issue
Block a user