(git:6a2e663)
qs_tensors Module Reference

Utility methods to build 3-center integral tensors of various types. More...

Functions/Subroutines

subroutine, public build_2c_neighbor_lists (ij_list, basis_i, basis_j, potential_parameter, name, qs_env, sym_ij, molecular, dist_2d, pot_to_rad)
 Build 2-center neighborlists adapted to different operators This mainly wraps build_neighbor_lists for consistency with build_3c_neighbor_lists. More...
 
subroutine, public build_3c_neighbor_lists (ijk_list, basis_i, basis_j, basis_k, dist_3d, potential_parameter, name, qs_env, sym_ij, sym_jk, sym_ik, molecular, op_pos, own_dist)
 Build a 3-center neighbor list. More...
 
subroutine, public neighbor_list_3c_destroy (ijk_list)
 Destroy 3c neighborlist. More...
 
subroutine, public neighbor_list_3c_iterator_create (iterator, ijk_nl)
 Create a 3-center neighborlist iterator. More...
 
subroutine, public neighbor_list_3c_iterator_destroy (iterator)
 Destroy 3c-nl iterator. More...
 
recursive integer function, public neighbor_list_3c_iterate (iterator)
 Iterate 3c-nl iterator. More...
 
subroutine, public get_3c_iterator_info (iterator, ikind, jkind, kkind, nkind, iatom, jatom, katom, rij, rjk, rik, cell_j, cell_k)
 Get info of current iteration. More...
 
subroutine, public build_3c_derivatives (t3c_der_i, t3c_der_k, filter_eps, qs_env, nl_3c, basis_i, basis_j, basis_k, potential_parameter, der_eps, op_pos, do_kpoints, do_hfx_kpoints, bounds_i, bounds_j, bounds_k, RI_range, img_to_RI_cell)
 Build 3-center derivative tensors. More...
 
subroutine, public calc_3c_virial (work_virial, t3c_trace, pref, qs_env, nl_3c, basis_i, basis_j, basis_k, potential_parameter, der_eps, op_pos)
 Calculates the 3c virial contributions on the fly. More...
 
subroutine, public build_3c_integrals (t3c, filter_eps, qs_env, nl_3c, basis_i, basis_j, basis_k, potential_parameter, int_eps, op_pos, do_kpoints, do_hfx_kpoints, desymmetrize, bounds_i, bounds_j, bounds_k, RI_range, img_to_RI_cell)
 Build 3-center integral tensor. More...
 
subroutine, public build_2c_derivatives (t2c_der, filter_eps, qs_env, nl_2c, basis_i, basis_j, potential_parameter, do_kpoints)
 Calculates the derivatives of 2-center integrals, wrt to the first center. More...
 
subroutine, public calc_2c_virial (work_virial, t2c_trace, pref, qs_env, nl_2c, basis_i, basis_j, potential_parameter)
 Calculates the virial coming from 2c derivatives on the fly. More...
 
subroutine, public build_2c_integrals (t2c, filter_eps, qs_env, nl_2c, basis_i, basis_j, potential_parameter, do_kpoints, do_hfx_kpoints, ext_kpoints, regularization_RI)
 ... More...
 
subroutine, public compress_tensor (tensor, blk_indices, compressed, eps, memory)
 ... More...
 
subroutine, public decompress_tensor (tensor, blk_indices, compressed, eps)
 ... More...
 
subroutine, public get_tensor_occupancy (tensor, nze, occ)
 ... More...
 

Detailed Description

Utility methods to build 3-center integral tensors of various types.

Function/Subroutine Documentation

◆ build_2c_neighbor_lists()

subroutine, public qs_tensors::build_2c_neighbor_lists ( type(neighbor_list_set_p_type), dimension(:), pointer  ij_list,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(libint_potential_type), intent(in)  potential_parameter,
character(len=*), intent(in)  name,
type(qs_environment_type), pointer  qs_env,
logical, intent(in), optional  sym_ij,
logical, intent(in), optional  molecular,
type(distribution_2d_type), optional, pointer  dist_2d,
integer, intent(in), optional  pot_to_rad 
)

Build 2-center neighborlists adapted to different operators This mainly wraps build_neighbor_lists for consistency with build_3c_neighbor_lists.

