pub struct Kinematics { /* private fields */ }Expand description
Symbolic Lorentz kinematics in Spenso’s scalar-product notation.
Momentum names are unindexed symbols or labeled calls such as Q(1).
Assumptions belong to this value and can be reused across expressions.
Tensor and Dirac contractions remain the responsibility of Idenso; apply
these substitutions after converting contractions to compact scalar products.
Implementations§
Source§impl Kinematics
impl Kinematics
Sourcepub fn dimension(&self) -> Dimension
pub fn dimension(&self) -> Dimension
Lorentz dimension carried by this context’s scalar products.
Sourcepub fn momenta(&self) -> impl ExactSizeIterator<Item = &Atom>
pub fn momenta(&self) -> impl ExactSizeIterator<Item = &Atom>
Declared formal momentum names, including those without assumptions.
Iteration follows native Atom ordering, not a portable serialization order.
Sourcepub fn scalar_assumptions(
&self,
) -> impl ExactSizeIterator<Item = (&Atom, &Atom)>
pub fn scalar_assumptions( &self, ) -> impl ExactSizeIterator<Item = (&Atom, &Atom)>
Every stored scalar-product key and its value, including metric aliases.
Values are borrowed verbatim: no substitution or arithmetic is performed. Iteration follows native Atom ordering, not a portable serialization order.
Sourcepub fn try_map_scalar_values<E>(
&self,
map: impl FnMut(&Atom) -> Result<Atom, E>,
) -> Result<Self, E>
pub fn try_map_scalar_values<E>( &self, map: impl FnMut(&Atom) -> Result<Atom, E>, ) -> Result<Self, E>
Transform scalar assumption values while retaining all keys and momenta.
The callback runs once per structurally distinct original value, in native
Atom order. Its result is reused for every occurrence, so equal values
and dot/metric aliases remain equal even with a stateful callback. Results
are stored verbatim, without recursive substitution or simplification.
Dimension and formal momentum names are unchanged. Failure returns no
partial owner and leaves self unchanged; callback side effects are not
rolled back. An arbitrary mapping does not certify physical equivalence.
Sourcepub fn in_dimension(dimension: &Atom) -> Result<Self, DimensionError>
pub fn in_dimension(dimension: &Atom) -> Result<Self, DimensionError>
Start with no assumptions in a symbolic or nonnegative integer dimension.
Use a symbol such as D during dimensional regularization, then
substitute D = 4 - 2 eps in the contracted result with Symbolica.
Sourcepub fn with_momenta(
self,
momenta: impl IntoIterator<Item = Atom>,
) -> Result<Self, SymbolicKinematicsError>
pub fn with_momenta( self, momenta: impl IntoIterator<Item = Atom>, ) -> Result<Self, SymbolicKinematicsError>
Declare momentum names for linear combinations with symbolic coefficients.
Setting a scalar product also declares both momentum names. Symbols not declared as momenta are scalar coefficients inside a linear combination.
Sourcepub fn with_scalar_product(
self,
left: &Atom,
right: &Atom,
value: Atom,
) -> Result<Self, SymbolicKinematicsError>
pub fn with_scalar_product( self, left: &Atom, right: &Atom, value: Atom, ) -> Result<Self, SymbolicKinematicsError>
Set one scalar product. Reversed arguments use the same symmetric key.
Sourcepub fn with_mass_squared(
self,
momentum: &Atom,
mass_squared: Atom,
) -> Result<Self, SymbolicKinematicsError>
pub fn with_mass_squared( self, momentum: &Atom, mass_squared: Atom, ) -> Result<Self, SymbolicKinematicsError>
Set the on-shell relation p.p = mass_squared.
Sourcepub fn flux(
&self,
first: &Atom,
second: Option<&Atom>,
) -> Result<Atom, SymbolicKinematicsError>
pub fn flux( &self, first: &Atom, second: Option<&Atom>, ) -> Result<Atom, SymbolicKinematicsError>
Initial-state denominator for scattering, or a decay in its rest frame.
Two momenta give 4 sqrt((p1.p2)^2 - p1^2 p2^2). One momentum gives
2 sqrt(p^2) for a rest-frame decay. Divide the squared matrix element
times the phase-space measure by this value. Physical momenta are future
directed and on shell; square roots retain Symbolica’s branch semantics.
Sourcepub fn two_body_phase_space(
&self,
first: &Atom,
second: &Atom,
) -> Result<Atom, SymbolicKinematicsError>
pub fn two_body_phase_space( &self, first: &Atom, second: &Atom, ) -> Result<Atom, SymbolicKinematicsError>
Four-dimensional dPhi_2 / dOmega for two outgoing on-shell momenta.
The measure includes (2 pi)^4 delta^4(P-p1-p2) and each
d^3p / ((2 pi)^3 2E). The solid angle is measured in the pair rest
frame. This is the physical above-threshold branch, without an
identical-particle factor or initial-state flux. Symbolica retains
roots unless positivity assumptions justify their simplification.
Sourcepub fn three_body_phase_space(
&self,
first: &Atom,
second: &Atom,
third: &Atom,
) -> Result<Atom, SymbolicKinematicsError>
pub fn three_body_phase_space( &self, first: &Atom, second: &Atom, third: &Atom, ) -> Result<Atom, SymbolicKinematicsError>
Four-dimensional dPhi_3 / (ds12 ds23), with overall orientation integrated.
Here sij=(pi+pj)^2. The normalization includes (2 pi)^4 delta^4
and d^3p / ((2 pi)^3 2E) for each final particle. The density is
1/(128 pi^3 P^2), where P=p1+p2+p3, inside the physical Dalitz
region. Masses determine that region, not the density. This method does
not impose its boundaries or include flux or identical-particle factors.
Use an orientation-independent or orientation-averaged squared amplitude.
Sourcepub fn mandelstam(
momenta: [&Atom; 4],
mass_squared: [Atom; 4],
invariants: [Atom; 3],
) -> Result<Self, SymbolicKinematicsError>
pub fn mandelstam( momenta: [&Atom; 4], mass_squared: [Atom; 4], invariants: [Atom; 3], ) -> Result<Self, SymbolicKinematicsError>
Scalar products for p1 + p2 -> p3 + p4.
Mass arguments are squared masses. The invariants obey
s=(p1+p2)^2, t=(p1-p3)^2, u=(p1-p4)^2 and
s+t+u=sum(mass_squared). This constructor does not eliminate an
invariant; use ordinary Symbolica substitution to choose which to remove.
Sourcepub fn scalar_product(
&self,
left: &Atom,
right: &Atom,
) -> Result<Atom, SymbolicKinematicsError>
pub fn scalar_product( &self, left: &Atom, right: &Atom, ) -> Result<Atom, SymbolicKinematicsError>
Expand a bilinear scalar product and apply the known assumptions.
Single momentum names need no declaration. For sums and products, declare the momentum names first; all remaining symbols are scalar coefficients.
Sourcepub fn linear_terms(
&self,
momentum: &Atom,
) -> Result<Vec<(Atom, Atom)>, SymbolicKinematicsError>
pub fn linear_terms( &self, momentum: &Atom, ) -> Result<Vec<(Atom, Atom)>, SymbolicKinematicsError>
Decompose a linear momentum into (momentum name, scalar coefficient) pairs.
Single names need no declaration. For combinations, momentum names must be declared and may not occur inside scalar coefficient functions or powers. Native exact expression-field grouping retains Gaussian and symbolic coefficients without statistical zero testing.
Trait Implementations§
Source§impl Clone for Kinematics
impl Clone for Kinematics
Source§fn clone(&self) -> Kinematics
fn clone(&self) -> Kinematics
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 Kinematics
impl Debug for Kinematics
Auto Trait Implementations§
impl Freeze for Kinematics
impl RefUnwindSafe for Kinematics
impl Send for Kinematics
impl Sync for Kinematics
impl Unpin for Kinematics
impl UnsafeUnpin for Kinematics
impl UnwindSafe for Kinematics
Blanket Implementations§
§impl<T> AtomComponentOptimizable<()> for T
impl<T> AtomComponentOptimizable<()> for T
fn optimize_atom_components(self) -> T
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.