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

Stores insertion and momenta data and provides a simple interface to manipulate it. More...

#include <kinematics.h>

Public Member Functions

 Kinematics ()=default
 Default constructor: empty process.
 
 Kinematics (std::vector< mty::Insertion > const &t_insertions)
 Initializes the object only from insertions, creates the required momenta. More...
 
 Kinematics (std::vector< mty::Insertion > const &t_insertions, std::vector< csl::Tensor > const &t_momenta)
 Initializes the object from insertions and momenta. More...
 
 Kinematics (std::vector< mty::Insertion > const &t_insertions, std::vector< size_t > const &indices)
 Initializes the object from insertions and indices for momenta. More...
 
size_t size () const
 
mty::Insertion const & insertion (size_t i) const
 Returns the insertion in position i. More...
 
csl::Tensor const & momentum (size_t i) const
 Returns the momentum in position i. More...
 
csl::Expr squaredMomentum (size_t i, size_t j) const
 
std::vector< mty::Insertion > const & getInsertions () const
 
std::vector< csl::Tensor > const & getMomenta () const
 
std::vector< csl::TensorgetOrderedMomenta () const
 
std::vector< csl::Expr > const & getSquaredMomenta () const
 
std::vector< size_t > const & getIndices () const
 
csl::Expr getDegreesOfFreedomFactor () const
 Returns the combinatorial factor corresponding to the process. More...
 
Kinematics subset (std::vector< size_t > pos) const
 Returns a subset of the Kinematics object taking only some indices. More...
 
void applyPermutation (std::vector< size_t > const &pos)
 Permutes elements inside the Kinematics object, keeping insertions and (squared-)momenta aligned with each other. More...
 
Kinematics applyIndices (std::vector< size_t > const &indices) const
 Creates a new kinemtics object with newly created momenta for the same insertions. More...
 
void sortFromIndices ()
 
Kinematics alignedWith (Kinematics const &other) const
 

Static Public Member Functions

static void replace (csl::Expr &expr, Kinematics const &k1, Kinematics const &k2)
 Replaces in an expression the relevant (squared-)momenta corresponding to the replacement of one Kinematics object to another. This function must receive two kinematics of the same size, and replaces in expr the (squared-)momenta of k1 by those of k2. More...
 
static Kinematics merge (Kinematics const &k1, Kinematics const &k2)
 
static std::vector< size_t > defaultIndices (size_t N)
 Returns the default range of indices form 1 to N. More...
 

Private Member Functions

void initMomentaSquared (std::vector< size_t > const &indices)
 Calculates and fills momenta squared from momenta contractions following the expression given in the documentation of squaredMomenta. More...
 
void addContraction (csl::Tensor &p1, csl::Tensor &p2, csl::Expr const &res)
 Adds a CSL contraction for momenta. More...
 
void setSquaredMomentum (size_t i, size_t j, csl::Expr const &res)
 Sets a squared momentum from its indices and the corresponding expression. More...
 
size_t squaredMomentumIndex (size_t i, size_t j) const
 Returns the index corresponding to a given momenta product. More...
 

Private Attributes

std::vector< mty::Insertioninsertions
 Set of insertions of the process.
 
std::vector< csl::Tensormomenta
 Set of external momenta of the process. More...
 
std::vector< size_t > indices
 Indices of momenta. More...
 
std::vector< csl::ExprsquaredMomenta
 Set of squared external momenta for the process. More...
 

Friends

std::ostream & operator<< (std::ostream &out, Kinematics const &kin)
 Overload of output stream operator for Kinematics object. More...
 

Detailed Description

Stores insertion and momenta data and provides a simple interface to manipulate it.

Constructor & Destructor Documentation

◆ Kinematics() [1/3]

mty::Kinematics::Kinematics ( std::vector< mty::Insertion > const &  t_insertions)
explicit

Initializes the object only from insertions, creates the required momenta.

Parameters
t_insertionsInsertions of the process.

◆ Kinematics() [2/3]

mty::Kinematics::Kinematics ( std::vector< mty::Insertion > const &  t_insertions,
std::vector< csl::Tensor > const &  t_momenta 
)

Initializes the object from insertions and momenta.

