Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
mty::InteractionTerm Class Reference

Interaction term (in the Lagrangian) in MARTY. More...

#include <interactionTerm.h>

Public Types

using permutation = std::vector< std::pair< csl::Index, csl::Index > >
 
using TermType = std::shared_ptr< InteractionTerm >
 

Public Member Functions

 InteractionTerm (InteractionTerm const &)
 
InteractionTermoperator= (InteractionTerm const &)
 
 InteractionTerm (InteractionTerm &&)=default
 
InteractionTermoperator= (InteractionTerm &&)=default
 
InteractionTerm copy () const
 
 InteractionTerm (csl::Expr const &term, std::vector< QuantumField > const &t_content)
 
 InteractionTerm (csl::Expr const &term, bool copy=true)
 
bool hasSameContent (InteractionTerm const &other) const
 
bool hasSameContent (std::vector< mty::QuantumField > const &fields) const
 
size_t size () const
 Returns the number of interacting fields. More...
 
size_t nTerms () const
 
void clear ()
 
csl::Expr getTerm () const
 Returns the symbolic expression corresponding to the interaction. More...
 
csl::Expr getGlobalFactor () const
 
csl::Expr getTotalFactor () const
 
csl::Expr getMass () const
 
std::vector< QuantumField > & getContent ()
 Returns a reference to the field content of the interaction. More...
 
std::vector< QuantumField > const & getContent () const
 Returns a const reference to the field content of the interaction. More...
 
std::vector< ParticlegetParticles () const
 Returns the set of different interacting particles. More...
 
std::vector< QuantumFieldParent * > getParticlesInfo () const
 Returns the set of different interacting particles. More...
 
size_t count (QuantumFieldParent *particle) const
 Counts, in the content, how many particles are of a given species. More...
 
size_t getExponent (csl::Expr const &parameter) const
 Returns the exponent associated to a given coupling in the interaction term. More...
 
csl::Expr getFieldProduct () const
 Returns the product of bare fields with only free indices. More...
 
csl::Expr getFullExpression () const
 Returns the full expression of the interaction term. More...
 
csl::Expr applyFactorAndSymmetriesOn (csl::Expr const &init) const
 Applies all factors and symmetries on a field product to recover the full interaction term properties. More...
 
csl::Tensor getPoint () const
 
void setPoint (csl::Tensor const &newPoint)
 
bool contains (const QuantumFieldParent *p) const
 Tells if the interaction term contains a given field. More...
 
bool containsWeakly (const QuantumFieldParent *p) const
 Tells if the interaction term contains a given field or only a part of it. More...
 
bool contains (mty::Particle const &p) const
 Tells if the interaction term contains a given field. More...
 
bool containsWeakly (mty::Particle const &p) const
 Tells if the interaction term contains a given field or only a part of it. More...
 
bool containsExactly (const QuantumFieldParent *p) const
 Tells if the interaction term contains exactly a given field. More...
 
bool containsExactly (mty::Particle const &p) const
 Tells if the interaction term contains exactly a given field. More...
 
bool operator== (const InteractionTerm &other) const
 Equality operator, compares the symbolic expressions. More...
 
bool operator== (const csl::Expr &other) const
 Equality operator with a csl::Expr. More...
 

Static Public Member Functions

static void fillContent (csl::Expr const &prod, std::vector< mty::QuantumField > &fields)
 
static std::vector< TermTypecreateAndDispatch (csl::Expr const &expression)
 

Static Public Attributes

static bool abbreviateFactors = false
 Options telling if factors (constants etc.) must be abbreviated or not. Default is false. More...
 

Private Member Functions

bool gatherFieldContent (csl::Expr const &expr, size_t multiplicity, csl::IndexStructure const &derivativeStructure)
 
void gatherFieldContent ()
 
std::pair< csl::Expr, csl::IndexStructurebuildContent (QuantumField expr, csl::IndexStructure const &structure)
 
void gatherFactorsAndSymmetries ()
 
void gatherSymmetries (csl::Expr const &sum)
 

Static Private Member Functions

static bool containsQuantumField (csl::Expr const &expr)
 
static void recallIndices (permutation &perm, csl::IndexStructure const &old, csl::IndexStructure const &structure)
 
static bool areSimilarField (QuantumField const &A, QuantumField const &B)
 
static bool areSimilarContent (std::vector< QuantumField > const &A, std::vector< QuantumField > const &B)
 
static csl::Expr applyPermutation (permutation const &perm, csl::Expr const &init, std::map< csl::Index, csl::Index > &constraints)
 

Private Attributes

