This MR adds a Julia interface including types and functions to describe particles in the sense of the standard model of particle physics. The description is not restricted to static properties, but can in general be fulfilled by any instance of particles in general.
Furthermore, this MR contains an implementation of a type hierarchy for Bosons, Fermions, and their respective anti-particles, as well as particle types for Electrons, Positrons, and Photons. Again, the type hierarchy is not restricted to these particle types.
Particles
Abstract particle interface
In the implementation, the notion of particles is derived from an abstract type AbstractParticle and the following interface functions:
is_fermion(::AbstractParticle), which returns true if the input can be considered as a fermion, and false if not.
is_boson(::AbstractParticle), which returns true if the input can be considered as a boson, and false if not.
is_particle(::AbstractParticle), which returns true if the input can be considered as a particle, and false if not.
is_anti_particle(::AbstractParticle), which returns true if the input can be considered as an antiparticle, and false if not.
mass(::AbstractParticle), which returns the mass of the input (usually as but not restricted to float)
charge(::AbstractParticle), which returns the electric charge of the input (usually as but not restricted to float)
For more detailed descriptions, see the respective docstrings.
Particle type hierarchy
The abstract type AbstractParticleType <: AbstractParticle is the root type for all types of particles, where type means, that all subtypes only provide static information about a certain particle species.
Beginning with AbstractParticleType, there is a hierarchy of particle types indicating if there are fermions, bosons, and their respective anti-particles. The leaves of the hierarchy tree are the concrete types for Electrons, Positrons, and Photons.
Within this MR, the particle type hierarchy looks like this:
(The leading a_ indicates that the type is abstract. This was done only here and not in the code.)
It can easily be extended by concrete types to other particles, e.g. Gluons, Higgs, W-, or Z-Bosons as well as Neutrinos, but also quasi-particles like Cooper-pairs or phonons.
Except for mass and charge, inserting particle types into the hierarchy above will provide default implementations for the particle interface functions.
This means the only interface functions which need to be implemented for additional particles are mass and charge. For Electron, Positron, and Photon, this is already done.)
Using reasonable defaults, the particle interface can be extended, e.g. by functions like flavor, color_charge, and so on.
Generatities
This MR adds a Julia interface including types and functions to describe particles in the sense of the standard model of particle physics. The description is not restricted to static properties, but can in general be fulfilled by any instance of particles in general.
Furthermore, this MR contains an implementation of a type hierarchy for Bosons, Fermions, and their respective anti-particles, as well as particle types for Electrons, Positrons, and Photons. Again, the type hierarchy is not restricted to these particle types.
Particles
Abstract particle interface
In the implementation, the notion of particles is derived from an abstract type
AbstractParticle
and the following interface functions:is_fermion(::AbstractParticle)
, which returnstrue
if the input can be considered as a fermion, andfalse
if not.is_boson(::AbstractParticle)
, which returnstrue
if the input can be considered as a boson, andfalse
if not.is_particle(::AbstractParticle)
, which returnstrue
if the input can be considered as a particle, andfalse
if not.is_anti_particle(::AbstractParticle)
, which returnstrue
if the input can be considered as an antiparticle, andfalse
if not.mass(::AbstractParticle)
, which returns the mass of the input (usually as but not restricted to float)charge(::AbstractParticle)
, which returns the electric charge of the input (usually as but not restricted to float)For more detailed descriptions, see the respective docstrings.
Particle type hierarchy
The abstract type
AbstractParticleType <: AbstractParticle
is the root type for all types of particles, wheretype
means, that all subtypes only provide static information about a certain particle species. Beginning withAbstractParticleType
, there is a hierarchy of particle types indicating if there are fermions, bosons, and their respective anti-particles. The leaves of the hierarchy tree are the concrete types forElectrons
,Positrons
, andPhotons
.Within this MR, the particle type hierarchy looks like this:
(The leading
a_
indicates that the type is abstract. This was done only here and not in the code.)It can easily be extended by concrete types to other particles, e.g. Gluons, Higgs, W-, or Z-Bosons as well as Neutrinos, but also quasi-particles like Cooper-pairs or phonons. Except for
mass
andcharge
, inserting particle types into the hierarchy above will provide default implementations for the particle interface functions. This means the only interface functions which need to be implemented for additional particles aremass
andcharge
. ForElectron
,Positron
, andPhoton
, this is already done.) Using reasonable defaults, the particle interface can be extended, e.g. by functions likeflavor
,color_charge
, and so on.