The GAS PCHB excitation generator for doubles using spin orbitals and doing full weighting. This means that first a hole is chosen via ( p( A | I J) |{A \notin D_i} ) !! then a second hole is chosen via ( p( B | I J A) | ).
This means it is guaranteed that only unoccupied sites are sampled.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | use_lookup | = | .false. |
Use a lookup for the supergroup index in global_det_data |
|
logical, | public | :: | create_lookup | = | .false. |
Create and manage! the supergroup index lookup in global_det_data. |
|
class(ParticleSelector_t), | private, | allocatable | :: | particle_selector |
The particle selector for I, J |
||
type(AliasSampler_2D_t), | private | :: | A_sampler |
The sampler for the first hole |
|||
type(AliasSampler_3D_t), | private | :: | B_sampler |
The sampler for the second hole |
|||
class(GASSpec_t), | private, | allocatable | :: | GAS_spec | |||
type(SuperGroupIndexer_t), | private, | pointer | :: | indexer | => | null() | |
integer(kind=n_int), | private | :: | last_possible_occupied |
The last element of the ilut array has some elements which are not used, if the number of spinorbitals is not a multiple of bitsize_n_int. To correctly zero them this bitmask is 1 wherever a determinant could be occupied in the last element, and 0 otherwise. |
@brief Initialize the pchb excitation generator
@details
This does two things:
1. setup the lookup table for the mapping ab -> (a,b)
2. setup the alias table for picking ab given ij with probability ~
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(inout) | :: | this | |||
class(GASSpec_t), | intent(in) | :: | GAS_spec | |||
logical, | intent(in) | :: | use_lookup | |||
logical, | intent(in) | :: | create_lookup | |||
type(PCHB_ParticleSelection_t), | intent(in) | :: | PCHB_particle_selection |
Finalize everything
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(inout) | :: | this |
Given the initial determinant (both as nI and ilut), create a random double excitation using the hamiltonian matrix elements as weights
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | nI(nel) | |||
integer(kind=n_int), | intent(in) | :: | ilutI(0:NIfTot) | |||
integer, | intent(out) | :: | nJ(nel) | |||
integer(kind=n_int), | intent(out) | :: | ilutJ(0:NifTot) | |||
integer, | intent(in) | :: | exFlag | |||
integer, | intent(out) | :: | ic | |||
integer, | intent(out) | :: | ex(2,maxExcit) | |||
logical, | intent(out) | :: | tParity | |||
real(kind=dp), | intent(out) | :: | pGen | |||
real(kind=dp), | intent(out) | :: | hel | |||
type(excit_gen_store_type), | intent(inout), | target | :: | store | ||
integer, | intent(in), | optional | :: | part_type |
@brief Calculate the probability of drawing a given double excitation ex
@param[in] ex 2x2 excitation matrix
@return pgen probability of generating this double with the pchb double excitgen
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | nI(nel) | |||
integer(kind=n_int), | intent(in) | :: | ilutI(0:NIfTot) | |||
integer, | intent(in) | :: | ex(2,maxExcit) | |||
integer, | intent(in) | :: | ic | |||
integer, | intent(in) | :: | ClassCount2(ScratchSize) | |||
integer, | intent(in) | :: | ClassCountUnocc2(ScratchSize) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(in) | :: | this | |||
integer, | intent(in) | :: | nI(nEl) | |||
integer, | intent(out) | :: | n_excits | |||
integer(kind=n_int), | intent(out), | allocatable | :: | det_list(:,:) |
computes and stores values for the alias sampling table n_supergroup * number_of_fused_indices * 3 * (bytes_per_sampler)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(inout) | :: | this | |||
type(PCHB_ParticleSelection_t), | intent(in) | :: | PCHB_particle_selection |
Return a bitmask and enumeration of the unoccupied spin orbitals.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t), | intent(in) | :: | this | |||
integer(kind=n_int), | intent(in) | :: | ilutI(0:nIfD) | |||
integer(kind=n_int), | intent(out) | :: | ilut_unoccupied(0:nIfD) | |||
integer, | intent(out) | :: | unoccupied(nBasis-nEl) |
type, extends(DoubleExcitationGenerator_t) :: GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t
!! The GAS PCHB excitation generator for doubles using spin orbitals
!! and doing full weighting.
!! This means that first a hole is chosen via \( p( A | I J) |_{A \notin D_i} )\
!! then a second hole is chosen via \( p( B | I J A) |_{B \notin D_i} )\.
!! This means it is guaranteed that only unoccupied sites are sampled.
private
logical, public :: use_lookup = .false.
!! Use a lookup for the supergroup index in global_det_data
logical, public :: create_lookup = .false.
!! Create **and** manage! the supergroup index lookup in global_det_data.
class(ParticleSelector_t), allocatable :: particle_selector
!! The particle selector for I, J
type(AliasSampler_2D_t) :: A_sampler
!! The sampler for the first hole `A`.
!! It yields \( p(A | IJ, i_{\text{sg}}) \)
!! where IJ is a fused index I < J and `i_sg` is the supergroup.
type(AliasSampler_3D_t) :: B_sampler
!! The sampler for the second hole `B`.
!! It yields \( p(B | A, IJ, i_{\text{sg}}) \)
!! where IJ is a fused index I < J, A is the first hole and `i_sg` is the supergroup.
class(GASSpec_t), allocatable :: GAS_spec
type(SuperGroupIndexer_t), pointer :: indexer => null()
integer(n_int), private :: last_possible_occupied
!! The last element of the ilut array has some elements
!! which are not used, if the number of spinorbitals is not a multiple of
!! bitsize_n_int.
!! To correctly zero them this bitmask is 1 wherever a determinant
!! could be occupied in the last element, and 0 otherwise.
contains
private
procedure, public :: init => GAS_doubles_PCHB_init
procedure, public :: finalize => GAS_doubles_PCHB_finalize
procedure, public :: gen_exc => GAS_doubles_PCHB_gen_exc
procedure, public :: get_pgen => GAS_doubles_PCHB_get_pgen
procedure, public :: gen_all_excits => GAS_doubles_PCHB_gen_all_excits
procedure :: compute_samplers => GAS_doubles_PCHB_compute_samplers
procedure :: get_unoccupied
end type GAS_PCHB_DoublesSpinorbFullyWeightedExcGenerator_t