Documentation for module mixed_cdft_utils

Utility subroutines for mixed CDFT calculations

source: mixed_cdft_utils.F
Loading...

public Subroutines/Functions:

SUBROUTINE
hfun_zero (fun, th, just_zero, bounds, work)
Determine confinement bounds along confinement dir (hardcoded to be z) and determine the number of nonzero entries Optionally zero entries below a given threshold
Given the size of a symmetric matrix and a permutation index, returns indices (i, j) of the off-diagonal element that corresponds to the permutation index. Assumes that the permutation index was computed by going through the upper triangular part of the input matrix row-by-row.
Assembles the new block diagonalized mixed CDFT Hamiltonian and overlap matrices.
Diagonalizes each of the matrix blocks.
Assembles the matrix blocks from the mixed CDFT Hamiltonian.
Initialize all the structures needed for a mixed CDFT calculation
Parse settings for mixed cdft calculation and check their consistency
Routine to print out the electronic coupling(s) between CDFT states.
Read input section related to block diagonalization of the mixed CDFT Hamiltonian matrix.
Redistribute arrays needed for an ET coupling calculation from individual CDFT states to the mixed CDFT env, that is, move the arrays to the correct blacs context. For parallel simulations, the array processor distributions also change from N to 2N processors.
Release storage reserved for mixed CDFT matrices
Transfer settings to mixed_cdft

SUBROUTINEhfun_zero(fun, th, just_zero, bounds, work)

Determine confinement bounds along confinement dir (hardcoded to be z) and determine the number of nonzero entries Optionally zero entries below a given threshold

Arguments:
REAL(dp),
INTENT(inout)
:: fun(:,:,:) input 3D potential (real space)
REAL(dp),
INTENT(in)
:: th threshold for screening values
LOGICAL
:: just_zero determines if fun should only be zeroed without returning bounds/work
INTEGER,
OPTIONAL
:: bounds(2) the confinement bounds: fun is nonzero only between these values along 3rd dimension
INTEGER,
OPTIONAL
:: work an estimate of the total number of grid points where fun is nonzero

SUBROUTINEmap_permutation_to_states(n, ipermutation, i, j)

Given the size of a symmetric matrix and a permutation index, returns indices (i, j) of the off-diagonal element that corresponds to the permutation index. Assumes that the permutation index was computed by going through the upper triangular part of the input matrix row-by-row.

Arguments:
INTEGER,
INTENT(in)
:: n the size of the symmetric matrix
INTEGER,
INTENT(in)
:: ipermutation the permutation index
INTEGER,
INTENT(out)
:: i the row index corresponding to ipermutation
INTEGER,
INTENT(out)
:: j the column index corresponding to ipermutation

SUBROUTINEmixed_cdft_assemble_block_diag(mixed_cdft, blocks, h_block, eigenvalues, n, iounit)

Assembles the new block diagonalized mixed CDFT Hamiltonian and overlap matrices.

Arguments:
POINTER
:: mixed_cdft the env that holds the CDFT states
ALLOCATABLE
:: blocks(:) list of CDFT states defining the matrix blocks
ALLOCATABLE
:: h_block(:) list of Hamiltonian matrix blocks
ALLOCATABLE
:: eigenvalues(:) list of eigenvalues for each block
INTEGER
:: n size of the new Hamiltonian and overlap matrices
INTEGER
:: iounit the output unit

SUBROUTINEmixed_cdft_diagonalize_blocks(blocks, h_block, s_block, eigenvalues)

Diagonalizes each of the matrix blocks.

Arguments:
ALLOCATABLE
:: blocks(:) list of CDFT states defining the matrix blocks
ALLOCATABLE
:: h_block(:) list of Hamiltonian matrix blocks
ALLOCATABLE
:: s_block(:) list of overlap matrix blocks
INTENT(out),
ALLOCATABLE
:: eigenvalues(:) list of eigenvalues for each block

SUBROUTINEmixed_cdft_get_blocks(mixed_cdft, blocks, h_block, s_block)

Assembles the matrix blocks from the mixed CDFT Hamiltonian.

Arguments:
POINTER
:: mixed_cdft the env that holds the CDFT states
ALLOCATABLE
:: blocks(:) list of CDFT states defining the matrix blocks
INTENT(out),
ALLOCATABLE
:: h_block(:) list of Hamiltonian matrix blocks
INTENT(out),
ALLOCATABLE
:: s_block(:) list of overlap matrix blocks

SUBROUTINEmixed_cdft_init_structures(force_env, force_env_qs, mixed_env, mixed_cdft, settings)

Initialize all the structures needed for a mixed CDFT calculation

Arguments:
POINTER
:: force_env the force_env that holds the CDFT mixed_env
POINTER
:: force_env_qs the force_env that holds the qs_env, which is CDFT state specific
POINTER
:: mixed_env the mixed_env that holds the CDFT states
POINTER
:: mixed_cdft the control section for mixed CDFT calculations
:: settings container for settings related to the mixed CDFT calculation

SUBROUTINEmixed_cdft_parse_settings(force_env, mixed_env, mixed_cdft, settings, natom)

Parse settings for mixed cdft calculation and check their consistency

Arguments:
POINTER
:: force_env the force_env that holds the CDFT mixed_env
POINTER
:: mixed_env the mixed_env that holds the CDFT states
POINTER
:: mixed_cdft control section for mixed CDFT
:: settings container for settings related to the mixed CDFT calculation
INTEGER
:: natom the total number of atoms

SUBROUTINEmixed_cdft_print_couplings(force_env)

Routine to print out the electronic coupling(s) between CDFT states.

Arguments:
POINTER
:: force_env the force_env that holds the CDFT states

SUBROUTINEmixed_cdft_read_block_diag(force_env, blocks, ignore_excited, nrecursion)

Read input section related to block diagonalization of the mixed CDFT Hamiltonian matrix.

Arguments:
POINTER
:: force_env the force_env that holds the CDFT states
INTENT(out),
ALLOCATABLE
:: blocks(:) list of CDFT states defining the matrix blocks
LOGICAL,
INTENT(out)
:: ignore_excited flag that determines if excited states resulting from the block diagonalization process should be ignored
INTEGER,
INTENT(out)
:: nrecursion integer that determines how many steps of recursive block diagonalization is performed (1 if disabled)

SUBROUTINEmixed_cdft_redistribute_arrays(force_env)

Redistribute arrays needed for an ET coupling calculation from individual CDFT states to the mixed CDFT env, that is, move the arrays to the correct blacs context. For parallel simulations, the array processor distributions also change from N to 2N processors.

Arguments:
POINTER
:: force_env the force_env that holds the CDFT states

SUBROUTINEmixed_cdft_release_work(force_env)

Release storage reserved for mixed CDFT matrices

Arguments:
POINTER
:: force_env the force_env that holds the CDFT states

SUBROUTINEmixed_cdft_transfer_settings(force_env, mixed_cdft, settings)

Transfer settings to mixed_cdft

Arguments:
POINTER
:: force_env the force_env that holds the CDFT states
POINTER
:: mixed_cdft the control section for mixed CDFT calculations
:: settings container for settings related to the mixed CDFT calculation