property_vector_index Module

This module generalizes the “supergroup” concept of PropVec to arbitrary property vectors. This allows more general constraints such as Löwdin’s perturbation theory via PQ space folding or constraints that use e.g. the spin projection.

A property vector is a vector of integers where each element encodes a property of a sub-space. In traditional PropVec the property is just the particle number, while in general these can be e.g. [N_1, Sz_1, N_2, Sz_2] where N_i is the particle number in the i-th sub-space and Sz_i is the spin projection in the i-th sub-space (encoded as integer). The only assumed constraint of the property vectors is that the sum over them is preserved.

The algorithm follows the ideas of stochastic PropVec (https://pubs.acs.org/doi/full/10.1021/acs.jctc.1c00936), i.e. the property vectors are indexed by calculating the corresponding composition index.



Variables

Type Visibility Attributes Name Initial
class(PropertyIndexer_t), public, allocatable :: indexer
class(PropertyIndexer_t), public, allocatable :: lookup_property_indexer

Abstract Interfaces

abstract interface

  • private pure function is_allowed_single_t(this, exc, prop_vec)

    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(PropertyIndexer_t), intent(in) :: this
    type(Excite_1_t), intent(in) :: exc
    integer, intent(in) :: prop_vec(:)

    Return Value logical

abstract interface

  • private pure function is_allowed_double_t(this, exc, prop_vec)

    Check if a double excitation is allowed.

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

    Arguments

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

    Return Value logical

abstract interface

  • private pure function is_allowed_triple_t(this, exc, prop_vec)

    Check if a double excitation is allowed.

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

    Arguments

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

    Return Value logical

abstract interface

  • private pure function is_allowed_configurations_t(this, nI, nJ)

    Check if an excitation nI -> nJ is allowed.

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

    Arguments

    Type IntentOptional Attributes Name
    class(PropertyIndexer_t), intent(in) :: this
    integer, intent(in) :: nI(nEl)
    integer, intent(in) :: nJ(nEl)

    Return Value logical

abstract interface

  • private pure function is_allowed_distinct_double_t(this, exc, prop_vec)

    Arguments

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

    Return Value logical

abstract interface

  • private pure function to_prop_vec_nI_t(this, nI) result(prop_vec)

    Arguments

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

    Return Value integer, (this%prop_vec_dim())

abstract interface

  • private pure function to_prop_vec_csf_t(this, csf_i) result(prop_vec)

    Arguments

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

    Return Value integer, (this%prop_vec_dim())

abstract interface

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

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

    Arguments

    Type IntentOptional Attributes Name
    class(PropertyIndexer_t), intent(in) :: this
    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.

abstract interface

  • private subroutine write_to_t(this, iunit)

    Write a string representation of this PropVec specification to iunit

    Arguments

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

Derived Types

type, public, abstract ::  PropertyIndexer_t

Components

Type Visibility Attributes Name Initial
integer(kind=int64), public, allocatable :: allowed_composition_indices(:)
integer, public :: n_spin_orbs_

The number of spin orbitals of underlying determinants.

integer, public :: prop_vec_sum_

The sum of the property vectors. In the case of PropVec this is the particle number.

integer, public :: prop_vec_dim_

The dimension of the property vector (corresponds to number of PropVec spaces for pure PropVec)

Type-Bound Procedures

procedure, public :: idx_prop_vec
procedure, public :: idx_nI => get_idx_prop_vec_det
generic, public :: lookup_prop_vec_idx => lookup_prop_vec_idx_nI
procedure, private :: lookup_prop_vec_idx_nI
procedure, public :: n_prop_vecs => get_n_prop_vecs
procedure, public :: get_prop_vecs
procedure(is_allowed_single_t), private, deferred :: is_allowed_single
procedure(is_allowed_double_t), private, deferred :: is_allowed_double
procedure(is_allowed_triple_t), private, deferred :: is_allowed_triple
procedure(is_allowed_configurations_t), private, deferred :: is_allowed_configurations
generic, public :: is_allowed => is_allowed_single, is_allowed_double, is_allowed_triple, is_allowed_configurations
procedure, public :: dyn_is_allowed
procedure(idxer_gen_all_excits_t), public, deferred :: gen_all_excits
procedure(to_prop_vec_nI_t), private, deferred :: to_prop_vec_nI
generic, public :: to_prop_vec => to_prop_vec_nI
procedure, public :: prop_vec_dim
procedure, public :: n_spin_orbs
procedure, public :: prop_vec_sum
procedure(write_to_t), public, deferred :: write_to

type, public, abstract, extends(PropertyIndexer_t) ::  AlsoGUGA_PropertyIndexer_t

Components

Type Visibility Attributes Name Initial
integer(kind=int64), public, allocatable :: allowed_composition_indices(:)
integer, public :: n_spin_orbs_

The number of spin orbitals of underlying determinants.

integer, public :: prop_vec_sum_

The sum of the property vectors. In the case of PropVec this is the particle number.

integer, public :: prop_vec_dim_

The dimension of the property vector (corresponds to number of PropVec spaces for pure PropVec)

Type-Bound Procedures

procedure, public :: idx_prop_vec
procedure, public :: idx_nI => get_idx_prop_vec_det
procedure, public :: n_prop_vecs => get_n_prop_vecs
procedure, public :: get_prop_vecs
procedure, public :: dyn_is_allowed
procedure(idxer_gen_all_excits_t), public, deferred :: gen_all_excits
procedure, public :: prop_vec_dim
procedure, public :: n_spin_orbs
procedure, public :: prop_vec_sum
procedure(write_to_t), public, deferred :: write_to
procedure, public :: idx_csf => get_prop_vec_idx_csf
generic, public :: lookup_prop_vec_idx => lookup_prop_vec_idx_nI, lookup_prop_vec_idx_CSF
procedure, private :: lookup_prop_vec_idx_CSF
procedure(is_allowed_distinct_double_t), private, deferred :: is_allowed_distinct_double
generic, public :: is_allowed => is_allowed_single, is_allowed_double, is_allowed_triple, is_allowed_configurations, is_allowed_distinct_double
procedure(to_prop_vec_csf_t), private, deferred :: to_prop_vec_csf
generic, public :: to_prop_vec => to_prop_vec_ni, to_prop_vec_csf

Functions

private pure function lookup_prop_vec_idx_nI(this, idet, nI) result(idx)

Use a precomputed prop_vec index from global_det_data.

Read more…

Arguments

Type IntentOptional Attributes Name
class(PropertyIndexer_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 prop_vec index should be calculated.

Return Value integer

private pure function idx_prop_vec(this, prop_vec) result(idx)

Get the index of a property vector.

Read more…

Arguments

Type IntentOptional Attributes Name
class(PropertyIndexer_t), intent(in) :: this
integer, intent(in) :: prop_vec(:)

Return Value integer

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

Calculate the property vector index for a determinant nI

Arguments

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

The determinant for which the prop_vec index should be calculated.

Return Value integer

private pure function get_n_prop_vecs(this) result(res)

Get the number of possible prop_vecs.

Read more…

Arguments

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

Return Value integer

private pure function get_prop_vecs(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(PropertyIndexer_t), intent(in) :: this

Return Value integer, allocatable, (:,:)

private elemental function prop_vec_dim(this)

Arguments

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

Return Value integer

private elemental function n_spin_orbs(this)

Arguments

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

Return Value integer

private elemental function prop_vec_sum(this)

Arguments

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

Return Value integer

private pure function get_prop_vec_idx_csf(this, csf_i) result(idx)

Calculate the prop_vec index for a CSF csf_i

Arguments

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

The CSF for which the prop_vec index should be calculated.

Return Value integer

private pure function lookup_prop_vec_idx_CSF(this, csf_i) result(idx)

Use a precomputed prop_vec index from global_det_data.

Read more…

Arguments

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

The CSF

Return Value integer

private pure function dyn_is_allowed(this, exc, prop_vec)

Check if an excitation is allowed.

Read more…

Arguments

Type IntentOptional Attributes Name
class(PropertyIndexer_t), intent(in) :: this
class(Excitation_t), intent(in) :: exc
integer, intent(in) :: prop_vec(:)

Return Value logical

public pure function is_zero_by_prop_vec(nI, nJ)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nI(nEl)
integer, intent(in) :: nJ(nEl)

Return Value logical