spherical.modes.algebra
add
add(self, other, subtraction=False)
Source: spherical/modes/algebra.py
conjugate
conjugate(self, inplace=False)
Source: spherical/modes/algebra.py
Return Modes object corresponding to conjugated function
The operations of conjugation and decomposition into mode weights do not commute. That is, the modes of a conjugated function do not equal the conjugated modes of a function. So, rather than simply returning the conjugate of the data from this Modes object, this function returns a Modes object containing the data for the conjugated function. If inplace
is True, then the operation is performed in place, modifying this Modes object itself. Note that some copying is still needed, but only for 2 modes at a time, and those copies are freed after this function returns. Here is the derivation: f = sum(f{s, l,m} * {s}Y{l,m} for l, m in LM) conjugate(f) = sum(conjugate(f{s, l,m}) * conjugate({s}Y{l,m})) = sum(conjugate(f{s, l,m}) * (-1)(s+m) * {-s}Y{l,-m}) = sum((-1)(s+m) * conjugate(f{s, l, -m}) * {-s}Y{l,m}) conjugate(f){s', l',m'} = integral( sum((-1)(s+m) * conjugate(f{s,l,-m}) * {-s}Y{l,m}) * {s'}Y{l',m'}, dR # integration over rotation group ) = sum((-1)(s+m) * conjugate(f{s,l,-m}) * delta_{-s, s'} * delta_{l, l'} * delta_{m, m'}) = (-1)(s'+m') * conjugate(f{-s', l', -m'}) The result is this: conjugate(f){s, l, m} = (-1)(s+m) * conjugate(f{-s, l, -m})
divide
divide(self, other)
Source: spherical/modes/algebra.py
multiply
multiply(self, other, truncator=None)
Source: spherical/modes/algebra.py
Multiply by another spin-weighted function or a scalar
For spin-weighted functions, the spin weight of their product is the sum of the spin weights of the input. If those functions are band limited to maximum ell values, their product has maximum ell value given by the sum of the input maximum ell values. Note that this output ell_max can be controlled by the truncator
argument to this function; if the result is smaller than the sum of the input maximum ell values, this is equivalent to performing the full multiplication and then setting higher ell modes to zero. The benefit of this type of truncation is that the higher modes don't even need to be computed, and no aliasing will result.
Parameters
-
other
:or float
,complex
,array_like
,Modes
Modes objects representing the spin-weighted functions, or an array or float which is equivalent to a spin-0 function.
-
truncator
:callable [defaults to None]
,None
Function to be applied to the tuple (self.ell_max, other.ell_max) to produce the ell_max for the resulting function. Sensible values of the truncator include the built-in python functions
min
,max
, andsum
-- the latter giving the full "correct" answer. If you want a specific ell value, you can uselambda tup: max_ell
. If None, this function falls back on themultiplication_truncator
metadata fields of the input Modes objects, and uses the greater of the values that they return. If either input object is missing themultiplication_truncator
metadata field, it defaults tosum
.
norm
norm(self)
Source: spherical/modes/algebra.py
subtract
subtract(self, other)
Source: spherical/modes/algebra.py