archimedes.measure.JacobiMeasure¶

class archimedes.measure.JacobiMeasure(alpha: float, beta: float)¶

Measure for the Jacobi polynomial family.

Weight \(w(x) = (1-x)^\alpha (1+x)^\beta\) on \([-1, 1]\), with \(\alpha, \beta > -1\).

The associated orthogonal polynomials are the Jacobi polynomials \(P_n^{(\alpha,\beta)}(x)\). Gauss-Legendre is the special case \(\alpha = \beta = 0\); Chebyshev quadrature of the first and second kind are the special cases \(\alpha = \beta = -1/2\) and \(\alpha = \beta = 1/2\), respectively. The zeroth moment (normalization) of the weight has a closed form in terms of the Beta function:

\[\int_{-1}^1 (1-x)^\alpha (1+x)^\beta \, dx = 2^{\alpha + \beta + 1} \, B(\alpha + 1, \beta + 1)\]

Shares the UnitInterval reference domain (and hence affine_params) with LegendreMeasure; the two differ only in their weight.

Parameters:
  • alpha (float) – Exponents of the weight function. Must be \(> -1\) for the weight to be integrable at the corresponding endpoint.

  • beta (float) – Exponents of the weight function. Must be \(> -1\) for the weight to be integrable at the corresponding endpoint.

Raises:

ValueError – If alpha or beta is \(\leq -1\).

Methods

affine_params(*args, **kwargs)

Return (scale, shift) mapping the reference measure onto the requested instance of this family; forwarded to domain.affine_params.

mass(*args, **kwargs)

Total mass of the measure mapped by affine_params(*args, **kwargs).

recurrence_coeffs(n)

Monic Jacobi recurrence coefficients (DLMF 18.9.2_1-2).

weight(x)

Reference weight function \(w(x) = (1-x)^\alpha (1+x)^\beta\), evaluated at x.

Attributes

affine_invariant

True if this measure's weight is provably the same shape, just relocated/rescaled, under affine_params's reparametrization.

domain

The reference domain this measure's weight is supported on.

reference_mass

\(2^{\alpha + \beta + 1} \, B(\alpha + 1, \beta + 1)\).

support

Support \(\mathcal{D} = [a, b]\); forwarded from domain.

uniform_weight

True if the weight is constant (weight(x) == weight(y)) for every x, y in support -- e.g. true for Legendre, false for Jacobi (singular at the endpoints) or Hermite/Laguerre (unbounded support).

alpha

beta

__init__(alpha: float, beta: float) → None¶
affine_params(*args, **kwargs) → tuple[float, float]¶

Return (scale, shift) mapping the reference measure onto the requested instance of this family; forwarded to domain.affine_params.

Quadrature weights pick up the same scale as a Jacobian factor, since \(dx = \mathrm{scale} \cdot dt\). The meaning of the arguments is domain-specific – a/b for UnitInterval, loc/scale for RealLine, rate/start for HalfLine – see the corresponding ReferenceDomain subclass.

mass(*args, **kwargs) → float¶

Total mass of the measure mapped by affine_params(*args, **kwargs).

Equal to scale * reference_mass, where scale is the affine scale factor. Dividing a mapped weight by this quantity turns it into a probability density on the mapped domain. Concrete subclasses don’t need to override this; it’s fully determined by affine_params and reference_mass.

recurrence_coeffs(n: int) → tuple[ndarray, ndarray]¶

Monic Jacobi recurrence coefficients (DLMF 18.9.2_1-2).

\[\alpha_0 = \frac{\beta - \alpha}{\alpha + \beta + 2}, \qquad \alpha_k = \frac{\beta^2 - \alpha^2} {(2k+\alpha+\beta)(2k+\alpha+\beta+2)}, \quad k \geq 1\]
\[\beta_0 = \mathrm{reference\_mass}, \qquad \beta_1 = \frac{4(1+\alpha)(1+\beta)} {(2+\alpha+\beta)^2(3+\alpha+\beta)}, \qquad \beta_k = \frac{4k(k+\alpha)(k+\beta)(k+\alpha+\beta)} {(2k+\alpha+\beta)^2(2k+\alpha+\beta+1)(2k+\alpha+\beta-1)}, \quad k \geq 2\]

The \(\alpha_0\) and \(\beta_1\) forms above are the already-simplified (common-factor-cancelled) versions of the general-\(k\) formulas. Evaluated directly, the general formulas have removable \(0/0\) singularities at \(k=0\) when \(\alpha+\beta=0\) (the Legendre point) and at \(k=1\) when \(\alpha+\beta=-1\) (the Chebyshev-first-kind point, \(\alpha=\beta=-1/2\), and any other pair summing to \(-1\)) – both within the valid domain (\(\alpha,\beta > -1\), so \(\alpha+\beta > -2\)), and both explicitly named as important special cases in this class’s docstring. So alpha[0] and beta[1] are assigned the simplified forms directly rather than computed via the general-\(k\) expression (which would evaluate the singular branch elementwise even under np.where).

weight(x: ndarray) → ndarray¶

Reference weight function \(w(x) = (1-x)^\alpha (1+x)^\beta\), evaluated at x.

affine_invariant: bool = True¶

True if this measure’s weight is provably the same shape, just relocated/rescaled, under affine_params’s reparametrization. False (the default) for anything relying on the generic Stieltjes-based recurrence_coeffs fallback, since it is not guaranteed that an arbitrary weight family stays affine-closed.

domain: ReferenceDomain = <archimedes.measure._domain.UnitInterval object>¶

The reference domain this measure’s weight is supported on. Set as a class attribute by each concrete subclass; carries the support, affine_params and Parameters that Measure delegates to.

property reference_mass: float¶

\(2^{\alpha + \beta + 1} \, B(\alpha + 1, \beta + 1)\).

property support: tuple[float, float]¶

Support \(\mathcal{D} = [a, b]\); forwarded from domain.

uniform_weight: bool = False¶

True if the weight is constant (weight(x) == weight(y)) for every x, y in support – e.g. true for Legendre, false for Jacobi (singular at the endpoints) or Hermite/Laguerre (unbounded support). Used by consumers that need to know whether the weight’s shape is trivial, e.g. archimedes.quadrature.composite_quad, which can only tile a rule across sub-elements when there’s no interior discontinuity in the weight to worry about.