pub struct ParticleProperties {Show 21 fields
pub name: Option<String>,
pub species: Option<String>,
pub antiparticle_species: Option<String>,
pub self_conjugate: Option<bool>,
pub spin: Option<J>,
pub parity: Option<Parity>,
pub c_parity: Option<Parity>,
pub g_parity: Option<Parity>,
pub charge: Option<i32>,
pub isospin: Option<Isospin>,
pub strangeness: Option<i32>,
pub charm: Option<i32>,
pub bottomness: Option<i32>,
pub topness: Option<i32>,
pub baryon_number: Option<i32>,
pub electron_lepton_number: Option<i32>,
pub muon_lepton_number: Option<i32>,
pub tau_lepton_number: Option<i32>,
pub statistics: Option<Statistics>,
pub mass: Option<f64>,
pub ids: IndexMap<String, ExternalId>,
}Expand description
The set of properties which define the quantum state of a particle.
Fields§
§name: Option<String>The name of the particle, if known.
species: Option<String>The species of the particle, if known (used to compare to ParticleProperties::antiparticle_species).
antiparticle_species: Option<String>The species of the particle’s antiparticle, if known (used to compare to ParticleProperties::species).
self_conjugate: Option<bool>Whether the particle is its own antiparticle.
spin: Option<J>The spin of the particle, if known.
parity: Option<Parity>The intrinsic parity of the particle, if known.
c_parity: Option<Parity>The intrinsic C-parity of the particle, if known or applicable.
g_parity: Option<Parity>The intrinsic G-parity of the particle, if known or applicable.
charge: Option<i32>The electric charge of the particle, if known.
isospin: Option<Isospin>The isospin of the particle, if known.
strangeness: Option<i32>The total strangeness of the particle, if known.
charm: Option<i32>The total charm of the particle, if known.
bottomness: Option<i32>The total bottomness of the particle, if known.
topness: Option<i32>The total topness of the particle, if known.
baryon_number: Option<i32>The total baryon number of the particle, if known.
electron_lepton_number: Option<i32>The electron lepton number of the particle, if known.
muon_lepton_number: Option<i32>The muon lepton number of the particle, if known.
tau_lepton_number: Option<i32>The tau lepton number of the particle, if known.
statistics: Option<Statistics>The particle’s statistical nature, if known.
mass: Option<f64>The nominal particle mass, if known.
ids: IndexMap<String, ExternalId>External identifiers for this particle.
Implementations§
Source§impl ParticleProperties
impl ParticleProperties
Sourcepub fn name(&self) -> LadduPhysicsResult<String>
pub fn name(&self) -> LadduPhysicsResult<String>
Get the particle’s name
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the name is
unknown.
Sourcepub fn species(&self) -> LadduPhysicsResult<String>
pub fn species(&self) -> LadduPhysicsResult<String>
Get the particle’s species
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the species
is unknown.
Sourcepub fn antiparticle_species(&self) -> LadduPhysicsResult<String>
pub fn antiparticle_species(&self) -> LadduPhysicsResult<String>
Get the particle’s antiparticle species
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the
antiparticle species is unknown.
Sourcepub fn self_conjugate(&self) -> LadduPhysicsResult<bool>
pub fn self_conjugate(&self) -> LadduPhysicsResult<bool>
Get the particle’s self-conjugate status
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the
self-conjugate status is unknown.
Sourcepub fn spin(&self) -> LadduPhysicsResult<J>
pub fn spin(&self) -> LadduPhysicsResult<J>
Get the particle’s spin
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the spin is
unknown.
Sourcepub fn parity(&self) -> LadduPhysicsResult<Parity>
pub fn parity(&self) -> LadduPhysicsResult<Parity>
Get the particle’s intrinsic parity
§Errors
Returns LadduPhysicsError::MissingParticleProperty when parity is
unknown.
Sourcepub fn c_parity(&self) -> LadduPhysicsResult<Parity>
pub fn c_parity(&self) -> LadduPhysicsResult<Parity>
Get the particle’s intrinsic C-parity
§Errors
Returns LadduPhysicsError::MissingParticleProperty when C-parity is
unknown.
Sourcepub fn g_parity(&self) -> LadduPhysicsResult<Parity>
pub fn g_parity(&self) -> LadduPhysicsResult<Parity>
Get the particle’s intrinsic G-parity
§Errors
Returns LadduPhysicsError::MissingParticleProperty when G-parity is
unknown.
Sourcepub fn charge(&self) -> LadduPhysicsResult<i32>
pub fn charge(&self) -> LadduPhysicsResult<i32>
Get the particle’s electric charge
§Errors
Returns LadduPhysicsError::MissingParticleProperty when charge is
unknown.
Sourcepub fn isospin(&self) -> LadduPhysicsResult<Isospin>
pub fn isospin(&self) -> LadduPhysicsResult<Isospin>
Get the particle’s isospin
§Errors
Returns LadduPhysicsError::MissingParticleProperty when isospin is
unknown.
Sourcepub fn strangeness(&self) -> LadduPhysicsResult<i32>
pub fn strangeness(&self) -> LadduPhysicsResult<i32>
Get the particle’s strangeness
§Errors
Returns LadduPhysicsError::MissingParticleProperty when strangeness
is unknown.
Sourcepub fn charm(&self) -> LadduPhysicsResult<i32>
pub fn charm(&self) -> LadduPhysicsResult<i32>
Get the particle’s charm
§Errors
Returns LadduPhysicsError::MissingParticleProperty when charm is
unknown.
Sourcepub fn bottomness(&self) -> LadduPhysicsResult<i32>
pub fn bottomness(&self) -> LadduPhysicsResult<i32>
Get the particle’s bottomness
§Errors
Returns LadduPhysicsError::MissingParticleProperty when bottomness
is unknown.
Sourcepub fn topness(&self) -> LadduPhysicsResult<i32>
pub fn topness(&self) -> LadduPhysicsResult<i32>
Get the particle’s topness
§Errors
Returns LadduPhysicsError::MissingParticleProperty when topness is
unknown.
Sourcepub fn baryon_number(&self) -> LadduPhysicsResult<i32>
pub fn baryon_number(&self) -> LadduPhysicsResult<i32>
Get the particle’s baryon number
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the baryon
number is unknown.
Sourcepub fn electron_lepton_number(&self) -> LadduPhysicsResult<i32>
pub fn electron_lepton_number(&self) -> LadduPhysicsResult<i32>
Get the particle’s electron lepton number
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the electron
lepton number is unknown.
Sourcepub fn muon_lepton_number(&self) -> LadduPhysicsResult<i32>
pub fn muon_lepton_number(&self) -> LadduPhysicsResult<i32>
Get the particle’s muon lepton number
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the muon
lepton number is unknown.
Sourcepub fn tau_lepton_number(&self) -> LadduPhysicsResult<i32>
pub fn tau_lepton_number(&self) -> LadduPhysicsResult<i32>
Get the particle’s tau lepton number
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the tau
lepton number is unknown.
Sourcepub fn statistics(&self) -> LadduPhysicsResult<Statistics>
pub fn statistics(&self) -> LadduPhysicsResult<Statistics>
Get the particle’s statistics
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the
statistics are unknown.
Sourcepub fn mass(&self) -> LadduPhysicsResult<f64>
pub fn mass(&self) -> LadduPhysicsResult<f64>
Get the particle’s mass.
§Errors
Returns LadduPhysicsError::MissingParticleProperty when the mass is
unknown.
Sourcepub fn jp(j: J, p: Parity) -> Self
pub fn jp(j: J, p: Parity) -> Self
Construct a particle with the given spin and parity. Construct a particle with the given spin and intrinsic parity.
Sourcepub fn jpc(j: J, p: Parity, c: Parity) -> Self
pub fn jpc(j: J, p: Parity, c: Parity) -> Self
Construct a particle with the given spin, parity, and C-parity.
Sourcepub fn lepton(e: i32, m: i32, t: i32) -> Self
pub fn lepton(e: i32, m: i32, t: i32) -> Self
Construct a lepton-like state with the supplied family lepton numbers.
Sourcepub fn hadron() -> Self
pub fn hadron() -> Self
A hadron-like state with zero lepton number. Does not assume baryon number, charge, or flavor.
Sourcepub fn meson() -> Self
pub fn meson() -> Self
A meson-like hadron with zero baryon and lepton number. Does not assume charge or flavor.
Sourcepub fn baryon(b: i32) -> Self
pub fn baryon(b: i32) -> Self
A baryon-like hadron with baryon number b and zero lepton number.
Usually b = 1; nuclei/dibaryons can use b > 1; antibaryons use negative values.
Sourcepub fn with_species(
self,
species: impl Into<String>,
) -> LadduPhysicsResult<Self>
pub fn with_species( self, species: impl Into<String>, ) -> LadduPhysicsResult<Self>
Set the particle’s species.
§Errors
Returns LadduPhysicsError when the species conflicts with existing
self-conjugacy or antiparticle metadata.
Sourcepub fn with_antiparticle_species(
self,
antiparticle_species: impl Into<String>,
) -> LadduPhysicsResult<Self>
pub fn with_antiparticle_species( self, antiparticle_species: impl Into<String>, ) -> LadduPhysicsResult<Self>
Set the particle’s antiparticle species.
§Errors
Returns LadduPhysicsError when the antiparticle species conflicts
with existing self-conjugacy or species metadata.
Sourcepub fn with_species_names(
self,
species: impl Into<String>,
antiparticle_species: impl Into<String>,
) -> LadduPhysicsResult<Self>
pub fn with_species_names( self, species: impl Into<String>, antiparticle_species: impl Into<String>, ) -> LadduPhysicsResult<Self>
Set both particle and antiparticle species names.
Equal names mark the particle as self-conjugate.
§Errors
Returns LadduPhysicsError when the resulting species and quantum
number metadata violate particle invariants.
Sourcepub fn with_self_conjugate(self, value: bool) -> LadduPhysicsResult<Self>
pub fn with_self_conjugate(self, value: bool) -> LadduPhysicsResult<Self>
Set whether the particle is its own antiparticle.
§Errors
Returns LadduPhysicsError when value conflicts with species names,
C-parity, or nonzero additive quantum numbers.
Sourcepub fn with_self_conjugate_species(
self,
species: impl Into<String>,
) -> LadduPhysicsResult<Self>
pub fn with_self_conjugate_species( self, species: impl Into<String>, ) -> LadduPhysicsResult<Self>
Set one species name and mark the particle as self-conjugate.
§Errors
Returns LadduPhysicsError when existing particle metadata is
inconsistent with self-conjugacy.
Sourcepub fn with_parity(self, p: Parity) -> Self
pub fn with_parity(self, p: Parity) -> Self
Set the particle’s intrinsic parity.
Sourcepub fn with_c_parity(self, c: Parity) -> LadduPhysicsResult<Self>
pub fn with_c_parity(self, c: Parity) -> LadduPhysicsResult<Self>
Set the particle’s intrinsic C-parity.
§Errors
Returns LadduPhysicsError when C-parity conflicts with the
particle’s self-conjugacy or additive quantum numbers.
Sourcepub fn with_g_parity(self, g: Parity) -> Self
pub fn with_g_parity(self, g: Parity) -> Self
Set the particle’s intrinsic G-parity.
Sourcepub fn with_charge(self, q: i32) -> Self
pub fn with_charge(self, q: i32) -> Self
Set the particle’s electric charge.
Sourcepub fn with_isospin(self, isospin: Isospin) -> Self
pub fn with_isospin(self, isospin: Isospin) -> Self
Set the particle’s isospin state.
Sourcepub fn with_strangeness(self, s: i32) -> LadduPhysicsResult<Self>
pub fn with_strangeness(self, s: i32) -> LadduPhysicsResult<Self>
Set the particle’s total strangeness.
§Errors
Returns LadduPhysicsError when nonzero strangeness conflicts with
self-conjugacy.
Sourcepub fn with_charm(self, c: i32) -> LadduPhysicsResult<Self>
pub fn with_charm(self, c: i32) -> LadduPhysicsResult<Self>
Set the particle’s total charm.
§Errors
Returns LadduPhysicsError when nonzero charm conflicts with
self-conjugacy.
Sourcepub fn with_bottomness(self, b: i32) -> LadduPhysicsResult<Self>
pub fn with_bottomness(self, b: i32) -> LadduPhysicsResult<Self>
Set the particle’s total bottomness.
§Errors
Returns LadduPhysicsError when nonzero bottomness conflicts with
self-conjugacy.
Sourcepub fn with_topness(self, t: i32) -> LadduPhysicsResult<Self>
pub fn with_topness(self, t: i32) -> LadduPhysicsResult<Self>
Set the particle’s total topness.
§Errors
Returns LadduPhysicsError when nonzero topness conflicts with
self-conjugacy.
Sourcepub fn with_flavor(
self,
s: i32,
c: i32,
b: i32,
t: i32,
) -> LadduPhysicsResult<Self>
pub fn with_flavor( self, s: i32, c: i32, b: i32, t: i32, ) -> LadduPhysicsResult<Self>
Set strangeness, charm, bottomness, and topness together.
§Errors
Returns LadduPhysicsError when a nonzero flavor quantum number
conflicts with self-conjugacy.
Sourcepub fn with_baryon_number(self, b: i32) -> LadduPhysicsResult<Self>
pub fn with_baryon_number(self, b: i32) -> LadduPhysicsResult<Self>
Set the particle’s total baryon number.
§Errors
Returns LadduPhysicsError when a nonzero baryon number conflicts
with self-conjugacy.
Sourcepub fn with_electron_lepton_number(self, e: i32) -> LadduPhysicsResult<Self>
pub fn with_electron_lepton_number(self, e: i32) -> LadduPhysicsResult<Self>
Set the particle’s electron lepton number.
§Errors
Returns LadduPhysicsError when a nonzero electron lepton number
conflicts with self-conjugacy.
Sourcepub fn with_muon_lepton_number(self, m: i32) -> LadduPhysicsResult<Self>
pub fn with_muon_lepton_number(self, m: i32) -> LadduPhysicsResult<Self>
Set the particle’s muon lepton number.
§Errors
Returns LadduPhysicsError when a nonzero muon lepton number
conflicts with self-conjugacy.
Sourcepub fn with_tau_lepton_number(self, t: i32) -> LadduPhysicsResult<Self>
pub fn with_tau_lepton_number(self, t: i32) -> LadduPhysicsResult<Self>
Set the particle’s tau lepton number.
§Errors
Returns LadduPhysicsError when a nonzero tau lepton number
conflicts with self-conjugacy.
Sourcepub fn with_lepton_numbers(
self,
e: i32,
m: i32,
t: i32,
) -> LadduPhysicsResult<Self>
pub fn with_lepton_numbers( self, e: i32, m: i32, t: i32, ) -> LadduPhysicsResult<Self>
Set electron-, muon-, and tau-family lepton numbers together.
§Errors
Returns LadduPhysicsError when a nonzero lepton number conflicts
with self-conjugacy.
Sourcepub fn with_statistics(self, s: Statistics) -> LadduPhysicsResult<Self>
pub fn with_statistics(self, s: Statistics) -> LadduPhysicsResult<Self>
Set the particle’s statistical nature.
§Errors
Returns LadduPhysicsError if the spin and statistics do not match.
Sourcepub fn with_zero_flavor(self) -> Self
pub fn with_zero_flavor(self) -> Self
Set every flavor quantum number to zero.
Sourcepub fn with_zero_lepton_numbers(self) -> Self
pub fn with_zero_lepton_numbers(self) -> Self
Set every family lepton number to zero.
Sourcepub fn with_zero_additive_quantum_numbers(self) -> LadduPhysicsResult<Self>
pub fn with_zero_additive_quantum_numbers(self) -> LadduPhysicsResult<Self>
Set charge, flavor, baryon number, and all lepton numbers to zero.
§Errors
Returns LadduPhysicsError when the resulting metadata violates
another particle invariant.
Sourcepub fn is_antiparticle_of(&self, other: &ParticleProperties) -> bool
pub fn is_antiparticle_of(&self, other: &ParticleProperties) -> bool
Returns true if self is the antiparticle of other.
Sourcepub fn ids(&self) -> &IndexMap<String, ExternalId>
pub fn ids(&self) -> &IndexMap<String, ExternalId>
External identifiers for the particle
Sourcepub fn id(&self, namespace: &str) -> Option<&ExternalId>
pub fn id(&self, namespace: &str) -> Option<&ExternalId>
Return the first external identifier in the requested namespace.
Sourcepub fn with_id<Id: Into<ExternalId>>(self, namespace: &str, id: Id) -> Self
pub fn with_id<Id: Into<ExternalId>>(self, namespace: &str, id: Id) -> Self
Append an external identifier.
Trait Implementations§
Source§impl Clone for ParticleProperties
impl Clone for ParticleProperties
Source§fn clone(&self) -> ParticleProperties
fn clone(&self) -> ParticleProperties
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParticleProperties
impl Debug for ParticleProperties
Source§impl Default for ParticleProperties
impl Default for ParticleProperties
Source§fn default() -> ParticleProperties
fn default() -> ParticleProperties
Source§impl<'de> Deserialize<'de> for ParticleProperties
impl<'de> Deserialize<'de> for ParticleProperties
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ParticleProperties
impl PartialEq for ParticleProperties
Source§impl Serialize for ParticleProperties
impl Serialize for ParticleProperties
impl StructuralPartialEq for ParticleProperties
Auto Trait Implementations§
impl Freeze for ParticleProperties
impl RefUnwindSafe for ParticleProperties
impl Send for ParticleProperties
impl Sync for ParticleProperties
impl Unpin for ParticleProperties
impl UnsafeUnpin for ParticleProperties
impl UnwindSafe for ParticleProperties
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.