Species
Introduction
Species
is a type that stores information about a particle.
A species is defined by the following fields:
struct Species
name # name of the particle to track
charge # charge of the particle
mass # mass of the particle
spin # spin of the particle
moment # magnetic moment of the particle
iso # mass number of atomic isotope
kind # the kind of particle
end
The kind
field classifies species into five types: ATOM
, HADRON
, LEPTON
, PHOTON
, and NULL
. The NULL
kind serves as a placeholder that can be used by Julia code. For example, if a struct
has a Species
component, a NULL
species can be used as an initial value to indicate that the species component has not yet been set.
Each field stores values with their corresponding units and returns a Unitful value when accessed directly. For example:
julia> Species("electron").mass
0.51099895069 MeV c^-2
The default units are:
mass
: MeV/c²charge
: elementary chargespin
: ℏmoment
: J/T
For convenience, use our getter functions massof()
and chargeof()
to obtain values in your preferred units. See the Constants page for more information.
Construct a Species
Use the constructor Species(name)
to create a species.
Note: Species names follow the OpenPMD standard.
Constructing a Null species
The Null
species is useful for bookkeeping purposes, such as a placeholder in a struct component to indicate an unset species. To instantiate:
julia> Species("Null")
julia> Species() # Same as above
Constructing Subatomic Species
To construct a subatomic species, provide the exact name of the particle in the name
field. Note that the name must be provided exactly.
Example:
julia> Species("electron")
For antiparticles, prepend "anti-" to the name.
Example:
julia> Species("anti-proton")
See the list of all available subatomic species at the end of this page.
Constructing Atomic Species
To construct an atomic species, include these components in name
:
- Atomic Symbol
- Mass number of the atom (optional), format:
- Mass number before the atomic symbol (accepts unicode superscript)
- Optional "#" symbol at the beginning
- If not specified, uses the average of the mass in naturally occurring samples.
- These formats all represent Hydrogen-1:
julia julia> Species("1H") julia> Species("¹H") julia> Species("#1H")
- Charge (optional), format (all accept unicode superscript):
- "+" for single positive charge
- "++" for double positive charge
- "+n" or "n+" for n positive charges
- "-" for single negative charge
- "–" for double negative charge
- "-n" or "n-" for n negative charges
- Defaults to 0 if not specified
- Add "anti-" prefix to construct an anti-atom
Example:
julia> Species("13C+") # Carbon-13 with a single positive charge
julia> Species("¹⁵N³⁻") # Nitrogen-15 with a 3 negative charge
julia> Species("Al+3") # Average Aluminum with 3 positive charge
julia> Species("anti-H") # Anti-hydrogen
Species Functions
Species functions each take a Species
as their parameter and return a specific property. Here are the available functions:
massof()
chargeof()
atomicnumber()
fullname()
g_spin()
- $g = \frac{2m\mu }{Sq}$
- $g$ is gyromagnetic ratio
- $m$ is species mass
- $\mu$ is the species magnetic moment
- $S$ is the species spin
- $q$ is the species charge
gyromagnetic_anomaly()
- $g_a = \frac{g-2}{2}$
- $g_a$ is the gyromagnetic anomaly for a lepton
- $g$ is the gyromagnetic ratio
g_nucleon()
- $g_n = \frac{g Zm_p}{m}$
- $g_n$ is the gyromagnetic anomaly for a baryon
- $g$ is the gyromagnetic ratio
- $Z$ is the species charge
- $m_p$ is the mass of a proton
- $m$ is species mass
Note: You must call @APCdef
before using massof()
or chargeof()
.
List of Available Subatomic Species
anti-deuteron
- anti-electron
same as positron
anti-neutron
anti-proton
anti-muon
deuteron
electron
muon
neutron
photon
pion0
pion+
pion-
positron
proton