e3j.core.Polynomial¶
- class e3j.core.Polynomial(monomials: Monomial, coef: Array | None = None, shape: tuple | None = None)¶
Batched polynomials, aggregating monomials with a coefficient matrix.
Given a d-variate
MonomialinstanceMand a(k, n)coefficient matrixC, evaluatingP = Polynomial(M, C)on a(b, d)point cloudxyieldsbatch_size * kscalars given by:P(x)[s, i] = sum(C[i, j] * M(x)[s, j] for j in range(n))
Methods
C()__call__(x)Evaluate polynomials on a point cloud.
__init__(monomials[, coef, shape])Create polynomials from array of monomials and coefficient matrix.
aggregate(mx)coalesce([sort])Aggregate coefficients on equal monomials.
concat(ps[, axis])Concatenate polynomial instances.
stack(ps[, axis])Stack polynomials along a given axis.
Attributes
coordsDifferential of polynomials.
exp- __call__(x: Array) Array¶
Evaluate polynomials on a point cloud.
- Parameters:
(jax.Array) (x) – a point cloud of shape
[..., d]- Returns:
evaluated polynomials, of shape
[..., k]wherek = p.coef.shape[0].- Return type:
px (
jax.Array)
- __init__(monomials: Monomial, coef: Array | None = None, shape: tuple | None = None)¶
Create polynomials from array of monomials and coefficient matrix.
- Parameters:
monomials (
Monomial) – an array ofnmonomialscoef (
jax.Array | None) – an optional(k, n)matrix of coefficients, defaults to ones.shape (
tuple | None) – an optional leading shape, mostly useful to arrange outputs of polynomial differentials. Defaults to(k,).
- coalesce(sort=False) Polynomial¶
Aggregate coefficients on equal monomials.
- classmethod concat(ps: Polynomial | Monomial, axis: int = -1) Polynomial¶
Concatenate polynomial instances.
- property diff: Polynomial¶
Differential of polynomials.
- classmethod stack(ps: Polynomial, axis: int = -1) Polynomial¶
Stack polynomials along a given axis.