Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Types | Public Member Functions | Data Fields | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
mty::FeynOptions Class Reference

Instances of this class can be given to mty::Model when launching a calculation to customize the output. More...

#include <feynOptions.h>

Public Types

using LagrangianFilter = std::function< bool(mty::InteractionTerm const &)>
 Type definition for a Lagrangian filter. More...
 
using DiagramFilter = std::function< bool(mty::FeynmanDiagram const &)>
 Type definition for a Feynman diagram. More...
 

Public Member Functions

 FeynOptions ()
 Default constructor, only constructor of this class (expect copy and move). More...
 
bool getFeynRuleCalculation () const
 
int getLoopOrder () const
 
int getExpansionOrder () const
 
int getTopology () const
 
std::vector< int > const & getFermionOrder () const
 
std::vector< LagrangianFilter > const & getLagrangianFilters () const
 
std::vector< DiagramFilter > const & getDiagramFilters () const
 
csl::Expr getWilsonOperatorCoefficient () const
 
OperatorBasis getWilsonOperatorBasis () const
 
void setFeynmanRuleMode ()
 Sets the value of feynRuleCalculation to true (the default value of this member is false). More...
 
void setLoopOrder (int t_nLoops, int nExternalLegs)
 Sets the number of loops for the calculation. More...
 
void setTopology (int t_topology)
 Sets the topology for the calculation. More...
 
void setFermionOrder (std::vector< int > const &order)
 Sets the fermion order used to express the amplitude. More...
 
void setWilsonOperatorCoefficient (csl::Expr const &factor)
 Sets the Wilson operator coefficient wilsonOperatorCoefficient. More...
 
bool passFilters (FeynmanDiagram const &diagram) const
 Tells if a diagram passes all diagram filters. More...
 
void applyFilters (std::vector< Lagrangian::TermType > &lagrangian) const
 Applies the Lagrangian filters on a vector of vertices. More...
 
std::vector< FeynmanRule const * > applyFilters (std::vector< FeynmanRule > const &lagrangian) const
 Filters a set a Feynman rules using the lagrangian filters. More...
 
void applyFilters (std::vector< FeynmanDiagram > &diagrams, bool forceFilters=false) const
 Applies the diagram filters on a vector of Feynman diagrams. More...
 
template<class Filter >
void addFilter (Filter &&filter)
 Adds one filter (LagrangianFilter or DiagramFilter) to the options. More...
 
void addFilters ()
 Overloads to add 0 filter (this function does nothing). More...
 
template<class First , class ... Next>
void addFilters (First &&first, Next &&...next)
 Adds an arbitrary number of filters (Lagrangian or diagram filters) to the options. More...
 
void resetFilters ()
 Resets the filters (for lagrangian and diagrams) to the default ones, i.e. removing all user-defined ones.
 

Data Fields

bool orderInsertions { mty::option::applyInsertionOrdering }
 This option (default = true) implies that fermionic insertions are ordered using a given rule. More...
 
bool orderExternalFermions { mty::option::orderExternalFermions }
 Boolean telling if external fermions must be ordered in the result. More...
 
bool simplifyAmplitudes { mty::option::simplifyAmplitudes }
 Set this option to false if you want to disable all simplifications of amplitudes. More...
 
bool discardLowerOrders { mty::option::discardLowerOrders }
 Set this option to false if you want the tree-level diagrams to appear in the same amplitude as the one-loop calculation.
 
bool verboseAmplitude { mty::option::verboseAmplitude }
 Set this options to false to disable all prints during calculations.
 
bool partialCalculation { false }
 Set this option to true to disable the DiagramFilters if the calculation is only a part of the full calculation.
 

Protected Member Functions

void addLagrangianFilter (LagrangianFilter const &filter)
 Adds one Lagrangian filter to the options. More...
 
void addDiagramFilter (DiagramFilter const &filter)
 Adds one diagram filter to the options. More...
 
void addLagrangianFilters (std::initializer_list< LagrangianFilter > filters)
 Adds a list of Lagrangian filters to the options. More...
 
void addDiagramFilters (std::initializer_list< DiagramFilter > filters)
 Adds a list of diagram filters to the options. More...
 

Private Member Functions

template<class Container , class Predicate >
void applyFilters (Container &container, Predicate const &predicate) const
 Helper private class applying a set of filters on a range. More...
 
void initDefaultFilters ()
 Initializes the default filters.
 
void setWilsonOperatorBasis (OperatorBasis basis)
 Sets the Wilson operator basis wilsonOperatorBasis. More...
 

Private Attributes

bool feynRuleCalculation { false }
 Mode of an amplitude calculation. More...
 
