pub enum ExpressionNode {
Zero,
One,
Amp(usize),
Add(Box<ExpressionNode>, Box<ExpressionNode>),
Sub(Box<ExpressionNode>, Box<ExpressionNode>),
Mul(Box<ExpressionNode>, Box<ExpressionNode>),
Div(Box<ExpressionNode>, Box<ExpressionNode>),
Neg(Box<ExpressionNode>),
Real(Box<ExpressionNode>),
Imag(Box<ExpressionNode>),
Conj(Box<ExpressionNode>),
NormSqr(Box<ExpressionNode>),
}Expand description
Expression tree used by Expression.
Variants§
Zero
A expression equal to zero.
One
A expression equal to one.
Amp(usize)
A registered Amplitude referenced by index.
Add(Box<ExpressionNode>, Box<ExpressionNode>)
The sum of two ExpressionNodes.
Sub(Box<ExpressionNode>, Box<ExpressionNode>)
The difference of two ExpressionNodes.
Mul(Box<ExpressionNode>, Box<ExpressionNode>)
The product of two ExpressionNodes.
Div(Box<ExpressionNode>, Box<ExpressionNode>)
The division of two ExpressionNodes.
Neg(Box<ExpressionNode>)
The additive inverse of an ExpressionNode.
Real(Box<ExpressionNode>)
The real part of an ExpressionNode.
Imag(Box<ExpressionNode>)
The imaginary part of an ExpressionNode.
Conj(Box<ExpressionNode>)
The complex conjugate of an ExpressionNode.
NormSqr(Box<ExpressionNode>)
The absolute square of an ExpressionNode.
Implementations§
Source§impl ExpressionNode
impl ExpressionNode
Sourcepub fn evaluate(&self, amplitude_values: &[Complex64]) -> Complex64
pub fn evaluate(&self, amplitude_values: &[Complex64]) -> Complex64
Evaluate an ExpressionNode over a single event using calculated AmplitudeValues
This method parses the underlying ExpressionNode but doesn’t actually calculate the values
from the Amplitudes themselves.
Sourcepub fn evaluate_gradient(
&self,
amplitude_values: &[Complex64],
gradient_values: &[DVector<Complex64>],
) -> DVector<Complex64>
pub fn evaluate_gradient( &self, amplitude_values: &[Complex64], gradient_values: &[DVector<Complex64>], ) -> DVector<Complex64>
Evaluate the gradient of an ExpressionNode over a single event using calculated AmplitudeValues
This method parses the underlying ExpressionNode but doesn’t actually calculate the
gradient from the Amplitudes themselves.
Trait Implementations§
Source§impl Clone for ExpressionNode
impl Clone for ExpressionNode
Source§fn clone(&self) -> ExpressionNode
fn clone(&self) -> ExpressionNode
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExpressionNode
impl Debug for ExpressionNode
Source§impl Default for ExpressionNode
impl Default for ExpressionNode
Source§fn default() -> ExpressionNode
fn default() -> ExpressionNode
Source§impl<'de> Deserialize<'de> for ExpressionNode
impl<'de> Deserialize<'de> for ExpressionNode
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>,
Auto Trait Implementations§
impl Freeze for ExpressionNode
impl RefUnwindSafe for ExpressionNode
impl Send for ExpressionNode
impl Sync for ExpressionNode
impl Unpin for ExpressionNode
impl UnwindSafe for ExpressionNode
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
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.