gasci_supergroup_index Module



Contents


Variables

Type Visibility Attributes Name Initial
type(SuperGroupIndexer_t), public, pointer :: lookup_supergroup_indexer => null()

Interfaces

public interface SuperGroupIndexer_t


Derived Types

type, public ::  SuperGroupIndexer_t

Components

Type Visibility Attributes Name Initial
class(GASSpec_t), private, allocatable :: GAS_spec
integer(kind=int64), private, allocatable :: allowed_composition_indices(:)
integer, private :: N

The particle number.

Constructor

private pure function construct_SuperGroupIndexer_t (GAS_spec, N)

Type-Bound Procedures

procedure , public :: nEl => get_nEl Function
procedure , public :: idx_supergroup => get_supergroup_idx Function
procedure , public :: idx_nI => get_supergroup_idx_det Function
procedure , public :: lookup_supergroup_idx Function
procedure , public :: n_supergroups => get_n_supergroups Function
procedure , public :: get_supergroups => indexer_get_supergroups Function

Functions

public elemental function n_compositions(k, n) result(res)

Return the number of compositions for k summands and a sum of n

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: k
integer, intent(in) :: n

Return Value integer(kind=int64)

private pure function next_composition(previous) result(res)

Return the next composition.

Read more…

Arguments

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

Return Value integer, (size(previous))

public pure function get_compositions(k, n) result(res)

Get the ordered compositions of n into k summands.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: k
integer, intent(in) :: n

Return Value integer, allocatable, (:,:)

public pure function composition_idx(composition) result(idx)

Return the composition index for a given composition.

Read more…

Arguments

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

Return Value integer(kind=int64)

public pure function composition_from_idx(k, N, idx) result(composition)

Return the composition for a given composition index

Read more…

Arguments

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

k is the number of summands (k == size(composition)).

integer, intent(in) :: N

N is the sum over the composition (N == sum(composition)).

integer(kind=int64), intent(in) :: idx

The composition index.

Return Value integer, (k)

public pure function get_supergroups(GAS_spec, N) result(res)

Get the ordered compositions of n into k summands constrained by cumulative minima and maxima.

Read more…

Arguments

Type IntentOptional Attributes Name
class(GASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: N

Return Value integer, allocatable, (:,:)

public pure function get_first_supergroup(GAS_spec, N) result(res)

Return the first supergroup

Read more…

Arguments

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

GAS constraints

integer, intent(in) :: N

Particle number

Return Value integer, (GAS_spec%nGAS())

public pure function get_last_supergroup(GAS_spec, N) result(res)

Return the last supergroup

Read more…

Arguments

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

GAS constraints

integer, intent(in) :: N

Particle number

Return Value integer, (GAS_spec%nGAS())

public pure function next_supergroup(GAS_spec, comp_idx_last, previous) result(res)

Return the next supergoup

Arguments

Type IntentOptional Attributes Name
class(GASSpec_t), intent(in) :: GAS_spec
integer(kind=int64), intent(in) :: comp_idx_last

The composition index of the last supergroup that can be generated. “Last” as defined by lexicographically decreasing order.

integer, intent(in) :: previous(:)

The previous supergroup.

Return Value integer, (size(previous))

private pure function move_particles_local(GAS_spec, previous, src, tgt) result(res)

Move particles from src -> tgt and as many particles as possible from the right of tgt.

Arguments

Type IntentOptional Attributes Name
type(LocalGASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: previous(:)

The previous supergroup

integer, intent(in) :: src

Source and target GAS space

integer, intent(in) :: tgt

Source and target GAS space

Return Value integer, (size(previous))

private pure function move_particles_cumul(GAS_spec, previous, src, tgt) result(res)

Move particles from src -> tgt and as many particles as possible from the right of tgt.

Arguments

Type IntentOptional Attributes Name
type(CumulGASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: previous(:)

The previous supergroup

integer, intent(in) :: src

Source and target GAS space

integer, intent(in) :: tgt

Source and target GAS space

Return Value integer, (size(previous))

private pure function get_allowed_composition_indices(GAS_spec, N) result(res)

Arguments

Type IntentOptional Attributes Name
class(GASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: N

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

private pure function get_n_supergroups(this) result(res)

Get the number of possible supergroups.

Read more…

Arguments

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

Return Value integer

private elemental function get_nEl(this)

Arguments

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

Return Value integer

private pure function indexer_get_supergroups(this) result(res)

Get the ordered compositions of n into k summands constrained by cumulative minima and maxima.

Read more…

Arguments

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

Return Value integer, allocatable, (:,:)

private pure function get_supergroup_idx(this, supergroup) result(idx)

Arguments

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

Return Value integer

private pure function get_supergroup_idx_det(this, nI) result(idx)

Calculate the supergroup index for a determinant nI

Arguments

Type IntentOptional Attributes Name
class(SuperGroupIndexer_t), intent(in) :: this
integer, intent(in) :: nI(:)

The determinant for which the supergroup index should be calculated.

Return Value integer

private function lookup_supergroup_idx(this, idet, nI) result(idx)

Use a precomputed supergroup index from global_det_data.

Read more…

Arguments

Type IntentOptional Attributes Name
class(SuperGroupIndexer_t), intent(in) :: this
integer, intent(in) :: idet

The index of nI in the FciMCData::CurrentDets array.

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

The determinant for which the supergroup index should be calculated.

Return Value integer

private pure function construct_SuperGroupIndexer_t(GAS_spec, N) result(idxer)

Arguments

Type IntentOptional Attributes Name
class(GASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: N

Return Value type(SuperGroupIndexer_t)

private elemental function has_enough_room(GAS_spec, N)

Arguments

Type IntentOptional Attributes Name
class(GASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: N

Return Value logical


Subroutines

private pure subroutine find_flip_local(GAS_spec, sg, src, tgt)

Find source and target to transfer particle

Read more…

Arguments

Type IntentOptional Attributes Name
type(LocalGASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: sg(:)

A given supergroup

integer, intent(out) :: src

Source and target GAS space. If no possible movement with src <= tgt exists, then tgt == 0.

integer, intent(out) :: tgt

Source and target GAS space. If no possible movement with src <= tgt exists, then tgt == 0.

private pure subroutine find_flip_cumul(GAS_spec, sg, src, tgt)

Find source and target to transfer particle

Read more…

Arguments

Type IntentOptional Attributes Name
type(CumulGASSpec_t), intent(in) :: GAS_spec
integer, intent(in) :: sg(:)

A given supergroup

integer, intent(out) :: src

Source and target GAS space. If no possible movement with src <= tgt exists, then tgt == 0.

integer, intent(out) :: tgt

Source and target GAS space. If no possible movement with src <= tgt exists, then tgt == 0.