std::shared_ptr< int > loopOrder
 Loop order (0 for tree-level, 1 for one-loop). More...
 
int expansionOrder
 Taylor expansion order for an amplitude calculation (expansion of the lagrangian exponential).
 
int topology = mty::Topology::Any
 Topology allowed for the calculation. The default is mty::Topology::Any.
 
std::vector< int > fermionOrder
 Order for fermions in bilinears. More...
 
std::vector< LagrangianFilterlfilters
 List of lagrangian filters. More...
 
std::vector< DiagramFilterdfilters
 List of diagram filters. More...
 
csl::Expr wilsonOperatorCoefficient { CSL_1 }
 Prefactor used for Wilson coefficients. More...
 
OperatorBasis wilsonOperatorBasis = OperatorBasis::Chiral
 Operator basis for Wilson coefficients. More...
 

Static Private Attributes

static constexpr size_t nDefaultDiagramFilters = 1
 

Detailed Description

Instances of this class can be given to mty::Model when launching a calculation to customize the output.

Member Typedef Documentation

◆ DiagramFilter

using mty::FeynOptions::DiagramFilter = std::function<bool(mty::FeynmanDiagram const&)>

Type definition for a Feynman diagram.

A Feynman diagram filter is a boolean predicate (function, lambda, ...) taking a mty::FeynmanDiagram as parameter (const reference) and returning true if the diagram must be kept.

◆ LagrangianFilter

using mty::FeynOptions::LagrangianFilter = std::function<bool(mty::InteractionTerm const&)>

Type definition for a Lagrangian filter.

A Lagrangian filter is a boolean predicate (function, lambda, ...) taking a mty::InteractionTerm as parameter (const reference) and returning true if the vertex must be kept.

Constructor & Destructor Documentation

◆ FeynOptions()

mty::FeynOptions::FeynOptions ( )

Default constructor, only constructor of this class (expect copy and move).

This constructor initializes default Lagrangian and Feynman diagram filters used in all calculations.

Member Function Documentation

◆ addDiagramFilter()

void mty::FeynOptions::addDiagramFilter ( DiagramFilter const &  filter)
inlineprotected

Adds one diagram filter to the options.

This function delegates to the other overload that takes an arbitrary number of filters.

Parameters
filterUnique filter to add.

◆ addDiagramFilters()

void mty::FeynOptions::addDiagramFilters ( std::initializer_list< DiagramFilter filters)
protected

Adds a list of diagram filters to the options.

Parameters
filtersList of filters.

◆ addFilter()

template<class Filter >
void mty::FeynOptions::addFilter ( Filter &&  filter)
inline

Adds one filter (LagrangianFilter or DiagramFilter) to the options.

Depending on the type (deduced at compile-time) of the filter, this function delegates to addLagrangianFilter() or addDiagramFilter().

Template Parameters
FilterType of the filter given as parameter.
Parameters
filterUser-defined predicate respecting the requirements of LagrangianFilter or DiagramFilter types.
See also
addFilters()

◆ addFilters() [1/2]

void mty::FeynOptions::addFilters ( )
inline

Overloads to add 0 filter (this function does nothing).

This function represents the end-point of the compile-time recursion of the templated overload.

◆ addFilters() [2/2]

template<class First , class ... Next>
void mty::FeynOptions::addFilters ( First &&  first,
Next &&...  next 
)
inline

Adds an arbitrary number of filters (Lagrangian or diagram filters) to the options.

This function accepts an arbitrary number of arguments provided that each of them is either a LagrangianFilter or a DiagramFilter. The compiler deduces automatically the types and the function can be used as simply as

FeynOptions options;
options.addFilter(
// diagram filter:
mty::filters::forceParticle("t"), // only top quark contrib
// Lagrangian filter:
mty::filters::disableParticle("Z"), // no Z boson
// Another diagram filter:
mty::filters::disableParticleCombination({"e", "mu"}) // Disables combinations of e and mu in the same diagram
);
Template Parameters
FirstType of the first filter given.
...NextTypes of the next filters.
Parameters
firstFirst filter.
...nextNext filters.

◆ addLagrangianFilter()

void mty::FeynOptions::addLagrangianFilter ( LagrangianFilter const &  filter)
inlineprotected

Adds one Lagrangian filter to the options.

This function delegates to the other overload that takes an arbitrary number of filters.

Parameters
filterUnique filter to add.

◆ addLagrangianFilters()

void mty::FeynOptions::addLagrangianFilters ( std::initializer_list< LagrangianFilter filters)
protected

Adds a list of Lagrangian filters to the options.

Parameters
filtersList of filters.

◆ applyFilters() [1/4]

void mty::FeynOptions::applyFilters ( std::vector< Lagrangian::TermType > &  lagrangian) const

Applies the Lagrangian filters on a vector of vertices.

The vector must contain mty::Lagrangian::TermType objects even if the filters themselves take mty::InteractionTerm. This function removes from the vector all interaction terms for which one of the filters returns false (filter out).

Parameters
lagrangianLagrangian Set of interaction terms to filter.
See also
lfilters, addFilter(), addFilters()

◆ applyFilters() [2/4]

std::vector< FeynmanRule const * > mty::FeynOptions::applyFilters ( std::vector< FeynmanRule > const &  lagrangian) const

Filters a set a Feynman rules using the lagrangian filters.

This function uses the interaction term represented by the different rules and applies the Lagrangian filters. Unlike the other filtering functions, this one does not remove the elements inside the initial vector but returns a newly constructed vector containing pointers to the rules that passed all filters (i.e. for which all filters returned true). This allows to avoid any copy of a FeynmanRule object that is a high cost operation.

Parameters
lagrangianSet of Feynman rules (interpreted here as a lagrangian with respect to filters).
Returns
A vector containing all pointers to FeynmanRule objects that passed the filters.
See also
lfilters, addFilter(), addFilters()

◆ applyFilters() [3/4]

void mty::FeynOptions::applyFilters ( std::vector< FeynmanDiagram > &  diagrams,
bool  forceFilters = false 
) const

Applies the diagram filters on a vector of Feynman diagrams.

This function removes from the vector all diagrams for which one of the filters returns false (filter out).

Parameters
diagramsSet of diagrams to filter.
forceFiltersBoolean that ensures (is true) that the filters are applied whatever are the other options (partialCalculation in particular).
See also
dfilters, addFilter(), addFilters()

◆ applyFilters() [4/4]

template<class Container , class Predicate >
void mty::FeynOptions::applyFilters ( Container &  container,
Predicate const &  predicate 
) const
inlineprivate

Helper private class applying a set of filters on a range.

Template Parameters
ContainerType of the container to filter.
PredicatePredicate type to apply.
Parameters
containerContainer on which the filter is applied.
predicateInversed filter, must return true if the object must be filtered out.

◆ getDiagramFilters()

std::vector<DiagramFilter> const& mty::FeynOptions::getDiagramFilters ( ) const
inline
Returns
dfilters

◆ getExpansionOrder()

int mty::FeynOptions::getExpansionOrder ( ) const
inline

◆ getFermionOrder()

std::vector<int> const& mty::FeynOptions::getFermionOrder ( ) const
inline
Returns
fermionOrder

◆ getFeynRuleCalculation()

bool mty::FeynOptions::getFeynRuleCalculation ( ) const
inline

◆ getLagrangianFilters()

std::vector<LagrangianFilter> const& mty::FeynOptions::getLagrangianFilters ( ) const
inline
Returns
lfilters

◆ getLoopOrder()

int mty::FeynOptions::getLoopOrder ( ) const
inline
Returns
The value pointed by loopOrder

◆ getTopology()

int mty::FeynOptions::getTopology ( ) const
inline
Returns
topology

◆ getWilsonOperatorBasis()

OperatorBasis mty::FeynOptions::getWilsonOperatorBasis ( ) const
inline

◆ getWilsonOperatorCoefficient()

csl::Expr mty::FeynOptions::getWilsonOperatorCoefficient ( ) const
inline

◆ passFilters()

bool mty::FeynOptions::passFilters ( FeynmanDiagram const &  diagram) const

Tells if a diagram passes all diagram filters.

Parameters
diagram
Returns

◆ setFermionOrder()

void mty::FeynOptions::setFermionOrder ( std::vector< int > const &  order)

Sets the fermion order used to express the amplitude.

Parameters
orderFermion order to apply, range of integers from \( 0 \) to \( N-1 \) for \( N \) external fermions in the process.
See also
fermionOrder

◆ setFeynmanRuleMode()

void mty::FeynOptions::setFeynmanRuleMode ( )

Sets the value of feynRuleCalculation to true (the default value of this member is false).

This function will probably not be useful for user-level manipulations.

◆ setLoopOrder()

void mty::FeynOptions::setLoopOrder ( int  t_nLoops,
int  nExternalLegs 
)

Sets the number of loops for the calculation.

This function needs not only the loop order, but also the number of external legs in the process as it will determine, together with the number of loop, the Taylor expansion order of the Lagrangian exponential.

Parameters
t_nLoopsNumber of loops wanted (basically 0 or 1).
nExternalLegsNumber of external legs of the process.

◆ setTopology()

void mty::FeynOptions::setTopology ( int  t_topology)

