Documentation for module negf_matrix_utils

Helper routines to manipulate with matrices.

source: negf_matrix_utils.F
Loading...

public Subroutines/Functions:

FUNCTION
INTEGER PURE
get_index_by_cell (cell, cell_to_index)
Helper routine to obtain index of a DBCSR matrix image by its unit cell replica. Can be used with any usin cell.
Invert cell_to_index mapping between unit cells and DBCSR matrix images.
Driver routine to extract diagonal and off-diagonal blocks from a symmetric DBCSR matrix.
Populate relevant blocks of the DBCSR matrix using data from a ScaLAPACK matrix. Irrelevant blocks of the DBCSR matrix are kept untouched.
Extract part of the DBCSR matrix based on selected atoms and copy it into a dense matrix.
Extract part of the DBCSR matrix based on selected atoms and copy it into another DBCSR matrix.
Compute the number of atomic orbitals of the given set of atoms.

PURE FUNCTIONget_index_by_cell(cell, cell_to_index)

Helper routine to obtain index of a DBCSR matrix image by its unit cell replica. Can be used with any usin cell.

Return Value ::
INTEGER
Arguments:
INTEGER,
INTENT(in)
:: cell(3) indices of the unit cell
INTEGER,
POINTER
:: cell_to_index(:,:,:) mapping: unit_cell -> image_index

SUBROUTINEinvert_cell_to_index(cell_to_index, nimages, index_to_cell)

Invert cell_to_index mapping between unit cells and DBCSR matrix images.

Arguments:
INTEGER,
POINTER
:: cell_to_index(:,:,:) mapping: unit_cell -> image_index
INTEGER,
INTENT(in)
:: nimages number of images
INTEGER,
INTENT(out)
:: index_to_cell(3,nimages) inverted mapping: image_index -> unit_cell

SUBROUTINEnegf_copy_contact_matrix(fm_cell0, fm_cell1, direction_axis, matrix_kp, index_to_cell, atom_list0, atom_list1, subsys, mpi_comm_global, is_same_cell, matrix_ref)

Driver routine to extract diagonal and off-diagonal blocks from a symmetric DBCSR matrix.

Arguments:
TYPE(cp_fm_type),
POINTER
:: fm_cell0 extracted diagonal matrix block
TYPE(cp_fm_type),
POINTER
:: fm_cell1 extracted off-diagonal matrix block
INTEGER,
INTENT(in)
:: direction_axis axis towards the secondary unit cell
INTENT(in)
:: matrix_kp(:) set of DBCSR matrices
INTEGER,
INTENT(in)
:: index_to_cell(:,:) inverted mapping between unit cells and DBCSR matrix images
INTEGER,
INTENT(in)
:: atom_list0(:) list of atoms which belong to the primary contact unit cell
INTEGER,
INTENT(in)
:: atom_list1(:) list of atoms which belong to the secondary contact unit cell
POINTER
:: subsys QuickStep subsystem
INTEGER,
INTENT(in)
:: mpi_comm_global global MPI communicator
INTEGER,
INTENT(inout)
:: is_same_cell(:,:) for every atomic pair indicates whether or not both atoms are assigned to the same (0) or different (-1) unit cells (initialised when the optional argument 'matrix_ref' is given)
TYPE(dbcsr_type),
OPTIONAL, POINTER
:: matrix_ref reference DBCSR matrix

SUBROUTINEnegf_copy_fm_submat_to_dbcsr(fm, matrix, atomlist_row, atomlist_col, subsys)

Populate relevant blocks of the DBCSR matrix using data from a ScaLAPACK matrix. Irrelevant blocks of the DBCSR matrix are kept untouched.

Arguments:
TYPE(cp_fm_type),
POINTER
:: fm dense matrix to copy
TYPE(dbcsr_type),
POINTER
:: matrix DBCSR matrix (modified on exit)
INTEGER,
INTENT(in)
:: atomlist_row(:) set of atomic indices along the 1st (row) dimension
INTEGER,
INTENT(in)
:: atomlist_col(:) set of atomic indices along the 2nd (column) dimension
POINTER
:: subsys subsystem environment

SUBROUTINEnegf_copy_sym_dbcsr_to_fm_submat(matrix, fm, atomlist_row, atomlist_col, subsys, mpi_comm_global, do_upper_diag, do_lower)

Extract part of the DBCSR matrix based on selected atoms and copy it into a dense matrix.

Arguments:
TYPE(dbcsr_type),
POINTER
:: matrix DBCSR matrix
TYPE(cp_fm_type),
POINTER
:: fm dense matrix (created and initialised on exit)
INTEGER,
INTENT(in)
:: atomlist_row(:) set of atomic indices along the 1st (row) dimension
INTEGER,
INTENT(in)
:: atomlist_col(:) set of atomic indices along the 2nd (column) dimension
POINTER
:: subsys subsystem environment
INTEGER,
INTENT(in)
:: mpi_comm_global MPI communicator which was used to distribute blocks of the DBCSR matrix. If missed, assume that both DBCSR and ScaLapack matrices are distributed across the same set of processors
LOGICAL,
INTENT(in)
:: do_upper_diag initialise upper-triangular part of the dense matrix as well as diagonal elements
LOGICAL,
INTENT(in)
:: do_lower initialise lower-triangular part of the dense matrix

SUBROUTINEnegf_reference_contact_matrix(matrix_contact, matrix_device, atom_list, atom_map, para_env)

Extract part of the DBCSR matrix based on selected atoms and copy it into another DBCSR matrix.

Arguments:
TYPE(dbcsr_type),
POINTER
:: matrix_contact extracted DBCSR matrix
TYPE(dbcsr_type),
POINTER
:: matrix_device original DBCSR matrix
INTEGER,
INTENT(in)
:: atom_list(:) list of selected atoms
INTENT(in)
:: atom_map(:) atomic map between device and contact force environments
POINTER
:: para_env parallel environment

FUNCTIONnumber_of_atomic_orbitals(subsys, atom_list)

Compute the number of atomic orbitals of the given set of atoms.

Return Value ::
INTEGER
Arguments:
POINTER
:: subsys QuickStep subsystem
INTEGER,
INTENT(in),
OPTIONAL
:: atom_list(:) list of selected atom; when absent all the atoms are taken into account