setup_ind_matrix_singles Subroutine

public subroutine setup_ind_matrix_singles()

Arguments

None

Contents


Source Code

    subroutine setup_ind_matrix_singles()
        character(*), parameter :: this_routine = "setup_ind_matrix_singles"

        integer :: i, j, k
        integer(n_int) :: temp_ilut(0:nifd)

        ASSERT(allocated(projedet))
        ASSERT(allocated(iLutRef))

        if (allocated(ind_matrix_singles)) deallocate(ind_matrix_singles)

        allocate(ind_matrix_singles(nbasis, nbasis))
        ind_matrix_singles = 0

        temp_ilut = iLutRef(0:nifd, 1)
        k = 1
        do i = 1, nbasis
            if (IsOcc(temp_ilut, i)) then
                ! the i is an electron in the reference!
                ! and for each electron index the virtuals
                do j = 1, nbasis
                    ! and i should and can specify the spin here!
                    if (IsNotOcc(temp_ilut, j) .and. same_spin(i, j)) then
                        ind_matrix_singles(i, j) = k
                        k = k + 1
                    end if
                end do
            end if
        end do

    end subroutine setup_ind_matrix_singles