Octopus
mesh_batch_oct_m Module Reference

This module defines functions over batches of mesh functions. More...

Detailed Description

This module defines functions over batches of mesh functions.

Data Types

type  batch_p_t
 

Functions/Subroutines

subroutine, public mesh_batch_nrm2 (mesh, aa, nrm2, reduce)
 Calculate the norms (norm2, not the square!) of a batch of mesh functions. More...
 
subroutine, public dmesh_batch_dotp_matrix (mesh, aa, bb, dot, reduce)
 Calculate the overlap matrix of two batches. More...
 
subroutine, public dmesh_batch_dotp_self (mesh, aa, dot, reduce)
 calculate the overlap matrix of a batch with itself More...
 
subroutine, public dmesh_batch_dotp_vector (mesh, aa, bb, dot, reduce, cproduct)
 calculate the vector of dot-products of mesh functions between two batches More...
 
subroutine, public dmesh_batch_mf_dotp (mesh, aa, psi, dot, reduce, nst)
 calculate the dot products between a batch and a vector of mesh functions More...
 
subroutine, public dmesh_batch_codensity (mesh, aa, psi, rho)
 calculate the co-densities More...
 
subroutine, public dmesh_batch_exchange_points (mesh, aa, forward_map, backward_map)
 This functions exchanges points of a mesh according to a certain map. Two possible maps can be given. Only one map argument must be present. More...
 
subroutine dpriv_mesh_batch_nrm2 (mesh, aa, nrm2)
 This function should not be called directly, but through mesh_batch_nrm2. More...
 
subroutine, public dmesh_batch_orthogonalization (mesh, nst, psib, phib, normalize, overlap, norm, gs_scheme, full_batch)
 Orthonormalizes states of phib to the orbitals of nst batches of psi. More...
 
subroutine, public dmesh_batch_normalize (mesh, psib, norm)
 Normalize a batch. More...
 
subroutine, public zmesh_batch_dotp_matrix (mesh, aa, bb, dot, reduce)
 Calculate the overlap matrix of two batches. More...
 
subroutine, public zmesh_batch_dotp_self (mesh, aa, dot, reduce)
 calculate the overlap matrix of a batch with itself More...
 
subroutine, public zmesh_batch_dotp_vector (mesh, aa, bb, dot, reduce, cproduct)
 calculate the vector of dot-products of mesh functions between two batches More...
 
subroutine, public zmesh_batch_mf_dotp (mesh, aa, psi, dot, reduce, nst)
 calculate the dot products between a batch and a vector of mesh functions More...
 
subroutine, public zmesh_batch_codensity (mesh, aa, psi, rho)
 calculate the co-densities More...
 
subroutine, public zmesh_batch_exchange_points (mesh, aa, forward_map, backward_map)
 This functions exchanges points of a mesh according to a certain map. Two possible maps can be given. Only one map argument must be present. More...
 
subroutine zpriv_mesh_batch_nrm2 (mesh, aa, nrm2)
 This function should not be called directly, but through mesh_batch_nrm2. More...
 
subroutine, public zmesh_batch_orthogonalization (mesh, nst, psib, phib, normalize, overlap, norm, gs_scheme, full_batch)
 Orthonormalizes states of phib to the orbitals of nst batches of psi. More...
 
subroutine, public zmesh_batch_normalize (mesh, psib, norm)
 Normalize a batch. More...
 

Function/Subroutine Documentation

◆ mesh_batch_nrm2()

subroutine, public mesh_batch_oct_m::mesh_batch_nrm2 ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
real(real64), dimension(:), intent(out), contiguous  nrm2,
logical, intent(in), optional  reduce 
)

Calculate the norms (norm2, not the square!) of a batch of mesh functions.

Parameters
[in]meshunderlying mesh
[in]aabatch of mesh functions
[out]nrm2vector of norms
[in]reduceoptional flag whether to perform reduction; default=.true.

Definition at line 176 of file mesh_batch.F90.

