rapidity.core.grid module¶
One-dimensional quadrature grids.
This module defines Grid1D, the fundamental discretization object
in rapidity. A grid stores quadrature points, weights, and a dimension
label. It is a pure data container with no knowledge of physical quantities.
Alternative constructors are provided for common quadrature rules:
Grid1D.gauss_legendre()— for integrals on finite intervalsGrid1D.uniform()— trapezoid rule on a uniform gridGrid1D.gauss_hermite()— for rapidly decaying functions on the full real line
- class rapidity.core.grid.Grid1D(points, weights, label)¶
Bases:
object- classmethod gauss_hermite(n, label)¶
Construct a Gauss-Hermite quadrature grid on (-inf, inf).
Approximates integrals of rapidly decaying functions f(x) on the full real line, without assuming any explicit Gaussian factor in the integrand.
- Parameters:
n (
int) – Number of quadrature points.label (
str) – Dimension label.
- Returns:
A Gauss-Hermite quadrature grid.
- Return type:
- classmethod gauss_legendre(a, b, n, label)¶
Constructs a Gauss-Legendre quadrature grid on [a, b] of n points
- Parameters:
a (
float) – The grid boundaries.b (
float) – The grid boundaries.n (
int) – Number of quadrature points.label (
str) – Dimension label
- Returns:
A Gauss-Legendre quadrature grid.
- Return type:
- label: str¶
- points: ndarray¶
- classmethod uniform(a, b, n, label)¶
Constructs a uniform quadrature grid on[a, b] of n points
- Parameters:
a (
float) – The grid boundaries.b (
float) – The grid boundaries.n (
int) – Number of quadrature points.label (
str) – Dimension label
- Returns:
A uniform quadrature grid.
- Return type:
- weights: ndarray¶