csl::Expr term
 Initial expression defining the interaction (symbolic Lagrangian term).
 
std::vector< QuantumFieldcontent
 Quantum fields in the interactions.
 
bool forcedContent = false
 
csl::Expr globalFactor = CSL_1
 
permutation globalPermutation
 
csl::vector_expr factors
 
std::vector< permutation > permutations
 

Friends

std::ostream & operator<< (std::ostream &out, InteractionTerm const &term)
 

Detailed Description

Interaction term (in the Lagrangian) in MARTY.

This class stores an interaction term and decomposes it in a more abstract representation to lighten calculations of Feynman rules (that is the full quantum calculation of tree-level matrix elements). It is used as the term container in the mty::Lagrangian.

This class is also used, at the user interface level, in Lagrangian filters (mty::FeynOptions::LagrangianFilter), that are predicates taking a mty::InteractionTerm (const reference) as parameter. Functions that are relevant to use as filter conditions are documented (other functions may also be documented) i.e. an undocumented function is probably not relevant for filtering anyway.

Member Function Documentation

◆ applyFactorAndSymmetriesOn()

csl::Expr mty::InteractionTerm::applyFactorAndSymmetriesOn ( csl::Expr const &  init) const

Applies all factors and symmetries on a field product to recover the full interaction term properties.

This function applies all factors and symmetries that were removed to obtain the result of getFieldProduct(). This allows to do the calculation with a simple and general field product, and apply this function on the result to recover couplings, index contractions etc.

Parameters
initInitial expression on which factors and symmetries must be applied.
Returns
The expression on which factors and symmetries have been applied.
See also
getFieldProduct()

◆ contains() [1/2]

bool mty::InteractionTerm::contains ( const QuantumFieldParent p) const

Tells if the interaction term contains a given field.

This function searches for a partial match between fields, and takes into account fields that contain others. For example, a Dirac fermion contains its Weyl fermions and not the contrary. For a Dirac fermion \( \psi \equiv \psi_L \oplus \psi_R \), one has that \( \psi \) contains \( \psi_L \) but \( \psi_L \) does not contain \( \psi \). Otherwise, this function is equivalent to containsExactly().

Parameters
pA const pointer to the parent of the field to search for.
Returns
True if the interaction term contains p or a particle of the same species included in p.
False else.

◆ contains() [2/2]

bool mty::InteractionTerm::contains ( mty::Particle const &  p) const
inline

Tells if the interaction term contains a given field.

This function searches for a partial match between fields, and takes into account fields that contain others. For example, a Dirac fermion contains its Weyl fermions and not the contrary. For a Dirac fermion \( \psi \equiv \psi_L \oplus \psi_R \), one has that \( \psi \) contains \( \psi_L \) but \( \psi_L \) does not contain \( \psi \). Otherwise, this function is equivalent to containsExactly().

Parameters
pThe particle to search for.
Returns
True if the interaction term contains p or a particle of the same species included in p.
False else.

◆ containsExactly() [1/2]

bool mty::InteractionTerm::containsExactly ( const QuantumFieldParent p) const

Tells if the interaction term contains exactly a given field.

This function searches for an exact match between fields, and does not take into account fields that contain others. For example, this function considers that for a Dirac fermion \( \psi = \psi_L\oplus\psi_R \), one has that \( \psi \) and \( \psi_L \) are different fields (which is strictly true).

Parameters
pA const pointer to the parent of the field to search for.
Returns
True if the interaction term contains p or a particle of the same specied.
False else.

◆ containsExactly() [2/2]

bool mty::InteractionTerm::containsExactly ( mty::Particle const &  p) const
inline

Tells if the interaction term contains exactly a given field.

This function searches for an exact match between fields, and does not take into account fields that contain others. For example, this function considers that for a Dirac fermion \( \psi = \psi_L\oplus\psi_R \), one has that \( \psi \) and \( \psi_L \) are different fields (which is strictly true).

Parameters
pThe particle to search for.
Returns
True if the interaction term contains p or a particle of the same specied.
False else.

◆ containsWeakly() [1/2]

bool mty::InteractionTerm::containsWeakly ( const QuantumFieldParent p) const

Tells if the interaction term contains a given field or only a part of it.

This function searches for a partial match between fields, and takes into account fields that contain others. For example, a Dirac fermion contains its Weyl fermions and not the contrary. This weak comparison will return true event if the interaction term does not contain the entire field (a Weyl fermion in particular contains in this weak sense its Dirac parent).

Parameters
pA const pointer to the parent of the field to search for.
Returns
True if the interaction term contains p or a particle of the same species.
False else.

◆ containsWeakly() [2/2]

