particle

A collection of particle info containers.

The particle module is the starting point of the expertsystem. Its main interface is the ParticleCollection, which is a collection of immutable Particle instances that are uniquely defined by their properties. As such, it can be used stand-alone as a database of quantum numbers (see Particle database).

The reaction module uses the properties of Particle instances when it computes which StateTransitionGraph s are allowed between an initial state and final state.

class GellmannNishijima[source]

Bases: object

Collection of conversion methods using Gell-Mann–Nishijima.

The methods in this class use the Gell-Mann–Nishijima formula:

\[Q = I_3 + \frac{1}{2}(B+S+C+B'+T)\]

where \(Q\) is charge (computed), \(I_3\) is Spin.projection of isospin, \(B\) is baryon_number, \(S\) is strangeness, \(C\) is charmness, \(B'\) is bottomness, and \(T\) is topness.

static compute_charge(state: expertsystem.particle.Particle) → Optional[float][source]

Compute charge using the Gell-Mann–Nishijima formula.

If isospin is not None, returns the value \(Q\): computed with the Gell-Mann–Nishijima formula.

static compute_isospin_projection(charge: float, baryon_number: float, strangeness: float, charmness: float, bottomness: float, topness: float)float[source]

Compute isospin projection using the Gell-Mann–Nishijima formula.

See compute_charge, but then computed for \(I_3\).

class Parity(value: Union[float, int, str])[source]

Bases: collections.abc.Hashable

Safe, immutable data container for parity.

__eq__(other: object)bool[source]

Return self==value.

property value
class Particle(name: str, pid: int, spin: float, mass: float, width: float = 0.0, charge: int = 0, isospin: Optional[expertsystem.particle.Spin] = None, strangeness: int = 0, charmness: int = 0, bottomness: int = 0, topness: int = 0, baryon_number: int = 0, electron_lepton_number: int = 0, muon_lepton_number: int = 0, tau_lepton_number: int = 0, parity: Optional[expertsystem.particle.Parity] = None, c_parity: Optional[expertsystem.particle.Parity] = None, g_parity: Optional[expertsystem.particle.Parity] = None)[source]

Bases: object

Immutable container of data defining a physical particle.

A Particle is defined by the minimum set of the quantum numbers that every possible instances of that particle have in common (the “static” quantum numbers of the particle). A “non-static” quantum number is the spin projection. Hence Particle instances do not contain spin projection information.

Particle instances are uniquely defined by their quantum numbers and properties like mass. The name and pid are therefore just labels that are not taken into account when checking if two Particle instances are equal.

Note

As opposed to classes such as EdgeQuantumNumbers and NodeQuantumNumbers, the Particle class serves as an interface to the user (see Particle database).

__eq__(other)

Method generated by attrs for class Particle.

baryon_number: int
bottomness: int
c_parity: Optional[expertsystem.particle.Parity]
charge: int
charmness: int
electron_lepton_number: int
g_parity: Optional[expertsystem.particle.Parity]
is_lepton()bool[source]
isospin: Optional[expertsystem.particle.Spin]
mass: float
muon_lepton_number: int
name: str
parity: Optional[expertsystem.particle.Parity]
pid: int
spin: float
strangeness: int
tau_lepton_number: int
topness: int
width: float
class ParticleCollection(particles: Optional[Iterable[expertsystem.particle.Particle]] = None)[source]

Bases: collections.abc.MutableSet

Searchable collection of immutable Particle instances.

__eq__(other: object)bool[source]

Return self==value.

add(value: expertsystem.particle.Particle)None[source]

Add an element.

discard(value: Union[expertsystem.particle.Particle, str])None[source]

Remove an element. Do not raise an exception if absent.

filter(function: Callable[[expertsystem.particle.Particle], bool])expertsystem.particle.ParticleCollection[source]

Search by Particle properties using a lambda function.

For example:

>>> from expertsystem import io
>>> pdg = io.load_pdg()
>>> subset = pdg.filter(
...     lambda p: p.mass > 1.8
...     and p.mass < 2.0
...     and p.spin == 2
...     and p.strangeness == 1
... )
>>> sorted(list(subset.names))
['K(2)(1820)+', 'K(2)(1820)0']
find(search_term: Union[int, str])expertsystem.particle.Particle[source]

Search for a particle by either name (str) or PID (int).

property names
update(other: Iterable[expertsystem.particle.Particle])None[source]
class Spin(magnitude: float, projection: float)[source]

Bases: collections.abc.Hashable

Safe, immutable data container for spin with projection.

__eq__(other: object)bool[source]

Return self==value.

property magnitude
property projection
create_antiparticle(template_particle: expertsystem.particle.Particle, new_name: Optional[str] = None)expertsystem.particle.Particle[source]
create_particle(template_particle: expertsystem.particle.Particle, name: Optional[str] = None, pid: Optional[int] = None, mass: Optional[float] = None, width: Optional[float] = None, charge: Optional[int] = None, spin: Optional[float] = None, isospin: Optional[expertsystem.particle.Spin] = None, strangeness: Optional[int] = None, charmness: Optional[int] = None, bottomness: Optional[int] = None, topness: Optional[int] = None, baryon_number: Optional[int] = None, electron_lepton_number: Optional[int] = None, muon_lepton_number: Optional[int] = None, tau_lepton_number: Optional[int] = None, parity: Optional[int] = None, c_parity: Optional[int] = None, g_parity: Optional[int] = None)expertsystem.particle.Particle[source]