init_guga_bitrep Subroutine

public subroutine init_guga_bitrep(n_spatial_bits)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n_spatial_bits

Contents

Source Code


Source Code

    subroutine init_guga_bitrep(n_spatial_bits)
        ! set up a nIfGUGA variable to use a similar integer list to
        ! calculate excitations for a given GUGA CSF
        integer, intent(in) :: n_spatial_bits
        integer :: x0_pos, x1_pos, deltaB_pos, rdm_ind_pos, rdm_x0_pos, rdm_x1_pos

        ! Structure of a bit representation:
        ! the parenthesis is for the stochastic GUGA rdm implementation
        ! | 0-NIfD: Det | x0 | x1 | deltaB | (rdm_ind | rdm_x0 | rdm_x1)
        !
        ! -------
        ! (NIfD + 1) * 64-bits              Orbital rep.
        !  1         * 64-bits              x0 matrix element
        !  1         * 64-bits              x1 matrix element
        !  1         * 64-bits              deltaB value
        ! if we sample RDMs:
        !  1         * 64-bits              rdm_index (contains ex-level and type info!)
        !  1         * 64-bits              x0 coupling coeff for RDMs
        !  1         * 64-bits              x1-coupling coeff for RDMs

        x0_pos = n_spatial_bits + 1
        x1_pos = x0_pos + 1
        deltaB_pos = x1_pos + 1

        if (tRDMonfly) then
            rdm_ind_pos = deltaB_pos + 1
            rdm_x0_pos = rdm_ind_pos + 1
            rdm_x1_pos = rdm_x0_pos + 1

            nifguga = rdm_x1_pos
        else
            rdm_ind_pos = -1
            rdm_x0_pos = -1
            rdm_x1_pos = -1

            nIfGUGA = deltaB_pos
        end if

        ! and also use a global data structure for more overview
        GugaBits = BitRep_t( &
                   len_tot=nIfGUGA, &
                   len_orb=n_spatial_bits, &
                   ind_x0=x0_pos, &
                   ind_x1=x1_pos, &
                   ind_b=deltaB_pos, &
                   ind_rdm_ind=rdm_ind_pos, &
                   ind_rdm_x0=rdm_x0_pos, &
                   ind_rdm_x1=rdm_x1_pos)

    end subroutine init_guga_bitrep