mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 05:30:46 +01:00
conserved current insertion summed over Lorentzindex
This commit is contained in:
parent
55e39df30f
commit
935cd1e173
@ -1,60 +1,31 @@
|
|||||||
/*************************************************************************************
|
#include <Grid/Hadrons/Modules/MSolver/RBPrecCG.hpp>
|
||||||
|
|
||||||
Grid physics library, www.github.com/paboyle/Grid
|
|
||||||
|
|
||||||
Source file: extras/Hadrons/Modules.hpp
|
|
||||||
|
|
||||||
Copyright (C) 2015
|
|
||||||
Copyright (C) 2016
|
|
||||||
Copyright (C) 2017
|
|
||||||
|
|
||||||
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 <Grid/Hadrons/Modules/MAction/DWF.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MAction/Wilson.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MContraction/Baryon.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MContraction/DiscLoop.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MContraction/Gamma3pt.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MContraction/Meson.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MContraction/WardIdentity.hpp>
|
#include <Grid/Hadrons/Modules/MContraction/WardIdentity.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MContraction/WeakHamiltonian.hpp>
|
#include <Grid/Hadrons/Modules/MContraction/Meson.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MContraction/Gamma3pt.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MContraction/DiscLoop.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp>
|
#include <Grid/Hadrons/Modules/MContraction/WeakHamiltonianEye.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp>
|
#include <Grid/Hadrons/Modules/MContraction/Baryon.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MContraction/WeakHamiltonian.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MContraction/WeakNeutral4ptDisc.hpp>
|
#include <Grid/Hadrons/Modules/MContraction/WeakNeutral4ptDisc.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MFermion/GaugeProp.hpp>
|
#include <Grid/Hadrons/Modules/MContraction/WeakHamiltonianNonEye.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MGauge/Load.hpp>
|
#include <Grid/Hadrons/Modules/MUtilities/TestSeqGamma.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MGauge/Random.hpp>
|
#include <Grid/Hadrons/Modules/MUtilities/TestSeqConserved.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MGauge/StochEm.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MGauge/Unit.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MLoop/NoiseLoop.hpp>
|
#include <Grid/Hadrons/Modules/MLoop/NoiseLoop.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MScalar/ChargedProp.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MScalar/FreeProp.hpp>
|
#include <Grid/Hadrons/Modules/MScalar/FreeProp.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MScalar/ChargedProp.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MScalar/Scalar.hpp>
|
#include <Grid/Hadrons/Modules/MScalar/Scalar.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSink/Point.hpp>
|
#include <Grid/Hadrons/Modules/MSink/Point.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSink/Smear.hpp>
|
#include <Grid/Hadrons/Modules/MSink/Smear.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSolver/RBPrecCG.hpp>
|
#include <Grid/Hadrons/Modules/MFermion/GaugeProp.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MSource/SeqConservedSummed.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MSource/Wall.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSource/Point.hpp>
|
#include <Grid/Hadrons/Modules/MSource/Point.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSource/SeqConserved.hpp>
|
#include <Grid/Hadrons/Modules/MSource/SeqConserved.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSource/SeqGamma.hpp>
|
#include <Grid/Hadrons/Modules/MSource/SeqGamma.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MSource/Wall.hpp>
|
|
||||||
#include <Grid/Hadrons/Modules/MSource/Z2.hpp>
|
#include <Grid/Hadrons/Modules/MSource/Z2.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MUtilities/TestSeqConserved.hpp>
|
#include <Grid/Hadrons/Modules/MGauge/Load.hpp>
|
||||||
#include <Grid/Hadrons/Modules/MUtilities/TestSeqGamma.hpp>
|
#include <Grid/Hadrons/Modules/MGauge/StochEm.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MGauge/Random.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MGauge/Unit.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MAction/DWF.hpp>
|
||||||
|
#include <Grid/Hadrons/Modules/MAction/Wilson.hpp>
|
||||||
|
165
extras/Hadrons/Modules/MSource/SeqConservedSummed.hpp
Normal file
165
extras/Hadrons/Modules/MSource/SeqConservedSummed.hpp
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
/*************************************************************************************
|
||||||
|
|
||||||
|
Grid physics library, www.github.com/paboyle/Grid
|
||||||
|
|
||||||
|
Source file: extras/Hadrons/Modules/MContraction/SeqConservedSummed.hpp
|
||||||
|
|
||||||
|
Copyright (C) 2017
|
||||||
|
|
||||||
|
Author: Andrew Lawson <andrew.lawson1991@gmail.com>
|
||||||
|
Author: Vera Guelpers <v.m.guelpers@soton.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_MSource_SeqConservedSummed_hpp_
|
||||||
|
#define Hadrons_MSource_SeqConservedSummed_hpp_
|
||||||
|
|
||||||
|
#include <Grid/Hadrons/Global.hpp>
|
||||||
|
#include <Grid/Hadrons/Module.hpp>
|
||||||
|
#include <Grid/Hadrons/ModuleFactory.hpp>
|
||||||
|
|
||||||
|
BEGIN_HADRONS_NAMESPACE
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Sequential source summed over the Lorentz index of current
|
||||||
|
-----------------------------
|
||||||
|
* src_x = sum_mu q_x * theta(x_3 - tA) * theta(tB - x_3) * J_mu * exp(i x.mom)
|
||||||
|
|
||||||
|
* options:
|
||||||
|
- q: input propagator (string)
|
||||||
|
- action: fermion action used for propagator q (string)
|
||||||
|
- tA: begin timeslice (integer)
|
||||||
|
- tB: end timesilce (integer)
|
||||||
|
- curr_type: type of conserved current to insert (Current)
|
||||||
|
- mom: momentum insertion, space-separated float sequence (e.g ".1 .2 1. 0.")
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* SeqConservedSummed *
|
||||||
|
******************************************************************************/
|
||||||
|
BEGIN_MODULE_NAMESPACE(MSource)
|
||||||
|
|
||||||
|
class SeqConservedSummedPar: Serializable
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
GRID_SERIALIZABLE_CLASS_MEMBERS(SeqConservedSummedPar,
|
||||||
|
std::string, q,
|
||||||
|
std::string, action,
|
||||||
|
unsigned int, tA,
|
||||||
|
unsigned int, tB,
|
||||||
|
Current, curr_type,
|
||||||
|
std::string, mom);
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
class TSeqConservedSummed: public Module<SeqConservedSummedPar>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FERM_TYPE_ALIASES(FImpl,);
|
||||||
|
public:
|
||||||
|
// constructor
|
||||||
|
TSeqConservedSummed(const std::string name);
|
||||||
|
// destructor
|
||||||
|
virtual ~TSeqConservedSummed(void) = default;
|
||||||
|
// 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_NS(SeqConservedSummed, TSeqConservedSummed<FIMPL>, MSource);
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* TSeqConservedSummed implementation *
|
||||||
|
******************************************************************************/
|
||||||
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
TSeqConservedSummed<FImpl>::TSeqConservedSummed(const std::string name)
|
||||||
|
: Module<SeqConservedSummedPar>(name)
|
||||||
|
{}
|
||||||
|
|
||||||
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
std::vector<std::string> TSeqConservedSummed<FImpl>::getInput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> in = {par().q, par().action};
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename FImpl>
|
||||||
|
std::vector<std::string> TSeqConservedSummed<FImpl>::getOutput(void)
|
||||||
|
{
|
||||||
|
std::vector<std::string> out = {getName()};
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup ///////////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
void TSeqConservedSummed<FImpl>::setup(void)
|
||||||
|
{
|
||||||
|
auto Ls_ = env().getObjectLs(par().action);
|
||||||
|
env().template registerLattice<PropagatorField>(getName(), Ls_);
|
||||||
|
}
|
||||||
|
|
||||||
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
|
template <typename FImpl>
|
||||||
|
void TSeqConservedSummed<FImpl>::execute(void)
|
||||||
|
{
|
||||||
|
if (par().tA == par().tB)
|
||||||
|
{
|
||||||
|
LOG(Message) << "Generating sequential source with conserved "
|
||||||
|
<< par().curr_type << " current insertion summed over mu at "
|
||||||
|
<< "t = " << par().tA << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG(Message) << "Generating sequential source with conserved "
|
||||||
|
<< par().curr_type << " current insertion summed over mu for "
|
||||||
|
<< par().tA << " <= t <= "
|
||||||
|
<< par().tB << std::endl;
|
||||||
|
}
|
||||||
|
PropagatorField &src = *env().template createLattice<PropagatorField>(getName());
|
||||||
|
auto src_buf = src;
|
||||||
|
PropagatorField &q = *env().template getObject<PropagatorField>(par().q);
|
||||||
|
FMat &mat = *(env().template getObject<FMat>(par().action));
|
||||||
|
|
||||||
|
std::vector<Real> mom = strToVec<Real>(par().mom);
|
||||||
|
src = zero;
|
||||||
|
for(int mu=0;mu<=3;mu++)
|
||||||
|
{
|
||||||
|
mat.SeqConservedCurrent(q, src_buf, par().curr_type, mu,
|
||||||
|
mom, par().tA, par().tB);
|
||||||
|
src += src_buf;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
|
END_HADRONS_NAMESPACE
|
||||||
|
|
||||||
|
#endif // Hadrons_SeqConservedSummed_hpp_
|
@ -1,42 +1,44 @@
|
|||||||
modules_cc =\
|
modules_cc =\
|
||||||
Modules/MContraction/WeakHamiltonianEye.cc \
|
Modules/MContraction/WeakHamiltonianEye.cc \
|
||||||
Modules/MContraction/WeakHamiltonianNonEye.cc \
|
|
||||||
Modules/MContraction/WeakNeutral4ptDisc.cc \
|
Modules/MContraction/WeakNeutral4ptDisc.cc \
|
||||||
Modules/MGauge/Load.cc \
|
Modules/MContraction/WeakHamiltonianNonEye.cc \
|
||||||
|
Modules/MScalar/FreeProp.cc \
|
||||||
|
Modules/MScalar/ChargedProp.cc \
|
||||||
Modules/MGauge/Random.cc \
|
Modules/MGauge/Random.cc \
|
||||||
Modules/MGauge/StochEm.cc \
|
Modules/MGauge/StochEm.cc \
|
||||||
Modules/MGauge/Unit.cc \
|
Modules/MGauge/Unit.cc \
|
||||||
Modules/MScalar/ChargedProp.cc \
|
Modules/MGauge/Load.cc
|
||||||
Modules/MScalar/FreeProp.cc
|
|
||||||
|
|
||||||
modules_hpp =\
|
modules_hpp =\
|
||||||
Modules/MAction/DWF.hpp \
|
Modules/MSolver/RBPrecCG.hpp \
|
||||||
Modules/MAction/Wilson.hpp \
|
|
||||||
Modules/MContraction/Baryon.hpp \
|
|
||||||
Modules/MContraction/DiscLoop.hpp \
|
|
||||||
Modules/MContraction/Gamma3pt.hpp \
|
|
||||||
Modules/MContraction/Meson.hpp \
|
|
||||||
Modules/MContraction/WardIdentity.hpp \
|
Modules/MContraction/WardIdentity.hpp \
|
||||||
Modules/MContraction/WeakHamiltonian.hpp \
|
Modules/MContraction/Meson.hpp \
|
||||||
|
Modules/MContraction/Gamma3pt.hpp \
|
||||||
|
Modules/MContraction/DiscLoop.hpp \
|
||||||
Modules/MContraction/WeakHamiltonianEye.hpp \
|
Modules/MContraction/WeakHamiltonianEye.hpp \
|
||||||
Modules/MContraction/WeakHamiltonianNonEye.hpp \
|
Modules/MContraction/Baryon.hpp \
|
||||||
|
Modules/MContraction/WeakHamiltonian.hpp \
|
||||||
Modules/MContraction/WeakNeutral4ptDisc.hpp \
|
Modules/MContraction/WeakNeutral4ptDisc.hpp \
|
||||||
Modules/MFermion/GaugeProp.hpp \
|
Modules/MContraction/WeakHamiltonianNonEye.hpp \
|
||||||
Modules/MGauge/Load.hpp \
|
Modules/MUtilities/TestSeqGamma.hpp \
|
||||||
Modules/MGauge/Random.hpp \
|
Modules/MUtilities/TestSeqConserved.hpp \
|
||||||
Modules/MGauge/StochEm.hpp \
|
|
||||||
Modules/MGauge/Unit.hpp \
|
|
||||||
Modules/MLoop/NoiseLoop.hpp \
|
Modules/MLoop/NoiseLoop.hpp \
|
||||||
Modules/MScalar/ChargedProp.hpp \
|
|
||||||
Modules/MScalar/FreeProp.hpp \
|
Modules/MScalar/FreeProp.hpp \
|
||||||
|
Modules/MScalar/ChargedProp.hpp \
|
||||||
Modules/MScalar/Scalar.hpp \
|
Modules/MScalar/Scalar.hpp \
|
||||||
Modules/MSink/Point.hpp \
|
Modules/MSink/Point.hpp \
|
||||||
Modules/MSink/Smear.hpp \
|
Modules/MSink/Smear.hpp \
|
||||||
Modules/MSolver/RBPrecCG.hpp \
|
Modules/MFermion/GaugeProp.hpp \
|
||||||
|
Modules/MSource/SeqConservedSummed.hpp \
|
||||||
|
Modules/MSource/Wall.hpp \
|
||||||
Modules/MSource/Point.hpp \
|
Modules/MSource/Point.hpp \
|
||||||
Modules/MSource/SeqConserved.hpp \
|
Modules/MSource/SeqConserved.hpp \
|
||||||
Modules/MSource/SeqGamma.hpp \
|
Modules/MSource/SeqGamma.hpp \
|
||||||
Modules/MSource/Wall.hpp \
|
|
||||||
Modules/MSource/Z2.hpp \
|
Modules/MSource/Z2.hpp \
|
||||||
Modules/MUtilities/TestSeqConserved.hpp \
|
Modules/MGauge/Load.hpp \
|
||||||
Modules/MUtilities/TestSeqGamma.hpp
|
Modules/MGauge/StochEm.hpp \
|
||||||
|
Modules/MGauge/Random.hpp \
|
||||||
|
Modules/MGauge/Unit.hpp \
|
||||||
|
Modules/MAction/DWF.hpp \
|
||||||
|
Modules/MAction/Wilson.hpp
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user