GASSpec_t Derived Type

type, public, abstract :: GASSpec_t

Speficies the GAS spaces.


Components

Type Visibility Attributes Name Initial
integer, private, allocatable :: GAS_table(:)

GAS_table(i) returns the GAS space for the i-th spin orbital

integer, private, allocatable :: GAS_sizes(:)

The number of spin orbitals per GAS space

integer, private :: largest_GAS_size

maxval(GAS_sizes)

integer, private, allocatable :: splitted_orbitals(:,:)

This is the preimage of GASSpec_t%GAS_table.

An array that contains the spin orbitals per GAS space of dimension splitted_orbitals(1 : maxval(GAS_sizes), 1 : nGAS). Only splitted_orbitals(i, j), 1 <= i <= GAS_sizes(j) is defined.

logical, private :: lookup_is_connected

These lookup variables stay valid, because the data structure is immutable

logical, private :: exchange_recoupling

Do we do exchange recoupling?

integer, private :: N_particle

The particle number


Type-Bound Procedures

procedure(contains_supergroup_t), public, deferred :: contains_supergroup

  • pure function contains_supergroup_t(this, supergroup) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: supergroup(:)

    Return Value logical

procedure(is_valid_t), public, deferred :: is_valid

  • pure function is_valid_t(this, n_basis) Prototype

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in), optional :: n_basis

    Return Value logical

procedure(write_to_t), public, deferred :: write_to

  • subroutine write_to_t(this, iunit) Prototype

    Write a string representation of this GAS specification to iunit

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: iunit

procedure(get_possible_spaces_t), public, deferred :: get_possible_spaces

  • pure function get_possible_spaces_t(this, supergroup, add_holes, add_particles, n_total) result(spaces) Prototype

    Return the GAS spaces, where one particle can be created.

    The returned array can be empty (allocated, but size == 0).

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    integer, intent(in) :: supergroup(size(this%GAS_sizes))

    The particles per GAS space.

    integer, intent(in), optional :: add_holes(:)

    An index of orbitals where particles should be deleted before creating the new particle.

    integer, intent(in), optional :: add_particles(:)

    Index of orbitals where particles should be created before creating the new particle.

    integer, intent(in), optional :: n_total

    The total number of particles that will be created. Defaults to one. (Relevant for double excitations)

    Return Value integer, allocatable, (:)

procedure, public :: get_possible_holes

  • private pure function get_possible_holes(this, det_I, add_holes, add_particles, n_total, excess) result(possible_holes)

    Return the possible holes where a particle can be created under GAS constraints.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    integer, intent(in) :: det_I(:)

    The starting determinant

    integer, intent(in), optional :: add_holes(:)

    An index of orbitals where particles should be deleted before creating the new particle.

    integer, intent(in), optional :: add_particles(:)

    An index of orbitals where particles should be created before creating the new particle.

    integer, intent(in), optional :: n_total

    The total number of particles that will be created. Defaults to one.

    type(SpinProj_t), intent(in), optional :: excess

    The current excess of spin projections. If a beta electron was deleted, the excess is (1 \cdot \alpha).

    Return Value integer, allocatable, (:)

procedure, private :: contains_conf_nI

  • private pure function contains_conf_nI(this, nI) result(res)

    Query wether a determinant is contained in the GAS space.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    integer, intent(in) :: nI(:)

    An index of occupied spin orbitals.

    Return Value logical

procedure, private :: contains_conf_csf

  • private pure function contains_conf_csf(this, csf_i) result(res)

    Query wether a CSF is contained in the GAS space.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    type(CSF_Info_t), intent(in) :: csf_i

    Return Value logical

generic, public :: contains_conf => contains_conf_nI

  • private pure function contains_conf_nI(this, nI) result(res)

    Query wether a determinant is contained in the GAS space.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    integer, intent(in) :: nI(:)

    An index of occupied spin orbitals.

    Return Value logical

generic, public :: contains_conf => contains_conf_csf

  • private pure function contains_conf_csf(this, csf_i) result(res)

    Query wether a CSF is contained in the GAS space.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    type(CSF_Info_t), intent(in) :: csf_i

    Return Value logical

procedure, public :: contains_ilut

  • private pure function contains_ilut(this, ilut) result(res)

    Query wether a determinant in bitmask format is contained in the GAS space.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    integer(kind=n_int), intent(in) :: ilut(0:nIfTot)

    An index of occupied spin orbitals.

    Return Value logical

procedure, public :: is_connected => get_is_connected

  • private pure function get_is_connected(this)

    Query if there are connected GAS spaces under the GAS specification.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Specification of GAS spaces.

    Return Value logical

procedure, public :: nGAS => get_nGAS

  • private pure function get_nGAS(this)

    Returns the total number of GAS spaces.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value integer

procedure, public :: max_GAS_size => get_max_GAS_size

  • private pure function get_max_GAS_size(this)

    Returns the size of the largest GAS space.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value integer

procedure, public :: recoupling

  • private elemental function recoupling(this)

    Query whether we do exchange recoupling.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value logical

procedure, public :: n_spin_orbs => get_nOrbs

  • private elemental function get_nOrbs(this)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value integer

procedure, public :: nEl => get_nEl

  • private elemental function get_nEl(this)

    Get the number of electrons.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value integer

generic, public :: GAS_size => get_GAS_size_i, get_GAS_size_idx, get_GAS_size_all

  • private pure function get_GAS_size_i(this, iGAS)

    Returns the size of the i-th GAS space in number of spin orbitals.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: iGAS

    Return Value integer

  • private pure function get_GAS_size_idx(this, idx) result(res)

    Returns the sizes for GAS spaces specified in idx.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: idx(:)

    Return Value integer, (size(idx))

  • private pure function get_GAS_size_all(this) result(res)

    Returns the sizes for all GAS spaces.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value integer, (size(this%GAS_sizes))