bool mty::InteractionTerm::containsWeakly ( mty::Particle const &  p) const
inline

Tells if the interaction term contains a given field or only a part of it.

This function searches for a partial match between fields, and takes into account fields that contain others. For example, a Dirac fermion contains its Weyl fermions and not the contrary. This weak comparison will return true event if the interaction term does not contain the entire field (a Weyl fermion in particular contains in this weak sense its Dirac parent).

Parameters
pA const pointer to the parent of the field to search for.
Returns
True if the interaction term contains p or a particle of the same species.
False else.

◆ count()

size_t mty::InteractionTerm::count ( QuantumFieldParent particle) const

Counts, in the content, how many particles are of a given species.

Parameters
particleSpecies.
Returns
The number of interacting particles having exactly particle as parent (species).

◆ getContent() [1/2]

vector< QuantumField > & mty::InteractionTerm::getContent ( )

Returns a reference to the field content of the interaction.

Returns
content

◆ getContent() [2/2]

vector< QuantumField > const & mty::InteractionTerm::getContent ( ) const

Returns a const reference to the field content of the interaction.

Returns
content

◆ getExponent()

size_t mty::InteractionTerm::getExponent ( csl::Expr const &  parameter) const

Returns the exponent associated to a given coupling in the interaction term.

Parameters
parameterCoupling to test.
Returns
0 if the term does not depend on param.
n if the term is proportional to \( param^n \).

◆ getFieldProduct()

csl::Expr mty::InteractionTerm::getFieldProduct ( ) const

Returns the product of bare fields with only free indices.

This field product is used for calculations. All factors and index contraction are removed from the term to obtain a very simple and general expression. For example, interaction terms

\[ eQ A_\mu\bar{psi}_\alpha \gamma^\mu_{\alpha\beta}\psi{\beta},\\ -\frac{g^2}{4}f^{EAB}f^{ECD}G_\mu^A G_\nu^B G^{C\mu}G^{D\nu}, \]

have respective field products equal to

\[ A_\mu \bar{psi}_{alpha}\psi_{\beta}, G^{A\mu}G^{B\nu}G^{c\rho}G^{D\sigma}. \]

Returns
The field product of the interaction term.
See also
applyFactorAndSymmetriesOn()

◆ getFullExpression()

csl::Expr mty::InteractionTerm::getFullExpression ( ) const

Returns the full expression of the interaction term.

This function should be equivalent to the getTerm() function, but does more calculations (this means that one should not use it in general). This function is most of all a way to check that applying symmetries on the bare field product returned by getFieldProduct() one recovers an expression equivalent to term.

Note
This function is quasi-equivalent to call
Returns
The full expression corresponding to the interaction term.

◆ getParticles()

vector< Particle > mty::InteractionTerm::getParticles ( ) const

Returns the set of different interacting particles.

This function creates the result, looping through the content and isolating different fields. mty::Particle objects are returned, allowing one to then use them with other interface functions.

Returns
The set of different interacting particles.

◆ getParticlesInfo()

vector< QuantumFieldParent * > mty::InteractionTerm::getParticlesInfo ( ) const

Returns the set of different interacting particles.

This function creates the result, looping through the content and isolating different fields. Pointers to mty::QuantumFieldParent are returned meaning that this function should be use for read-only operations on the fields. Otherwise use getParticles().

Returns
The set of different interacting particles.

◆ getTerm()

csl::Expr mty::InteractionTerm::getTerm ( ) const

Returns the symbolic expression corresponding to the interaction.

Returns
term

◆ operator==() [1/2]

bool mty::InteractionTerm::operator== ( const InteractionTerm other) const

Equality operator, compares the symbolic expressions.

Parameters
otherOther interaction term to compare.
Returns
True if the two interaction terms have the same term (csl::Expr comparison is used).
False else.

◆ operator==() [2/2]

bool mty::InteractionTerm::operator== ( const csl::Expr other) const

Equality operator with a csl::Expr.

Parameters
otherSymbolic expression to compare.
Returns
True if the symbolic expression for the term (term) is equal (csl::Expr definition of equality) to other.
False else.

◆ size()

size_t mty::InteractionTerm::size ( ) const

Returns the number of interacting fields.

Returns
The number of interacting fields.

Field Documentation

◆ abbreviateFactors

bool mty::InteractionTerm::abbreviateFactors = false
inlinestatic

Options telling if factors (constants etc.) must be abbreviated or not. Default is false.

If enabled, abbreviations will be introduced for all interaction terms. This can save some calculations but will make the lagrangian much less readable.


The documentation for this class was generated from the following files: