Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
mty::wick::WickCalculator Class Reference

Class handling the full application of Wick theorem. Starts from an initial Graph fully disconnected, delegates contraction steps to the Graph class and handles the series of resulting Graphs (eliminates non physical ones, iterates the Graph::contractoinStep()...). More...

#include <graph.h>

Static Public Member Functions

static csl::Expr applyWickTheoremOnDiagram (const Graph &diagram, std::vector< mty::FeynruleMomentum > &witnessMapping, bool ruleMode=true)
 
static csl::vector_expr applyWickTheoremOnDiagrams (const std::vector< std::shared_ptr< Graph >> &diagrams, std::vector< mty::FeynruleMomentum > &witnessMapping, bool ruleMode=true)
 
static std::vector< mty::FeynmanDiagramgetDiagrams (mty::Model const *model, const csl::Expr &initialExpr, std::map< csl::Tensor, size_t > &vertexIds, std::vector< mty::FeynruleMomentum > &witnessMapping, bool symmetriseExternalLegs=false, bool ruleMode=true)
 
static std::vector< mty::FeynmanDiagramgetDiagrams (mty::Model const *model, const csl::Expr &initialExpr, std::map< csl::Tensor, size_t > &vertexIds, bool symmetriseExternalLegs=false, bool ruleMode=true)
 
static bool isContractionZero (const std::vector< mty::QuantumField > &fields, size_t maxLoops=size_t(-1), size_t nVertices=size_t(-1))
 Checks quickly if a set of fields gives a zero contraction. More...
 
static bool isContractionZero (const std::vector< mty::QuantumField const *> &fields, size_t maxLoops=size_t(-1), size_t nVertices=size_t(-1))
 

Private Member Functions

 WickCalculator ()
 Default constructor.
 
 WickCalculator (const Graph &freeDiagram)
 Constructor with one parameter. More...
 
 WickCalculator (const WickCalculator &other)=default
 Copy constructor = c++ default.
 
 ~WickCalculator ()
 Destructor.
 
void setSymmetrizeExternalLegs (bool t_symmetrize)
 
Graph getInitialDiagram () const
 
std::vector< std::shared_ptr< Graph > > getDiagrams ()
 Calculates and returns all possible contractions of the initial Graph. If the different diagrams have already been found, does not recompute them. More...
 
void eliminateNonPhysicalDiagrams (std::vector< std::shared_ptr< Graph >> &diagrams)
 See Graph::isPhysical(). Eliminate Graph that do not fill this condition. More...
 
void calculateDiagrams ()
 Contraction algorithm. Generates all possible Graph using the method Graph::contractionStep(), and stores it in the member feynmanDiagram.
 

Static Private Member Functions

static std::vector< std::vector< mty::QuantumField > > splitFields (const std::vector< mty::QuantumField > &field)
 Static helper function that splits a std::vector of fields into several, each part being associated with a unique QuantumFieldParent. Allows to discard quickly diagrams that have one (at least) species that presents an odd number of fields. More...
 
static std::vector< std::vector< mty::QuantumField const * > > splitFields (const std::vector< mty::QuantumField const *> &field)
 

Private Attributes

bool diagramsCalculated = false
 Boolean that tells if contractions have already been done.
 
bool symmetrizeExternalLegs = false
 
Graph initialDiagram
 Initial diagram for contractions.
 
std::vector< std::shared_ptr< Graph > > feynmanDiagram
 All possible diagrams once contractions have been done. Result of the function calculateDiagrams()).
 

Detailed Description

Class handling the full application of Wick theorem. Starts from an initial Graph fully disconnected, delegates contraction steps to the Graph class and handles the series of resulting Graphs (eliminates non physical ones, iterates the Graph::contractoinStep()...).

Constructor & Destructor Documentation

◆ WickCalculator()

mty::wick::WickCalculator::WickCalculator ( const Graph freeDiagram)
explicitprivate

Constructor with one parameter.

Parameters
freeDiagramGraph fully disconnected initializing the algorithm.

Member Function Documentation

◆ eliminateNonPhysicalDiagrams()

void mty::wick::WickCalculator::eliminateNonPhysicalDiagrams ( std::vector< std::shared_ptr< Graph >> &  diagrams)
private

See Graph::isPhysical(). Eliminate Graph that do not fill this condition.

Parameters
diagramsstd::vector of Graph which non physical elements are removed (modified during the run).

◆ getDiagrams()

std::vector< std::shared_ptr< Graph > > mty::wick::WickCalculator::getDiagrams ( )
private

Calculates and returns all possible contractions of the initial Graph. If the different diagrams have already been found, does not recompute them.

Returns
The set of possible Graph once contractions have been done.

◆ getInitialDiagram()

Graph mty::wick::WickCalculator::getInitialDiagram ( ) const
private
Returns
The initial Graph initialDiagram.

◆ isContractionZero()

bool mty::wick::WickCalculator::isContractionZero ( const std::vector< mty::QuantumField > &  fields,
size_t  maxLoops = size_t(-1),
size_t  nVertices = size_t(-1) 
)
static

Checks quickly if a set of fields gives a zero contraction.

Parameters
fieldsstd::vector of mty::QuantumField to check.

This function will not detect all cases at all. The purpose is to do a quick check to discard the most obvious cases, in order to save time in computations.

Returns
True if the contraction of fields is zero in some cases.
False else.

◆ splitFields()

vector< vector< QuantumField > > mty::wick::WickCalculator::splitFields ( const std::vector< mty::QuantumField > &  field)
staticprivate

Static helper function that splits a std::vector of fields into several, each part being associated with a unique QuantumFieldParent. Allows to discard quickly diagrams that have one (at least) species that presents an odd number of fields.

Parameters
fieldInitial std::vector of mty::QuantumField to split in species.
Returns
The splitted std::vector into groups of mty::QuantumField from the same species.

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