seemps.analysis.expansion.PolynomialExpansion#

class seemps.analysis.expansion.PolynomialExpansion#

Bases: ABC

Abstract base class for polynomial expansions.

A PolynomialExpansion represents a truncated expansion

f(x) ≈ ∑_{k=0}^d c_k P_k(x),

where {P_k} is a polynomial basis generated by a three-term recurrence relation. The expansion is fully characterized by: - The expansion coefficients coefficients. - The recurrence coefficients (α_k, β_k, γ_k) defining the basis. - The orthogonality domain [a, b] of the basis. - An affine normalization (σ, μ) such that P_1(x) = σ x + μ.

Subclasses define concrete polynomial families (e.g. power, Chebyshev, Legendre, Hermite) by specifying the recurrence coefficients projection routines.

The expansion can be evaluated on tensor-network objects via to_mps and to_mpo, which construct MPS/MPO representations of composed functions f(g(x)) or operator functions f(A).

Attributes

coefficients

(Vector) Expansion coefficients {c_k} of f(x) in the chosen polynomial basis.

orthogonality_domain

(tuple[float, float]) Real interval on which the basis is orthogonal. For example, (-1, 1) for Chebyshev or Legendre, and (-∞, ∞) for Hermite. Set to None for non-orthogonal bases, such as the monomial basis.

affine_fix

(tuple[float, float]) Pair of coefficients (σ, μ) fixing the affine gauge of the basis via P_1(x) = σ x + μ.

abstractmethod recurrence_coefficients(k: int) tuple[float, float, float][source]#

Return the three-term coefficients (α_k, β_k, γ_k) for the recursion P_{k+1}(x) = (α_k x + β_k) P_k(x) - γ_k P_{k-1}(x).

rescale_mpo(mpo: MPO) MPO[source]#

Rescale the argument MPO from the approximation domain to the orthogonality domain of the basis, if applicable. This is delegated to the polynomial basis subclass to correctly account for their orthogonality domain.

rescale_mps(mps: MPS) MPS[source]#

Rescale the argument MPS from the approximation domain to the orthogonality domain of the basis, if applicable. This is delegated to the polynomial basis subclass to correctly account for their orthogonality domain.

to_mpo(argument: MPO, clenshaw: bool = True, strategy: Strategy = DEFAULT_STRATEGY, rescale_argument: bool = True) MPO[source]#

Construct the MPO representation of a composed function via a polynomial expansion.

Given a polynomial expansion of a scalar function f(x) and an argument g(x) provided either as an MPO, this method builds an MPO approximation of the composed function f(g(x)).

Evaluation can be performed either using the Clenshaw recurrence or by direct polynomial recursion. If the polynomial family has a finite orthogonality_domain, the argument is affinely mapped to that domain prior to evaluation.

Parameters:
argumentMPO

The argument g to which the polynomial expansion is applied.

clenshawbool, default=True

Whether to use the Clenshaw recurrence for polynomial evaluation.

strategyStrategy, default=DEFAULT_STRATEGY

Simplification strategy for intermediate MPO operations.

rescale_argumentbool, default=True

Whether to rescale the argument to the orthogonality domain of the basis, if applicable. This utilizes the methods rescale_mps and rescale_mpo defined in the basis subclass.

Returns:
MPO

An MPO approximation of f(g(x)).

to_mps(argument: TypeAliasForwardRef('~seemps.analysis.mesh.Interval') | TypeAliasForwardRef('~seemps.state.MPS'), clenshaw: bool = True, strategy: Strategy = DEFAULT_STRATEGY, rescale_argument: bool = True) MPS[source]#

Construct the MPS representation of a composed function via a polynomial expansion.

Given a polynomial expansion of a scalar function f(x) and an argument g(x) provided either as an Interval or an MPS, this method builds an MPS approximation of the composed function f(g(x)).

Evaluation can be performed either using the Clenshaw recurrence or by direct polynomial recursion. If the polynomial family has a finite orthogonality_domain, the argument is affinely mapped to that domain prior to evaluation.

Parameters:
argumentInterval or MPS

The argument g to which the polynomial expansion is applied.

clenshawbool, default=True

Whether to use the Clenshaw recurrence for polynomial evaluation.

strategyStrategy, default=DEFAULT_STRATEGY

Simplification strategy for intermediate MPS operations.

rescale_argumentbool, default=True

Whether to rescale the argument to the orthogonality domain of the basis, if applicable. This utilizes the methods rescale_mps and rescale_mpo defined in the basis subclass.

Returns:
MPS

An MPS approximation of f(g(x)).