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

This class represents quantum numbers of a theory, like for example baryon number B, lepton number L etc. More...

#include <quantumNumber.h>

Public Types

using ID = unsigned short
 Integer type for QuantumNumber id.
 
using Value = int
 Integer type for quantum number value.
 

Public Member Functions

 QuantumNumber (std::string const &t_name, bool t_conserved=true)
 Constructor with 2 parameters. More...
 
 QuantumNumber (QuantumNumber const &)=default
 Defaulted copy constructor.
 
QuantumNumberoperator= (QuantumNumber const &)=default
 Defaulted copy assignement operator.
 
 ~QuantumNumber ()
 Destructor.
 
bool isConserved () const
 Returns the conservation property of the quantum number. More...
 
std::string getName () const
 Returns the name of the quantum number. More...
 
void setConservedProperty (bool t_conserved)
 Sets the conserved property of the quantum number. More...
 
void setName (std::string const &t_name)
 Sets the name of the quantum number. More...
 
bool appearsIn (std::vector< mty::QuantumField > const &fields) const
 Tells if one of the fields has a non trivial value for the quantum number. More...
 
int computeQuantumNumber (std::vector< mty::QuantumField > const &field) const
 Calculates the value of the total quantum numbers carried by a list of fields. More...
 
ID getID () const
 Returns the id of the quantum number. More...
 
bool operator== (QuantumNumber const &other) const
 Compares the ids of two quantum numbers. More...
 
bool operator!= (QuantumNumber const &other) const
 Compares the ids of two quantum numbers. More...
 

Static Private Member Functions

static std::map< ID, std::string > & name ()
 Returns the map between ids and names for quantumNumbers. More...
 

Private Attributes

bool conserved
 Tells if the quantum number is conserved. More...
 
ID id
 ID of the quantum number.
 

Static Private Attributes

static ID current_id = 0
 Current id of QuantumNumber. More...
 

Detailed Description

This class represents quantum numbers of a theory, like for example baryon number B, lepton number L etc.

When doing a calculation, you may give a list of independant quantum numbers (like B and L in the SM) to be conserved. This will not change the result but will allow MARTY to discard early diagrams that are zero. You must not give non-independant quantum numbers like F (fermion number) and B. If so, MARTY will discard diagrams that are actually possible because some particles (quarks in this example) may contribute in both numbers.

Constructor & Destructor Documentation

◆ QuantumNumber()

mty::QuantumNumber::QuantumNumber ( std::string const &  t_name,
bool  t_conserved = true 
)
explicit

Constructor with 2 parameters.

Initliazes the name, and possible the conserved property of the quantum number.

Parameters
t_nameName.
t_conservedBoolean that tells if the quantum number is conserved (default = true).

Member Function Documentation

◆ appearsIn()

bool mty::QuantumNumber::appearsIn ( std::vector< mty::QuantumField > const &  fields) const

Tells if one of the fields has a non trivial value for the quantum number.

Parameters
fieldsList of fields.
Returns
True if one of the fields has a non trivial value for the quantum number.
False else.

◆ computeQuantumNumber()

int mty::QuantumNumber::computeQuantumNumber ( std::vector< mty::QuantumField > const &  field) const

Calculates the value of the total quantum numbers carried by a list of fields.

For example, qqq has baryonic number B = 1, leptonic number L = 0, fermionic number F = 3.

Parameters
fieldsList of fields
Returns
The sum of the quantum values corresponding to the fields.

◆ getID()

ID mty::QuantumNumber::getID ( ) const
inline

Returns the id of the quantum number.

Returns
The quantum number ID

◆ getName()

std::string mty::QuantumNumber::getName ( ) const

Returns the name of the quantum number.

The name is not stored directly in the quantum number. Instead, the id is the key to get it. This function then determines the name corresponding to the quantum number's id, and returns it.

Returns
The name of the quantum number.

◆ isConserved()

bool mty::QuantumNumber::isConserved ( ) const

Returns the conservation property of the quantum number.

Returns
True if the quantum number is conserved.
False else.

◆ name()

static std::map<ID, std::string>& mty::QuantumNumber::name ( )
inlinestaticprivate

Returns the map between ids and names for quantumNumbers.

This function allocates statically a map between IDs and names, and returns a reference to it.

Returns
The mapping between ids and names for quantum numbers.

◆ operator!=()

bool mty::QuantumNumber::operator!= ( QuantumNumber const &  other) const
inline

Compares the ids of two quantum numbers.

Returns
False if the two quantum numbers have the same id (same quantum number then)
True else

◆ operator==()

bool mty::QuantumNumber::operator== ( QuantumNumber const &  other) const
inline

Compares the ids of two quantum numbers.

Returns
True if the two quantum numbers have the same id (same quantum number then)
False else

◆ setConservedProperty()

void mty::QuantumNumber::setConservedProperty ( bool  t_conserved)

Sets the conserved property of the quantum number.

Parameters
t_conservedBoolean. If true, the quantum number is conserved and may be used to simplify calculations.

◆ setName()

void mty::QuantumNumber::setName ( std::string const &  t_name)

Sets the name of the quantum number.

Parameters
t_nameNew name of the quantum number.

Field Documentation

◆ conserved

bool mty::QuantumNumber::conserved
private

Tells if the quantum number is conserved.

True by default. If false, the quantum number has no impact on any calculation.

◆ current_id

ID mty::QuantumNumber::current_id = 0
inlinestaticprivate

Current id of QuantumNumber.

This is used to define the id of new quantum numbers. Each time, this variable is incremented.


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