pure function lMatIndSpin(i, j, k, a, b, c) result(index)
! Index functions that is symmetric with respect to swapping a<->i, b<->j and c<->k,
! as well as swapping (b,j)<->(c,k), but does not have the full ai,bj,ck, permutational
! symmetry
! Input: a,b,c - orbital indices of electrons
! i,j,k - orbital indices of holes
! Output: index - contiguous index I(a,b,c,i,j,k) with the aforementioned symmetry
integer(int64), value, intent(in) :: i, j, k
integer(int64), value, intent(in) :: a, b, c
integer(int64) :: index
integer(int64) :: ai, bj, ck
ai = fuseIndex(a, i)
bj = fuseIndex(b, j)
ck = fuseIndex(c, k)
index = ai + strideInner * fuseIndex(bj, ck)
end function lMatIndSpin