identity#
Concrete implementation of Identity transformation when there is no basis change.
Notes
This class is needed for completeness reasons and also to enable the high-level helper functions for polynomial basis transformations to handle transformations between identical basis.
- class minterpy.transformations.identity.Identity(origin_poly)[source]#
Bases:
TransformationABC
Transformation between same basis.
Properties
The grid of the origin polynomial.
The multi index set of the origin polynomial (and also the target polynomial).
The polynomial basis transformation operator.
- Parameters:
origin_poly (MultivariatePolynomialSingleABC)
- origin_type#
alias of
MultivariatePolynomialABC
- target_type#
alias of
MultivariatePolynomialABC
- _get_transformation_operator()#
Abstract container for storing the transformation operator.
This is a placeholder of the ABC, which is overwritten by the concrete implementation.
- _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
- __call__(origin_poly=None)#
Transformation of polynomial.
This function is called when an instance of transformation is called
T()
orT(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.
- __init__(origin_poly)#
- Parameters:
origin_poly (MultivariatePolynomialSingleABC)
- classmethod __init_subclass__(**kwargs)#
Add a concrete implementation to the registry of available transformations
- __weakref__#
list of weak references to the object (if defined)
- property _target_indices: MultiIndexSet#
The MultiIndexSet of the target_poly.
- Returns:
the indices the target polynomial will have
- property multi_index: MultiIndexSet#
The multi index set of the origin polynomial (and also the target polynomial).
- 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.