2017-06-08 17:43:39 +01:00
|
|
|
#include <Grid/Hadrons/Modules/MScalar/ChargedProp.hpp>
|
2017-03-27 15:02:16 +01:00
|
|
|
#include <Grid/Hadrons/Modules/MScalar/ScalarVP.hpp>
|
2017-04-13 17:04:37 +01:00
|
|
|
#include <Grid/Hadrons/Modules/MScalar/Scalar.hpp>
|
2017-03-21 11:39:46 +00:00
|
|
|
|
|
|
|
using namespace Grid;
|
|
|
|
using namespace Hadrons;
|
|
|
|
using namespace MScalar;
|
|
|
|
|
|
|
|
/******************************************************************************
|
2017-03-27 15:02:16 +01:00
|
|
|
* TScalarVP implementation *
|
2017-03-21 11:39:46 +00:00
|
|
|
******************************************************************************/
|
|
|
|
// constructor /////////////////////////////////////////////////////////////////
|
2017-03-27 15:02:16 +01:00
|
|
|
TScalarVP::TScalarVP(const std::string name)
|
|
|
|
: Module<ScalarVPPar>(name)
|
2017-03-21 11:39:46 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
// dependencies/products ///////////////////////////////////////////////////////
|
2017-03-27 15:02:16 +01:00
|
|
|
std::vector<std::string> TScalarVP::getInput(void)
|
2017-03-21 11:39:46 +00:00
|
|
|
{
|
2017-06-08 17:43:39 +01:00
|
|
|
propQName_ = par().scalarProp + "_Q";
|
|
|
|
propSunName_ = par().scalarProp + "_Sun";
|
|
|
|
propTadName_ = par().scalarProp + "_Tad";
|
|
|
|
|
|
|
|
std::vector<std::string> in = {par().emField, propQName_, propSunName_,
|
|
|
|
propTadName_};
|
2017-03-21 11:39:46 +00:00
|
|
|
|
|
|
|
return in;
|
|
|
|
}
|
|
|
|
|
2017-03-27 15:02:16 +01:00
|
|
|
std::vector<std::string> TScalarVP::getOutput(void)
|
2017-03-21 11:39:46 +00:00
|
|
|
{
|
2017-06-08 17:43:39 +01:00
|
|
|
std::vector<std::string> out;
|
2017-03-21 11:39:46 +00:00
|
|
|
|
2017-04-25 10:04:03 +01:00
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
|
|
|
out.push_back(getName() + "_propQ_" + std::to_string(mu));
|
2017-05-03 12:53:41 +01:00
|
|
|
|
|
|
|
for (unsigned int nu = 0; nu < env().getNd(); ++nu)
|
|
|
|
{
|
|
|
|
out.push_back(getName() + "_" + std::to_string(mu) + "_" + std::to_string(nu));
|
|
|
|
}
|
2017-04-25 10:04:03 +01:00
|
|
|
}
|
|
|
|
|
2017-03-21 11:39:46 +00:00
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
// setup ///////////////////////////////////////////////////////////////////////
|
2017-03-27 15:02:16 +01:00
|
|
|
void TScalarVP::setup(void)
|
2017-03-21 11:39:46 +00:00
|
|
|
{
|
2017-06-08 17:43:39 +01:00
|
|
|
freeMomPropName_ = FREEMOMPROP(static_cast<TChargedProp *>(env().getModule(par().scalarProp))->par().mass);
|
|
|
|
GFSrcName_ = "_" + par().scalarProp + "_DinvSrc";
|
|
|
|
prop0Name_ = par().scalarProp + "_0";
|
2017-04-10 16:33:54 +01:00
|
|
|
|
2017-03-27 16:49:18 +01:00
|
|
|
phaseName_.clear();
|
2017-04-10 16:33:54 +01:00
|
|
|
muPropQName_.clear();
|
2017-05-03 12:53:41 +01:00
|
|
|
vpTensorName_.clear();
|
|
|
|
|
2017-03-27 16:49:18 +01:00
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
|
|
|
phaseName_.push_back("_shiftphase_" + std::to_string(mu));
|
2017-04-10 16:33:54 +01:00
|
|
|
muPropQName_.push_back(getName() + "_propQ_" + std::to_string(mu));
|
2017-05-03 12:53:41 +01:00
|
|
|
|
|
|
|
std::vector<std::string> vpTensorName_mu;
|
|
|
|
for (unsigned int nu = 0; nu < env().getNd(); ++nu)
|
|
|
|
{
|
|
|
|
vpTensorName_mu.push_back(getName() + "_" + std::to_string(mu)
|
|
|
|
+ "_" + std::to_string(nu));
|
|
|
|
}
|
|
|
|
vpTensorName_.push_back(vpTensorName_mu);
|
2017-03-27 16:49:18 +01:00
|
|
|
}
|
2017-03-21 11:39:46 +00:00
|
|
|
|
2017-04-10 16:33:54 +01:00
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
2017-05-09 12:46:57 +01:00
|
|
|
env().registerLattice<ScalarField>(muPropQName_[mu]);
|
2017-06-08 17:43:39 +01:00
|
|
|
|
2017-05-03 12:53:41 +01:00
|
|
|
for (unsigned int nu = 0; nu < env().getNd(); ++nu)
|
|
|
|
{
|
|
|
|
env().registerLattice<ScalarField>(vpTensorName_[mu][nu]);
|
|
|
|
}
|
2017-06-08 17:43:39 +01:00
|
|
|
}
|
2017-03-21 11:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// execution ///////////////////////////////////////////////////////////////////
|
2017-03-27 15:02:16 +01:00
|
|
|
void TScalarVP::execute(void)
|
2017-03-21 11:39:46 +00:00
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
// Get objects cached by ChargedProp module
|
2017-04-10 16:33:54 +01:00
|
|
|
Complex ci(0.0,1.0);
|
|
|
|
FFT fft(env().getGrid());
|
2017-06-08 17:43:39 +01:00
|
|
|
Real q = static_cast<TChargedProp *>(env().getModule(par().scalarProp))->par().charge;
|
2017-04-10 16:33:54 +01:00
|
|
|
|
2017-06-08 17:43:39 +01:00
|
|
|
freeMomProp_ = env().getObject<ScalarField>(freeMomPropName_);
|
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
2017-04-10 16:33:54 +01:00
|
|
|
{
|
2017-06-08 17:43:39 +01:00
|
|
|
phase_.push_back(env().getObject<ScalarField>(phaseName_[mu]));
|
2017-04-10 16:33:54 +01:00
|
|
|
}
|
2017-06-08 17:43:39 +01:00
|
|
|
GFSrc_ = env().getObject<ScalarField>(GFSrcName_);
|
|
|
|
prop0_ = env().getObject<ScalarField>(prop0Name_);
|
2017-03-21 11:39:46 +00:00
|
|
|
|
2017-04-10 16:33:54 +01:00
|
|
|
// Propagator from unshifted source
|
2017-06-08 17:43:39 +01:00
|
|
|
ScalarField &propQ = *env().getObject<ScalarField>(propQName_);
|
|
|
|
ScalarField &propSun = *env().getObject<ScalarField>(propSunName_);
|
|
|
|
ScalarField &propTad = *env().getObject<ScalarField>(propTadName_);
|
2017-04-10 16:33:54 +01:00
|
|
|
|
|
|
|
// Propagators from shifted sources
|
2017-05-09 12:46:57 +01:00
|
|
|
LOG(Message) << "Computing O(q) charged scalar propagators..."
|
|
|
|
<< std::endl;
|
2017-05-09 11:46:25 +01:00
|
|
|
std::vector<ScalarField> muPropQ;
|
2017-04-10 16:33:54 +01:00
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
2017-05-09 11:46:25 +01:00
|
|
|
muPropQ.push_back(*env().createLattice<ScalarField>(muPropQName_[mu]));
|
2017-04-27 14:17:50 +01:00
|
|
|
|
2017-05-09 11:46:25 +01:00
|
|
|
// -G*momD1*G*F*tau_mu*Src (momD1 = F*D1*Finv)
|
|
|
|
muPropQ[mu] = adj(*phase_[mu])*(*GFSrc_);
|
|
|
|
momD1(muPropQ[mu], fft);
|
|
|
|
muPropQ[mu] = -(*freeMomProp_)*muPropQ[mu];
|
|
|
|
fft.FFT_all_dim(muPropQ[mu], muPropQ[mu], FFT::backward);
|
2017-04-10 16:33:54 +01:00
|
|
|
}
|
2017-04-27 14:17:50 +01:00
|
|
|
|
2017-05-03 12:53:41 +01:00
|
|
|
// CONTRACTIONS
|
2017-05-09 12:46:57 +01:00
|
|
|
ScalarField prop1(env().getGrid()), prop2(env().getGrid());
|
|
|
|
EmField &A = *env().getObject<EmField>(par().emField);
|
2017-06-09 18:08:40 +01:00
|
|
|
ScalarField Amu(env().getGrid()), tmp_vp(env().getGrid());
|
2017-05-09 12:46:57 +01:00
|
|
|
TComplex Anu0;
|
|
|
|
std::vector<int> coor0 = {0, 0, 0, 0};
|
2018-01-19 17:14:11 +00:00
|
|
|
std::vector<std::vector<ScalarField> > vpTensor;
|
2017-05-03 12:53:41 +01:00
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
2017-05-05 17:12:41 +01:00
|
|
|
std::vector<ScalarField> vpTensor_mu;
|
2017-05-03 12:53:41 +01:00
|
|
|
for (unsigned int nu = 0; nu < env().getNd(); ++nu)
|
|
|
|
{
|
2017-05-05 17:12:41 +01:00
|
|
|
vpTensor_mu.push_back(*env().createLattice<ScalarField>(vpTensorName_[mu][nu]));
|
2017-05-03 12:53:41 +01:00
|
|
|
}
|
2017-05-05 17:12:41 +01:00
|
|
|
vpTensor.push_back(vpTensor_mu);
|
2017-05-03 12:53:41 +01:00
|
|
|
}
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Open output files if necessary
|
2017-11-03 18:46:16 +00:00
|
|
|
std::vector<TComplex> vecBuf;
|
|
|
|
std::vector<Complex> result;
|
|
|
|
ScalarField vpPhase(env().getGrid());
|
2017-06-12 18:27:32 +01:00
|
|
|
std::vector<CorrWriter *> writer, writer0, writerD;
|
2017-11-03 18:46:16 +00:00
|
|
|
std::vector<ScalarField> momphases;
|
2017-06-09 18:08:40 +01:00
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
LOG(Message) << "Preparing output files..." << std::endl;
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
|
|
|
{
|
|
|
|
std::vector<int> mom = strToVec<int>(par().outputMom[i_p]);
|
|
|
|
|
2017-11-03 18:46:16 +00:00
|
|
|
// Open output files
|
2017-06-12 18:27:32 +01:00
|
|
|
std::string filename = par().output + "_" + std::to_string(mom[0])
|
|
|
|
+ std::to_string(mom[1])
|
|
|
|
+ std::to_string(mom[2])
|
|
|
|
+ "." +
|
|
|
|
std::to_string(env().getTrajectory());
|
|
|
|
std::string filename0 = par().output + "_" + std::to_string(mom[0])
|
|
|
|
+ std::to_string(mom[1])
|
|
|
|
+ std::to_string(mom[2])
|
|
|
|
+ "_free." +
|
|
|
|
std::to_string(env().getTrajectory());
|
|
|
|
std::string filenameD = par().output + "_" + std::to_string(mom[0])
|
|
|
|
+ std::to_string(mom[1])
|
|
|
|
+ std::to_string(mom[2])
|
|
|
|
+ "_diagrams." +
|
|
|
|
std::to_string(env().getTrajectory());
|
|
|
|
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
CorrWriter *writer_i = new CorrWriter(filename);
|
|
|
|
writer.push_back(writer_i);
|
|
|
|
CorrWriter *writer0_i = new CorrWriter(filename0);
|
|
|
|
writer0.push_back(writer0_i);
|
|
|
|
CorrWriter *writerD_i = new CorrWriter(filenameD);
|
|
|
|
writerD.push_back(writerD_i);
|
|
|
|
|
|
|
|
write(*writer[i_p], "charge", q);
|
|
|
|
write(*writer[i_p], "mass", static_cast<TChargedProp *>(env().getModule(par().scalarProp))->par().mass);
|
|
|
|
write(*writer0[i_p], "charge", 0.0);
|
|
|
|
write(*writer0[i_p], "mass", static_cast<TChargedProp *>(env().getModule(par().scalarProp))->par().mass);
|
|
|
|
write(*writerD[i_p], "charge", q);
|
|
|
|
write(*writerD[i_p], "mass", static_cast<TChargedProp *>(env().getModule(par().scalarProp))->par().mass);
|
|
|
|
}
|
2017-11-03 18:46:16 +00:00
|
|
|
|
|
|
|
// Calculate phase factors
|
|
|
|
vpPhase = Complex(1.0,0.0);
|
|
|
|
for (unsigned int j = 0; j < env().getNd()-1; ++j)
|
|
|
|
{
|
|
|
|
for (unsigned int momcount = 0; momcount < mom[j]; ++momcount)
|
|
|
|
{
|
|
|
|
vpPhase = vpPhase*(*phase_[j]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vpPhase = adj(vpPhase);
|
|
|
|
momphases.push_back(vpPhase);
|
2017-06-12 18:27:32 +01:00
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
|
2017-06-12 18:27:32 +01:00
|
|
|
// Do contractions
|
2017-05-03 12:53:41 +01:00
|
|
|
for (unsigned int nu = 0; nu < env().getNd(); ++nu)
|
|
|
|
{
|
|
|
|
peekSite(Anu0, peekLorentz(A, nu), coor0);
|
|
|
|
|
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
|
|
|
LOG(Message) << "Computing Pi[" << mu << "][" << nu << "]..."
|
|
|
|
<< std::endl;
|
|
|
|
Amu = peekLorentz(A, mu);
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-05-09 12:46:57 +01:00
|
|
|
// Free VP
|
|
|
|
prop1 = *prop0_;
|
|
|
|
prop2 = Cshift(*prop0_, nu, -1);
|
2018-01-19 17:14:11 +00:00
|
|
|
tmp_vp = adj(prop2) * Cshift(prop1, mu, 1);
|
|
|
|
tmp_vp -= Cshift(adj(prop2), mu, 1) * prop1;
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] = tmp_vp;
|
2017-06-09 18:08:40 +01:00
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2018-01-19 17:14:11 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writer0[i_p],
|
|
|
|
"Pi_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
2018-01-19 17:14:11 +00:00
|
|
|
|
|
|
|
// S
|
|
|
|
// X
|
|
|
|
// 4C
|
2017-05-09 12:46:57 +01:00
|
|
|
|
2017-05-09 11:46:25 +01:00
|
|
|
// "Exchange" terms
|
2017-05-09 12:46:57 +01:00
|
|
|
prop1 += q*propQ;
|
|
|
|
prop2 += q*muPropQ[nu];
|
2017-06-09 18:08:40 +01:00
|
|
|
tmp_vp = adj(prop2) * (1.0 + ci*q*Amu)
|
|
|
|
* Cshift(prop1, mu, 1) * (1.0 + ci*q*Anu0);
|
|
|
|
tmp_vp -= Cshift(adj(prop2), mu, 1) * (1.0 - ci*q*Amu)
|
|
|
|
* prop1 * (1.0 + ci*q*Anu0);
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
2017-06-12 18:27:32 +01:00
|
|
|
vpTensor[mu][nu] = tmp_vp;
|
2017-06-09 18:08:40 +01:00
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_exchange_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-09 11:46:25 +01:00
|
|
|
|
|
|
|
// Subtract O(alpha^2) term
|
|
|
|
prop1 = q*propQ;
|
|
|
|
prop2 = q*muPropQ[nu];
|
2017-06-09 18:08:40 +01:00
|
|
|
tmp_vp = Cshift(adj(prop2), mu, 1) * (-ci)*q*Amu
|
|
|
|
* prop1 * ci*q*Anu0;
|
|
|
|
tmp_vp -= adj(prop2) * ci*q*Amu
|
|
|
|
* Cshift(prop1, mu, 1) * ci*q*Anu0;
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_alpha2_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Sunset from unshifted source
|
|
|
|
prop1 = q*q*propSun;
|
2017-05-09 11:46:25 +01:00
|
|
|
prop2 = Cshift(*prop0_, nu, -1);
|
2017-06-09 18:08:40 +01:00
|
|
|
tmp_vp = adj(prop2) * Cshift(prop1, mu, 1);
|
|
|
|
tmp_vp -= Cshift(adj(prop2), mu, 1) * prop1;
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_sunset_unshifted_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Sunset from shifted source
|
2017-05-09 11:46:25 +01:00
|
|
|
prop1 = Cshift(prop1, nu, -1);
|
2017-06-09 18:08:40 +01:00
|
|
|
tmp_vp = Cshift(adj(*prop0_), mu, 1) * prop1;
|
|
|
|
tmp_vp -= adj(*prop0_) * Cshift(prop1, mu, 1);
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_sunset_shifted_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Tadpole from unshifted source
|
|
|
|
prop1 = q*q*propTad;
|
|
|
|
prop2 = Cshift(*prop0_, nu, -1);
|
|
|
|
tmp_vp = adj(prop2) * Cshift(prop1, mu, 1);
|
|
|
|
tmp_vp -= Cshift(adj(prop2), mu, 1) * prop1;
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
2017-05-09 11:46:25 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_tadpole_unshifted_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-03 12:53:41 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Tadpole from shifted source
|
|
|
|
prop1 = Cshift(prop1, nu, -1);
|
|
|
|
tmp_vp = Cshift(adj(*prop0_), mu, 1) * prop1;
|
|
|
|
tmp_vp -= adj(*prop0_) * Cshift(prop1, mu, 1);
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
2017-05-03 12:53:41 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
2017-05-03 12:53:41 +01:00
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-05-03 12:53:41 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_tadpole_shifted_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-05-03 12:53:41 +01:00
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
2017-05-09 12:46:57 +01:00
|
|
|
|
2017-06-09 18:08:40 +01:00
|
|
|
// Source tadpole
|
|
|
|
prop1 = *prop0_;
|
|
|
|
tmp_vp = adj(prop2)
|
|
|
|
* Cshift(prop1, mu, 1)
|
|
|
|
* (-0.5)*q*q*Anu0*Anu0;
|
|
|
|
tmp_vp -= Cshift(adj(prop2), mu, 1)
|
|
|
|
* prop1
|
|
|
|
* (-0.5)*q*q*Anu0*Anu0;
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_sourcetadpole_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Sink tadpole
|
|
|
|
tmp_vp = adj(prop2)
|
|
|
|
* (-0.5)*q*q*Amu*Amu
|
|
|
|
* Cshift(prop1, mu, 1);
|
|
|
|
tmp_vp -= Cshift(adj(prop2), mu, 1)
|
|
|
|
* (-0.5)*q*q*Amu*Amu
|
|
|
|
* prop1;
|
|
|
|
tmp_vp = 2.0*real(tmp_vp);
|
|
|
|
vpTensor[mu][nu] += tmp_vp;
|
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-06-09 18:08:40 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = tmp_vp*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writerD[i_p],
|
|
|
|
"Pi_sinktadpole_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-06-09 18:08:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Output if necessary
|
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
2017-06-12 18:27:32 +01:00
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
2017-05-09 12:46:57 +01:00
|
|
|
{
|
2017-11-03 18:46:16 +00:00
|
|
|
vpPhase = vpTensor[mu][nu]*momphases[i_p];
|
2017-06-12 18:27:32 +01:00
|
|
|
sliceSum(vpPhase, vecBuf, Tp);
|
|
|
|
result.resize(vecBuf.size());
|
|
|
|
for (unsigned int t = 0; t < vecBuf.size(); ++t)
|
|
|
|
{
|
|
|
|
result[t] = TensorRemove(vecBuf[t]);
|
|
|
|
}
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
write(*writer[i_p],
|
|
|
|
"Pi_"+std::to_string(mu)+"_"+std::to_string(nu),
|
|
|
|
result);
|
|
|
|
}
|
2017-05-09 12:46:57 +01:00
|
|
|
}
|
2017-05-03 12:53:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-06-12 18:27:32 +01:00
|
|
|
if (!par().output.empty())
|
|
|
|
{
|
|
|
|
for (unsigned int i_p = 0; i_p < par().outputMom.size(); ++i_p)
|
|
|
|
{
|
2017-11-07 14:46:39 +00:00
|
|
|
if (env().getGrid()->IsBoss())
|
|
|
|
{
|
|
|
|
delete writer[i_p];
|
|
|
|
delete writer0[i_p];
|
|
|
|
delete writerD[i_p];
|
|
|
|
}
|
2017-06-12 18:27:32 +01:00
|
|
|
}
|
|
|
|
}
|
2017-04-10 16:33:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void TScalarVP::momD1(ScalarField &s, FFT &fft)
|
2017-03-27 16:49:18 +01:00
|
|
|
{
|
2017-04-10 16:33:54 +01:00
|
|
|
EmField &A = *env().getObject<EmField>(par().emField);
|
2017-03-27 16:49:18 +01:00
|
|
|
ScalarField buf(env().getGrid()), result(env().getGrid()),
|
|
|
|
Amu(env().getGrid());
|
|
|
|
Complex ci(0.0,1.0);
|
|
|
|
|
|
|
|
result = zero;
|
|
|
|
|
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
|
|
|
Amu = peekLorentz(A, mu);
|
|
|
|
buf = (*phase_[mu])*s;
|
|
|
|
fft.FFT_all_dim(buf, buf, FFT::backward);
|
|
|
|
buf = Amu*buf;
|
|
|
|
fft.FFT_all_dim(buf, buf, FFT::forward);
|
|
|
|
result = result - ci*buf;
|
|
|
|
}
|
|
|
|
fft.FFT_all_dim(s, s, FFT::backward);
|
|
|
|
for (unsigned int mu = 0; mu < env().getNd(); ++mu)
|
|
|
|
{
|
|
|
|
Amu = peekLorentz(A, mu);
|
|
|
|
buf = Amu*s;
|
|
|
|
fft.FFT_all_dim(buf, buf, FFT::forward);
|
|
|
|
result = result + ci*adj(*phase_[mu])*buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
s = result;
|
|
|
|
}
|