GASSpec_t Derived Type

type, public, abstract :: GASSpec_t

Speficies the GAS spaces.


Contents


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

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.

    This function uses get_possible_spaces to find possible GAS spaces where a particle can be created and returns only unoccupied sites of correct spin.

    “Trivial” excitations are avoided. That means, that a site is only counted as unoccupied if it was unoccupied in nI from the beginning on. (A double excitation where a particle is deleted, but immediately recreated would be such a trivial excitations.)

    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, public, :: contains_conf

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

    Query wether a determinant or CSF 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, 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.

    The function in nI-format is faster! It is assumed that the determinant is contained in the Full CI space and obeys e.g. the Pauli principle. The return value is not defined, if that is not the case!

    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, :: 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, :: 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)

    Arguments

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

    Return Value logical

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.

    Can be seen as the preimage of get_iGAS (which is usually not injective).

    Arguments

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

    Return Value integer

procedure, public, :: count_per_GAS

  • private pure function count_per_GAS(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))

generic, public, :: is_allowed => is_allowed_single, is_allowed_double

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

    Check if a single excitation is allowed.

    Is called once at initialization, so it does not have to be super fast.

    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.

    Is called once at initialization, so it does not have to be super fast. recoupling allows recoupling excitations that change the spin projection of individual GAS spaces.

    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_single

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

    Check if a single excitation is allowed.

    Is called once at initialization, so it does not have to be super fast.

    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.

    Is called once at initialization, so it does not have to be super fast. recoupling allows recoupling excitations that change the spin projection of individual GAS spaces.

    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