Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Data Structures | Namespaces | Functions
graph.h File Reference

Handles graphs for applying wick theorem. In this file lies the algorithm performing Wick contractions, i.e. that finds all different Feynman diagrams (with their numerical factor) that intervenes in a given process (i.e. correlation function). More...

#include "quantumField.h"
#include "fermionFlow.h"

Go to the source code of this file.

Data Structures

class  mty::wick::Node
 Represents a contractible mty::QuantumField in the context of Wick contraction. More...
 
class  mty::wick::Vertex
 Represents a Vertex in feynman diagrams, i.e. a set of Nodes at the same space-time point. More...
 
class  mty::wick::ConnectedComponent
 std::vector of Vertex that represents the connected component of a Graph. A Graph has typically one ConnectedComponent and free Vertices. More...
 
class  mty::wick::Graph
 Handles wick contractions. A graph contains Vertices, and is able to connect them in all possible ways returning the set of all possible Graph. More...
 
class  mty::wick::WickCalculator
 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...
 

Namespaces

 mty
 Namespace of MARTY.
 

Functions

void mty::wick::contractNodes (const std::shared_ptr< Node > &node1, const std::shared_ptr< Node > &node2)
 Contracts two Node together, i.e. sets the partner of each node equal to a std::weak_ptr to the other. More...
 
bool mty::wick::areDegenerate (const mty::QuantumField &f1, const mty::QuantumField &f2)
 Tells if two mty::QuantumField are degenerate, i.e. have the same value in the contraction sens. They must be the same mty::QuantumField and have the same conjugation property. More...
 
bool mty::wick::areExactlyContractible (const mty::QuantumField &f1, const mty::QuantumField &f2)
 Tells if the contraction of two mty::QuantumField is non zero. More...
 
std::ostream & mty::wick::operator<< (std::ostream &fout, const std::shared_ptr< Node > &node)
 Overload of the operator<< for Node. More...
 
bool mty::wick::operator== (const std::shared_ptr< Node > &A, const std::shared_ptr< Node > &B)
 Overload of operator== for sstd::shared_ptr<Node>. Compares the values of the two pointers. More...
 
bool mty::wick::comparePriority (const std::shared_ptr< Node > &A, const std::shared_ptr< Node > &B, const std::vector< csl::Tensor > &foundNodes)
 
bool mty::wick::internal_comparePriority (const std::shared_ptr< Node > &A, const std::shared_ptr< Node > &B, const std::vector< csl::Tensor > &foundNodes)
 
std::vector< mty::QuantumFieldmty::wick::convertExprToFields (const csl::Expr &expr)
 Converts a csl csl::Expr that is just a product of field into a std::vector of mty::QuantumField objects. More...
 
int mty::wick::countFermions (std::vector< const mty::QuantumField *>::const_iterator begin, std::vector< const mty::QuantumField *>::const_iterator end)
 Counts the number of fermions in a std::vector of mty::QuantumField. More...
 
int mty::wick::getCommutationSign (const std::vector< mty::QuantumField > &A, std::vector< const mty::QuantumField *> B)
 Computes and returns the sign cost of the commutation of two sets of mty::QuantumField. \( sgn = (-1)^{N_c}\), with \( N_c \) the number of fermion permutations necessary to Transform A to B. More...
 
int mty::wick::getCommutationSign (const std::vector< const mty::QuantumField *> &A, std::vector< const mty::QuantumField *> B)
 
csl::vector_expr mty::wick::convertGraphsToCorrelators (const std::vector< std::shared_ptr< Graph >> &diagrams, std::vector< mty::FeynruleMomentum > &witnessMapping, bool ruleMode=true)
 Converts a std::vector of fully connected graphs into a std::vector of expressions (one expression per graph) via Graph::getExpression(). More...
 

Detailed Description

Handles graphs for applying wick theorem. In this file lies the algorithm performing Wick contractions, i.e. that finds all different Feynman diagrams (with their numerical factor) that intervenes in a given process (i.e. correlation function).

Author
Gregoire Uhlrich
Version
1.3

Function Documentation

◆ areDegenerate()

