Spherical harmonics provide a smooth, orthogonal, and symmetry-adapted basis
to expand functions on a sphere, and they are used routinely in computer
graphics, signal processing and different fields of science, from geology to
quantum chemistry. More recently, spherical harmonics have become a key
component of rotationally equivariant models for geometric deep learning, where
they are used in combination with distance-dependent functions to describe the
distribution of neighbors within local spherical environments within a point
cloud. We present a fast and elegant algorithm for the evaluation of the
real-valued spherical harmonics. Our construction integrates many of the
desirable features of existing schemes and allows to compute Cartesian
derivatives in a numerically stable and computationally efficient manner. We
provide an efficient C implementation of the proposed algorithm, along with
easy-to-use Python bindings