Parameters
ij_list2c neighbor list for atom pairs i, j
basis_ibasis object for atoms i
basis_jbasis object for atoms j
potential_parameter...
namename of 2c neighbor list
qs_env...
sym_ijSymmetry in i, j (default .TRUE.)
molecular...
dist_2doptionally a custom 2d distribution
pot_to_radwhich radius (1 for i, 2 for j) should be adapted to incorporate potential

Definition at line 141 of file qs_tensors.F.

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

◆ build_3c_neighbor_lists()

subroutine, public qs_tensors::build_3c_neighbor_lists ( type(neighbor_list_3c_type), intent(out)  ijk_list,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(gto_basis_set_p_type), dimension(:)  basis_k,
type(distribution_3d_type), intent(in)  dist_3d,
type(libint_potential_type), intent(in)  potential_parameter,
character(len=*), intent(in)  name,
type(qs_environment_type), pointer  qs_env,
logical, intent(in), optional  sym_ij,
logical, intent(in), optional  sym_jk,
logical, intent(in), optional  sym_ik,
logical, intent(in), optional  molecular,
integer, intent(in), optional  op_pos,
logical, intent(in), optional  own_dist 
)

Build a 3-center neighbor list.

Parameters
ijk_list3c neighbor list for atom triples i, j, k
basis_ibasis object for atoms i
basis_jbasis object for atoms j
basis_kbasis object for atoms k
dist_3d3d distribution object
potential_parameter...
namename of 3c neighbor list
qs_env...
sym_ijSymmetry in i, j (default .FALSE.)
sym_jkSymmetry in j, k (default .FALSE.)
sym_ikSymmetry in i, k (default .FALSE.)
molecular??? not tested
op_pos...
own_dist...

Definition at line 278 of file qs_tensors.F.

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

◆ neighbor_list_3c_destroy()

subroutine, public qs_tensors::neighbor_list_3c_destroy ( type(neighbor_list_3c_type), intent(inout)  ijk_list)

Destroy 3c neighborlist.

Parameters
ijk_list...

Definition at line 382 of file qs_tensors.F.

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

◆ neighbor_list_3c_iterator_create()

subroutine, public qs_tensors::neighbor_list_3c_iterator_create ( type(neighbor_list_3c_iterator_type), intent(out)  iterator,
type(neighbor_list_3c_type), intent(in)  ijk_nl 
)

Create a 3-center neighborlist iterator.

Parameters
iterator...
ijk_nl...

Definition at line 399 of file qs_tensors.F.

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

◆ neighbor_list_3c_iterator_destroy()

subroutine, public qs_tensors::neighbor_list_3c_iterator_destroy ( type(neighbor_list_3c_iterator_type), intent(inout)  iterator)

Destroy 3c-nl iterator.

Parameters
iterator...

Definition at line 444 of file qs_tensors.F.

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

◆ neighbor_list_3c_iterate()

recursive integer function, public qs_tensors::neighbor_list_3c_iterate ( type(neighbor_list_3c_iterator_type), intent(inout)  iterator)

Iterate 3c-nl iterator.

Parameters
iterator...
Returns
0 if successful; 1 if end was reached

Definition at line 466 of file qs_tensors.F.

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

◆ get_3c_iterator_info()

subroutine, public qs_tensors::get_3c_iterator_info ( type(neighbor_list_3c_iterator_type), intent(inout)  iterator,
integer, intent(out), optional  ikind,
integer, intent(out), optional  jkind,
integer, intent(out), optional  kkind,
integer, intent(out), optional  nkind,
integer, intent(out), optional  iatom,
integer, intent(out), optional  jatom,
integer, intent(out), optional  katom,
real(kind=dp), dimension(3), intent(out), optional  rij,
real(kind=dp), dimension(3), intent(out), optional  rjk,
real(kind=dp), dimension(3), intent(out), optional  rik,
integer, dimension(3), intent(out), optional  cell_j,
integer, dimension(3), intent(out), optional  cell_k 
)

Get info of current iteration.

Parameters
iterator...
ikind...
jkind...
kkind...
nkind...
iatom...
jatom...
katom...
rij...
rjk...
rik...
cell_j...
cell_k...
Returns
...

Definition at line 562 of file qs_tensors.F.

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

◆ build_3c_derivatives()

