LMat_freeze Module



Contents


Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: num_ex = 4

Parameter for number of double excitations a single LMat entry can contribute to (counting permutations)

integer, private, parameter :: num_inds = 6
integer, private, parameter :: step = (num_inds/2)
real(kind=dp), private :: ECore_local
real(kind=dp), private :: ECore_tot
real(kind=dp), private, allocatable :: TMat_local(:,:)
real(kind=dp), private, allocatable :: TMat_total(:,:)

Functions

public pure function t_freeze(indices)

Checks if an entry is zeroed due to frozen orbitals being included @param[in] indices array of size 6 containing the indices of the entry in question in the frozen orbital numbering @return t_freeze true if the entry is zeroed

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: indices(num_inds)

Return Value logical

private pure function count_frozen_inds(indices) result(level)

Count how many frozen indices there are, determine if the entry has to be added to a lower-order term and if yes, which one. @param[in] indices array of size 6 with the orbital indices of the entry @return level indicates to which lower order term this entry has to be added and therefore, which subroutine has to be called in the following 0 - none 1 - one frozen index pair -> two-body term 2 - two frozen index pairs -> one-body term 3 - three frozen index pairs -> diagonal term

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: indices(num_inds)

Return Value integer

private function frozen_double_entry(indices, prefactor) result(idx)

Get the index of the UMat entry to which the LMat entry with given indices shall be added if it is frozen. @param[in] indices array of lenght 6 with the orbital indices of the LMat entry @param[ou] t_par flag indicating if the matrix element enters UMat with a -1 @return index index of the UMat entry to add the LMat entry to, 0 if entry is not frozen

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: indices(num_inds)
real(kind=dp), intent(out) :: prefactor

Return Value integer(kind=int64), (num_ex)

private function permute_umat_inds(a, b, c, d) result(inds)

Returns the UMatInd values of all possible permutations of the input indices @param[in] a,b,c,d orbital indices of a two-body element @return inds array of size 4 containing the indices of UMat corresponding to these four orbitals (in this order) and their hermitian conjugates entries of 0 indicate that no position in UMat has to be addressed

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: a
integer, intent(in) :: b
integer, intent(in) :: c
integer, intent(in) :: d

Return Value integer(kind=int64), (num_ex)

private function frozen_single_entry(indices, prefactor) result(orbs)

For a given set of 6 orbital indices with two pairs of frozen orbitals, returns the orbital indices of the corresponding single excitation and the prefactor for the matrix element due to spin @param[in] indices array of size 6 with orbital indices, four of which have to be repeated frozen indices @param[out] prefactor on return, the prefactor of the matrix element when added to the one-body terms @return orbs the two non-frozen orbitals

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: indices(num_inds)
real(kind=dp), intent(out) :: prefactor

Return Value integer, (2)

private pure function is_direct(one, two) result(t_dir)

For two positions of indices in a 6-index set, return if these are a direct pair @param[in] one, two integers between 1 and 6 @return t_dir true if the two integers correspond to positions that are direct, i.e. for which the LMat entry is symmetric under exchange of the values

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: one
integer, intent(in) :: two

Return Value logical

private pure function is_repeated_pair(indices, ct) result(t_dir)

For a set of 6 orbital indices, return whether the pair at a given position is repeated @param[in] indices array of size 6 containing a set of indices indexing an LMat entry @param[in] ct integer between 1 and 3 labeling a position in the index set @return t_dir true if the two indices at the position ct (i.e. ct and ct+step in indices) are the same

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: indices(num_inds)
integer, intent(in) :: ct

Return Value logical


Subroutines

public subroutine init_freeze_buffers()

Initialize the local storage for the diagonal and one-electron terms (two-electron terms are shared memory). This is called before reading in the 6-index integrals

Arguments

None

public subroutine flush_freeze_buffers()

Sum the locally accumulated corrections to the diagonal and one-body terms up and add them to the global terms, then deallocate temporaries. This is called after reading in the 6-index integrals

Arguments

None

public subroutine map_indices(indices)

Maps a set of six indices from pre-freeze to post-freeze orbital indexing @param indices on entry: array of indices in pre-freeze indexing, on return: same array in post-freeze indexing

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(inout) :: indices(:)

public subroutine freeze_lmat(matel, indices)

Checks if the entry is neglected due to frozen orbitals being included and absorbs entries into the lower order matrix elements if required

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: matel
integer(kind=int64), intent(inout) :: indices(num_inds)

public subroutine add_core_en(matel, indices)

Absorb entries with repeated frozen orbitals into the corresponding lower-order terms.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: matel
integer(kind=int64), intent(in) :: indices(num_inds)

private pure subroutine frozen_diagonal_entry(indices, prefactor)

Determine the prefactor for a diagonal contribution (i.e. three pairs of frozen orbitals) @param[in] indices orbital indices of the frozen entry - need to belong to a contribution @param[out] prefactor prefactor with which this LMat entry enters the matrix element

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: indices(num_inds)
real(kind=dp), intent(out) :: prefactor