transformation_abstract#

This module contains the abstract base class for defining the transformation from one polynomial basis to another.

All transformation classes, each of which defines the transformation from one polynomial basis (the origin) to another (the target), must inherit from this abstract base class to ensure consistent behaviors across all instances.


class minterpy.core.ABC.transformation_abstract.TransformationABC(origin_poly)[source]#

this is the abstract base class for polynomial basis transformations.

All polynomial basis transformers should be derived from this class to maintain a uniform interface for

basis transformations.

Properties

grid

The grid of the origin polynomial.

multi_index

The multi index set of the origin polynomial (and also the target polynomial).

origin_type

Abstract container that stores the data type of the origin polynomial.

target_type

Abstract container that stores the data type of the target polynomial.

transformation_operator

The polynomial basis transformation operator.

Parameters:

origin_poly (MultivariatePolynomialSingleABC)

__init__(origin_poly)[source]#
Parameters:

origin_poly (MultivariatePolynomialSingleABC)

property multi_index: MultiIndexSet#

The multi index set of the origin polynomial (and also the target polynomial).

property grid: Grid#

The grid of the origin polynomial.

classmethod __init_subclass__(**kwargs)[source]#

Add a concrete implementation to the registry of available transformations

__call__(origin_poly=None)[source]#

Transformation of polynomial.

This function is called when an instance of transformation is called T() or T(x). If called without any arguments, the transformation is applied on the origin_poly used to construct the transformation. If an argument is passed, the transformation is applied on the instance passed.

Parameters:

origin_poly (MultivariatePolynomialSingleABC | None) – (optional) an instance of the polynomial to be transformed.

Returns:

an instance of the polynomial in the target basis.

abstract property origin_type#

Abstract container that stores the data type of the origin polynomial.

This is a placeholder of the ABC, which is overwritten by the concrete implementation.

abstract property target_type#

Abstract container that stores the data type of the target polynomial.

This is a placeholder of the ABC, which is overwritten by the concrete implementation.

abstract _get_transformation_operator()[source]#

Abstract container for storing the transformation operator.

This is a placeholder of the ABC, which is overwritten by the concrete implementation.

property transformation_operator: OperatorABC#

The polynomial basis transformation operator.

Returns:

instance of the transformation operator

Notes

The transformation operator once constructed can be reused for transforming other polynomial instance of the origin_poly type, which have the same basis (and grid) as the origin_poly, to the target_poly type.

property _target_indices: MultiIndexSet#

The MultiIndexSet of the target_poly.

Returns:

the indices the target polynomial will have

_apply_transformation(origin_poly)[source]#

Transforms the polynomial to the target type of the transformation.

Parameters:

origin_poly – instance of the polynomial to be transformed

Returns:

an instance of the transformed polynomial in the target basis

__weakref__#

list of weak references to the object (if defined)