Squared momenta are determined from the momenta given as parameters through the relation \( s_{ij} = g_{\mu\nu}p_i^\mu p_j^\nu \).

Parameters
t_insertionsInsertions of the process.
t_momentaExternal momenta of the process. Should be of the same size as t_insertions.

◆ Kinematics() [3/3]

mty::Kinematics::Kinematics ( std::vector< mty::Insertion > const &  t_insertions,
std::vector< size_t > const &  indices 
)

Initializes the object from insertions and indices for momenta.

Indices given as parameter determine the name of the different momenta, replacing the default \( p_1, p_2 ..., p_N \) that corresponds to indices \( {1, 2, ..., N} \). The range of indices can be arbitrary provided that its size corresponds to the number of different insertions and that all indices are different. Then squared momenta are determined from the momenta created from the indices through the relation \( s_{ij} = g_{\mu\nu}p_i^\mu p_j^\nu \).

Parameters
t_insertionsInsertions of the process.
indicesIndices to initialize momenta names.

Member Function Documentation

◆ addContraction()

void mty::Kinematics::addContraction ( csl::Tensor p1,
csl::Tensor p2,
csl::Expr const &  res 
)
private

Adds a CSL contraction for momenta.

This function delegates to CSL the responsibility to add the contraction property for \( p_1\cdot p_2 \) calling cgl::TensorParent::addSelfContraction() so that this contraction is simplified when encountered in calculations and replaced by the result.

Parameters
p1Left momentum in the contraction.
p2Right momentum in the contraction.
resResult of the contraction (see squaredMomenta).

◆ applyIndices()

Kinematics mty::Kinematics::applyIndices ( std::vector< size_t > const &  indices) const

Creates a new kinemtics object with newly created momenta for the same insertions.

Parameters
indicesSet of indices constructing the momenta for the new Kinematics object.
Returns
The copy of the current Kinematics object with new momenta corresponding to indices.

◆ applyPermutation()

void mty::Kinematics::applyPermutation ( std::vector< size_t > const &  pos)

Permutes elements inside the Kinematics object, keeping insertions and (squared-)momenta aligned with each other.

Parameters
posPermutation. Must be of the same size as the Kinematics object and contain all indices in \( {1, 2, ..., N} \).

◆ defaultIndices()

static std::vector<size_t> mty::Kinematics::defaultIndices ( size_t  N)
inlinestatic

Returns the default range of indices form 1 to N.

Parameters
NSize of the container to return.
Returns
A std::vector<size_t> equal to \( {1, 2, ..., N} \).

◆ getDegreesOfFreedomFactor()

csl::Expr mty::Kinematics::getDegreesOfFreedomFactor ( ) const

Returns the combinatorial factor corresponding to the process.

This function takes into account two different factors required in the squared amplitude calculation, namely the number of incoming degrees if freedom to average over them, and the combinatorial factor taking into account indistinguishable outgoing particles. For \( N \) incoming particles indexed by \( i \) and \( M \) groups of indistinguishable outgoing particles of respective sizes \( m_j \), this function returns a symbolic factor equal to

\[ F = \prod _i\dfrac{1}{d_i}\cdot \prod _j \dfrac{1}{m_j!}, \]

with \( d_i \) the number of degrees of freedom of the incoming particle $i$ taking into account spin and gauge representations dimensions.

Note
For spin 1 particles, the spin dimension is 2 if the particle is massless, 3 otherwise.
Indistinguishable particles are particles of the exact same species, with the same complex conjugation property (e.g. \( W^+ \) and \( W^- \) are distinguishable, \( Z \) and \( Z \) are not).
Returns
The factor \( F \) calculated as the combinatorial factor for the corresponding squared amplitude.

◆ getIndices()

std::vector<size_t> const& mty::Kinematics::getIndices ( ) const
inline
Returns
indices

◆ getInsertions()

std::vector<mty::Insertion> const& mty::Kinematics::getInsertions ( ) const
inline
Returns
A const reference to the range of insertions.

◆ getMomenta()

std::vector<csl::Tensor> const& mty::Kinematics::getMomenta ( ) const
inline
Returns
A const reference to the range of momenta.

◆ getOrderedMomenta()