Sets the topology for the calculation.

Parameters
t_topologyTopologies allowed.
See also
mty::Topology

◆ setWilsonOperatorBasis()

void mty::FeynOptions::setWilsonOperatorBasis ( OperatorBasis  basis)
private

Sets the Wilson operator basis wilsonOperatorBasis.

Note
This method is private because the operator basis is for now fixed to the standard basis, more suitable for identification.
Parameters
basisBasis used in Wilson coefficient decomposition.

◆ setWilsonOperatorCoefficient()

void mty::FeynOptions::setWilsonOperatorCoefficient ( csl::Expr const &  factor)

Sets the Wilson operator coefficient wilsonOperatorCoefficient.

Parameters
factorFactor used in Wilson coefficient decomposition.

Field Documentation

◆ dfilters

std::vector<DiagramFilter> mty::FeynOptions::dfilters
private

List of diagram filters.

Those filters are applied by MARTY once the Wick theorem has been applied, i.e. that all possible diagrams have been found. They save less calculation than LagrangianFilter but are more general as one can filter diagrams on more complex conditions.

See also
filters.h for built-in filters

◆ fermionOrder

std::vector<int> mty::FeynOptions::fermionOrder
private

Order for fermions in bilinears.

The order of fermions in the result in fixed, useful for Wilson coefficient extraction. For example, a process with for external fermions \( \psi_0,\ \psi_1,\ \psi_2 \) and \( \psi_3 \) can be expressed with the order \( (0123) \) with terms of the type

\[ \left(\bar{\psi}_0\Gamma^A\psi_1\right) \left(\bar{\psi}_1\Gamma^B\psi_2\right, \]

while an order \( (2013) \) corresponds to something such as

\[ \left(\bar{\psi}_2\Gamma^C\psi_0\right) \left(\bar{\psi}_1\Gamma^D\psi_3\right, \]

with \( \Gamma^{A,B,C,D} \) arbitrary \( \gamma \)-matrix combinations.

◆ feynRuleCalculation

bool mty::FeynOptions::feynRuleCalculation { false }
private

Mode of an amplitude calculation.

If true, the calculation is done to derive Feynman rules, false otherwise. The derivation of Feynman rules is a more involved calculation and is used only in that purpose. Otherwise, Feynman rules are used. This parameter is handled automatically by MARTY when calculating Feynman rules, it should not be set by the user a priori.

◆ lfilters

std::vector<LagrangianFilter> mty::FeynOptions::lfilters
private

List of lagrangian filters.

Those filters are applied by MARTY before any calculation is done by discarding unwanted interaction terms. This type of filter must be preferred to diagram filters if possible.

See also
filters.h for built-in filters

◆ loopOrder

std::shared_ptr<int> mty::FeynOptions::loopOrder
private

Loop order (0 for tree-level, 1 for one-loop).

This variable is stored in a shared pointer for a technical reason, but the interface (getter and setter functions) use a standard integer.

◆ orderExternalFermions

bool mty::FeynOptions::orderExternalFermions { mty::option::orderExternalFermions }

Boolean telling if external fermions must be ordered in the result.

This option is false by default and should not be set to true except for Wilson coefficient calculations because it requires more calculations and it not relevant when calculating a squared amplitude.

◆ orderInsertions

bool mty::FeynOptions::orderInsertions { mty::option::applyInsertionOrdering }

This option (default = true) implies that fermionic insertions are ordered using a given rule.

This only affects the absolute signs of different diagrams in a process and is then physically irrelevant.

◆ simplifyAmplitudes

bool mty::FeynOptions::simplifyAmplitudes { mty::option::simplifyAmplitudes }

Set this option to false if you want to disable all simplifications of amplitudes.

Using this option, the result is then much closer to the bare use of Feynman rules and propagators.

◆ wilsonOperatorBasis

OperatorBasis mty::FeynOptions::wilsonOperatorBasis = OperatorBasis::Chiral
private

Operator basis for Wilson coefficients.

The chiral basis uses projectors \( P_L,P_R \) whereas the standard one uses \( \1,\gamma^5 \).

◆ wilsonOperatorCoefficient

csl::Expr mty::FeynOptions::wilsonOperatorCoefficient { CSL_1 }
private

Prefactor used for Wilson coefficients.

An amplitude is decomposed on pairs of Wilson coefficients and operators the following way:

\[ i\mathcal{M} \equiv -if\sum _i C_i \hat{\mathcal{O}}_i, \]

with \( C_i \) the Wilson coefficients, \( \hat{\mathcal{O}}_i \) the operators, and $f$ a convention-dependent factor. This member corresponds to the \( f \)used by MARTY when calculating the \( C_i \).


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