gasci Module



Contents


Variables

Type Visibility Attributes Name Initial
type(possible_GAS_exc_gen_t), public, parameter :: possible_GAS_exc_gen = possible_GAS_exc_gen_t()
type(GAS_exc_gen_t), public :: GAS_exc_gen = possible_GAS_exc_gen%ON_FLY_HEAT_BATH
type(GAS_exc_gen_t), public, allocatable :: user_input_GAS_exc_gen
class(GASSpec_t), public, allocatable :: GAS_specification

Interfaces

public interface LocalGASSpec_t

  • private pure function construct_LocalGASSpec_t(n_min, n_max, spat_GAS_orbs, recoupling) result(GAS_spec)

    Constructor of LocalGASSpec_t

    Arguments

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

    Minimum particle number per GAS space.

    integer, intent(in) :: n_max(:)

    Maximum particle number per GAS space.

    integer, intent(in) :: spat_GAS_orbs(:)

    GAS space for the i-th spatial orbital.

    logical, intent(in), optional :: recoupling

    Exchange double excitations that recouple the spin are allowed

    Return Value type(LocalGASSpec_t)

public interface CumulGASSpec_t

  • private pure function construct_CumulGASSpec_t(cn_min, cn_max, spat_GAS_orbs, recoupling) result(GAS_spec)

    Constructor of CumulGASSpec_t

    Arguments

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

    Cumulative minimum particle number.

    integer, intent(in) :: cn_max(:)

    Cumulative maximum particle number.

    integer, intent(in) :: spat_GAS_orbs(:)

    GAS space for the i-th spatial orbital.

    logical, intent(in), optional :: recoupling

    Exchange double excitations that recouple the spin are allowed

    Return Value type(CumulGASSpec_t)

public interface FlexibleGASSpec_t

  • private pure function construct_FlexibleGASSpec_t(supergroups, spat_GAS_orbs, recoupling) result(GAS_spec)

    Constructor of FlexibleGASSpec_t

    Arguments

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

    The allowed supergroups.

    integer, intent(in) :: spat_GAS_orbs(:)

    GAS space for the i-th spatial orbital.

    logical, intent(in), optional :: recoupling

    Exchange double excitations that recouple the spin are allowed

    Return Value type(FlexibleGASSpec_t)


Abstract Interfaces

abstract interface

  • private pure function contains_supergroup_t(this, supergroup)

    Arguments

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

    Return Value logical

abstract interface

  • private pure function is_valid_t(this, n_basis)

    Arguments

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

    Return Value logical

abstract interface

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

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

abstract interface

  • private subroutine write_to_t(this, iunit)

    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

Derived Types

type, private, extends(EnumBase_t) ::  GAS_exc_gen_t

Components

Type Visibility Attributes Name Initial
integer, public :: val

Type-Bound Procedures

generic, public :: operator(==) => eq_EnumBase_t
generic, public :: operator(/=) => neq_EnumBase_t

type, private ::  possible_GAS_exc_gen_t

Components

Type Visibility Attributes Name Initial
type(GAS_exc_gen_t), public :: DISCONNECTED = GAS_exc_gen_t(1)
type(GAS_exc_gen_t), public :: ON_FLY_HEAT_BATH = GAS_exc_gen_t(2)
type(GAS_exc_gen_t), public :: DISCARDING = GAS_exc_gen_t(3)
type(GAS_exc_gen_t), public :: PCHB = GAS_exc_gen_t(4)

type, public ::  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.

Read more…
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 :: contains_supergroup
procedure (is_valid_t) , public :: is_valid
procedure (write_to_t) , public :: write_to
procedure (get_possible_spaces_t) , public :: get_possible_spaces
procedure , public , :: get_possible_holes Function
procedure , public , :: contains_conf Function
procedure , public , :: contains_ilut Function
procedure , public , :: is_connected => get_is_connected Function
procedure , public , :: nGAS => get_nGAS Function
procedure , public , :: n_spin_orbs => get_nOrbs Function
procedure , public , :: max_GAS_size => get_max_GAS_size Function
procedure , public , :: recoupling Function
generic, public , :: GAS_size => get_GAS_size_i, get_GAS_size_idx, get_GAS_size_all
procedure , private :: get_GAS_size_i Function
procedure , private :: get_GAS_size_idx Function
procedure , private :: get_GAS_size_all Function
procedure , public , :: get_iGAS Function
procedure , public , :: get_orb_idx Function
procedure , public , :: count_per_GAS Function
generic, public , :: is_allowed => is_allowed_single, is_allowed_double
procedure , private :: is_allowed_single Function
procedure , private :: is_allowed_double Function

