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:

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:

Grid1D

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:

Grid1D

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:

Grid1D

weights: ndarray