e3x.so3.quadrature.lebedev_quadrature

e3x.so3.quadrature.lebedev_quadrature(precision=None, num=None)[source]

Returns a Lebedev quadrature grid.

A Lebedev quadrature is a numerical approximation to the surface integral of a function \(f\) over the unit sphere

\[\int_{\Omega} f(\Omega) d\Omega \approx 4\pi \sum_{i=1}^N w_i f(\vec{r}_i)\]

where \(\vec{r}_i\) and \(w_i\) are grid points and weights, respectively. A Lebedev rule of precision \(p\) can be used to correctly integrate any polynomial for which the highest degree term \(x^iy^jz^k\) satisfies \(i+j+k \leq p\).

Parameters:
  • precision (Optional[int], default: None) – The desired minimum precision \(p\). The returned Lebedev rule will be the smallest grid that has the desired precision (if this value is not None, num must be set to None).

  • num (Optional[int], default: None) – The desired maximum number of points \(N\). The returned Lebedev rule will be the highest-precision grid that has not more than num points (if this value is not None, precision must be set to None).

Return type:

tuple[Float[Array, 'num_points 3'], Float[Array, 'num_points']]

Returns:

A tuple of two arrays representing the grid points \(\vec{r}_i\) and weights \(w_i\).

Raises:
  • ValueError – If both precision and num are None (or both are specified at the same time).

  • RuntimeError – If the Lebedev quadrature rules cannot be loaded from disk.