1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Cleanup modules that are no longer required

This commit is contained in:
Michael Marshall 2019-09-17 13:06:52 +01:00
parent eb293e9909
commit 911fbb0f36
8 changed files with 0 additions and 598 deletions

View File

@ -56,8 +56,6 @@
#include <Hadrons/Modules/MContraction/A2AAslashField.hpp>
#include <Hadrons/Modules/MContraction/Baryon.hpp>
#include <Hadrons/Modules/MContraction/Meson.hpp>
#include <Hadrons/Modules/MContraction/Nucleon.hpp>
#include <Hadrons/Modules/MContraction/SelfContract.hpp>
#include <Hadrons/Modules/MDistil/BContraction.hpp>
#include <Hadrons/Modules/MDistil/Baryon2pt.hpp>
#include <Hadrons/Modules/MDistil/DistilVectors.hpp>
@ -65,7 +63,6 @@
#include <Hadrons/Modules/MDistil/Noises.hpp>
#include <Hadrons/Modules/MDistil/PerambFromSolve.hpp>
#include <Hadrons/Modules/MDistil/Perambulator.hpp>
#include <Hadrons/Modules/MDistil/g5_multiply.hpp>
#include <Hadrons/Modules/MNPR/FourQuark.hpp>
#include <Hadrons/Modules/MNPR/Bilinear.hpp>
#include <Hadrons/Modules/MNPR/Amputate.hpp>

View File

@ -1,35 +0,0 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: Hadrons/Modules/MContraction/Nucleon.cc
Copyright (C) 2015-2019
Author: Antonin Portelli <antonin.portelli@me.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/
/* END LEGAL */
#include <Hadrons/Modules/MContraction/Nucleon.hpp>
using namespace Grid;
using namespace Hadrons;
using namespace MContraction;
template class Grid::Hadrons::MContraction::TNucleon<FIMPL,FIMPL,FIMPL>;

View File