subroutine, public qs_tensors::build_3c_derivatives ( type(dbt_type), dimension(:, :, :), intent(inout)  t3c_der_i,
type(dbt_type), dimension(:, :, :), intent(inout)  t3c_der_k,
real(kind=dp), intent(in)  filter_eps,
type(qs_environment_type), pointer  qs_env,
type(neighbor_list_3c_type), intent(inout)  nl_3c,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(gto_basis_set_p_type), dimension(:)  basis_k,
type(libint_potential_type), intent(in)  potential_parameter,
real(kind=dp), intent(in), optional  der_eps,
integer, intent(in), optional  op_pos,
logical, intent(in), optional  do_kpoints,
logical, intent(in), optional  do_hfx_kpoints,
integer, dimension(2), intent(in), optional  bounds_i,
integer, dimension(2), intent(in), optional  bounds_j,
integer, dimension(2), intent(in), optional  bounds_k,
real(dp), intent(in), optional  RI_range,
integer, dimension(:), intent(in), optional  img_to_RI_cell 
)

Build 3-center derivative tensors.

Parameters
t3c_der_iempty DBCSR tensor which will contain the 1st center derivatives
t3c_der_kempty DBCSR tensor which will contain the 3rd center derivatives
filter_epsFilter threshold for tensor blocks
qs_env...
nl_3c3-center neighborlist
basis_i...
basis_j...
basis_k...
potential_parameter...
der_epsneglect integrals smaller than der_eps
op_posoperator position. 1: calculate (i|jk) integrals, 2: calculate (ij|k) integrals
do_kpoints... this routine requires that libint has been static initialised somewhere else
do_hfx_kpoints...
bounds_i...
bounds_j...
bounds_k...
RI_range...
img_to_RI_cell...

Definition at line 1141 of file qs_tensors.F.

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

◆ calc_3c_virial()

subroutine, public qs_tensors::calc_3c_virial ( real(dp), dimension(3, 3), intent(inout)  work_virial,
type(dbt_type), intent(inout)  t3c_trace,
real(kind=dp), intent(in)  pref,
type(qs_environment_type), pointer  qs_env,
type(neighbor_list_3c_type), intent(inout)  nl_3c,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(gto_basis_set_p_type), dimension(:)  basis_k,
type(libint_potential_type), intent(in)  potential_parameter,
real(kind=dp), intent(in), optional  der_eps,
integer, intent(in), optional  op_pos 
)

Calculates the 3c virial contributions on the fly.

Parameters
work_virial...
t3c_tracethe tensor with which the trace should be taken
pref...
qs_env...
nl_3c3-center neighborlist, with a distribution matching that of t3c_trace
basis_i...
basis_j...
basis_k...
potential_parameter...
der_epsneglect integrals smaller than der_eps
op_posoperator position. 1: calculate (i|jk) integrals, 2: calculate (ij|k) integrals this routine requires that libint has been static initialised somewhere else

Definition at line 1865 of file qs_tensors.F.

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

◆ build_3c_integrals()

subroutine, public qs_tensors::build_3c_integrals ( type(dbt_type), dimension(:, :), intent(inout)  t3c,
real(kind=dp), intent(in)  filter_eps,
type(qs_environment_type), pointer  qs_env,
type(neighbor_list_3c_type), intent(inout)  nl_3c,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(gto_basis_set_p_type), dimension(:)  basis_k,
type(libint_potential_type), intent(in)  potential_parameter,
real(kind=dp), intent(in), optional  int_eps,
integer, intent(in), optional  op_pos,
logical, intent(in), optional  do_kpoints,
logical, intent(in), optional  do_hfx_kpoints,
logical, intent(in), optional  desymmetrize,
integer, dimension(2), intent(in), optional  bounds_i,
integer, dimension(2), intent(in), optional  bounds_j,
integer, dimension(2), intent(in), optional  bounds_k,
real(dp), intent(in), optional  RI_range,
integer, dimension(:), intent(in), optional  img_to_RI_cell 
)

Build 3-center integral tensor.

Parameters
t3cempty DBCSR tensor Should be of shape (1,1) if no kpoints are used and of shape (nimages, nimages) if k-points are used
filter_epsFilter threshold for tensor blocks
qs_env...
nl_3c3-center neighborlist
basis_i...
basis_j...
basis_k...
potential_parameter...
int_epsneglect integrals smaller than int_eps
op_posoperator position. 1: calculate (i|jk) integrals, 2: calculate (ij|k) integrals
do_kpoints... this routine requires that libint has been static initialised somewhere else
do_hfx_kpoints...
desymmetrize...
bounds_i...
bounds_j...
bounds_k...
RI_range...
img_to_RI_cell...

