cyjax.polynomial#
Methods for manipulating polynomials.
The base class Poly
builds on top of
sympy.Poly
and adds numerically efficient evaluation. In addition, it groups (scalar)
input variables into groups which represent some complex vector space
(later \(\mathbb{P}^n\)).
For example, \(z_0, z_1, z_2, z_3 \in \mathbb{C}\) are grouped into a
single vectorial input variable \(z\). Besides input variables,
the class also tracks a list of scalar parameters which are passed
together as a single array when evaluating the polynomial.
As a subclass of Poly
, a homogeneous polynomial class HomPoly
is given,
which can be evaluated efficiently given affine coordinates.
General polynomials#
The base functionality is implemented in the Poly
class:
|
It can be constructed either based on a (sympy) expression of the equation, or given matrices of powers and coefficients:
|
Construct a |
|
Construct |
Extract powers of variables and lists of coefficients. |
Several helper functions are implemented that are used inside Poly
:
|
Compute monomial terms of a polynomial. |
|
Split variable into main name and integer subscript (or None). |
|
Join variable name and subscript to sympy symbol. |
|
Check if any of the arguments are symbolic instead of numerical. |
Extract coefficients from multivariate polynomial#
|
Polynomials for coefficients in each order for a single variable. |
Homogeneous polynomials#
Based on the Poly
class, a homogeneous polynomial class is defined which itself inherits from Poly
.
|
The Dwork family and the Fermat polynomial are given for convenience.
|
|
|