davidson_direct_ci_init Function

public function davidson_direct_ci_init() result(this)

Arguments

None

Return Value type(DavidsonCalcType)


Contents


Source Code

    function davidson_direct_ci_init() result(this)
        use bit_rep_data, only: NIfD
        use direct_ci, only: create_direct_ci_arrays
        use FciMCData, only: davidson_ras, davidson_classes, davidson_strings, davidson_iluts, davidson_excits
        use ras, only: initialise_ras_space, find_ras_size

        type(DavidsonCalcType) :: this
        integer :: class_i, class_j, j, sym_i, sym_j

        write(stdout, '(/,1X,"Beginning Direct CI Davidson calculation.",/)'); call neci_flush(stdout)

        call initialise_ras_space(davidson_ras, davidson_classes)
        ! The total hilbert space dimension of calculation to be performed.
        call find_ras_size(davidson_ras, davidson_classes, this%super%space_size)

        allocate(davidson_strings(-1:tot_nelec, davidson_ras%num_strings))
        allocate(davidson_iluts(0:NIfD, davidson_ras%num_strings))
        allocate(davidson_excits(davidson_ras%num_strings))

        ! Create the arrays used by the direct CI multiplication.
        call create_direct_ci_arrays(davidson_ras, davidson_classes, davidson_strings, &
                                     davidson_iluts, davidson_excits)

        ! Allocate input and output direct CI vectors.
        allocate(direct_ci_inp(size(davidson_classes), size(davidson_classes), 0:7))
        allocate(direct_ci_out(size(davidson_classes), size(davidson_classes), 0:7))
        do class_i = 1, size(davidson_classes)
            do j = 1, davidson_classes(class_i)%num_comb
                class_j = davidson_classes(class_i)%allowed_combns(j)
                do sym_i = 0, 7
                    sym_j = ieor(int(HFSym_ras), sym_i)
                    if (davidson_classes(class_i)%num_sym(sym_i) == 0) cycle
                    if (davidson_classes(class_j)%num_sym(sym_j) == 0) cycle
                    allocate(direct_ci_inp(class_i, class_j, sym_i)% &
                              elements(1:davidson_classes(class_i)%num_sym(sym_i), 1:davidson_classes(class_j)%num_sym(sym_j)))
                    allocate(direct_ci_out(class_i, class_j, sym_i)% &
                              elements(1:davidson_classes(class_i)%num_sym(sym_i), 1:davidson_classes(class_j)%num_sym(sym_j)))
                end do
            end do
        end do
    end function davidson_direct_ci_init