Skip to content

Commit

Permalink
Break out function qnm.angular.ells, add xref doc for C vector
Browse files Browse the repository at this point in the history
  • Loading branch information
duetosymmetry committed Apr 22, 2019
1 parent 2cef7fa commit 9d3fc9b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
32 changes: 29 additions & 3 deletions qnm/angular.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
Here ℓmin=max(|m|,|s|) (see :meth:`l_min`), and ℓmax can be chosen at
run time. The C coefficients are returned as a complex ndarray, with
the zeroth element corresponding to ℓmin.
the zeroth element corresponding to ℓmin. You can get the associated
ℓ values by calling :meth:`ells`.
TODO More documentation.
"""
Expand Down Expand Up @@ -185,6 +186,31 @@ def l_min(s, m):

return np.max([np.abs(s), np.abs(m)])

def ells(s, m, l_max):
"""Vector of ℓ values in C vector and M matrix.
The format of the C vector and M matrix is that the 0th element
corresponds to l_min(s,m) (see :meth:`l_min`).
Parameters
----------
s: int
Spin-weight of interest
m: int
Magnetic quantum number
l_max: int
Maximum angular quantum number
Returns
-------
int ndarray
Vector of ℓ values, starting from l_min
"""

return np.arange(l_min(s,m), l_max+1)

def M_matrix(s, c, m, l_max):
"""Spherical-spheroidal decomposition matrix truncated at l_max.
Expand All @@ -208,11 +234,11 @@ def M_matrix(s, c, m, l_max):
Decomposition matrix
"""

ells = np.arange(l_min(s,m), l_max+1)
_ells = ells(s, m, l_max)

uf = give_M_matrix_elem_ufunc(s, c, m)

return uf.outer(ells,ells).astype(complex)
return uf.outer(_ells,_ells).astype(complex)

def sep_consts(s, c, m, l_max):
"""Finds eigenvalues of decomposition matrix, i.e. the separation
Expand Down
5 changes: 4 additions & 1 deletion qnm/spinsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ def __call__(self, a):
The first element of the tuple is omega. The second element
of the tuple is A. The third element of the tuple is the
array of complex spherical-spheroidal decomposition
coefficients.
coefficients. For documentation on the format of the
spherical-spheroidal decomposition coefficient array, see
:mod:`qnm.angular` or
:func:`qnm.angular.C_and_sep_const_closest`.
"""

# TODO Make sure that interpolants have been built
Expand Down

0 comments on commit 9d3fc9b

Please sign in to comment.