e3j.core.Monomial¶
- class e3j.core.Monomial(exp: Array, coords: Array | str | None = None)¶
Batched monomials w.r.t. an optional coordinate basis.
Given an array
m = m[:n,:d]of exponents,M = Monomial(m)will efficiently evaluate n monomials on a d-dimensional point cloudx:M(x)[:, i] = x[:, 0] ** m[i,0] * ... * x[:, d-1] ** m[i, d-1]
Optionally, a (possibly complex) coordinate matrix can be used in place of the canonical degree-1 generators.
Note
The
Monomialclass is intended to store the collection of monomials that need to be evaluated by downstreamPolynomialinstances, i.e. before aggregation with a coefficient matrix.Keeping these classes distinct (although monomials are one-term polynomials) is useful for having distinct product/power implementations.
Methods
C()__call__(x)Evaluate monomials on a point cloud.
__init__(exp[, coords])Create monomials from exponents array and optional coordinate matrix.
concat(ms)eval_coords(r)exponentiate_and_multiply(x)Attributes
- __call__(x: Array) Array¶
Evaluate monomials on a point cloud.
- Parameters:
(jax.Array) (x) – a point cloud of shape
[b, d]- Returns:
evaluated monomials of shape
[b, n]- Return type:
mx (
jax.Array)
- __init__(exp: Array, coords: Array | str | None = None)¶
Create monomials from exponents array and optional coordinate matrix.
- Parameters:
(jax.Array) (exp) – exponents array of shape
[n, d]None) (coords (jax.Array |) – an optional
[d, d]matrix of coordinate functions.