pub struct SphericalChannelsResidual {
basis: Basis,
ks: [Complex; 2],
q: Vec<[f64; 2]>,
polarizations: Vec<u8>,
area: f64,
helicity: bool,
fixed_q: bool,
}Expand description
What spherical_channels saves for its pullback: its inputs alone.
The pullback recomputes each channel with its derivatives with respect to the position, the wavenumber, the transverse wavevector and the area.
The pullback adds the per-column position, wavenumber and area gradients in chunks of
consecutive columns fixed by the column count, and the chunk sums in chunk order
(numerics::parallel::try_fold_ordered), so the thread count does not change them.
Each transverse-wavevector gradient belongs to one column, which writes it in place.
Fields§
§basis: Basis§ks: [Complex; 2]§q: Vec<[f64; 2]>§polarizations: Vec<u8>§area: f64§helicity: bool§fixed_q: boolImplementations§
Source§impl SphericalChannelsResidual
impl SphericalChannelsResidual
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 multipole, 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. Tangents have the same shapes
and order as the pullback outputs; q is held fixed with fixed_q. A zero
transverse tangent also permits other input directions at normal incidence.
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 transverse wavevectors
(zero with fixed_q) and the area, for a cotangent of the channel matrix’s
shape. Both families traverse columns, sides and multipoles in the same order.
Trait Implementations§
Source§impl Clone for SphericalChannelsResidual
impl Clone for SphericalChannelsResidual
Source§fn clone(&self) -> SphericalChannelsResidual
fn clone(&self) -> SphericalChannelsResidual
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SphericalChannelsResidual
impl Debug for SphericalChannelsResidual
Auto Trait Implementations§
impl Freeze for SphericalChannelsResidual
impl RefUnwindSafe for SphericalChannelsResidual
impl Send for SphericalChannelsResidual
impl Sync for SphericalChannelsResidual
impl Unpin for SphericalChannelsResidual
impl UnwindSafe for SphericalChannelsResidual
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.