rapidity.fredholm module

Numerical evaluation of Fredholm determinants.

This module provides tools for computing Fredholm determinants of the form

\[\det(I - wK)\]

where \(K\) is an integral operator with kernel \(K(x, x')\) and \(w(x)\) is an optional weight function.

The main entry point is fredholm_det(), which accepts a kernel and an optional weight function as Field objects defined on a Grid1D quadrature grid.

References

Bornemann, F. (2010). On the numerical evaluation of Fredholm determinants. Mathematics of Computation, 79(270), 871-915.

rapidity.fredholm.fredholm_det(kernel, weight=None)

Compute the Fredholm determinant det(I - wK) using the Nyström method.

The Fredholm determinant is approximated as a finite matrix determinant:

\[\det(I - wK) \approx \det(\delta_{ij} - w(x_i) \sqrt{w_i} K(x_i, x_j) \sqrt{w_j})\]

where \(w_i\) are the quadrature weights and \(w(x)\) is the optional weight function.

Parameters:
  • kernel (Field) – A 2D field representing the kernel K(x, x’). Must have exactly two identical grids.

  • weight (Field | None) – A 1D field representing the weight function w(x). If None, w(x) = 1 is assumed, reducing to det(I - K).

Returns:

The Fredholm determinant det(I - wK).

Return type:

float

Raises:

ValueError – If the kernel is not a 2D field, if its two grids are not identical, or if the weight is not a 1D field on the same grid as the kernel.

Examples

>>> grid = Grid1D.gauss_legendre(0.0, 1.0, 50, "x")
>>> kernel = Field.from_function(lambda x, y: np.sin(x - y), [grid, grid])
>>> fredholm_det(kernel)