subroutine get_excit_details(ex, ras, nras1, nras3, string_j, sym_j, class_j, in_ras_space)
integer, intent(in) :: ex(2)
type(ras_parameters), intent(in) :: ras
integer, intent(in) :: nras1, nras3
integer, intent(inout) :: string_j(tot_nelec)
integer, intent(inout) :: sym_j
integer, intent(inout) :: class_j
logical, intent(out) :: in_ras_space
integer :: i, new1, new3
integer :: sym_prod
in_ras_space = .true.
if (ex(1) == ex(2)) return
new1 = nras1
new3 = nras3
if (ex(1) <= ras%size_1) then
new1 = new1 - 1
else if (ex(1) > ras%size_1 + ras%size_2) then
new3 = new3 - 1
end if
if (ex(2) <= ras%size_1) then
new1 = new1 + 1
else if (ex(2) > ras%size_1 + ras%size_2) then
new3 = new3 + 1
end if
if (.not. class_allowed(ras, new1, new3)) then
in_ras_space = .false.
return
end if
class_j = ras%class_label(new1, new3)
do i = 1, tot_nelec
if (string_j(i) == ex(1)) then
string_j(i) = ex(2)
exit
end if
end do
call sort(string_j)
if (tHub) then
!Since RAS is originally developed for molucules, it cannot handle kpoint symmetries.
!As a quick fix, we ignore symmetry labels of the Hubbard model.
sym_prod = 0
else
sym_prod = int(ieor(G1(BRR(ex(1) * 2))%Sym%S, G1(BRR(ex(2) * 2))%Sym%S))
end if
sym_j = ieor(sym_j, sym_prod)
end subroutine get_excit_details