1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-13 01:05:36 +00:00

Hadrons: added Weak Hamiltonian module dependencies, some reformatting.

This commit is contained in:
Lanny91 2017-01-30 17:54:21 +00:00
parent 9bf4108d1f
commit 9e9f621d5d
3 changed files with 28 additions and 20 deletions

View File

@ -38,16 +38,16 @@ using namespace MContraction;
* These contractions are generated by the Q1 and Q2 operators in the physical * These contractions are generated by the Q1 and Q2 operators in the physical
* basis (see e.g. Fig 3 of arXiv:1507.03094). * basis (see e.g. Fig 3 of arXiv:1507.03094).
* *
* Schematics: q4 | q4 * Schematics: q4 |
* /-<-¬ | /-<-¬ * /-<-¬ |
* / \ | / \ * / \ | q2 q3
* \ / | \ / * \ / | /----<------*------<----¬
* q2 \ / q3 | \_ _/ * q2 \ / q3 | / /-*-¬ \
* |-----<-----* *-----<----¬ | q2 * q3 * /-----<-----* *-----<----¬ | / / \ \
* i * H_W * f | |-----<------*------<----¬ * i * H_W * f | i * \ / q4 * f
* \ / | i * H_W * f * \ / | \ \->-/ /
* \ / | \ / * \ / | \ /
* \---------->---------/ | \------------>---------/ * \---------->---------/ | \----------->----------/
* q1 | q1 * q1 | q1
* | * |
* Saucer (S) | Eye (E) * Saucer (S) | Eye (E)
@ -67,7 +67,7 @@ TWeakHamiltonianEye::TWeakHamiltonianEye(const std::string name)
// dependencies/products /////////////////////////////////////////////////////// // dependencies/products ///////////////////////////////////////////////////////
std::vector<std::string> TWeakHamiltonianEye::getInput(void) std::vector<std::string> TWeakHamiltonianEye::getInput(void)
{ {
std::vector<std::string> in; std::vector<std::string> in = {par().q1, par().q2, par().q3, par().q4};
return in; return in;
} }

View File

@ -52,6 +52,13 @@ class TWeakHamiltonianEye: public Module<WeakHamiltonianPar>
{ {
public: public:
TYPE_ALIASES(FIMPL,) TYPE_ALIASES(FIMPL,)
class Result: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
std::string, name,
std::vector<Complex>, corr);
};
public: public:
// constructor // constructor
TWeakHamiltonianEye(const std::string name); TWeakHamiltonianEye(const std::string name);

View File

@ -69,7 +69,7 @@ TWeakHamiltonianNonEye::TWeakHamiltonianNonEye(const std::string name)
// dependencies/products /////////////////////////////////////////////////////// // dependencies/products ///////////////////////////////////////////////////////
std::vector<std::string> TWeakHamiltonianNonEye::getInput(void) std::vector<std::string> TWeakHamiltonianNonEye::getInput(void)
{ {
std::vector<std::string> in; std::vector<std::string> in = {par().q1, par().q2, par().q3, par().q4};
return in; return in;
} }
@ -99,28 +99,29 @@ void TWeakHamiltonianNonEye::execute(void)
LatticeComplex expbuf(env().getGrid()); LatticeComplex expbuf(env().getGrid());
std::vector<TComplex> corrbuf; std::vector<TComplex> corrbuf;
std::vector<Result> result; std::vector<Result> result;
unsigned int ndim = env().getNd();
PropagatorField tmp1(env().getGrid()); PropagatorField tmp1(env().getGrid());
LatticeComplex tmp2(env().getGrid()); LatticeComplex tmp2(env().getGrid());
std::vector<PropagatorField> C_i_side_loop(Nd, tmp1); std::vector<PropagatorField> C_i_side_loop(ndim, tmp1);
std::vector<PropagatorField> C_f_side_loop(Nd, tmp1); std::vector<PropagatorField> C_f_side_loop(ndim, tmp1);
std::vector<LatticeComplex> W_i_side_loop(Nd, tmp2); std::vector<LatticeComplex> W_i_side_loop(ndim, tmp2);
std::vector<LatticeComplex> W_f_side_loop(Nd, tmp2); std::vector<LatticeComplex> W_f_side_loop(ndim, tmp2);
// Soon to be deprecated. Keeping V and A parts distinct to take advantage // Soon to be deprecated. Keeping V and A parts distinct to take advantage
// of zero-flop gamma products, when implemented. // of zero-flop gamma products, when implemented.
std::vector<std::vector<SpinMatrix>> gL; std::vector<std::vector<SpinMatrix>> gL;
gL.resize(n_i); gL.resize(n_i);
gL[i_V].resize(Nd); gL[i_V].resize(ndim);
gL[i_A].resize(Nd); gL[i_A].resize(ndim);
for (unsigned int mu = 0; mu < Nd; ++mu) for (unsigned int mu = 0; mu < ndim; ++mu)
{ {
gL[i_V][mu] = makeGammaProd(mu); gL[i_V][mu] = makeGammaProd(mu);
gL[i_A][mu] = g5*makeGammaProd(mu); gL[i_A][mu] = g5*makeGammaProd(mu);
} }
// Setup for C-type contractions. // Setup for C-type contractions.
for (int mu = 0; mu < Nd; ++mu) for (int mu = 0; mu < ndim; ++mu)
{ {
C_i_side_loop[mu] = MAKE_CW_SUBDIAG(q1, q2, gL[i_V][mu]) - C_i_side_loop[mu] = MAKE_CW_SUBDIAG(q1, q2, gL[i_V][mu]) -
MAKE_CW_SUBDIAG(q1, q2, gL[i_A][mu]); MAKE_CW_SUBDIAG(q1, q2, gL[i_A][mu]);
@ -133,7 +134,7 @@ void TWeakHamiltonianNonEye::execute(void)
MAKE_DIAG(expbuf, corrbuf, result[C_diag], "3pt_HW_C") MAKE_DIAG(expbuf, corrbuf, result[C_diag], "3pt_HW_C")
// Recycle sub-expressions for W-type contractions. // Recycle sub-expressions for W-type contractions.
for (unsigned int mu = 0; mu < Nd; ++mu) for (unsigned int mu = 0; mu < ndim; ++mu)
{ {
W_i_side_loop[mu] = trace(C_i_side_loop[mu]); W_i_side_loop[mu] = trace(C_i_side_loop[mu]);
W_f_side_loop[mu] = trace(C_f_side_loop[mu]); W_f_side_loop[mu] = trace(C_f_side_loop[mu]);