mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 11:15:55 +01:00
Reduced code duplication for Weak Hamiltonian contraction modules
This commit is contained in:
parent
fff5751b1a
commit
cd1bd921bd
@ -79,6 +79,34 @@ public:
|
|||||||
std::string, output);
|
std::string, output);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MAKE_WEAK_MODULE(modname)\
|
||||||
|
class T##modname: public Module<WeakHamiltonianPar>\
|
||||||
|
{\
|
||||||
|
public:\
|
||||||
|
TYPE_ALIASES(FIMPL,)\
|
||||||
|
class Result: Serializable\
|
||||||
|
{\
|
||||||
|
public:\
|
||||||
|
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,\
|
||||||
|
std::string, name,\
|
||||||
|
std::vector<Complex>, corr);\
|
||||||
|
};\
|
||||||
|
public:\
|
||||||
|
/* constructor */ \
|
||||||
|
T##modname(const std::string name);\
|
||||||
|
/* destructor */ \
|
||||||
|
virtual ~T##modname(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);\
|
||||||
|
std::vector<std::string> VA_label = {"V", "A"};\
|
||||||
|
};\
|
||||||
|
MODULE_REGISTER_NS(modname, T##modname, MContraction);
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
END_HADRONS_NAMESPACE
|
END_HADRONS_NAMESPACE
|
||||||
|
@ -49,32 +49,7 @@ enum
|
|||||||
#define MAKE_SE_BODY(Q_1, Q_2, Q_3, gamma) (Q_3*g5*Q_1*adj(Q_2)*g5*gamma)
|
#define MAKE_SE_BODY(Q_1, Q_2, Q_3, gamma) (Q_3*g5*Q_1*adj(Q_2)*g5*gamma)
|
||||||
#define MAKE_SE_LOOP(Q_loop, gamma) (Q_loop*gamma)
|
#define MAKE_SE_LOOP(Q_loop, gamma) (Q_loop*gamma)
|
||||||
|
|
||||||
class TWeakHamiltonianEye: public Module<WeakHamiltonianPar>
|
MAKE_WEAK_MODULE(WeakHamiltonianEye)
|
||||||
{
|
|
||||||
public:
|
|
||||||
TYPE_ALIASES(FIMPL,)
|
|
||||||
class Result: Serializable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
|
||||||
std::string, name,
|
|
||||||
std::vector<Complex>, corr);
|
|
||||||
};
|
|
||||||
public:
|
|
||||||
// constructor
|
|
||||||
TWeakHamiltonianEye(const std::string name);
|
|
||||||
// destructor
|
|
||||||
virtual ~TWeakHamiltonianEye(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(WeakHamiltonianEye, TWeakHamiltonianEye, MContraction);
|
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
|
@ -48,32 +48,7 @@ enum
|
|||||||
// Wing and Connected subdiagram contractions
|
// Wing and Connected subdiagram contractions
|
||||||
#define MAKE_CW_SUBDIAG(Q_1, Q_2, gamma) (Q_1*adj(Q_2)*g5*gamma)
|
#define MAKE_CW_SUBDIAG(Q_1, Q_2, gamma) (Q_1*adj(Q_2)*g5*gamma)
|
||||||
|
|
||||||
class TWeakHamiltonianNonEye: public Module<WeakHamiltonianPar>
|
MAKE_WEAK_MODULE(WeakHamiltonianNonEye)
|
||||||
{
|
|
||||||
public:
|
|
||||||
TYPE_ALIASES(FIMPL,)
|
|
||||||
class Result: Serializable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
|
||||||
std::string, name,
|
|
||||||
std::vector<Complex>, corr);
|
|
||||||
};
|
|
||||||
public:
|
|
||||||
// constructor
|
|
||||||
TWeakHamiltonianNonEye(const std::string name);
|
|
||||||
// destructor
|
|
||||||
virtual ~TWeakHamiltonianNonEye(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(WeakHamiltonianNonEye, TWeakHamiltonianNonEye, MContraction);
|
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
|
@ -50,32 +50,7 @@ enum
|
|||||||
#define MAKE_DISC_LOOP(Q_LOOP, gamma) (Q_LOOP*gamma)
|
#define MAKE_DISC_LOOP(Q_LOOP, gamma) (Q_LOOP*gamma)
|
||||||
#define MAKE_DISC_CURR(Q_c, gamma) (trace(Q_c*gamma))
|
#define MAKE_DISC_CURR(Q_c, gamma) (trace(Q_c*gamma))
|
||||||
|
|
||||||
class TWeakNeutral4ptDisc: public Module<WeakHamiltonianPar>
|
MAKE_WEAK_MODULE(WeakNeutral4ptDisc)
|
||||||
{
|
|
||||||
public:
|
|
||||||
TYPE_ALIASES(FIMPL,)
|
|
||||||
class Result: Serializable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
|
||||||
std::string, name,
|
|
||||||
std::vector<Complex>, corr);
|
|
||||||
};
|
|
||||||
public:
|
|
||||||
// constructor
|
|
||||||
TWeakNeutral4ptDisc(const std::string name);
|
|
||||||
// destructor
|
|
||||||
virtual ~TWeakNeutral4ptDisc(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(WeakNeutral4ptDisc, TWeakNeutral4ptDisc, MContraction);
|
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user