◆ dmesh_batch_dotp_matrix()

subroutine, public mesh_batch_oct_m::dmesh_batch_dotp_matrix ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
class(batch_t), intent(in)  bb,
real(real64), dimension(:, :), intent(inout), contiguous  dot,
logical, intent(in), optional  reduce 
)

Calculate the overlap matrix of two batches.

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in]bbbatch bb
[in,out]dotresult: dot_ij = < aa(i) | bb(j) >; dimension (states%st_start: states%st_end, states%st_start: states%st_end)
[in]reduceoptional flag whether to perform reduction; default = .true.

Definition at line 270 of file mesh_batch.F90.

◆ dmesh_batch_dotp_self()

subroutine, public mesh_batch_oct_m::dmesh_batch_dotp_self ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
real(real64), dimension(:, :), intent(inout), contiguous  dot,
logical, intent(in), optional  reduce 
)

calculate the overlap matrix of a batch with itself

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in,out]dotresult: dot_ij = < aa(i) | aa(j) >; dimension (1:aa%nst, 1:aa%nst)
[in]reduceoptional flag whether to perform reduction; default = .true.

Definition at line 516 of file mesh_batch.F90.

◆ dmesh_batch_dotp_vector()

subroutine, public mesh_batch_oct_m::dmesh_batch_dotp_vector ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
class(batch_t), intent(in)  bb,
real(real64), dimension(:), intent(inout), contiguous  dot,
logical, intent(in), optional  reduce,
logical, intent(in), optional  cproduct 
)

calculate the vector of dot-products of mesh functions between two batches

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in]bbbatch bb
[in,out]dotresult: dot_i = < aa(i) | bb(i) >
[in]reduceoptional flag whether to perform reduction; default = .true.
[in]cproductoptional flag: complex conj. product; default = .false.

Definition at line 631 of file mesh_batch.F90.

◆ dmesh_batch_mf_dotp()

subroutine, public mesh_batch_oct_m::dmesh_batch_mf_dotp ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
real(real64), dimension(:,:), intent(in)  psi,
real(real64), dimension(:), intent(inout)  dot,
logical, intent(in), optional  reduce,
integer, intent(in), optional  nst 
)

calculate the dot products between a batch and a vector of mesh functions

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in]psimesh functions; min. dimension (1:np, 1:nst)
[in,out]dotresult dot_i = < aa(i) | psi(i) >
[in]reduceoptional flag whether to perform reduction; default = .true.
[in]nstoptional number of states; default = aanst

Definition at line 804 of file mesh_batch.F90.

◆ dmesh_batch_codensity()

subroutine, public mesh_batch_oct_m::dmesh_batch_codensity ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
real(real64), dimension(:,:), intent(in)  psi,
real(real64), dimension(:,:), intent(out)  rho 
)

calculate the co-densities

Result \( \rho_i(x) = \psi(x) \phi_i(x) \) where the $\phi_i$ are given by the batch aa.

Parameters
[in]meshThe mesh descriptor.
[in]aaA batch which contains the mesh functions
[in]psiA mesh function; dimension (1:mesh%np, 1:aadim)
[out]rhoAn array containing the result of the co-density

Definition at line 964 of file mesh_batch.F90.

◆ dmesh_batch_exchange_points()

subroutine, public mesh_batch_oct_m::dmesh_batch_exchange_points ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(inout)  aa,
integer(int64), dimension(:), intent(in), optional  forward_map,
logical, intent(in), optional  backward_map 
)

This functions exchanges points of a mesh according to a certain map. Two possible maps can be given. Only one map argument must be present.

Parameters
[in]meshThe mesh descriptor.
[in,out]aaA batch which contains the mesh functions whose points will be exchanged.
[in]forward_mapA map which gives the destination of the value each point.
[in]backward_mapA map which gives the source of the value of each point.

Definition at line 1025 of file mesh_batch.F90.

