1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

cleaned up, deleted commented out old code

This commit is contained in:
ferben 2019-01-22 13:48:44 +00:00
parent 813c1ab1f1
commit 46b05aa9c5

View File

@ -95,166 +95,6 @@ public:
}; };
/******************************************************************************
* Class to generate Distillation $\varrho$ and $\varphi$ vectors *
******************************************************************************/
/*
template <typename FImpl>
class DistilVectorsFromPerambulator
{
public:
FERM_TYPE_ALIASES(FImpl,);
SOLVER_TYPE_ALIASES(FImpl,);
public:
DistilVectorsFromPerambulator(FMat &action);
virtual ~DistilVectorsFromPerambulator(void) = default;
void makeRho(FermionField &rhoOut,
const FermionField &evec, const Complex &noises);
void makePhi(FermionField &phiOut,
const FermionField &evec, const SpinVector &Perambulators);
private:
GridBase *fGrid_, *frbGrid_, *gGrid_;
bool is5d_;
FermionField src_o_, sol_e_, sol_o_, tmp_, tmp5_;
};
*/
/******************************************************************************
* DistilVectorsFromPerambulator template implementation *
******************************************************************************/
/*
template <typename FImpl>
DistilVectorsFromPerambulator<FImpl>::DistilVectorsFromPerambulator(FMat &action)
: action_(action)
, fGrid_(action_.FermionGrid())
, frbGrid_(action_.FermionRedBlackGrid())
, gGrid_(action_.GaugeGrid())
, src_o_(frbGrid_)
, sol_e_(frbGrid_)
, sol_o_(frbGrid_)
, tmp_(frbGrid_)
, tmp5_(fGrid_)
, op_(action_)
{}
template <typename FImpl>
void DistilVectorsFromPerambulator<FImpl>::makeRho(FermionField &rhoOut, const FermionField &evec, const Complex &noises)
{
// INPUT:::::::::
Grid::Hadrons::EigenPack<LatticeColourVector> eig4d;
std::vector<std::vector<std::vector<SpinVector> > > noises;
// OUTPUT::::::::
std::vector <LatticeSpinColourVector> sources_tsrc;
{
LatticeSpinColourVector vecModel(grid4d);
sources_tsrc.resize(nnoise*LI*Ns*Nt_inv,vecModel);
}
// TEMPORARY:::::::::
LatticeSpinColourVector tmp2(grid4d);
LatticeSpinColourVector tmp3d(grid3d);
LatticeColourVector tmp3d_nospin(grid3d);
LatticeColourVector tmp_nospin(grid4d);
LatticeColourVector evec3d(grid3d);
int vecindex;
for (int inoise = 0; inoise < nnoise; inoise++) {
for (int dk = 0; dk < LI; dk++) {
for (int dt = 0; dt < Nt_inv; dt++) {
if(full_tdil) dt=tsrc; //TODO: this works for now, as longs as tsrc=0, but will crash otherwise!
for (int ds = 0; ds < Ns; ds++) {
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * Ns*dt;
sources_tsrc[vecindex] = zero;
tmp3d_nospin = zero;
for (int it = dt; it < Nt; it += TI){
if( it >= Ntfirst && it < Ntfirst + Ntlocal ) {
for (int ik = dk; ik < nvec; ik += LI){
for (int is = ds; is < Ns; is += Ns){ //at the moment, full spin dilution is enforced
ExtractSliceLocal(evec3d,eig4d.evec[ik],0,it,3);
tmp3d_nospin = evec3d * noises[inoise][it][ik]()(is)(); //noises do not have to be a spin vector
tmp3d=zero;
pokeSpin(tmp3d,tmp3d_nospin,is);
tmp2=zero;
#ifdef USE_LOCAL_SLICES
InsertSliceLocal(tmp3d,tmp2,0,it-Ntfirst,Grid::QCD::Tdir);
#else
InsertSlice(tmp3d,tmp2,it,Grid::QCD::Tdir);
#endif
sources_tsrc[vecindex] += tmp2;
}
}
}
}
}
}
}
}
}
template <typename FImpl>
void DistilVectorsFromPerambulator<FImpl>::makePhi(FermionField &rhoOut, const FermionField &evec, const SpinVector &perambulator)
{
// INPUT:::::::::
Perambulator<SpinVector> perambulator;
Grid::Hadrons::EigenPack<LatticeColourVector> eig4d;
// OUTPUT::::::::
std::vector <LatticeSpinColourVector> sinks_tsrc;
{
LatticeSpinColourVector vecModel(grid4d);
sinks_tsrc.resize(nnoise*LI*Ns*Nt_inv,vecModel);
}
// TEMPORARY:::::::::
LatticeSpinColourVector tmp2(grid4d);
LatticeSpinColourVector tmp3d(grid3d);
LatticeColourVector tmp3d_nospin(grid3d);
LatticeColourVector tmp_nospin(grid4d);
LatticeColourVector evec3d(grid3d);
int vecindex;
for (int inoise = 0; inoise < nnoise; inoise++) {
for (int dk = 0; dk < LI; dk++) {
for (int dt = 0; dt < Nt_inv; dt++) {
for (int ds = 0; ds < Ns; ds++) {
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * Ns*dt;
sinks_tsrc[vecindex] = zero;
for (int t = Ntfirst; t < Ntfirst + Ntlocal; t++) {
sink_tslice=zero;
for (int ivec = 0; ivec < nvec; ivec++) {
ExtractSliceLocal(evec3d,eig4d.evec[ivec],0,t,3);
sink_tslice += evec3d * perambulator(t, ivec, dk, inoise,dt,ds);
}
#ifdef USE_LOCAL_SLICES
InsertSliceLocal(sink_tslice,sinks_tsrc[vecindex],0,t-Ntfirst,Grid::QCD::Tdir);
#else
InsertSlice(sink_tslice,sinks_tsrc[vecindex],t,Grid::QCD::Tdir);
#endif
}
}
}
}
}
}
*/
/****************************************************************************** /******************************************************************************
* DistilVectors * * DistilVectors *
******************************************************************************/ ******************************************************************************/
@ -429,11 +269,8 @@ void TDistilVectors<FImpl>::execute(void)
sink_tslice=zero; sink_tslice=zero;
for (int ivec = 0; ivec < nvec; ivec++) { for (int ivec = 0; ivec < nvec; ivec++) {
ExtractSliceLocal(evec3d,epack.evec[ivec],0,t,3); ExtractSliceLocal(evec3d,epack.evec[ivec],0,t,3);
// sink_tslice += evec3d * perambulator[inoise + nnoise * dk + nnoise * LI * dt + nnoise*LI*Nt_inv * t + nnoise*LI*Nt_inv*Nt* ivec]()(ds)();
sink_tslice += evec3d * perambulator(t, ivec, dk, inoise,dt,ds); sink_tslice += evec3d * perambulator(t, ivec, dk, inoise,dt,ds);
} }
//InsertSliceLocal(sink_tslice,sink4d,0,t-Ntfirst,Grid::QCD::Tdir);
//phi[vecindex]+=sink4d; //DIFFERENT TYPES????
InsertSliceLocal(sink_tslice,phi[vecindex],0,t-Ntfirst,Grid::QCD::Tdir); InsertSliceLocal(sink_tslice,phi[vecindex],0,t-Ntfirst,Grid::QCD::Tdir);
} }
} }