std::vector< csl::Tensor > mty::Kinematics::getOrderedMomenta ( ) const
Returns
Returns the momenta in order (p_1, p_2, p_3, ...)

◆ getSquaredMomenta()

std::vector<csl::Expr> const& mty::Kinematics::getSquaredMomenta ( ) const
inline
Returns
A const reference to the range of squared momenta.

◆ initMomentaSquared()

void mty::Kinematics::initMomentaSquared ( std::vector< size_t > const &  indices)
private

Calculates and fills momenta squared from momenta contractions following the expression given in the documentation of squaredMomenta.

Parameters
indicesRange of indices names for momenta to initialize corresponding names for \( s_{ij} \) objects.

◆ insertion()

mty::Insertion const& mty::Kinematics::insertion ( size_t  i) const
inline

Returns the insertion in position i.

Parameters
iPosition of the insertion to get (starts at 0).
Returns
The insertion in position i.

◆ momentum()

csl::Tensor const& mty::Kinematics::momentum ( size_t  i) const
inline

Returns the momentum in position i.

Parameters
iPosition of the momentum to get (starts at 0).
Returns
The momentum in position i.

◆ replace()

void mty::Kinematics::replace ( csl::Expr expr,
Kinematics const &  k1,
Kinematics const &  k2 
)
static

Replaces in an expression the relevant (squared-)momenta corresponding to the replacement of one Kinematics object to another. This function must receive two kinematics of the same size, and replaces in expr the (squared-)momenta of k1 by those of k2.

Parameters
exprExpression in which the replacement takes place.
k1Left kinematics, its momenta are replaced.
k2Right kinematics, its momenta take place in expr.

◆ setSquaredMomentum()

void mty::Kinematics::setSquaredMomentum ( size_t  i,
size_t  j,
csl::Expr const &  res 
)
private

Sets a squared momentum from its indices and the corresponding expression.

Parameters
iIndex of the left momentum.
jIndex of the right momentum.
resExpression result of the contraction.

◆ size()

size_t mty::Kinematics::size ( ) const
inline
Returns
the size of the kinematics objects i.e. the number of insertions / momenta.

◆ squaredMomentumIndex()

size_t mty::Kinematics::squaredMomentumIndex ( size_t  i,
size_t  j 
) const
inlineprivate

Returns the index corresponding to a given momenta product.

Parameters
iIndex of the left momentum.
jIndex of the right momentum.
Returns
The index corresponding to \( s_{ij} \) in the linear range containing squared momenta.

◆ subset()

Kinematics mty::Kinematics::subset ( std::vector< size_t >  pos) const

Returns a subset of the Kinematics object taking only some indices.

Parameters
posRange of insertions indices of the subset to return.
Returns
The Kinematics object with a subset of insertions and (squared-)momenta containing only objects at given positions given by pos.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
Kinematics const &  kin 
)
friend

Overload of output stream operator for Kinematics object.

Parameters
outOutput stream.
kinKinematics object to display.
Returns
The modified stream.

Field Documentation

◆ indices

std::vector<size_t> mty::Kinematics::indices
private

Indices of momenta.

Momenta are defined as \( p_i \) with indices \( i \). This member allows the Kinematics to keep this information, considering for example that a set of momenta \( (p_2, p_3, p_1) \) will have indices \( (2, 3, 1) \).

◆ momenta

std::vector<csl::Tensor> mty::Kinematics::momenta
private

Set of external momenta of the process.

There are exactly \(N\) momenta for \(N\) insertions.

◆ squaredMomenta

std::vector<csl::Expr> mty::Kinematics::squaredMomenta
private

Set of squared external momenta for the process.

For \(N\) insertions, there are \(N\) external momenta and \( N(N+1)/2 \) squared momenta defined by

\[ s_{ij} \equiv g_{\mu\nu}p_i^\mu p_j^\nu, \text{ with } i \leq j. \]

For on-shell particles, one has

\[ s_{ii} = m_i^2. \]

This container is linear whereas the data it represents is 2-dimensional, see squaredMomentumIndex() that provides the relation between the 2D index and the physical index for this container. For now this container is redundant and contains both \( s_{ij} \) and \( s_{ji} \) that are equal. This is however not an important overhead and is less error prone that storing a triangle matrix in a linear container.


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