@ -1,214 +0,0 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: Hadrons/Modules/MContraction/Nucleon.hpp
Copyright (C) 2015-2019
Author: Antonin Portelli <antonin.portelli@me.com>
Author: Felix Erben <felix.erben@ed.ac.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/
/* END LEGAL */
#ifndef Hadrons_MContraction_Nucleon_hpp_
#define Hadrons_MContraction_Nucleon_hpp_
#include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp>
#include <Hadrons/ModuleFactory.hpp>
BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* Nucleon *
******************************************************************************/
BEGIN_MODULE_NAMESPACE(MContraction)
class NucleonPar: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(NucleonPar,
std::string, q1,
std::string, q2,
std::string, q3,
std::string, output);
};
template <typename FImpl1, typename FImpl2, typename FImpl3>
class TNucleon: public Module<NucleonPar>
{
public:
FERM_TYPE_ALIASES(FImpl1, 1);
FERM_TYPE_ALIASES(FImpl2, 2);
FERM_TYPE_ALIASES(FImpl3, 3);
class Result: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
std::vector<Complex>, corr);
};
public:
// constructor
TNucleon(const std::string name);
// destructor
virtual ~TNucleon(void) {};
// dependency relation
virtual std::vector<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void);
protected:
// setup
virtual void setup(void);
// execution
virtual void execute(void);
};
MODULE_REGISTER_TMP(Nucleon, ARG(TNucleon<FIMPL, FIMPL, FIMPL>), MContraction);
/******************************************************************************
* TNucleon implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
template <typename FImpl1, typename FImpl2, typename FImpl3>
TNucleon<FImpl1, FImpl2, FImpl3>::TNucleon(const std::string name)
: Module<NucleonPar>(name)
{}
// dependencies/products ///////////////////////////////////////////////////////
template <typename FImpl1, typename FImpl2, typename FImpl3>
std::vector<std::string> TNucleon<FImpl1, FImpl2, FImpl3>::getInput(void)
{
std::vector<std::string> input = {par().q1, par().q2, par().q3};
return input;
}
template <typename FImpl1, typename FImpl2, typename FImpl3>
std::vector<std::string> TNucleon<FImpl1, FImpl2, FImpl3>::getOutput(void)
{
std::vector<std::string> out = {};
return out;
}
// setup ///////////////////////////////////////////////////////////////////////
template <typename FImpl1, typename FImpl2, typename FImpl3>
void TNucleon<FImpl1, FImpl2, FImpl3>::setup(void)
{
envTmpLat(LatticeComplex, "c");
envTmpLat(LatticeComplex, "diquark");
}
#ifdef DEBUG
template <typename T> struct DebugShowType { DebugShowType() { T t = (void***) nullptr; } };
#define DEBUG_SHOW_TYPE(x) DebugShowType<decltype(x)> __DEBUG_SHOW_TYPE__##x
#endif
// execution ///////////////////////////////////////////////////////////////////
template <typename FImpl1, typename FImpl2, typename FImpl3>
void TNucleon<FImpl1, FImpl2, FImpl3>::execute(void)
{
LOG(Message) << "Computing nucleon contractions '" << getName() << "' using"
<< " quarks '" << par().q1 << "', '" << par().q2 << "', and '"
<< par().q3 << "'" << std::endl;
auto &q1 = envGet(PropagatorField1, par().q1);
auto &q2 = envGet(PropagatorField2, par().q2);
auto &q3 = envGet(PropagatorField3, par().q2);
envGetTmp(LatticeComplex, c);
envGetTmp(LatticeComplex, diquark);
Result result;
int nt = env().getDim(Tp);
result.corr.resize(nt);
std::vector<TComplex> buf;
// C = i gamma_2 gamma_4 => C gamma_5 = - i gamma_1 gamma_3
Gamma Cg5(Gamma::Algebra::SigmaXZ);
Gamma g4(Gamma::Algebra::GammaT); //needed for parity P_\pm = 0.5*(1 \pm \gamma_4)
std::vector<std::vector<int>> epsilon = {{0,1,2},{1,2,0},{2,0,1},{0,2,1},{2,1,0},{1,0,2}};
std::vector<int> epsilon_sgn = {1,1,1,-1,-1,-1};
// This is the \delta_{123}^{123} part
for (int ie_src=0; ie_src < 6 ; ie_src++){
int c1_src = epsilon[ie_src][0]; //a
int c2_src = epsilon[ie_src][1]; //b
int c3_src = epsilon[ie_src][2]; //c
for (int ie_snk=0; ie_snk < 6 ; ie_snk++){
int c1_snk = epsilon[ie_snk][0]; //a'
int c2_snk = epsilon[ie_snk][1]; //b'
int c3_snk = epsilon[ie_snk][2]; //c'
auto Dcc = peekColour(q1,c1_snk,c1_src); //D_{gamma' gamma}
auto Daa = peekColour(q2,c2_snk,c2_src); //D_{alpha' alpha}
// DEBUG Just defining a few types so I can see what these things are
//auto Daa_debug1 = transposeSpin( q1 );
// Current compilation settings tell me that FImpl is WilsonImplR (see FermionOperatorImpl.h, line 163)
const WilsonImplR::PropagatorField &Debug_q_1{ q1 };
//DEBUG_SHOW_TYPE( q1 );
// The propagator field is an alias for
const Lattice<iScalar<iMatrix<iMatrix<vComplexD, Nc>, Ns> >> &Debug_q_2{ q1 };
// So then Daa is one of these
const Lattice<iScalar<iMatrix<iScalar<vComplexD>, Ns> >> &Debug_Daa_1{ Daa };
// Which means I should be able to do this
//Lattice<iScalar<iMatrix<iScalar<vComplexD>, Ns> >> Debug_Daa_2 = transposeSpin(Daa);
// END DEBUG
//auto test = transposeSpin(Daa); //Does not work...
auto Dbb = peekColour(q3,c3_snk,c3_src); //D_{beta' beta}
diquark = trace(Cg5 * Daa * Cg5 * Dbb); //Daa transposed????
//diquark = q2()()(c2,1) * Cg5 * q3()()(c3,2); //Why does this not work??
auto temp = Dcc * diquark;
auto g4_temp = g4 * temp;
int parity = 1;
c += epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * 0.5 * (double)parity * trace(temp + g4_temp);
}
}
// This is the \delta_{123}^{213} part
for (int ie_src=0; ie_src < 6 ; ie_src++){
int c1_src = epsilon[ie_src][0]; //a
int c2_src = epsilon[ie_src][1]; //b
int c3_src = epsilon[ie_src][2]; //c
for (int ie_snk=0; ie_snk < 6 ; ie_snk++){
int c1_snk = epsilon[ie_snk][0]; //a'
int c2_snk = epsilon[ie_snk][1]; //b'
int c3_snk = epsilon[ie_snk][2]; //c'
auto Dca = peekColour(q1,c1_snk,c2_src); //D_{gamma' alpha}
auto Dac = peekColour(q2,c2_snk,c1_src); //D_{alpha' gamma}
auto Dbb = peekColour(q3,c3_snk,c3_src); //D_{beta' beta}
auto temp = Dca * Cg5 * Dbb * Cg5 * Dac; //(Dbb*Cg5) transposed???
auto g4_temp = g4 * temp;
int parity = 1;
c -= epsilon_sgn[ie_src] * epsilon_sgn[ie_snk] * 0.5 * (double)parity * trace(temp + g4_temp);
}
}
sliceSum(c,buf,Tp);
for (unsigned int t = 0; t < buf.size(); ++t)
{
result.corr[t] = TensorRemove(buf[t]);
}
saveResult(par().output, "baryon", result);
}
END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE
#endif // Hadrons_MContraction_Nucleon_hpp_

View File

@ -1,7 +0,0 @@
#include <Hadrons/Modules/MContraction/SelfContract.hpp>
using namespace Grid;
using namespace Hadrons;
using namespace MContraction;
template class Grid::Hadrons::MContraction::TSelfContract<FIMPL>;

View File

@ -1,147 +0,0 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: Hadrons/Modules/MContraction/Baryon.hpp
Copyright (C) 2015-2019
Author: Antonin Portelli <antonin.portelli@me.com>
Author: Felix Erben <felix.erben@ed.ac.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/
/* END LEGAL */
#ifndef Hadrons_MContraction_SelfContract_hpp_
#define Hadrons_MContraction_SelfContract_hpp_
#include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp>
#include <Hadrons/ModuleFactory.hpp>
BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* SelfContract *
******************************************************************************/
BEGIN_MODULE_NAMESPACE(MContraction)
class SelfContractPar: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(SelfContractPar,
std::string, q_self,
Gamma::Algebra, gamma,
std::string, sink,
std::string, output);
};
template <typename FImpl>
class TSelfContract: public Module<SelfContractPar>
{
FERM_TYPE_ALIASES(FImpl,);
BASIC_TYPE_ALIASES(ScalarImplCR, Scalar);
SINK_TYPE_ALIASES(Scalar);
class Result: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
Gamma::Algebra, gamma,
std::vector<Complex>, corr);
};
public:
// constructor
TSelfContract(const std::string name);
// destructor
virtual ~TSelfContract(void) {};
// dependency relation
virtual std::vector<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void);
protected:
// setup
virtual void setup(void);
// execution
virtual void execute(void);
};
MODULE_REGISTER_TMP(SelfContract, TSelfContract<FIMPL>, MContraction);
/******************************************************************************
* TSelfContract implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
template <typename FImpl>
TSelfContract<FImpl>::TSelfContract(const std::string name)
: Module<SelfContractPar>(name)
{}
// dependencies/products ///////////////////////////////////////////////////////
template <typename FImpl>
std::vector<std::string> TSelfContract<FImpl>::getInput(void)
{
std::vector<std::string> in = {par().q_self, par().sink};
return in;
}
template <typename FImpl>
std::vector<std::string> TSelfContract<FImpl>::getOutput(void)
{
std::vector<std::string> out = {};
return out;
}
// setup ///////////////////////////////////////////////////////////////////////
template <typename FImpl>
void TSelfContract<FImpl>::setup(void)
{
envTmpLat(LatticeComplex, "c");
}
// execution ///////////////////////////////////////////////////////////////////
template <typename FImpl>
void TSelfContract<FImpl>::execute(void)
{
LOG(Message) << "Computing self-contracted loop '" << getName()
<< "' using '" << par().q_self << "' with " << par().gamma
<< " insertion and sink " << par().sink << std::endl;
auto &q_self = envGet(PropagatorField, par().q_self);
Gamma gamma(par().gamma);
std::vector<TComplex> buf;
Result result;
envGetTmp(LatticeComplex, c);
SinkFnScalar &sink = envGet(SinkFnScalar, par().sink);
c = trace(gamma*q_self);
buf = sink(c);
result.gamma = par().gamma;
result.corr.resize(buf.size());
for (unsigned int t = 0; t < buf.size(); ++t)
{
result.corr[t] = TensorRemove(buf[t]);
}
saveResult(par().output, "selfContr", result);
}
END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE
#endif // Hadrons_MContraction_SelfContract_hpp_

View File

@ -1,36 +0,0 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: Hadrons/Modules/MDistil/g5_multiply.cc
Copyright (C) 2019
Author: Felix Erben <ferben@ed.ac.uk>
Author: Michael Marshall <Michael.Marshall@ed.ac.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/
/* END LEGAL */
#include <Hadrons/Modules/MDistil/g5_multiply.hpp>
using namespace Grid;
using namespace Hadrons;
using namespace MDistil;
template class Grid::Hadrons::MDistil::Tg5_multiply<FIMPL>;

