Lm2lin.m
Converts L,M spin state specification to linear indexing specification. In the linear indexing convention, the states are listed in the order of inc reasing L rank, and, within ranks, in the order of decreasing M pro- jection. Syntax: I=lm2lin(L,M)
WARNING - zero base indexing, that is:
(L=0,M=0) -> I=0
(L=1,M=1) -> I=1
(L=1,M=0) -> I=2, et cetera...
Arrays of any dimension are accepted as arguments.