Struct rustitude_core::amplitude::CohSum
source · pub struct CohSum(pub Vec<Box<dyn AmpLike>>);Expand description
Struct to hold a coherent sum of AmpLikes
Tuple Fields§
§0: Vec<Box<dyn AmpLike>>Implementations§
source§impl CohSum
impl CohSum
sourcepub fn print_tree(&self)
pub fn print_tree(&self)
Pretty prints a tree diagram to show the node structure of the CohSum.
sourcepub fn norm_int(&self, cache: &[Option<Complex64>]) -> Option<f64>
pub fn norm_int(&self, cache: &[Option<Complex64>]) -> Option<f64>
Function which returns a sum of all cross terms inside a coherent sum.
Take the following coherent sum, where $\vec{p}$ are input parameters $e$ is an
event, and $f_i$ is the $i$th term in the sum:
\left| \sum_{i\in\text{terms}} f_i(\vec{p}, e) \right|^2
This function will then return
\sum_{i\in\text{terms}} \sum_{j\in\text{terms}} f_i(\vec{p}, e) f_j^*(\vec{p}, e)
This should be used to compute normalization integrals. Note that if on of the terms is
None, this function will not add any products which contain that term. This can be used
to turn terms on and off.
sourcepub fn compute(&self, cache: &[Option<Complex64>]) -> Option<f64>
pub fn compute(&self, cache: &[Option<Complex64>]) -> Option<f64>
Shortcut for computation using a cache of precomputed values. This method will return
None if the cache value at the corresponding Amplitude’s
Amplitude::cache_position is also None, otherwise it just returns the corresponding
cached value. The computation is run across the CohSum’s terms, and the absolute square
of the result is returned (coherent sum).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CohSum
impl !RefUnwindSafe for CohSum
impl Send for CohSum
impl Sync for CohSum
impl Unpin for CohSum
impl !UnwindSafe for CohSum
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> 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> Pointable for T
impl<T> Pointable 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.