View File

@ -1,150 +0,0 @@
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: Hadrons/Modules/MDistil/g5_multiply.hpp
Copyright (C) 2019
Author: Felix Erben <ferben@ed.ac.uk>
Author: Michael Marshall <Michael.Marshall@ed.ac.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
See the full license in the file "LICENSE" in the top level distribution directory
*************************************************************************************/
/* END LEGAL */
#ifndef Hadrons_MDistil_g5_multiply_hpp_
#define Hadrons_MDistil_g5_multiply_hpp_
#include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp>
#include <Hadrons/ModuleFactory.hpp>
#include <Hadrons/Solver.hpp>
#include <Hadrons/EigenPack.hpp>
#include <Hadrons/A2AVectors.hpp>
#include <Hadrons/DilutedNoise.hpp>
// These are members of Distillation
#include <Hadrons/Distil.hpp>
BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* g5_multiply *
******************************************************************************/
BEGIN_MODULE_NAMESPACE(MDistil)
class g5_multiplyPar: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(g5_multiplyPar,
std::string, input,
int, nnoise,
int, LI,
int, Ns,
int, Nt_inv);
};
template <typename FImpl>
class Tg5_multiply: public Module<g5_multiplyPar>
{
public:
FERM_TYPE_ALIASES(FImpl,);
public:
// constructor
Tg5_multiply(const std::string name);
// destructor
virtual ~Tg5_multiply(void) {};
// dependency relation
virtual std::vector<std::string> getInput(void);
virtual std::vector<std::string> getOutput(void);
// setup
virtual void setup(void);
// execution
virtual void execute(void);
};
MODULE_REGISTER_TMP(g5_multiply, Tg5_multiply<FIMPL>, MDistil);
/******************************************************************************
* Tg5_multiply implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
template <typename FImpl>
Tg5_multiply<FImpl>::Tg5_multiply(const std::string name)
: Module<g5_multiplyPar>(name)
{}
// dependencies/products ///////////////////////////////////////////////////////
template <typename FImpl>
std::vector<std::string> Tg5_multiply<FImpl>::getInput(void)
{
std::vector<std::string> in;
in.push_back(par().input);
return in;
}
template <typename FImpl>
std::vector<std::string> Tg5_multiply<FImpl>::getOutput(void)
{
std::vector<std::string> out = {getName()};
return out;
}
// setup ///////////////////////////////////////////////////////////////////////
template <typename FImpl>
void Tg5_multiply<FImpl>::setup(void)
{
int nnoise=par().nnoise;
int LI=par().LI;
int Ns=par().Ns;
int Nt_inv=par().Nt_inv;
envCreate(std::vector<FermionField>, getName(), 1,
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
}
// execution ///////////////////////////////////////////////////////////////////
template <typename FImpl>
void Tg5_multiply<FImpl>::execute(void)
{
auto &input_vector = envGet(std::vector<FermionField>, par().input);
auto &output_vector = envGet(std::vector<FermionField>, getName());
Gamma g5(Gamma::Algebra::Gamma5);
int nnoise=par().nnoise;
int LI=par().LI;
int Ns=par().Ns;
int Nt_inv=par().Nt_inv;
int Ntot = nnoise*LI*Ns*Nt_inv;
for (int i =0; i<Ntot;i++){
output_vector[i] = g5*input_vector[i];
}
}
END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE
#endif // Hadrons_MDistil_g5_multiply_hpp_

View File

@ -54,8 +54,6 @@ modules_cc =\
Modules/MContraction/Baryon.cc \
Modules/MContraction/DiscLoop.cc \
Modules/MContraction/Meson.cc \
Modules/MContraction/Nucleon.cc \
Modules/MContraction/SelfContract.cc \
Modules/MContraction/WeakEye3pt.cc \
Modules/MDistil/BContraction.cc \
Modules/MDistil/Baryon2pt.cc \
@ -64,7 +62,6 @@ modules_cc =\
Modules/MDistil/Noises.cc \
Modules/MDistil/PerambFromSolve.cc \
Modules/MDistil/Perambulator.cc \
Modules/MDistil/g5_multiply.cc \
Modules/MNPR/Bilinear.cc \
Modules/MNPR/FourQuark.cc \
Modules/MNPR/Amputate.cc \
@ -138,8 +135,6 @@ modules_hpp =\
Modules/MContraction/A2AAslashField.hpp \
Modules/MContraction/Baryon.hpp \
Modules/MContraction/Meson.hpp \
Modules/MContraction/Nucleon.hpp \
Modules/MContraction/SelfContract.hpp \
Modules/MDistil/BContraction.hpp \
Modules/MDistil/Baryon2pt.hpp \
Modules/MDistil/DistilVectors.hpp \
@ -147,7 +142,6 @@ modules_hpp =\
Modules/MDistil/Noises.hpp \
Modules/MDistil/PerambFromSolve.hpp \
Modules/MDistil/Perambulator.hpp \
Modules/MDistil/g5_multiply.hpp \
Modules/MNPR/FourQuark.hpp \
Modules/MNPR/Bilinear.hpp \
Modules/MNPR/Amputate.hpp \