Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Public Member Functions | Protected Attributes | Friends
mty::wick::Vertex Class Reference

Represents a Vertex in feynman diagrams, i.e. a set of Nodes at the same space-time point. More...

#include <graph.h>

Inheritance diagram for mty::wick::Vertex:
[legend]

Public Member Functions

 Vertex ()
 Default constructor, initializes an empty Vertex.
 
 Vertex (const std::vector< const mty::QuantumField *> &fields, size_t id, bool t_external=false)
 Constructor with 2 parameters. More...
 
 Vertex (const Vertex &other)
 Copy constructor. See Vertex::operator=().
 
bool isExternal () const
 
bool isFree () const
 
bool hasFreeNode () const
 
bool hasFreeNode (const mty::QuantumField *field) const
 Tells if a Vertex can be contracted with (has free nodes for) a particular mty::QuantumField. More...
 
bool containsExplicit (const mty::QuantumField *field) const
 
bool isDegenerateWith (const Vertex &other) const
 Tells if the Vertex is degenerate with another. More...
 
const mty::QuantumFieldgetFirstContractibleField () const
 Returns the field associated to the first contractible Node of the Vertex. This function calls an error if the Vertex is fully contracted. More...
 
std::shared_ptr< NodegetFirstContractibleNode () const
 
std::shared_ptr< NodegetFirstContractibleNode (const mty::QuantumField *field) const
 Returns the first Node contractible with field if there is one. More...
 
std::vector< std::shared_ptr< Node > > getContractibleNodes () const
 
std::vector< std::shared_ptr< Node > > getContractibleNodes (const mty::QuantumField *field) const
 
void setExternal (bool t_external)
 Sets the external property of the Vertex. True means that the Vertex is composed of field insertions.
 
int getDegeneracy (const mty::QuantumField *t_field) const
 Computes and returns the degeneracy of the Vertex with respect to a given mty::QuantumField. The degeneracy is the number of free Nodes contractible with field. See isExactlyContractiblewith(). More...
 
int getTotalDegeneracyFactor () const
 
Vertexoperator= (const Vertex &other)
 Overload of operator= for Vertex. More...
 
bool operator== (const Vertex &other) const
 Overload of operator== for Vertex. More...
 
bool operator!= (const Vertex &other) const
 Overload of operator!= for Vertex. See Vertex::operator==(). More...
 

Protected Attributes

bool external
 Tells if the Vertex is external, i.e. composed of field insertions.
 
size_t id
 

Friends

std::ostream & operator<< (std::ostream &fout, const Vertex &v)
 Overload of operator<< for Vertex. More...
 

Detailed Description

Represents a Vertex in feynman diagrams, i.e. a set of Nodes at the same space-time point.

Constructor & Destructor Documentation

◆ Vertex()

mty::wick::Vertex::Vertex ( const std::vector< const mty::QuantumField *> &  fields,
size_t  id,
bool  t_external = false 
)
explicit

Constructor with 2 parameters.

Parameters
fieldsstd::vector of mty::QuantumField in the Vertex.
t_externalTells if the vertex is external (field insertion in correlator).

Member Function Documentation

◆ getContractibleNodes()

vector< shared_ptr< Node > > mty::wick::Vertex::getContractibleNodes ( ) const
Returns
A std::vector filled with all contractible Node objects in the Vertex.

◆ getDegeneracy()

int mty::wick::Vertex::getDegeneracy ( const mty::QuantumField t_field) const

Computes and returns the degeneracy of the Vertex with respect to a given mty::QuantumField. The degeneracy is the number of free Nodes contractible with field. See isExactlyContractiblewith().

Parameters
t_fieldmty::QuantumField we want to contract.
Returns
The number of free Node contractible with field.

◆ getFirstContractibleField()

const QuantumField * mty::wick::Vertex::getFirstContractibleField ( ) const

Returns the field associated to the first contractible Node of the Vertex. This function calls an error if the Vertex is fully contracted.

Returns
The mty::QuantumField of the first contractible Node.

◆ getFirstContractibleNode() [1/2]

shared_ptr< Node > mty::wick::Vertex::getFirstContractibleNode ( ) const
Returns
A shared_ptr to the the first constractible Node if ther is one.
nullptr else.

◆ getFirstContractibleNode() [2/2]

shared_ptr< Node > mty::wick::Vertex::getFirstContractibleNode ( const mty::QuantumField field) const

Returns the first Node contractible with field if there is one.

Parameters
fieldmty::QuantumField we want to contract.
Returns
A shared_ptr to the the first Node contractible with field if ther is one.
nullptr else.

◆ hasFreeNode() [1/2]

bool mty::wick::Vertex::hasFreeNode ( ) const
Returns
True if the Vertex has at least one free Node.
False else.

◆ hasFreeNode() [2/2]

bool mty::wick::Vertex::hasFreeNode ( const mty::QuantumField field) const

Tells if a Vertex can be contracted with (has free nodes for) a particular mty::QuantumField.

Parameters
fieldmty::QuantumField we want to contract.
Returns
True if the Vertex has at least one contractible Node with field (see isExactlyContractiblewith()).

◆ isDegenerateWith()

bool mty::wick::Vertex::isDegenerateWith ( const Vertex other) const

Tells if the Vertex is degenerate with another.

Returns
True if the two vertices have the same field content.
False else.

◆ isExternal()

bool mty::wick::Vertex::isExternal ( ) const
Returns
external (i.e. if the Vertex comes from field insertions).

◆ isFree()

bool mty::wick::Vertex::isFree ( ) const
Returns
True if the Vertex is free, i.e. has no contraction.
False else.

◆ operator!=()

bool mty::wick::Vertex::operator!= ( const Vertex other) const

Overload of operator!= for Vertex. See Vertex::operator==().

Returns
False if the field contents are identical.
True else.

◆ operator=()

Vertex & mty::wick::Vertex::operator= ( const Vertex other)

Overload of operator= for Vertex.

A little subtlety lies there. Nodes that are already contracted are not really copied, i.e. only the shared_ptr are copied. In that case the two final vertices have a pointer to the same Node in memory. This is because in the contraction algorithm, a contracted Node do not change at all after that. However, free nodes are really copied (the two Vertices have two different Nodes) because in two different graphs, the two Nodes can be contracted with different possible partners, and then will be different.

Parameters
otherVertex to copy.
Returns
A reference to the modified Vertex.

◆ operator==()

bool mty::wick::Vertex::operator== ( const Vertex other) const

Overload of operator== for Vertex.

Tells if the field content is the same and in the same order.

Parameters
otherVertex to compare.
Returns
True if the field contents are identical.
False else.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  fout,
const Vertex v 
)
friend

Overload of operator<< for Vertex.

Parameters
foutOutput stream.
vVertex to display.
Returns
The modified stream.

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