◆ dpriv_mesh_batch_nrm2()

subroutine mesh_batch_oct_m::dpriv_mesh_batch_nrm2 ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
real(real64), dimension(:), intent(out)  nrm2 
)
private

This function should not be called directly, but through mesh_batch_nrm2.

Definition at line 1247 of file mesh_batch.F90.

◆ dmesh_batch_orthogonalization()

subroutine, public mesh_batch_oct_m::dmesh_batch_orthogonalization ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  nst,
class(batch_p_t), dimension(:), intent(in)  psib,
class(batch_t), intent(inout)  phib,
logical, intent(in), optional  normalize,
real(real64), dimension(:,:), intent(out), optional  overlap,
real(real64), dimension(:), intent(out), optional  norm,
integer, intent(in), optional  gs_scheme,
logical, intent(in), optional  full_batch 
)

Orthonormalizes states of phib to the orbitals of nst batches of psi.

It also permits doing only the orthogonalization (no normalization).

Parameters
[in]meshunderlying mesh
[in]nstnumber of states
[in]psibpsi(nst) (array of nst pointers to batches)
[in,out]phibphi
[in]normalizeoptional flag whether to normalize the result; default = .false.
[out]overlapoptional result: (nst, phibnst)
[out]normoptional result: array of norms
[in]gs_schemeoptional: Gram-Schmidt scheme to use
[in]full_batchoptional: orthogonalize full batch

Definition at line 1433 of file mesh_batch.F90.

◆ dmesh_batch_normalize()

subroutine, public mesh_batch_oct_m::dmesh_batch_normalize ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(inout)  psib,
real(real64), dimension(:), intent(out), optional  norm 
)

Normalize a batch.

Parameters
[in]meshunderlying mesh
[in,out]psibbatch to normalize
[out]normoptional result: array of norms

Definition at line 1558 of file mesh_batch.F90.

◆ zmesh_batch_dotp_matrix()

subroutine, public mesh_batch_oct_m::zmesh_batch_dotp_matrix ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
class(batch_t), intent(in)  bb,
complex(real64), dimension(:, :), intent(inout), contiguous  dot,
logical, intent(in), optional  reduce 
)

Calculate the overlap matrix of two batches.

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in]bbbatch bb
[in,out]dotresult: dot_ij = < aa(i) | bb(j) >; dimension (states%st_start: states%st_end, states%st_start: states%st_end)
[in]reduceoptional flag whether to perform reduction; default = .true.

Definition at line 1657 of file mesh_batch.F90.

◆ zmesh_batch_dotp_self()

subroutine, public mesh_batch_oct_m::zmesh_batch_dotp_self ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
complex(real64), dimension(:, :), intent(inout), contiguous  dot,
logical, intent(in), optional  reduce 
)

calculate the overlap matrix of a batch with itself

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in,out]dotresult: dot_ij = < aa(i) | aa(j) >; dimension (1:aa%nst, 1:aa%nst)
[in]reduceoptional flag whether to perform reduction; default = .true.

Definition at line 1903 of file mesh_batch.F90.

◆ zmesh_batch_dotp_vector()

subroutine, public mesh_batch_oct_m::zmesh_batch_dotp_vector ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
class(batch_t), intent(in)  bb,
complex(real64), dimension(:), intent(inout), contiguous  dot,
logical, intent(in), optional  reduce,
logical, intent(in), optional  cproduct 
)

calculate the vector of dot-products of mesh functions between two batches

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in]bbbatch bb
[in,out]dotresult: dot_i = < aa(i) | bb(i) >
[in]reduceoptional flag whether to perform reduction; default = .true.
[in]cproductoptional flag: complex conj. product; default = .false.

Definition at line 2018 of file mesh_batch.F90.

◆ zmesh_batch_mf_dotp()

subroutine, public mesh_batch_oct_m::zmesh_batch_mf_dotp ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
complex(real64), dimension(:,:), intent(in)  psi,
complex(real64), dimension(:), intent(inout)  dot,
logical, intent(in), optional  reduce,
integer, intent(in), optional  nst 
)

