Code snippets to aid the implementation of spherical harmonic multipole energies, forces and torques.