def _spherical_harmonics_l2(xyz, m):
    """Compute the l=2 Spherical Harmonics
    Args:
        xyz : array (Nbatch,Nelec,Nrbf,Ndim) x,y,z, of (Point - Center)
        m : second quantum number (-2,-1,0,1,2)
    Returns
        Y2-2 = 1/2\sqrt(15/\pi) xy/r^2
        Y2-1 = 1/2\sqrt(15/\pi) yz/r^2
        Y20  = 1/4\sqrt(5/\pi) (-x^2-y^2+2z^2)/r^2
        Y21  = 1/2\sqrt(15/\pi) zx/r^2
        Y22  = 1/4\sqrt(15/\pi) (x*x-y*y)/r^2
    """

    r2 = (xyz**2).sum(-1)

    if m == 0:
        c0 = 0.31539156525252005
        return c0 * (-xyz[:, :, :, 0]**2 - xyz[:, :, :, 1]
                     ** 2 + 2 * xyz[:, :, :, 2]**2) / r2
    if m == 2:
        c2 = 0.5462742152960396
        return c2 * (xyz[:, :, :, 0]**2 - xyz[:, :, :, 1]**2) / r2
    else:
        cm = 1.0925484305920792
        index = {-2: [0, 1], -1: [1, 2], 1: [2, 0]}
        return cm * xyz[:, :, :, index[m][0]] * \
            xyz[:, :, :, index[m][1]] / r2