polynomials#
Classes#
A class to represent and manipulate spherical harmonics in the |
Functions#
|
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.ModuleA 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
todenseandfrom_densefollow 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}\]
- 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