General Utilities#

slothpy.lebedev_laikov_grid(grid)[source]#

Returns Lebedev-Laikov-Grids [1] over a hemisphere.

Parameters:

grid (int) –

An integer from 0 to 11 controling the number of points in the grid over the hemisphere.

0 - 17 points, 1 - 29 points, 2 - 93 points, 3 - 161 points, 4 - 185 points, 5 - 229 points, 6 - 309 points, 7 - 401 points, 8 - 505 points, 9 - 889 points, 10 - 1381 points, 11 - 2949 points

Returns:

Grid array in the form [[direction_x, direction_y, direction_z, weight], …].

Return type:

ndarray

Raises:

ValueError – If grid is not an integer from 0 to 11.

Notes

Grids 0-2 can be considered as insufficient in most cases (only should be used for experimental purposes), 3-5 minimal to standard, 6-8 very precise, but costly, 9-11 very dense - only for particular use-cases (extremely costly - especially 10-11).

References

[1]

V.I. Lebedev, and D.N. Laikov “A quadrature formula for the sphere of the 131st algebraic order of accuracy” Doklady Mathematics, Vol. 59, No. 3, 1999, pp. 477-481.

slothpy.set_default_error_reporting_mode()[source]#

Run this after the module import to return to the default full error tracebacks.

slothpy.set_plain_error_reporting_mode()[source]#

Run this after set_default_error_reporting_mode to return to the custom SlothPy-style error printing without tracebacks.