type, public, extends(GASSpec_t) ::  LocalGASSpec_t

Components

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

The indices are: min(1 : nGAS), max(1 : nGAS). min(iGAS) specifies the minimum particle number per GAS space. max(iGAS) specifies the maximum particle number per GAS space.

integer, private, allocatable :: max(:)

The indices are: min(1 : nGAS), max(1 : nGAS). min(iGAS) specifies the minimum particle number per GAS space. max(iGAS) specifies the maximum particle number per GAS space.

Constructor

private pure function construct_LocalGASSpec_t (n_min, n_max, spat_GAS_orbs, recoupling)

Constructor of LocalGASSpec_t

Type-Bound Procedures

procedure , public , :: get_possible_holes Function
procedure , public , :: contains_conf Function
procedure , public , :: contains_ilut Function
procedure , public , :: is_connected => get_is_connected Function
procedure , public , :: nGAS => get_nGAS Function
procedure , public , :: n_spin_orbs => get_nOrbs Function
procedure , public , :: max_GAS_size => get_max_GAS_size Function
procedure , public , :: recoupling Function
generic, public , :: GAS_size => get_GAS_size_i, get_GAS_size_idx, get_GAS_size_all
procedure , public , :: get_iGAS Function
procedure , public , :: get_orb_idx Function
procedure , public , :: count_per_GAS Function
generic, public , :: is_allowed => is_allowed_single, is_allowed_double
procedure , public , :: contains_supergroup => Local_contains_supergroup Function
procedure , public , :: is_valid => Local_is_valid Function
procedure , public , :: write_to => Local_write_to Subroutine
procedure , public , :: get_possible_spaces => Local_get_possible_spaces Function
generic, public , :: get_min => get_min_i, get_min_all
procedure , private :: get_min_all Function
procedure , private :: get_min_i Function
generic, public , :: get_max => get_max_i, get_max_all
procedure , private :: get_max_all Function
procedure , private :: get_max_i Function

type, public, extends(GASSpec_t) ::  CumulGASSpec_t

Components

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

The indices are: c_min(1 : nGAS), c_max(1 : nGAS). c_min(iGAS) specifies the cumulated minimum particle number per GAS space. c_max(iGAS) specifies the cumulated maximum particle number per GAS space.

integer, private, allocatable :: c_max(:)

The indices are: c_min(1 : nGAS), c_max(1 : nGAS). c_min(iGAS) specifies the cumulated minimum particle number per GAS space. c_max(iGAS) specifies the cumulated maximum particle number per GAS space.

Constructor

private pure function construct_CumulGASSpec_t (cn_min, cn_max, spat_GAS_orbs, recoupling)

Constructor of CumulGASSpec_t

Type-Bound Procedures

procedure , public , :: get_possible_holes Function
procedure , public , :: contains_conf Function
procedure , public , :: contains_ilut Function
procedure , public , :: is_connected => get_is_connected Function
procedure , public , :: nGAS => get_nGAS Function
procedure , public , :: n_spin_orbs => get_nOrbs Function
procedure , public , :: max_GAS_size => get_max_GAS_size Function
procedure , public , :: recoupling Function
generic, public , :: GAS_size => get_GAS_size_i, get_GAS_size_idx, get_GAS_size_all
procedure , public , :: get_iGAS Function
procedure , public , :: get_orb_idx Function
procedure , public , :: count_per_GAS Function
generic, public , :: is_allowed => is_allowed_single, is_allowed_double
procedure , public , :: contains_supergroup => Cumul_contains_supergroup Function
procedure , public , :: is_valid => Cumul_is_valid Function
procedure , public , :: write_to => Cumul_write_to Subroutine
procedure , public , :: get_possible_spaces => Cumul_get_possible_spaces Function
generic, public , :: get_cmin => get_cmin_i, get_cmin_all
procedure , private :: get_cmin_i Function
procedure , private :: get_cmin_all Function
generic, public , :: get_cmax => get_cmax_i, get_cmax_all
procedure , private :: get_cmax_i Function
procedure , private :: get_cmax_all Function

