From 3848da7c50a0a4e3556162e86ebe200fea0f200e Mon Sep 17 00:00:00 2001 From: Felix Erben Date: Mon, 8 Jul 2019 17:43:14 +0100 Subject: [PATCH] added nucleon module (non-distillation) --- Hadrons/Modules.hpp | 139 ++++++------ Hadrons/Modules/MContraction/Nucleon.cc | 35 +++ Hadrons/Modules/MContraction/Nucleon.hpp | 168 ++++++++++++++ Hadrons/modules.inc | 266 ++++++++++++----------- 4 files changed, 407 insertions(+), 201 deletions(-) create mode 100644 Hadrons/Modules/MContraction/Nucleon.cc create mode 100644 Hadrons/Modules/MContraction/Nucleon.hpp diff --git a/Hadrons/Modules.hpp b/Hadrons/Modules.hpp index 4a62cf02..07d24378 100644 --- a/Hadrons/Modules.hpp +++ b/Hadrons/Modules.hpp @@ -1,80 +1,81 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include +#include +#include #include #include +#include #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include +#include #include -#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/Hadrons/Modules/MContraction/Nucleon.cc b/Hadrons/Modules/MContraction/Nucleon.cc new file mode 100644 index 00000000..304ff07a --- /dev/null +++ b/Hadrons/Modules/MContraction/Nucleon.cc @@ -0,0 +1,35 @@ +/************************************************************************************* + +Grid physics library, www.github.com/paboyle/Grid + +Source file: Hadrons/Modules/MContraction/Nucleon.cc + +Copyright (C) 2015-2019 + +Author: Antonin Portelli + +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 + +using namespace Grid; +using namespace Hadrons; +using namespace MContraction; + +template class Grid::Hadrons::MContraction::TNucleon; + diff --git a/Hadrons/Modules/MContraction/Nucleon.hpp b/Hadrons/Modules/MContraction/Nucleon.hpp new file mode 100644 index 00000000..d2a5129d --- /dev/null +++ b/Hadrons/Modules/MContraction/Nucleon.hpp @@ -0,0 +1,168 @@ +/************************************************************************************* + +Grid physics library, www.github.com/paboyle/Grid + +Source file: Hadrons/Modules/MContraction/Nucleon.hpp + +Copyright (C) 2015-2019 + +Author: Antonin Portelli +Author: Felix Erben + +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 +#include +#include + +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 +class TNucleon: public Module +{ +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>>, corr); + }; +public: + // constructor + TNucleon(const std::string name); + // destructor + virtual ~TNucleon(void) {}; + // dependency relation + virtual std::vector getInput(void); + virtual std::vector getOutput(void); +protected: + // setup + virtual void setup(void); + // execution + virtual void execute(void); +}; + +MODULE_REGISTER_TMP(Nucleon, ARG(TNucleon), MContraction); + +/****************************************************************************** + * TNucleon implementation * + ******************************************************************************/ +// constructor ///////////////////////////////////////////////////////////////// +template +TNucleon::TNucleon(const std::string name) +: Module(name) +{} + +// dependencies/products /////////////////////////////////////////////////////// +template +std::vector TNucleon::getInput(void) +{ + std::vector input = {par().q1, par().q2, par().q3}; + + return input; +} + +template +std::vector TNucleon::getOutput(void) +{ + std::vector out = {}; + + return out; +} + +// setup /////////////////////////////////////////////////////////////////////// +template +void TNucleon::setup(void) +{ + envTmpLat(LatticeComplex, "c"); + envTmpLat(LatticeComplex, "diquark"); +} + +// execution /////////////////////////////////////////////////////////////////// +template +void TNucleon::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, quark2); + //envGetTmp(LatticeComplex, quark3); + envGetTmp(LatticeComplex, diquark); + Result result; + + // C = i gamma_2 gamma_4 => C gamma_5 = - i gamma_1 gamma_3 + Gamma Cg5(Gamma::Algebra::SigmaXZ); + Gamma g4(Gamma::Algebra::GammaT); + + std::vector> epsilon = {{0,1,2},{1,2,0},{2,0,1},{0,2,1},{2,1,0},{1,0,2}}; + std::vector epsilon_sgn = {1,1,1,-1,-1,-1}; + for (int ie_src=0; ie_src < 6 ; ie_src++){ + int c1_src = epsilon[ie_src][0]; + int c2_src = epsilon[ie_src][1]; + int c3_src = epsilon[ie_src][2]; + for (int ie_snk=0; ie_snk < 6 ; ie_snk++){ + int c1_snk = epsilon[ie_snk][0]; + int c2_snk = epsilon[ie_snk][1]; + int c3_snk = epsilon[ie_snk][2]; + auto f1 = peekColour(q1,c1_snk,c1_src); + auto f2 = peekColour(q2,c2_snk,c2_src); + auto f3 = peekColour(q3,c3_snk,c3_src); + diquark = trace(f2 * Cg5 * f3); + //diquark = q2()()(c2,1) * Cg5 * q3()()(c3,2); + auto temp = Cg5 * f1 * 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); + } + } + + // saveResult(par().output, "meson", result); +} + +END_MODULE_NAMESPACE + +END_HADRONS_NAMESPACE + +#endif // Hadrons_MContraction_Nucleon_hpp_ diff --git a/Hadrons/modules.inc b/Hadrons/modules.inc index 5cb77b9e..aa6d3af8 100644 --- a/Hadrons/modules.inc +++ b/Hadrons/modules.inc @@ -1,161 +1,163 @@ modules_cc =\ - Modules/MContraction/Baryon.cc \ - Modules/MContraction/Meson.cc \ - Modules/MContraction/WeakMesonDecayKl2.cc \ - Modules/MContraction/WeakEye3pt.cc \ - Modules/MContraction/A2ALoop.cc \ - Modules/MContraction/WeakNonEye3pt.cc \ - Modules/MContraction/A2AAslashField.cc \ - Modules/MContraction/A2AMesonField.cc \ - Modules/MContraction/DiscLoop.cc \ - Modules/MContraction/Gamma3pt.cc \ + Modules/MScalarSUN/Grad.cc \ + Modules/MScalarSUN/TwoPointNPR.cc \ + Modules/MScalarSUN/Div.cc \ + Modules/MScalarSUN/TrMag.cc \ + Modules/MScalarSUN/TransProj.cc \ + Modules/MScalarSUN/TwoPoint.cc \ + Modules/MScalarSUN/TrKinetic.cc \ + Modules/MScalarSUN/TrPhi.cc \ + Modules/MScalarSUN/EMT.cc \ + Modules/MScalarSUN/StochFreeField.cc \ + Modules/MNoise/FullVolumeSpinColorDiagonal.cc \ + Modules/MNoise/TimeDilutedSpinColorDiagonal.cc \ + Modules/MScalar/FreeProp.cc \ + Modules/MScalar/ChargedProp.cc \ + Modules/MIO/LoadBinary.cc \ + Modules/MIO/LoadCosmHol.cc \ + Modules/MIO/LoadCoarseEigenPack.cc \ + Modules/MIO/LoadNersc.cc \ + Modules/MIO/LoadEigenPack.cc \ + Modules/MIO/LoadA2AVectors.cc \ + Modules/MIO/LoadPerambulator.cc \ + Modules/MSink/Smear.cc \ + Modules/MSink/Point.cc \ Modules/MFermion/FreeProp.cc \ Modules/MFermion/GaugeProp.cc \ Modules/MFermion/EMLepton.cc \ - Modules/MSource/Momentum.cc \ - Modules/MSource/Point.cc \ - Modules/MSource/Wall.cc \ - Modules/MSource/SeqConserved.cc \ - Modules/MSource/SeqGamma.cc \ - Modules/MSource/SeqAslash.cc \ - Modules/MSource/Z2.cc \ - Modules/MSink/Point.cc \ - Modules/MSink/Smear.cc \ - Modules/MSolver/A2AVectors.cc \ - Modules/MSolver/A2AAslashVectors.cc \ - Modules/MSolver/RBPrecCG.cc \ - Modules/MSolver/MixedPrecisionRBPrecCG.cc \ - Modules/MSolver/LocalCoherenceLanczos.cc \ + Modules/MGauge/Random.cc \ + Modules/MGauge/StoutSmearing3D.cc \ + Modules/MGauge/StochEm.cc \ Modules/MGauge/StoutSmearing.cc \ Modules/MGauge/Unit.cc \ - Modules/MGauge/UnitEm.cc \ - Modules/MGauge/StochEm.cc \ - Modules/MGauge/Random.cc \ Modules/MGauge/Electrify.cc \ - Modules/MGauge/StoutSmearing3D.cc \ + Modules/MGauge/UnitEm.cc \ Modules/MGauge/FundtoHirep.cc \ Modules/MGauge/GaugeFix.cc \ - Modules/MNoise/FullVolumeSpinColorDiagonal.cc \ - Modules/MNoise/TimeDilutedSpinColorDiagonal.cc \ Modules/MUtilities/RandomVectors.cc \ Modules/MUtilities/PrecisionCast.cc \ - Modules/MScalar/FreeProp.cc \ - Modules/MScalar/ChargedProp.cc \ - Modules/MDistil/DistilVectors.cc \ - Modules/MDistil/g5_multiply.cc \ - Modules/MDistil/BC2.cc \ - Modules/MDistil/Noises.cc \ - Modules/MDistil/BContraction.cc \ - Modules/MDistil/LapEvec.cc \ - Modules/MDistil/Baryon2pt.cc \ - Modules/MDistil/Perambulator.cc \ Modules/MDistil/PerambFromSolve.cc \ - Modules/MNPR/Amputate.cc \ - Modules/MNPR/Bilinear.cc \ - Modules/MNPR/FourQuark.cc \ - Modules/MAction/Wilson.cc \ + Modules/MDistil/g5_multiply.cc \ + Modules/MDistil/LapEvec.cc \ + Modules/MDistil/Perambulator.cc \ + Modules/MDistil/Noises.cc \ + Modules/MDistil/DistilVectors.cc \ + Modules/MDistil/BContraction.cc \ + Modules/MDistil/Baryon2pt.cc \ + Modules/MDistil/BC2.cc \ + Modules/MSource/Momentum.cc \ + Modules/MSource/SeqAslash.cc \ + Modules/MSource/Z2.cc \ + Modules/MSource/Point.cc \ + Modules/MSource/SeqGamma.cc \ + Modules/MSource/Wall.cc \ + Modules/MSource/SeqConserved.cc \ + Modules/MContraction/WeakEye3pt.cc \ + Modules/MContraction/Meson.cc \ + Modules/MContraction/A2AAslashField.cc \ + Modules/MContraction/Baryon.cc \ + Modules/MContraction/Nucleon.cc \ + Modules/MContraction/WeakNonEye3pt.cc \ + Modules/MContraction/DiscLoop.cc \ + Modules/MContraction/WeakMesonDecayKl2.cc \ + Modules/MContraction/A2AMesonField.cc \ + Modules/MContraction/A2ALoop.cc \ + Modules/MContraction/Gamma3pt.cc \ Modules/MAction/MobiusDWF.cc \ - Modules/MAction/ZMobiusDWF.cc \ Modules/MAction/WilsonClover.cc \ + Modules/MAction/Wilson.cc \ Modules/MAction/DWF.cc \ Modules/MAction/ScaledDWF.cc \ - Modules/MScalarSUN/TrPhi.cc \ - Modules/MScalarSUN/Grad.cc \ - Modules/MScalarSUN/TrMag.cc \ - Modules/MScalarSUN/TrKinetic.cc \ - Modules/MScalarSUN/EMT.cc \ - Modules/MScalarSUN/TransProj.cc \ - Modules/MScalarSUN/StochFreeField.cc \ - Modules/MScalarSUN/TwoPoint.cc \ - Modules/MScalarSUN/TwoPointNPR.cc \ - Modules/MScalarSUN/Div.cc \ - Modules/MIO/LoadEigenPack.cc \ - Modules/MIO/LoadBinary.cc \ - Modules/MIO/LoadPerambulator.cc \ - Modules/MIO/LoadNersc.cc \ - Modules/MIO/LoadCoarseEigenPack.cc \ - Modules/MIO/LoadCosmHol.cc \ - Modules/MIO/LoadA2AVectors.cc + Modules/MAction/ZMobiusDWF.cc \ + Modules/MSolver/A2AVectors.cc \ + Modules/MSolver/RBPrecCG.cc \ + Modules/MSolver/LocalCoherenceLanczos.cc \ + Modules/MSolver/MixedPrecisionRBPrecCG.cc \ + Modules/MSolver/A2AAslashVectors.cc \ + Modules/MNPR/Bilinear.cc \ + Modules/MNPR/FourQuark.cc \ + Modules/MNPR/Amputate.cc modules_hpp =\ - Modules/MContraction/WeakEye3pt.hpp \ - Modules/MContraction/Baryon.hpp \ - Modules/MContraction/A2AAslashField.hpp \ - Modules/MContraction/A2ALoop.hpp \ - Modules/MContraction/A2AMesonField.hpp \ - Modules/MContraction/Meson.hpp \ - Modules/MContraction/DiscLoop.hpp \ - Modules/MContraction/Gamma3pt.hpp \ - Modules/MContraction/WeakMesonDecayKl2.hpp \ - Modules/MContraction/WeakNonEye3pt.hpp \ - Modules/MFermion/FreeProp.hpp \ - Modules/MFermion/GaugeProp.hpp \ - Modules/MFermion/EMLepton.hpp \ - Modules/MSource/SeqGamma.hpp \ - Modules/MSource/SeqAslash.hpp \ - Modules/MSource/Point.hpp \ - Modules/MSource/Wall.hpp \ - Modules/MSource/Z2.hpp \ - Modules/MSource/SeqConserved.hpp \ - Modules/MSource/Momentum.hpp \ - Modules/MSink/Smear.hpp \ - Modules/MSink/Point.hpp \ - Modules/MSolver/MixedPrecisionRBPrecCG.hpp \ - Modules/MSolver/LocalCoherenceLanczos.hpp \ - Modules/MSolver/A2AAslashVectors.hpp \ - Modules/MSolver/Guesser.hpp \ - Modules/MSolver/RBPrecCG.hpp \ - Modules/MSolver/A2AVectors.hpp \ - Modules/MGauge/UnitEm.hpp \ - Modules/MGauge/StoutSmearing.hpp \ - Modules/MGauge/Unit.hpp \ - Modules/MGauge/Random.hpp \ - Modules/MGauge/GaugeFix.hpp \ - Modules/MGauge/FundtoHirep.hpp \ - Modules/MGauge/StoutSmearing3D.hpp \ - Modules/MGauge/StochEm.hpp \ - Modules/MGauge/Electrify.hpp \ - Modules/MNoise/TimeDilutedSpinColorDiagonal.hpp \ - Modules/MNoise/FullVolumeSpinColorDiagonal.hpp \ - Modules/MUtilities/PrecisionCast.hpp \ - Modules/MUtilities/RandomVectors.hpp \ - Modules/MScalar/FreeProp.hpp \ - Modules/MScalar/Scalar.hpp \ - Modules/MScalar/ChargedProp.hpp \ - Modules/MDistil/LapEvec.hpp \ - Modules/MDistil/DistilVectors.hpp \ - Modules/MDistil/Noises.hpp \ - Modules/MDistil/BC2.hpp \ - Modules/MDistil/Perambulator.hpp \ - Modules/MDistil/PerambFromSolve.hpp \ - Modules/MDistil/BContraction.hpp \ - Modules/MDistil/Baryon2pt.hpp \ - Modules/MDistil/g5_multiply.hpp \ - Modules/MNPR/Bilinear.hpp \ - Modules/MNPR/Amputate.hpp \ - Modules/MNPR/FourQuark.hpp \ - Modules/MAction/DWF.hpp \ - Modules/MAction/MobiusDWF.hpp \ - Modules/MAction/Wilson.hpp \ - Modules/MAction/WilsonClover.hpp \ - Modules/MAction/ZMobiusDWF.hpp \ - Modules/MAction/ScaledDWF.hpp \ + Modules/MScalarSUN/TrKinetic.hpp \ Modules/MScalarSUN/StochFreeField.hpp \ Modules/MScalarSUN/TwoPointNPR.hpp \ + Modules/MScalarSUN/Grad.hpp \ + Modules/MScalarSUN/TransProj.hpp \ Modules/MScalarSUN/Div.hpp \ Modules/MScalarSUN/TrMag.hpp \ + Modules/MScalarSUN/Utils.hpp \ Modules/MScalarSUN/EMT.hpp \ Modules/MScalarSUN/TwoPoint.hpp \ Modules/MScalarSUN/TrPhi.hpp \ - Modules/MScalarSUN/Utils.hpp \ - Modules/MScalarSUN/TransProj.hpp \ - Modules/MScalarSUN/Grad.hpp \ - Modules/MScalarSUN/TrKinetic.hpp \ - Modules/MIO/LoadEigenPack.hpp \ - Modules/MIO/LoadNersc.hpp \ + Modules/MNoise/FullVolumeSpinColorDiagonal.hpp \ + Modules/MNoise/TimeDilutedSpinColorDiagonal.hpp \ + Modules/MScalar/FreeProp.hpp \ + Modules/MScalar/Scalar.hpp \ + Modules/MScalar/ChargedProp.hpp \ Modules/MIO/LoadPerambulator.hpp \ + Modules/MIO/LoadEigenPack.hpp \ Modules/MIO/LoadA2AVectors.hpp \ - Modules/MIO/LoadCosmHol.hpp \ Modules/MIO/LoadCoarseEigenPack.hpp \ - Modules/MIO/LoadBinary.hpp + Modules/MIO/LoadCosmHol.hpp \ + Modules/MIO/LoadBinary.hpp \ + Modules/MIO/LoadNersc.hpp \ + Modules/MSink/Smear.hpp \ + Modules/MSink/Point.hpp \ + Modules/MFermion/FreeProp.hpp \ + Modules/MFermion/GaugeProp.hpp \ + Modules/MFermion/EMLepton.hpp \ + Modules/MGauge/FundtoHirep.hpp \ + Modules/MGauge/Random.hpp \ + Modules/MGauge/StoutSmearing.hpp \ + Modules/MGauge/Unit.hpp \ + Modules/MGauge/GaugeFix.hpp \ + Modules/MGauge/StoutSmearing3D.hpp \ + Modules/MGauge/StochEm.hpp \ + Modules/MGauge/Electrify.hpp \ + Modules/MGauge/UnitEm.hpp \ + Modules/MUtilities/RandomVectors.hpp \ + Modules/MUtilities/PrecisionCast.hpp \ + Modules/MDistil/Noises.hpp \ + Modules/MDistil/Perambulator.hpp \ + Modules/MDistil/BC2.hpp \ + Modules/MDistil/g5_multiply.hpp \ + Modules/MDistil/PerambFromSolve.hpp \ + Modules/MDistil/Baryon2pt.hpp \ + Modules/MDistil/LapEvec.hpp \ + Modules/MDistil/BContraction.hpp \ + Modules/MDistil/DistilVectors.hpp \ + Modules/MSource/SeqConserved.hpp \ + Modules/MSource/SeqAslash.hpp \ + Modules/MSource/Z2.hpp \ + Modules/MSource/Wall.hpp \ + Modules/MSource/SeqGamma.hpp \ + Modules/MSource/Point.hpp \ + Modules/MSource/Momentum.hpp \ + Modules/MContraction/WeakMesonDecayKl2.hpp \ + Modules/MContraction/Nucleon.hpp \ + Modules/MContraction/A2AAslashField.hpp \ + Modules/MContraction/WeakEye3pt.hpp \ + Modules/MContraction/WeakNonEye3pt.hpp \ + Modules/MContraction/Baryon.hpp \ + Modules/MContraction/Meson.hpp \ + Modules/MContraction/A2ALoop.hpp \ + Modules/MContraction/Gamma3pt.hpp \ + Modules/MContraction/DiscLoop.hpp \ + Modules/MContraction/A2AMesonField.hpp \ + Modules/MAction/WilsonClover.hpp \ + Modules/MAction/ScaledDWF.hpp \ + Modules/MAction/MobiusDWF.hpp \ + Modules/MAction/Wilson.hpp \ + Modules/MAction/DWF.hpp \ + Modules/MAction/ZMobiusDWF.hpp \ + Modules/MSolver/RBPrecCG.hpp \ + Modules/MSolver/LocalCoherenceLanczos.hpp \ + Modules/MSolver/A2AVectors.hpp \ + Modules/MSolver/MixedPrecisionRBPrecCG.hpp \ + Modules/MSolver/Guesser.hpp \ + Modules/MSolver/A2AAslashVectors.hpp \ + Modules/MNPR/FourQuark.hpp \ + Modules/MNPR/Bilinear.hpp \ + Modules/MNPR/Amputate.hpp