1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 09:45:36 +00:00
Grid/Hadrons/Modules/MContraction/SigmaToNucleonNonEye.hpp

225 lines
8.5 KiB
C++
Raw Normal View History

2019-11-21 17:25:37 +00:00
/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: Hadrons/Modules/MContraction/SigmaToNucleonNonEye.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_SigmaToNucleonNonEye_hpp_
#define Hadrons_MContraction_SigmaToNucleonNonEye_hpp_
#include <Hadrons/Global.hpp>
#include <Hadrons/Module.hpp>
#include <Hadrons/ModuleFactory.hpp>
#include <Grid/qcd/utils/BaryonUtils.h>
BEGIN_HADRONS_NAMESPACE
/******************************************************************************
* SigmaToNucleonNonEye *
******************************************************************************/
/*
* Sigma-to-Nucleon 3-pt diagrams, non-eye topologies.
*
* Schematic:
2019-12-03 11:17:35 +00:00
* qs_xi qu_xf | qs_xi qd_xf
* /-->--¬ /-->--¬ | /-->--¬ /-->--¬
2019-11-21 17:25:37 +00:00
* / \ / \ | / \ / \
* / \ / \ | / \ / \
* / \ / \ | / \ / \
* * * G * | * G * * G *
* |\ * G | | |\ / \ /|
* | \ / \ /| | | \ / \ / |
* | \ / \ / | | | \ / \ / |
* | \ / \ / | | | \-->--/ \-->--/ |
* \ \-->--/ \-->--/ / | \ qu_xi qu_xf /
2019-12-03 11:17:35 +00:00
* \ qu_xi qd_xf / | \ /
2019-11-21 17:25:37 +00:00
* \ / | \ /
* \--------->----------/ | \--------->-----------/
* qu_spec | qu_spec
*
*
* analogously to the rare-kaon naming, the left diagram is named 'one-trace' and
* the diagram on the right 'two-trace'
*
* Propagators:
* * qu_xi, source at xi
* * qu_xf, source at xf
* * qu_spec, source at xi
* * qd_xf, source at xf
* * qs_xi, source at xi
2019-11-21 17:25:37 +00:00
*/
BEGIN_MODULE_NAMESPACE(MContraction)
class SigmaToNucleonNonEyePar: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(SigmaToNucleonNonEyePar,
std::string, qu_xi,
std::string, qu_xf,
std::string, qu_spec,
std::string, qd_xf,
std::string, qs_xi,
unsigned int, xf,
2019-11-21 17:25:37 +00:00
std::string, sink,
std::string, output);
};
2019-12-05 16:46:58 +00:00
template <typename FImpl>
2019-11-21 17:25:37 +00:00
class TSigmaToNucleonNonEye: public Module<SigmaToNucleonNonEyePar>
{
public:
2019-12-05 16:46:58 +00:00
FERM_TYPE_ALIASES(FImpl,);
2019-11-21 17:25:37 +00:00
BASIC_TYPE_ALIASES(ScalarImplCR, Scalar);
SINK_TYPE_ALIASES(Scalar);
2019-12-05 16:46:58 +00:00
typedef typename SpinMatrixField::vector_object::scalar_object SpinMatrix;
2019-11-21 17:25:37 +00:00
class Metadata: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(Metadata,
Gamma::Algebra, gamma_H,
Gamma::Algebra, gammaA_sigma,
Gamma::Algebra, gammaB_sigma,
Gamma::Algebra, gammaA_nucl,
Gamma::Algebra, gammaB_nucl,
2019-12-03 12:01:31 +00:00
int, trace);
2019-11-21 17:25:37 +00:00
};
typedef Correlator<Metadata, SpinMatrix> Result;
public:
// constructor
TSigmaToNucleonNonEye(const std::string name);
// destructor
virtual ~TSigmaToNucleonNonEye(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);
// Which gamma algebra was specified
Gamma::Algebra al;
};
2019-12-05 16:46:58 +00:00
MODULE_REGISTER_TMP(SigmaToNucleonNonEye, ARG(TSigmaToNucleonNonEye<FIMPL>), MContraction);
2019-11-21 17:25:37 +00:00
/******************************************************************************
* TSigmaToNucleonNonEye implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
2019-12-05 16:46:58 +00:00
template <typename FImpl>
TSigmaToNucleonNonEye<FImpl>::TSigmaToNucleonNonEye(const std::string name)
2019-11-21 17:25:37 +00:00
: Module<SigmaToNucleonNonEyePar>(name)
{}
// dependencies/products ///////////////////////////////////////////////////////
2019-12-05 16:46:58 +00:00
template <typename FImpl>
std::vector<std::string> TSigmaToNucleonNonEye<FImpl>::getInput(void)
2019-11-21 17:25:37 +00:00
{
std::vector<std::string> input = {par().qu_xi, par().qu_xf, par().qu_spec, par().qd_xf, par().qs_xi, par().sink};
return input;
}
2019-12-05 16:46:58 +00:00
template <typename FImpl>
std::vector<std::string> TSigmaToNucleonNonEye<FImpl>::getOutput(void)
2019-11-21 17:25:37 +00:00
{
std::vector<std::string> out = {};
return out;
}
// setup ///////////////////////////////////////////////////////////////////////
2019-12-05 16:46:58 +00:00
template <typename FImpl>
void TSigmaToNucleonNonEye<FImpl>::setup(void)
2019-11-21 17:25:37 +00:00
{
2019-12-05 16:46:58 +00:00
envTmpLat(SpinMatrixField, "c");
2019-11-21 17:25:37 +00:00
}
// execution ///////////////////////////////////////////////////////////////////
2019-12-05 16:46:58 +00:00
template <typename FImpl>
void TSigmaToNucleonNonEye<FImpl>::execute(void)
2019-11-21 17:25:37 +00:00
{
const Gamma GammaB(Gamma::Algebra::SigmaXZ); // C*gamma_5
const Gamma Id(Gamma::Algebra::Identity); // C*gamma_5
LOG(Message) << "Computing sigma-to-nucleon contractions '" << getName() << "'" << std::endl;
LOG(Message) << "' with (Gamma^A,Gamma^B)_sigma = ( Identity, C*gamma_5 ) and (Gamma^A,Gamma^B)_nucl = ( Identity, C*gamma_5 )" << std::endl;
2019-12-03 12:01:31 +00:00
LOG(Message) << " using sink " << par().sink << "." << std::endl;
2019-11-21 17:25:37 +00:00
2019-12-05 16:46:58 +00:00
envGetTmp(SpinMatrixField, c);
2019-11-21 17:25:37 +00:00
std::vector<SpinMatrix> buf;
std::vector<Result> result;
Result r;
r.info.gammaA_sigma = Id.g;
r.info.gammaB_sigma = GammaB.g;
r.info.gammaA_nucl = Id.g;
r.info.gammaB_nucl = GammaB.g;
2019-12-05 16:46:58 +00:00
auto &qu_xi = envGet(PropagatorField, par().qu_xi);
auto &qu_xf = envGet(PropagatorField, par().qu_xf);
auto &qu_spec = envGet(SlicedPropagator, par().qu_spec);
auto &qd_xf = envGet(PropagatorField, par().qd_xf);
auto &qs_xi = envGet(PropagatorField, par().qs_xi);
auto qut = qu_spec[par().xf];
2019-11-21 17:25:37 +00:00
for (auto &G: Gamma::gall)
{
r.info.gamma_H = G.g;
//Operator Q1, equivalent to the two-trace case in the rare-kaons module
c=Zero();
2019-12-03 12:01:31 +00:00
BaryonUtils<FIMPL>::Sigma_to_Nucleon_NonEye(qu_xi,qu_xf,qut,qd_xf,qs_xi,G,GammaB,GammaB,"Q1",c);
2019-11-21 17:25:37 +00:00
sliceSum(c,buf,Tp);
r.corr.clear();
for (unsigned int t = 0; t < buf.size(); ++t)
{
r.corr.push_back(buf[t]);
}
r.info.trace = 2;
result.push_back(r);
//Operator Q2, equivalent to the one-trace case in the rare-kaons module
c=Zero();
2019-12-03 12:01:31 +00:00
BaryonUtils<FIMPL>::Sigma_to_Nucleon_NonEye(qu_xi,qu_xf,qut,qd_xf,qs_xi,G,GammaB,GammaB,"Q2",c);
2019-11-21 17:25:37 +00:00
sliceSum(c,buf,Tp);
r.corr.clear();
for (unsigned int t = 0; t < buf.size(); ++t)
{
r.corr.push_back(buf[t]);
}
r.info.trace = 1;
result.push_back(r);
}
saveResult(par().output, "StN_NonEye", result);
}
END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE
#endif // Hadrons_MContraction_SigmaToNucleonNonEye_hpp_