Skip to main content

J

Struct J 

Source
pub struct J(/* private fields */);
Expand description

A non-negative total angular momentum stored as twice its physical value.

This representation keeps integer and half-integer quantum numbers exact. For example, J::half(1) represents $1/2$, and J::int(1) represents $1$.

Implementations§

Source§

impl J

Source

pub const fn int(value: u32) -> Self

Construct a non-negative integer angular momentum.

Source

pub const fn half(value: u32) -> Self

Construct a non-negative angular momentum from the given numerator over two.

Source

pub fn projections(self) -> Vec<M>

Enumerate the valid signed projections for this angular momentum.

Source

pub const fn doubled(self) -> u32

Return the doubled integer value.

Source

pub const fn multiplicity(self) -> u32

Return the number of projections, $2J + 1$.

Source

pub const fn is_integer(self) -> bool

Return whether this quantum number represents an integer value.

Source

pub fn coupled_with(self, other: Self) -> Vec<Self>

Enumerate the total angular momenta obtainable by coupling this value to other.

Results run from $\lvert J_1 - J_2\rvert$ through $J_1 + J_2$ in unit steps.

Source

pub fn can_couple_to(self, j1: Self, j2: Self) -> bool

Return whether j1 and j2 can couple to produce this angular momentum.

Trait Implementations§

Source§

impl Add for J

Source§

type Output = J

The resulting type after applying the + operator.
Source§

fn add(self, rhs: J) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&J> for &J

Source§

type Output = J

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &J) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<&J> for J

Source§

type Output = J

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &J) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<J> for &J

Source§

type Output = J

The resulting type after applying the + operator.
Source§

fn add(self, rhs: J) -> Self::Output

Performs the + operation. Read more
Source§

impl Clone for J

Source§

fn clone(&self) -> J

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 Copy for J

Source§

impl Debug for J

Source§

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

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

impl<'de> Deserialize<'de> for J

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 Display for J

Source§

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

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

impl Eq for J

Source§

impl From<J> for f32

Source§

fn from(value: J) -> Self

Converts to this type from the input type.
Source§

impl From<J> for f64

Source§

fn from(value: J) -> Self

Converts to this type from the input type.
Source§

impl From<J> for Isospin

Source§

fn from(value: J) -> Self

Converts to this type from the input type.
Source§

impl From<L> for J

Source§

fn from(value: L) -> Self

Converts to this type from the input type.
Source§

impl Hash for J

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for J

Source§

fn cmp(&self, other: &J) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for J

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for J

Source§

fn partial_cmp(&self, other: &J) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for J

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 J

Source§

impl TryFrom<J> for L

Source§

type Error = LadduPhysicsError

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

fn try_from(value: J) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<i8>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<i8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<i16>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<i16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<i32>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<i32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<i64>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<i64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<i128>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<i128>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<isize>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<isize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<u8>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<u8>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<u16>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<u16>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<u32>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<u32>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<u64>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<u64>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<u128>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<u128>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Ratio<usize>> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: Ratio<usize>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f32> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: f32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<f64> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: f64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i8> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: i8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i16> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: i16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i32> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: i32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i64> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i128> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<isize> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: isize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u8> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u16> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u32> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: u32) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u64> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u128> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<usize> for J

Source§

type Error = LadduPhysicsError

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

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for J

§

impl RefUnwindSafe for J

§

impl Send for J

§

impl Sync for J

§

impl Unpin for J

§

impl UnsafeUnpin for J

§

impl UnwindSafe for J

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<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

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

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.