bool mty::wick::areDegenerate ( const mty::QuantumField f1,
const mty::QuantumField f2 
)

Tells if two mty::QuantumField are degenerate, i.e. have the same value in the contraction sens. They must be the same mty::QuantumField and have the same conjugation property.

Example: \( \psi^*(X)_{\alpha} \) and \( \psi(Y)_{\beta} \) are contractible together but not degenerate. \( \psi^*(X)_{\alpha} \) and \( \psi^*(Y)_{\beta} \) are not contractible together but are degenerate.

Parameters
f1First mty::QuantumField to compare.
f2Second mty::QuantumField to compare.
Returns
True if f1 and f2 are degenerate.
False else.

◆ areExactlyContractible()

bool mty::wick::areExactlyContractible ( const mty::QuantumField f1,
const mty::QuantumField f2 
)

Tells if the contraction of two mty::QuantumField is non zero.

Parameters
f1First mty::QuantumField in the contraction.
f2Second mty::QuantumField in the contraction.
Returns
True if the contraction of f1 and f2 is non zero.
False else.

◆ contractNodes()

void mty::wick::contractNodes ( const std::shared_ptr< Node > &  node1,
const std::shared_ptr< Node > &  node2 
)

Contracts two Node together, i.e. sets the partner of each node equal to a std::weak_ptr to the other.

Parameters
node1std::shared_ptr to the first Node.
node2std::shared_ptr to the second Node.

◆ convertExprToFields()

vector< QuantumField > mty::wick::convertExprToFields ( const csl::Expr expr)

Converts a csl csl::Expr that is just a product of field into a std::vector of mty::QuantumField objects.

This function raises an error if it finds an object in the product that is neither a mty::QuantumField nor a positive Integer power of mty::QuantumField. If a field appears in a power, it is put as many times in the vector as its integer power.

Parameters
exprcsl::Expr product of quantum fields to convert.
Returns
A std::vector of mty::QuantumField containing all fields in expr.

◆ convertGraphsToCorrelators()

csl::vector_expr mty::wick::convertGraphsToCorrelators ( const std::vector< std::shared_ptr< Graph >> &  diagrams,
std::vector< mty::FeynruleMomentum > &  witnessMapping,
bool  ruleMode = true 
)

Converts a std::vector of fully connected graphs into a std::vector of expressions (one expression per graph) via Graph::getExpression().

Parameters
diagramsFully connected graphs to convert.
Returns
The converted graphs into csl csl::Expr.

◆ countFermions()

int mty::wick::countFermions ( std::vector< const mty::QuantumField *>::const_iterator  begin,
std::vector< const mty::QuantumField *>::const_iterator  end 
)

Counts the number of fermions in a std::vector of mty::QuantumField.

Parameters
beginBegin iterator of the std::vector of mty::QuantumField.
endEnd iterator of the std::vector of mty::QuantumField.
Returns
The number of fermions in the vector.

◆ getCommutationSign()

int mty::wick::getCommutationSign ( const std::vector< mty::QuantumField > &  A,
std::vector< const mty::QuantumField *>  B 
)

Computes and returns the sign cost of the commutation of two sets of mty::QuantumField. \( sgn = (-1)^{N_c}\), with \( N_c \) the number of fermion permutations necessary to Transform A to B.

Parameters
AInitial order of fields.
BSame field content as A but in a different order.
Returns
The sign cost of the permutation of B in order to Transform it into A.

◆ operator<<()

std::ostream& mty::wick::operator<< ( std::ostream &  fout,
const std::shared_ptr< Node > &  node 
)

Overload of the operator<< for Node.

Parameters
foutOutput flux.
nodeNode to display in a std::shared_ptr.
Returns
The modified flux.

◆ operator==()

bool mty::wick::operator== ( const std::shared_ptr< Node > &  A,
const std::shared_ptr< Node > &  B 
)

Overload of operator== for sstd::shared_ptr<Node>. Compares the values of the two pointers.

Parameters
AFirst std::shared_ptr to Node to compare.
BSecond std::shared_ptr to Node to compare.
Returns
True if the two pointers point to the same memory location.
False else.