create_all_open_shell_dets Function

public function create_all_open_shell_dets(n_orbs, n_alpha, n_beta) result(open_shells)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_orbs
integer, intent(in) :: n_alpha
integer, intent(in) :: n_beta

Return Value integer(kind=n_int), allocatable, (:,:)


Contents


Source Code

    function create_all_open_shell_dets(n_orbs, n_alpha, n_beta) result(open_shells)
        integer, intent(in) :: n_orbs, n_alpha, n_beta
        ! Alis idea for the use of the ADI option for the real-space hubbard
        ! is to let all fully open shell dets, and excitations thereof
        ! (dets with exactly one double occupancy in the case of half-filling)
        ! be initiators
        character(*), parameter :: this_routine = "create_all_open_shell_dets"

        integer, allocatable :: n_dets(:)
        integer(n_int), allocatable :: open_shells(:,:), max_basis(:)

        n_dets = calc_n_double(n_orbs, n_alpha, n_beta)

        ! only implement that for less than 32 orbitals, since i do not want to
        ! deal with multiple integers to store the basis and also the size of
        ! the hilbert space would be too big anyway..
        ASSERT(n_orbs <= 32)

        ! how should i create all of those purely open-shell dets?
        ! in the case of half-filling it is easiest..

        ! i could first distribute the alpha spins and then the beta spins
        ! afterwards..
        ! i should work with the bit-representation, then i get to know the
        ! fortran intrinsic bit operations again..
        max_basis = create_one_spin_basis(n_orbs, n_alpha)

        open_shells = combine_spin_basis(n_orbs, n_alpha, n_beta, n_dets(1), max_basis, .true.)

    end function create_all_open_shell_dets