pub struct CylindricalChannelsResidual {
basis: Basis,
ks: [Complex; 2],
q: Vec<[f64; 2]>,
polarizations: Vec<u8>,
period: f64,
fixed_q: bool,
}Expand description
What cylindrical_channels saves for its pullback: its inputs alone.
The pullback recomputes each channel with its derivatives with respect to the
position, the wavenumber, kx and the period.
The pullback adds the per-column position, wavenumber and period gradients as
SphericalChannelsResidual adds its shared gradients, so the thread count does not
change them. Each kx gradient belongs to one column, which writes it in place.
Fields§
§basis: Basis§ks: [Complex; 2]§q: Vec<[f64; 2]>§polarizations: Vec<u8>§period: f64§fixed_q: boolImplementations§
Source§impl CylindricalChannelsResidual
impl CylindricalChannelsResidual
Sourcepub fn state_size(
multipoles: usize,
positions: usize,
channels: usize,
) -> Result<usize>
pub fn state_size( multipoles: usize, positions: usize, channels: usize, ) -> Result<usize>
Bytes of saved derivative state for the fixed basis and channel counts.
Sourcepub fn shape(&self) -> (usize, usize)
pub fn shape(&self) -> (usize, usize)
The shape of the channel matrix: four rows per cylindrical mode, one column per plane mode.
Sourcepub fn validate_tangent(
&self,
positions: &[[f64; 3]],
ks: [Complex; 2],
q: &[[f64; 2]],
measure: f64,
) -> Result<()>
pub fn validate_tangent( &self, positions: &[[f64; 3]], ks: [Complex; 2], q: &[[f64; 2]], measure: f64, ) -> Result<()>
Check finite input tangents and their position and plane counts.
Sourcepub fn pushforward(
&self,
positions: &[[f64; 3]],
ks: [Complex; 2],
q: &[[f64; 2]],
measure: f64,
) -> Result<DMatrix<Complex>>
pub fn pushforward( &self, positions: &[[f64; 3]], ks: [Complex; 2], q: &[[f64; 2]], measure: f64, ) -> Result<DMatrix<Complex>>
Directional derivative of the channel matrix. The axial q[j][0] is a fixed
label, and q[j][1] is held fixed as well when fixed_q was requested.
Sourcepub fn pullback(&self, cotangent: &DMatrix<Complex>) -> Result<ChannelGradient>
pub fn pullback(&self, cotangent: &DMatrix<Complex>) -> Result<ChannelGradient>
Gradients of the positions, the two medium wavenumbers, the kx components and the
period, for a cotangent of the channel matrix’s shape. The axial kz = q[j][0]
is a fixed label with a zero gradient, and measure holds the period gradient. The
traversal is shared with SphericalChannelsResidual::pullback.
Trait Implementations§
Source§impl Clone for CylindricalChannelsResidual
impl Clone for CylindricalChannelsResidual
Source§fn clone(&self) -> CylindricalChannelsResidual
fn clone(&self) -> CylindricalChannelsResidual
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CylindricalChannelsResidual
impl Debug for CylindricalChannelsResidual
Auto Trait Implementations§
impl Freeze for CylindricalChannelsResidual
impl RefUnwindSafe for CylindricalChannelsResidual
impl Send for CylindricalChannelsResidual
impl Sync for CylindricalChannelsResidual
impl Unpin for CylindricalChannelsResidual
impl UnwindSafe for CylindricalChannelsResidual
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§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.