(lmax, i=None)
return (l, m)
Get the l and m from index and lmax.

        Parameters
        ----------
        lmax : int
          The maximum l defining the alm layout
        i : int or None
          The index for which to compute the l and m.
          If None, the function return l and m for i=0..Alm.getsize(lmax)
Get the l and m from index and lmax.
Get the l and m from index and lmax .
def getlm(lmax, i=None):
        """Get the l and m from index and lmax.

        Parameters
        ----------
        lmax : int
          The maximum l defining the alm layout
        i : int or None
          The index for which to compute the l and m.
          If None, the function return l and m for i=0..Alm.getsize(lmax)
        """
        szalm = Alm.getsize(lmax, lmax)
        if i is None:
            i = np.arange(szalm)
        assert (
            np.max(i) < szalm
        ), "Invalid index, it should less than the max alm array length of {}".format(
            szalm
        )

        with np.errstate(all="raise"):
            m = (
                np.ceil(
                    ((2 * lmax + 1) - np.sqrt((2 * lmax + 1) ** 2 - 8 * (i - lmax))) / 2
                )
            ).astype(int)
            l = i - m * (2 * lmax + 1 - m) // 2
        return (l, m)
def getlm ( lmax , i = None ) : szalm = Alm . getsize ( lmax , lmax ) if i is None : i = np . arange ( szalm ) assert ( np . max ( i ) < szalm ) , "Invalid index, it should less than the max alm array length of {}" . format ( szalm ) with np . errstate ( all = "raise" ) : m = ( np . ceil ( ( ( 2 * lmax + 1 ) - np . sqrt ( ( 2 * lmax + 1 ) ** 2 - 8 * ( i - lmax ) ) ) / 2 ) ) . astype ( int ) l = i - m * ( 2 * lmax + 1 - m ) // 2 return ( l , m )