orthax.recurrence.generate_recurrence
- orthax.recurrence.generate_recurrence(weight: Callable, domain: tuple, n: int, scale: str = 'monic', quadrule=None, quadopts: dict | None = None) TabulatedRecurrenceRelationSource
Generate recurrence relation coefficients for orthogonal polynomial family.
Finds coefficients \(a_i, b_i, g_i\) such that
\[\begin{split}\begin{align} p_{-1}(x) &= 0 \\ p_0(x) &= 1 \\ p_{i+1}(x) &= (x-a_i) p_i(x) - b_i p_{i-1}(x) \\ \int_D p_i(x) p_j(x) w(x) dx &= g^2_i \delta_{i,j} \end{align}\end{split}\]- Parameters:
weight (callable) – Weight function.
domain (tuple of float) – Lower and upper bounds for the domain of the polynomials.
n (int) – Number of terms to generate, ie, highest order of polynomial desired.
scale ({"monic", "normalized"}) – How to scale the resulting polynomials.
quadrule (quadax.AbstractQuadratureRule, optional) – Quadrature rule to use for computing integrals in generating recurrence coefficients. Defaults to
quadax.TanhSinhRule(order=129).quadopts (dict, optional) – Additional options passed to
quadax.adaptive_quadrature. Default options areepsabs=1e-15,epsrel=1e-15,max_ninter=500.
- Returns:
rec (TabulatedRecurrenceRelation) – Recurrence relation coefficients and polynomial norms.
Notes
Requires the
quadaxpackage to be installed.