procedure, private :: get_GAS_size_i

  • private pure function get_GAS_size_i(this, iGAS)

    Returns the size of the i-th GAS space in number of spin orbitals.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: iGAS

    Return Value integer

procedure, private :: get_GAS_size_idx

  • private pure function get_GAS_size_idx(this, idx) result(res)

    Returns the sizes for GAS spaces specified in idx.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: idx(:)

    Return Value integer, (size(idx))

procedure, private :: get_GAS_size_all

  • private pure function get_GAS_size_all(this) result(res)

    Returns the sizes for all GAS spaces.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Return Value integer, (size(this%GAS_sizes))

procedure, public :: get_iGAS

  • private elemental function get_iGAS(this, spin_orb_idx)

    Returns the GAS space for a given spin orbital index.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: spin_orb_idx

    Return Value integer

procedure, public :: get_orb_idx

  • private elemental function get_orb_idx(this, i, iGAS)

    Returns the i-th spin orbital in the iGAS GAS space.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: i
    integer, intent(in) :: iGAS

    Return Value integer

procedure, private :: count_per_GAS_nI

  • private pure function count_per_GAS_nI(this, occupied) result(supergroup)

    Count the particles per GAS space. i.e. return the supergroup.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: occupied(:)

    Return Value integer, (get_nGAS(this))

procedure, private :: count_per_GAS_csf

  • private pure function count_per_GAS_csf(this, csf_i) result(supergroup)

    Count the particles per GAS space. i.e. return the supergroup.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(CSF_Info_t), intent(in) :: csf_i

    Return Value integer, (this%nGAS())

generic, public :: count_per_GAS => count_per_GAS_nI, count_per_GAS_csf

  • private pure function count_per_GAS_nI(this, occupied) result(supergroup)

    Count the particles per GAS space. i.e. return the supergroup.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: occupied(:)

    Return Value integer, (get_nGAS(this))

  • private pure function count_per_GAS_csf(this, csf_i) result(supergroup)

    Count the particles per GAS space. i.e. return the supergroup.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(CSF_Info_t), intent(in) :: csf_i

    Return Value integer, (this%nGAS())

procedure, private :: is_allowed_single

  • private pure function is_allowed_single(this, exc, supergroup)

    Check if a single excitation is allowed.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_1_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

procedure, private :: is_allowed_double

  • private pure function is_allowed_double(this, exc, supergroup)

    Check if a double excitation is allowed.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_2_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

procedure, private :: is_allowed_triple

  • private pure function is_allowed_triple(this, exc, supergroup)

    Check if a triple excitation is allowed.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_3_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

procedure, private :: is_allowed_distinct_double

  • private pure function is_allowed_distinct_double(this, exc, supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(DistinctDouble_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

  • private pure function is_allowed_single(this, exc, supergroup)

    Check if a single excitation is allowed.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_1_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

  • private pure function is_allowed_double(this, exc, supergroup)

    Check if a double excitation is allowed.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_2_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

  • private pure function is_allowed_triple(this, exc, supergroup)

    Check if a triple excitation is allowed.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_3_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

  • private pure function is_allowed_distinct_double(this, exc, supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(DistinctDouble_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value logical

procedure, private :: excite_single

  • private pure function excite_single(this, exc, supergroup) result(excited_supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_1_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value integer, (size(supergroup))

procedure, private :: excite_double

  • private pure function excite_double(this, exc, supergroup) result(excited_supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_2_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value integer, (size(supergroup))

procedure, private :: excite_triple

  • private pure function excite_triple(this, exc, supergroup) result(excited_supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_3_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value integer, (size(supergroup))

generic, public :: excite => excite_single, excite_double, excite_triple

  • private pure function excite_single(this, exc, supergroup) result(excited_supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_1_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value integer, (size(supergroup))

  • private pure function excite_double(this, exc, supergroup) result(excited_supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_2_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value integer, (size(supergroup))

  • private pure function excite_triple(this, exc, supergroup) result(excited_supergroup)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    type(Excite_3_t), intent(in) :: exc
    integer, intent(in) :: supergroup(:)

    Return Value integer, (size(supergroup))

procedure, public :: get_available_singles

  • private pure function get_available_singles(this, det_I) result(singles_exc_list)

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    Get all single excitated determinants from det_I that are allowed under GAS constraints.

    integer, intent(in) :: det_I(:)

    Return Value integer, allocatable, (:,:)

    Dimension is (nEl, n_configurations)

procedure, public :: get_available_doubles

  • private pure function get_available_doubles(this, det_I) result(doubles_exc_list)

    @brief Get all double excitated determinants from det_I that are allowed under GAS constraints.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this
    integer, intent(in) :: det_I(:)

    Return Value integer, allocatable, (:,:)

procedure, public :: gen_all_excits

  • private subroutine gen_all_excits(this, nI, n_excits, det_list, ic)

    Get all excitated determinants from det_I that are allowed under GAS constraints.

    Arguments

    Type IntentOptional Attributes Name
    class(GASSpec_t), intent(in) :: this

    GAS specification

    integer, intent(in) :: nI(:)

    Starting determinant

    integer, intent(out) :: n_excits

    Number of determinants

    integer(kind=n_int), intent(out), allocatable :: det_list(:,:)

    Allocatable array of determinants in ilut format

    integer, intent(in), optional :: ic

    Optional input for excitation level (ic=1 => singles, ic=2 => doubles) If ommited generate all.