58 std::vector<GExpr>
const &mu,
75 std::vector<GExpr>
const &mu,
92 std::vector<GExpr>
const &mu,
109 std::vector<GExpr>
const &mu,
114 bool isZero()
const override;
117 GExpr getTerm()
const override;
125 std::pair<csl::Index, csl::Index> getBorderIndices()
const {
129 bool isHappy()
const;
131 bool isReversed()
const;
133 bool isFierzFixed()
const {
return fierzFixed; }
134 void setFixFierz(
bool value) { fierzFixed = value; }
136 bool hasCommonIndex(
IndexChain const &other)
const;
139 bool hasPropertyWith(
GExpr const &other)
const override;
140 GExpr propertyWith(
GExpr const &other)
const override;
142 bool contains(
csl::Index const &)
const override;
145 GExpr copy()
const override;
146 GExpr refresh()
const override;
150 std::pair<GExpr, IndexChain> cut(
155 void erase(
size_t pos,
size_t len);
159 GExpr simplify()
override;
161 GExpr calculateTrace()
const;
162 GExpr calculateStandardTrace()
const;
163 GExpr calculateChiralTrace()
const;
165 std::optional<GExpr> reduceStep()
const;
167 std::optional<GExpr> reduceMomenta(
179 GExpr applyGeneralFierz(
183 GExpr applyGeneralFierzTwice(
188 void print(std::ostream &out)
const override;
190 bool isTrace()
const {
return a == b && !(psiL || psiR); }
192 std::optional<GExpr> checkGammaAndConjugation()
const;
195 if (
auto pos = m_easyIndex.find(i); pos != m_easyIndex.end())
198 return m_easyIndex[i];
205 std::pair<int, IndexChain> conjugated()
const;
207 friend GExpr momentumGammaContraction(
212 GExpr moveIndex(
size_t init,
size_t target)
const;
216 bool hasContraction(
size_t i,
size_t j)
const;
217 std::optional<std::pair<size_t, size_t>> firstMove()
const;
218 std::optional<std::pair<size_t, size_t>> lastMove()
const;
220 GExpr contraction(
size_t i)
const;
224 static bool isDelta(
GExpr const &gamma) {
225 return dynamic_cast<GammaIndex const*
>(gamma.get())->isDelta();
227 static bool isGammaMu(
GExpr const &gamma) {
228 return dynamic_cast<GammaIndex const*
>(gamma.get())->isGammaMu();
230 static bool isSigma(
GExpr const &gamma) {
231 return dynamic_cast<GammaIndex const*
>(gamma.get())->isSigma();
233 static bool isChiral(
GExpr const &gamma) {
234 return isGamma5(gamma) || isP_L(gamma) || isP_R(gamma);
236 static bool isGamma5(
GExpr const &gamma) {
237 return dynamic_cast<GammaIndex const*
>(gamma.get())->isGamma5();
239 static bool isProjector(
GExpr const &gamma) {
240 return isP_L(gamma) || isP_R(gamma);
242 static bool isP_L(
GExpr const &gamma) {
243 return dynamic_cast<GammaIndex const*
>(gamma.get())->isP_L();
245 static bool isP_R(
GExpr const &gamma) {
246 return dynamic_cast<GammaIndex const*
>(gamma.get())->isP_R();
248 static bool isC(
GExpr const &gamma) {
249 return dynamic_cast<GammaIndex const*
>(gamma.get())->isC();
252 static GExpr CMatrix();
254 static GExpr gamma5();
264 bool fierzFixed =
false;
267 template<
class ...Args>
268 GExpr indexchain_s(Args &&...args) {
269 auto chain = std::make_shared<IndexChain>(std::forward<Args>(args)...);
271 return cslexpr_s(CSL_0);
272 auto factor = chain->getFactor();
273 if (factor != CSL_1) {
274 auto term = std::dynamic_pointer_cast<
IndexChain>(chain->getTerm());
275 auto opt_chain = term->checkGammaAndConjugation();
276 return factor * opt_chain.value_or(term);
278 return chain->checkGammaAndConjugation().value_or(chain);
281 template<
class ...Args>
283 std::initializer_list<GExpr> gammas,
286 std::vector<GExpr>(gammas.begin(), gammas.end()),
287 std::forward<Args>(args)...
303 std::vector<std::string>
const &mu,
Definition: tensorset.h:30
Definition: momentumindex.h:31
Definition: indexchain.h:35
Definition: abstractgammasym.h:87
Definition: abstractgammasym.h:32
SGL object representing a CSL Expression, sgl::CSLExpr.
Definition: multifunction.h:29
SGL symbolic expression representing quantum fields, in particular external spinors.
Definition: sglfield.h:36
sgl::MomentumIndex, symbolic representation of of momentum in SGL.
Definition: gammaindex.h:36
Index generateIndex(const std::string &name) const
Gamma matrices symbolic expression for SGL.