polynomials#

Classes#

Pijk

A class to represent and manipulate spherical harmonics in the

Functions#

polynomial_product_matrix(p, degree)

Given a polynomial vector p, return a matrix M such that M @ p2 is the polynomial

Module Contents#

class polynomials.Pijk(data: collections.abc.Mapping[tuple[int, int, int], jaxoplanet.types.Array], degree: int = None)[source]#

Bases: equinox.Module

A class to represent and manipulate spherical harmonics in the polynomial basis. Several indices are used throughout the class:

  • Indices \((i, j, k)\) represent the order of the polynomials of \((x, y, z)\), for example \((1, 0, 2)\) represents \(x\,z^2\).

  • Indices \((l, m)\) represent the orders of the spherical harmonics.

  • Index n represent the index of the polynomial in the flattened array.

Flattened array todense and from_dense follow the convention from Luger et al. (2019). More specifically:

\[\tilde{p} = \begin{pmatrix} 1 & x & y & z & x^2 & xz & xy & yz & y^2 & \cdot\cdot\cdot \end{pmatrix}^\mathsf{T}\]
data: dict[tuple[int, int, int], jaxoplanet.types.Array][source]#
degree: int[source]#
diagonal: bool[source]#
property shape[source]#
property indices[source]#
static ijk2lm(i, j, k)[source]#
static n2lm(n)[source]#
static lm2n(l, m)[source]#
static lm2ijk(l, m)[source]#
static n2ijk(n)[source]#
index(i, j, k)[source]#
tosparse() jax.experimental.sparse.BCOO[source]#
todense() jaxoplanet.types.Array[source]#
classmethod from_dense(x: jaxoplanet.types.Array, degree: int = None) Pijk[source]#
__add__(other: Pijk) Pijk[source]#
__mul__(other: Any) Pijk[source]#
__rmul__(other: Any) Pijk[source]#
__getitem__(key) jaxoplanet.types.Array[source]#
polynomials.polynomial_product_matrix(p, degree)[source]#

Given a polynomial vector p, return a matrix M such that M @ p2 is the polynomial product of p with p2.

Note: This function was implemented to reproduce the filter matrix from starry. However, tests show that using the polynomial multiplication operator on the class is faster than introducing a matrix multiplication (see surface_light_curve.py).

Parameters:
  • p (Array) – A vector in the polynomial basis (in its dense form).

  • degree (int) – Degree of the polynomial to be multiplied with.

Returns:

The polynomial product matrix.

Return type:

Array