(git:3add494)
negf_matrix_utils Module Reference

Helper routines to manipulate with matrices. More...

Functions/Subroutines

integer function, public number_of_atomic_orbitals (subsys, atom_list)
 Compute the number of atomic orbitals of the given set of atoms. More...
 
subroutine, public negf_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. More...
 
subroutine, public negf_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. More...
 
subroutine, public negf_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. More...
 
subroutine, public negf_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. More...
 
subroutine, public invert_cell_to_index (cell_to_index, nimages, index_to_cell)
 Invert cell_to_index mapping between unit cells and DBCSR matrix images. More...
 
pure integer function, public 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. More...
 

Detailed Description

Helper routines to manipulate with matrices.

Function/Subroutine Documentation

◆ number_of_atomic_orbitals()

integer function, public negf_matrix_utils::number_of_atomic_orbitals ( type(qs_subsys_type), pointer  subsys,
integer, dimension(:), intent(in), optional  atom_list 
)

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

Parameters
subsysQuickStep subsystem
atom_listlist of selected atom; when absent all the atoms are taken into account
Returns
number of atomic orbitals
History
  • 02.2017 created [Sergey Chulkov]

Definition at line 54 of file negf_matrix_utils.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ negf_copy_fm_submat_to_dbcsr()

subroutine, public negf_matrix_utils::negf_copy_fm_submat_to_dbcsr ( type(cp_fm_type), intent(in)  fm,
type(dbcsr_type), pointer  matrix,
integer, dimension(:), intent(in)  atomlist_row,
integer, dimension(:), intent(in)  atomlist_col,
type(qs_subsys_type), pointer  subsys 
)

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

Parameters
fmdense matrix to copy
matrixDBCSR matrix (modified on exit)
atomlist_rowset of atomic indices along the 1st (row) dimension
atomlist_colset of atomic indices along the 2nd (column) dimension
subsyssubsystem environment
History
  • 02.2017 created [Sergey Chulkov]

Definition at line 93 of file negf_matrix_utils.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ negf_copy_sym_dbcsr_to_fm_submat()

subroutine, public negf_matrix_utils::negf_copy_sym_dbcsr_to_fm_submat ( type(dbcsr_type), pointer  matrix,
type(cp_fm_type), intent(in)  fm,
integer, dimension(:), intent(in)  atomlist_row,
integer, dimension(:), intent(in)  atomlist_col,
type(qs_subsys_type), pointer  subsys,
class(mp_comm_type), intent(in)  mpi_comm_global,
logical, intent(in)  do_upper_diag,
logical, intent(in)  do_lower 
)

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

Parameters
matrixDBCSR matrix
fmdense matrix (created and initialised on exit)
atomlist_rowset of atomic indices along the 1st (row) dimension
atomlist_colset of atomic indices along the 2nd (column) dimension
subsyssubsystem environment
mpi_comm_globalMPI 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
do_upper_diaginitialise upper-triangular part of the dense matrix as well as diagonal elements
do_lowerinitialise lower-triangular part of the dense matrix
History
  • 02.2017 created [Sergey Chulkov]
Note
A naive implementation that copies relevant local DBCSR blocks into a 2-D matrix, performs collective summation, and then distributes the result. This approach seems to be optimal when processors are arranged into several independent MPI subgroups due to the fact that every subgroup automatically holds the copy of the dense matrix at the end, so we can avoid the final replication stage.

Definition at line 179 of file negf_matrix_utils.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ negf_copy_contact_matrix()

subroutine, public negf_matrix_utils::negf_copy_contact_matrix ( type(cp_fm_type), intent(in)  fm_cell0,
type(cp_fm_type), intent(in)  fm_cell1,
integer, intent(in)  direction_axis,
type(dbcsr_p_type), dimension(:), intent(in)  matrix_kp,
integer, dimension(:, :), intent(in)  index_to_cell,
integer, dimension(:), intent(in)  atom_list0,
integer, dimension(:), intent(in)  atom_list1,
type(qs_subsys_type), pointer  subsys,
class(mp_comm_type), intent(in)  mpi_comm_global,
integer, dimension(:, :), intent(inout)  is_same_cell,
type(dbcsr_type), optional, pointer  matrix_ref 
)

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

Parameters
fm_cell0extracted diagonal matrix block
fm_cell1extracted off-diagonal matrix block
direction_axisaxis towards the secondary unit cell
matrix_kpset of DBCSR matrices
index_to_cellinverted mapping between unit cells and DBCSR matrix images
atom_list0list of atoms which belong to the primary contact unit cell
atom_list1list of atoms which belong to the secondary contact unit cell
subsysQuickStep subsystem
mpi_comm_globalglobal MPI communicator
is_same_cellfor 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)
matrix_refreference DBCSR matrix
History
  • 10.2017 created [Sergey Chulkov]

Definition at line 295 of file negf_matrix_utils.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ negf_reference_contact_matrix()

subroutine, public negf_matrix_utils::negf_reference_contact_matrix ( type(dbcsr_type), pointer  matrix_contact,
type(dbcsr_type), pointer  matrix_device,
integer, dimension(:), intent(in)  atom_list,
type(negf_atom_map_type), dimension(:), intent(in)  atom_map,
type(mp_para_env_type), pointer  para_env 
)

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

Parameters
matrix_contactextracted DBCSR matrix
matrix_deviceoriginal DBCSR matrix
atom_listlist of selected atoms
atom_mapatomic map between device and contact force environments
para_envparallel environment

Definition at line 496 of file negf_matrix_utils.F.

Here is the caller graph for this function:

◆ invert_cell_to_index()

subroutine, public negf_matrix_utils::invert_cell_to_index ( integer, dimension(:, :, :), pointer  cell_to_index,
integer, intent(in)  nimages,
integer, dimension(3, nimages), intent(out)  index_to_cell 
)

Invert cell_to_index mapping between unit cells and DBCSR matrix images.

Parameters
cell_to_indexmapping: unit_cell -> image_index
nimagesnumber of images
index_to_cellinverted mapping: image_index -> unit_cell
History
  • 10.2017 created [Sergey Chulkov]

Definition at line 738 of file negf_matrix_utils.F.

Here is the caller graph for this function:

◆ get_index_by_cell()

pure integer function, public negf_matrix_utils::get_index_by_cell ( integer, dimension(3), intent(in)  cell,
integer, dimension(:, :, :), pointer  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.

Parameters
cellindices of the unit cell
cell_to_indexmapping: unit_cell -> image_index
Returns
DBCSR matrix images (0 means there are no non-zero matrix elements in the image)
History
  • 10.2017 created [Sergey Chulkov]

Definition at line 780 of file negf_matrix_utils.F.