Skip to main content

ParticleProperties

Struct ParticleProperties 

Source
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

Source

pub fn name(&self) -> LadduPhysicsResult<String>

Get the particle’s name

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the name is unknown.

Source

pub fn species(&self) -> LadduPhysicsResult<String>

Get the particle’s species

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the species is unknown.

Source

pub fn antiparticle_species(&self) -> LadduPhysicsResult<String>

Get the particle’s antiparticle species

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the antiparticle species is unknown.

Source

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.

Source

pub fn spin(&self) -> LadduPhysicsResult<J>

Get the particle’s spin

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the spin is unknown.

Source

pub fn parity(&self) -> LadduPhysicsResult<Parity>

Get the particle’s intrinsic parity

§Errors

Returns LadduPhysicsError::MissingParticleProperty when parity is unknown.

Source

pub fn c_parity(&self) -> LadduPhysicsResult<Parity>

Get the particle’s intrinsic C-parity

§Errors

Returns LadduPhysicsError::MissingParticleProperty when C-parity is unknown.

Source

pub fn g_parity(&self) -> LadduPhysicsResult<Parity>

Get the particle’s intrinsic G-parity

§Errors

Returns LadduPhysicsError::MissingParticleProperty when G-parity is unknown.

Source

pub fn charge(&self) -> LadduPhysicsResult<i32>

Get the particle’s electric charge

§Errors

Returns LadduPhysicsError::MissingParticleProperty when charge is unknown.

Source

pub fn isospin(&self) -> LadduPhysicsResult<Isospin>

Get the particle’s isospin

§Errors

Returns LadduPhysicsError::MissingParticleProperty when isospin is unknown.

Source

pub fn strangeness(&self) -> LadduPhysicsResult<i32>

Get the particle’s strangeness

§Errors

Returns LadduPhysicsError::MissingParticleProperty when strangeness is unknown.

Source

pub fn charm(&self) -> LadduPhysicsResult<i32>

Get the particle’s charm

§Errors

Returns LadduPhysicsError::MissingParticleProperty when charm is unknown.

Source

pub fn bottomness(&self) -> LadduPhysicsResult<i32>

Get the particle’s bottomness

§Errors

Returns LadduPhysicsError::MissingParticleProperty when bottomness is unknown.

Source

pub fn topness(&self) -> LadduPhysicsResult<i32>

Get the particle’s topness

§Errors

Returns LadduPhysicsError::MissingParticleProperty when topness is unknown.

Source

pub fn baryon_number(&self) -> LadduPhysicsResult<i32>

Get the particle’s baryon number

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the baryon number is unknown.

Source

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.

Source

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.

Source

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.

Source

pub fn statistics(&self) -> LadduPhysicsResult<Statistics>

Get the particle’s statistics

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the statistics are unknown.

Source

pub fn mass(&self) -> LadduPhysicsResult<f64>

Get the particle’s mass.

§Errors

Returns LadduPhysicsError::MissingParticleProperty when the mass is unknown.

Source

pub fn unknown() -> Self

Construct a particle with no specified properties.

Source

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.

Source

pub fn jpc(j: J, p: Parity, c: Parity) -> Self

Construct a particle with the given spin, parity, and C-parity.

Source

pub fn boson(j: L) -> Self

A Boson-like state with spin j and zero baryon or lepton number

Source

pub fn lepton(e: i32, m: i32, t: i32) -> Self

Construct a lepton-like state with the supplied family lepton numbers.

Source

pub fn hadron() -> Self

A hadron-like state with zero lepton number. Does not assume baryon number, charge, or flavor.

Source

pub fn meson() -> Self

A meson-like hadron with zero baryon and lepton number. Does not assume charge or flavor.

Source

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.

Source

pub fn with_name(self, name: impl Into<String>) -> Self

Set the particle’s name.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn with_spin(self, j: J) -> Self

Set the particle’s spin.

Source

pub fn with_parity(self, p: Parity) -> Self

Set the particle’s intrinsic parity.

Source

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.

Source

pub fn with_g_parity(self, g: Parity) -> Self

Set the particle’s intrinsic G-parity.

Source

pub fn with_charge(self, q: i32) -> Self

Set the particle’s electric charge.

Source

pub fn with_isospin(self, isospin: Isospin) -> Self

Set the particle’s isospin state.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn with_mass(self, mass: f64) -> Self

Set the particle’s mass.

Source

pub fn with_zero_flavor(self) -> Self

Set every flavor quantum number to zero.

Source

pub fn with_zero_lepton_numbers(self) -> Self

Set every family lepton number to zero.

Source

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.

Source

pub fn is_antiparticle_of(&self, other: &ParticleProperties) -> bool

Returns true if self is the antiparticle of other.

Source

pub fn ids(&self) -> &IndexMap<String, ExternalId>

External identifiers for the particle

Source

pub fn id(&self, namespace: &str) -> Option<&ExternalId>

Return the first external identifier in the requested namespace.

Source

pub fn with_id<Id: Into<ExternalId>>(self, namespace: &str, id: Id) -> Self

Append an external identifier.

Source

pub fn with_ids<I, S, Id>(self, ids: I) -> Self
where I: IntoIterator<Item = (S, Id)>, S: AsRef<str>, Id: Into<ExternalId>,

Replace external identifiers.

Trait Implementations§

Source§

impl Clone for ParticleProperties

Source§

fn clone(&self) -> ParticleProperties

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParticleProperties

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ParticleProperties

Source§

fn default() -> ParticleProperties

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ParticleProperties

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ParticleProperties

Source§

fn eq(&self, other: &ParticleProperties) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ParticleProperties

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ParticleProperties

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.