type, public, extends(GASSpec_t) ::  FlexibleGASSpec_t

Components

Type Visibility Attributes Name Initial
integer, public, allocatable :: supergroups(:,:)

List the allowed supergroups. The indices are: (nGAS, n_supergroups)

integer, private :: N

The number of particles.

Constructor

private pure function construct_FlexibleGASSpec_t (supergroups, spat_GAS_orbs, recoupling)

Constructor of FlexibleGASSpec_t

Type-Bound Procedures

procedure , public , :: get_possible_holes Function
procedure , public , :: contains_conf Function
procedure , public , :: contains_ilut Function
procedure , public , :: is_connected => get_is_connected Function
procedure , public , :: nGAS => get_nGAS Function
procedure , public , :: n_spin_orbs => get_nOrbs Function
procedure , public , :: max_GAS_size => get_max_GAS_size Function
procedure , public , :: recoupling Function
generic, public , :: GAS_size => get_GAS_size_i, get_GAS_size_idx, get_GAS_size_all
procedure , public , :: get_iGAS Function
procedure , public , :: get_orb_idx Function
procedure , public , :: count_per_GAS Function
generic, public , :: is_allowed => is_allowed_single, is_allowed_double
procedure , public , :: contains_supergroup => Flexible_contains_supergroup Function
procedure , public , :: is_valid => Flexible_is_valid Function
procedure , public , :: write_to => Flexible_write_to Subroutine
procedure , public , :: get_possible_spaces => Flexible_get_possible_spaces Function
procedure , public , :: N_particle => Flexible_N_particle Function

Functions

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

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

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

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

private elemental function get_nOrbs(this)

Arguments

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

Return Value integer

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

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

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

private elemental function recoupling(this)

Arguments

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

Return Value logical

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

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

public pure function get_name(impl) result(res)

Arguments

Type IntentOptional Attributes Name
type(GAS_exc_gen_t), intent(in) :: impl

Return Value character(len=:), allocatable

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

private pure function construct_LocalGASSpec_t(n_min, n_max, spat_GAS_orbs, recoupling) result(GAS_spec)

Constructor of LocalGASSpec_t

Arguments

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

Minimum particle number per GAS space.

integer, intent(in) :: n_max(:)

Maximum particle number per GAS space.

integer, intent(in) :: spat_GAS_orbs(:)

GAS space for the i-th spatial orbital.

logical, intent(in), optional :: recoupling

Exchange double excitations that recouple the spin are allowed

Return Value type(LocalGASSpec_t)

private pure function Local_contains_supergroup(this, supergroup) result(res)

Query wether a supergroup is contained in the GAS space.

Arguments

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

Specification of GAS spaces.

integer, intent(in) :: supergroup(:)

A supergroup.

Return Value logical

private pure function Local_is_valid(this, n_basis)

Check if the GAS specification is valid

Read more…

Arguments

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

Specification of GAS spaces with local constraints.

integer, intent(in), optional :: n_basis

Return Value logical

private elemental function get_min_i(this, iGAS)

Returns the minimum particle number for a given GAS space.

Arguments

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

Return Value integer

private pure function get_min_all(this) result(res)

Returns the minimum particle number for all GAS spaces.

Arguments

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

Return Value integer, allocatable, (:)

private elemental function get_max_i(this, iGAS)

Returns the maximum particle number for a given GAS space.

Arguments

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

Return Value integer

private pure function get_max_all(this) result(res)

Returns the maximum particle number for all GAS spaces.

Arguments

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

Return Value integer, allocatable, (:)

private pure function Local_get_possible_spaces(this, supergroup, add_holes, add_particles, n_total) result(spaces)

Arguments