Definition at line 2370 of file qs_tensors.F.

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

◆ build_2c_derivatives()

subroutine, public qs_tensors::build_2c_derivatives ( type(dbcsr_type), dimension(:, :), intent(inout)  t2c_der,
real(kind=dp), intent(in)  filter_eps,
type(qs_environment_type), pointer  qs_env,
type(neighbor_list_set_p_type), dimension(:), pointer  nl_2c,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(libint_potential_type), intent(in)  potential_parameter,
logical, intent(in), optional  do_kpoints 
)

Calculates the derivatives of 2-center integrals, wrt to the first center.

Parameters
t2c_der... this routine requires that libint has been static initialised somewhere else
filter_epsFilter threshold for matrix blocks
qs_env...
nl_2c2-center neighborlist
basis_i...
basis_j...
potential_parameter...
do_kpoints...

Definition at line 2980 of file qs_tensors.F.

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

◆ calc_2c_virial()

subroutine, public qs_tensors::calc_2c_virial ( real(dp), dimension(3, 3), intent(inout)  work_virial,
type(dbcsr_type), intent(inout)  t2c_trace,
real(kind=dp), intent(in)  pref,
type(qs_environment_type), pointer  qs_env,
type(neighbor_list_set_p_type), dimension(:), pointer  nl_2c,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(libint_potential_type), intent(in)  potential_parameter 
)

Calculates the virial coming from 2c derivatives on the fly.

Parameters
work_virial...
t2c_tracethe 2c tensor that we should trace with the derivatives
pref...
qs_env...
nl_2c2-center neighborlist. Assumed to have compatible distribution with t2c_trace, and to be non-symmetric
basis_i...
basis_j...
potential_parameter...

Definition at line 3225 of file qs_tensors.F.

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

◆ build_2c_integrals()

subroutine, public qs_tensors::build_2c_integrals ( type(dbcsr_type), dimension(:), intent(inout)  t2c,
real(kind=dp), intent(in)  filter_eps,
type(qs_environment_type), pointer  qs_env,
type(neighbor_list_set_p_type), dimension(:), pointer  nl_2c,
type(gto_basis_set_p_type), dimension(:)  basis_i,
type(gto_basis_set_p_type), dimension(:)  basis_j,
type(libint_potential_type), intent(in)  potential_parameter,
logical, intent(in), optional  do_kpoints,
logical, intent(in), optional  do_hfx_kpoints,
type(kpoint_type), optional, pointer  ext_kpoints,
real(kind=dp), optional  regularization_RI 
)

...

Parameters
t2cempty DBCSR matrix
filter_epsFilter threshold for matrix blocks
qs_env...
nl_2c2-center neighborlist
basis_i...
basis_j...
potential_parameter...
do_kpoints...
do_hfx_kpoints... this routine requires that libint has been static initialised somewhere else
ext_kpoints...
regularization_RI...

Definition at line 3402 of file qs_tensors.F.

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

◆ compress_tensor()

subroutine, public qs_tensors::compress_tensor ( type(dbt_type), intent(inout)  tensor,
integer, dimension(:, :), intent(inout), allocatable  blk_indices,
type(hfx_compression_type), intent(inout)  compressed,
real(dp), intent(in)  eps,
real(dp), intent(inout)  memory 
)

...

Parameters
tensortensor with data. Data is cleared after compression.
blk_indices...
compressedcompressed tensor data
epsall entries < eps are discarded
memory...

Definition at line 3659 of file qs_tensors.F.

Here is the caller graph for this function:

◆ decompress_tensor()

subroutine, public qs_tensors::decompress_tensor ( type(dbt_type), intent(inout)  tensor,
integer, dimension(:, :)  blk_indices,
type(hfx_compression_type), intent(inout)  compressed,
real(dp), intent(in)  eps 
)

...

Parameters
tensorempty tensor which is filled by decompressed data
blk_indicesindices of blocks to be reserved
compressedcompressed data
epsall entries < eps are discarded

Definition at line 3787 of file qs_tensors.F.

Here is the caller graph for this function:

◆ get_tensor_occupancy()

subroutine, public qs_tensors::get_tensor_occupancy ( type(dbt_type), intent(in)  tensor,
integer(int_8), intent(out)  nze,
real(dp), intent(out)  occ 
)

...

Parameters
tensor...
nze...
occ...

Definition at line 3878 of file qs_tensors.F.

Here is the caller graph for this function: