PURE SUBROUTINE FindExcitBitDetSym(iLut, iLutSym)
IMPLICIT NONE
INTEGER(KIND=n_int), intent(in) :: iLut(0:NIfTot)
INTEGER(KIND=n_int), intent(out) :: iLutSym(0:NIfTot)
INTEGER(KIND=n_int) :: iLutAlpha(0:NIfTot), iLutBeta(0:NIfTot)
INTEGER :: i
iLutSym(:) = 0
iLutAlpha(:) = 0
iLutBeta(:) = 0
do i = 0, NIfD
iLutAlpha(i) = IAND(iLut(i), MaskAlpha) !Seperate the alpha and beta bit strings
iLutBeta(i) = IAND(iLut(i), MaskBeta)
iLutAlpha(i) = ISHFT(iLutAlpha(i), -1) !Shift all alpha bits to the left by one.
iLutBeta(i) = ISHFT(iLutBeta(i), 1) !Shift all beta bits to the right by one.
iLutSym(i) = IOR(iLutAlpha(i), iLutBeta(i)) !Combine the bit strings to give the final bit representation.
end do
END SUBROUTINE FindExcitBitDetSym