calculate the dot products between a batch and a vector of mesh functions

Parameters
[in]meshunderlying mesh
[in]aabatch aa
[in]psimesh functions; min. dimension (1:np, 1:nst)
[in,out]dotresult dot_i = < aa(i) | psi(i) >
[in]reduceoptional flag whether to perform reduction; default = .true.
[in]nstoptional number of states; default = aanst

Definition at line 2191 of file mesh_batch.F90.

◆ zmesh_batch_codensity()

subroutine, public mesh_batch_oct_m::zmesh_batch_codensity ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
complex(real64), dimension(:,:), intent(in)  psi,
complex(real64), dimension(:,:), intent(out)  rho 
)

calculate the co-densities

Result \( \rho_i(x) = \psi(x) \phi_i(x) \) where the $\phi_i$ are given by the batch aa.

Parameters
[in]meshThe mesh descriptor.
[in]aaA batch which contains the mesh functions
[in]psiA mesh function; dimension (1:mesh%np, 1:aadim)
[out]rhoAn array containing the result of the co-density

Definition at line 2351 of file mesh_batch.F90.

◆ zmesh_batch_exchange_points()

subroutine, public mesh_batch_oct_m::zmesh_batch_exchange_points ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(inout)  aa,
integer(int64), dimension(:), intent(in), optional  forward_map,
logical, intent(in), optional  backward_map 
)

This functions exchanges points of a mesh according to a certain map. Two possible maps can be given. Only one map argument must be present.

Parameters
[in]meshThe mesh descriptor.
[in,out]aaA batch which contains the mesh functions whose points will be exchanged.
[in]forward_mapA map which gives the destination of the value each point.
[in]backward_mapA map which gives the source of the value of each point.

Definition at line 2412 of file mesh_batch.F90.

◆ zpriv_mesh_batch_nrm2()

subroutine mesh_batch_oct_m::zpriv_mesh_batch_nrm2 ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(in)  aa,
real(real64), dimension(:), intent(out)  nrm2 
)
private

This function should not be called directly, but through mesh_batch_nrm2.

Definition at line 2634 of file mesh_batch.F90.

◆ zmesh_batch_orthogonalization()

subroutine, public mesh_batch_oct_m::zmesh_batch_orthogonalization ( class(mesh_t), intent(in)  mesh,
integer, intent(in)  nst,
class(batch_p_t), dimension(:), intent(in)  psib,
class(batch_t), intent(inout)  phib,
logical, intent(in), optional  normalize,
complex(real64), dimension(:,:), intent(out), optional  overlap,
complex(real64), dimension(:), intent(out), optional  norm,
integer, intent(in), optional  gs_scheme,
logical, intent(in), optional  full_batch 
)

Orthonormalizes states of phib to the orbitals of nst batches of psi.

It also permits doing only the orthogonalization (no normalization).

Parameters
[in]meshunderlying mesh
[in]nstnumber of states
[in]psibpsi(nst) (array of nst pointers to batches)
[in,out]phibphi
[in]normalizeoptional flag whether to normalize the result; default = .false.
[out]overlapoptional result: (nst, phibnst)
[out]normoptional result: array of norms
[in]gs_schemeoptional: Gram-Schmidt scheme to use
[in]full_batchoptional: orthogonalize full batch

Definition at line 2844 of file mesh_batch.F90.

◆ zmesh_batch_normalize()

subroutine, public mesh_batch_oct_m::zmesh_batch_normalize ( class(mesh_t), intent(in)  mesh,
class(batch_t), intent(inout)  psib,
real(real64), dimension(:), intent(out), optional  norm 
)

Normalize a batch.

Parameters
[in]meshunderlying mesh
[in,out]psibbatch to normalize
[out]normoptional result: array of norms

Definition at line 2969 of file mesh_batch.F90.