subroutine initializeLMatPtrs()
integer :: nBI
nBI = numBasisIndices(nBasis)
! some typical array dimensions useful in the indexing functions
strideInner = fuseIndex(nBI, nBI)
strideOuter = strideInner**2
if(allocated(lMat)) deallocate(lMat)
if (tSparseLMat) then
allocate(sparse_lMat_t :: lMat)
else
allocate(dense_lMat_t :: lMat)
end if
! set the LMatInd function pointer
if (t12FoldSym) then
lMat%indexFunc => oldLMatInd
else if (tSymBrokenLMat) then
! also need to set the size of the blocks
lMat%indexFunc => lMatIndSymBroken
else
lMat%indexFunc => lMatIndSym
end if
end subroutine initializeLMatPtrs