Type IntentOptional Attributes Name
class(LocalGASSpec_t), intent(in) :: this
integer, intent(in) :: supergroup(size(this%GAS_sizes))
integer, intent(in), optional :: add_holes(:)
integer, intent(in), optional :: add_particles(:)
integer, intent(in), optional :: n_total

Return Value integer, allocatable, (:)

private pure function construct_CumulGASSpec_t(cn_min, cn_max, spat_GAS_orbs, recoupling) result(GAS_spec)

Constructor of CumulGASSpec_t

Arguments

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

Cumulative minimum particle number.

integer, intent(in) :: cn_max(:)

Cumulative maximum particle number.

integer, intent(in) :: spat_GAS_orbs(:)

GAS space for the i-th spatial orbital.

logical, intent(in), optional :: recoupling

Exchange double excitations that recouple the spin are allowed

Return Value type(CumulGASSpec_t)

private pure function Cumul_contains_supergroup(this, supergroup) result(res)

Query wether a supergroup is contained in the GAS space.

Arguments

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

Return Value logical

private pure function Cumul_is_valid(this, n_basis) result(is_valid)

Check if the GAS specification is valid

Read more…

Arguments

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

Specification of GAS spaces.

integer, intent(in), optional :: n_basis

The number of spin orbitals.

Return Value logical

private elemental function get_cmin_i(this, iGAS)

Returns the minimum particle number for a given GAS space.

Arguments

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

Return Value integer

private pure function get_cmin_all(this) result(res)

Returns the minimum particle number for all GAS spaces.

Arguments

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

Return Value integer, allocatable, (:)

private elemental function get_cmax_i(this, iGAS)

Returns the maximum particle number for a given GAS space.

Arguments

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

Return Value integer

private pure function get_cmax_all(this) result(res)

Returns the maximum particle number for all GAS spaces.

Arguments

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

Return Value integer, allocatable, (:)

private pure function Cumul_get_possible_spaces(this, supergroup, add_holes, add_particles, n_total) result(spaces)

Arguments

Type IntentOptional Attributes Name
class(CumulGASSpec_t), intent(in) :: this
integer, intent(in) :: supergroup(size(this%GAS_sizes))
integer, intent(in), optional :: add_holes(:)
integer, intent(in), optional :: add_particles(:)
integer, intent(in), optional :: n_total

Return Value integer, allocatable, (:)

Lower and upper bound for spaces where a particle can be created. If no particle can be created, then spaces == 0 .

private pure function Flexible_contains_supergroup(this, supergroup) result(res)

Query wether a supergroup is contained in the GAS space.

Arguments

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

Specification of GAS spaces.

integer, intent(in) :: supergroup(:)

A supergroup.

Return Value logical

private pure function Flexible_is_valid(this, n_basis)

Check if the GAS specification is valid

Read more…

Arguments

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

Specification of GAS spaces with local constraints.

integer, intent(in), optional :: n_basis

Return Value logical

private pure function Flexible_get_possible_spaces(this, supergroup, add_holes, add_particles, n_total) result(spaces)

Arguments

Type IntentOptional Attributes Name
class(FlexibleGASSpec_t), intent(in) :: this
integer, intent(in) :: supergroup(size(this%GAS_sizes))
integer, intent(in), optional :: add_holes(:)
integer, intent(in), optional :: add_particles(:)
integer, intent(in), optional :: n_total

Return Value integer, allocatable, (:)

private pure function construct_FlexibleGASSpec_t(supergroups, spat_GAS_orbs, recoupling) result(GAS_spec)

Constructor of FlexibleGASSpec_t

Arguments

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

The allowed supergroups.

integer, intent(in) :: spat_GAS_orbs(:)

GAS space for the i-th spatial orbital.

logical, intent(in), optional :: recoupling

Exchange double excitations that recouple the spin are allowed

Return Value type(FlexibleGASSpec_t)

private elemental function Flexible_N_particle(this) result(res)

Arguments

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

Return Value integer


Subroutines

private subroutine Local_write_to(this, iunit)

Arguments

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

private subroutine Cumul_write_to(this, iunit)

Write a string representation of this GAS specification to iunit

Arguments

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

private subroutine Flexible_write_to(this, iunit)

Arguments

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