MPI-SCATCI  2.0
An MPI version of SCATCI
contracted_symbolic_module Module Reference

Symbolic module. More...

Data Types

type  contractedsymbolicelementvector
 This class handles the storage symbolic elements. More...
 

Functions/Subroutines

integer function bstree_compare (this, i, j, data)
 Compare two integral index sets. More...
 
subroutine check_constructed (this)
 A simple class to check if this has been properly constructed. More...
 
subroutine construct (this, n1, n2, threshold, initial_size)
 Constructs the class by allocating space for the electron integrals. More...
 
logical function check_same_integral (this, integral, idx)
 A function to check whether the same integral label exists. More...
 
subroutine insert_ijklm_symbol (this, i, j, k, l, m, coeffs, check_same_)
 Insert unpacked integral labels. More...
 
subroutine insert_symbol (this, integral_label, coeffs, check_same_)
 Insert a packed integral symbol into the class. More...
 
subroutine expand_array (this)
 This is the array expansion subroutine. More...
 
subroutine add_symbols (this, rhs, alpha)
 Inserts one symbolic vector into another scaled by. More...
 
subroutine reduce_symbols (this, rhs)
 
subroutine synchronize_symbols (this)
 
subroutine synchronize_symbols_ii (this)
 
logical function check_bounds (this, i)
 Simply checks the index and wheter it exists within the array. More...
 
subroutine remove_symbol_at (this, idx)
 Removes an integral and coefficient, never been used and pretty much useless. More...
 
logical function is_empty (this)
 Simply returns whether we are storing integrals and coeffs or not. More...
 
subroutine clear (this)
 Clear our array (not really but it essentialy resets the symbol counter to zero which is way quicker). More...
 
subroutine modify_coeff (this, idx, coeff)
 
integer(longint) function, dimension(2) get_integral_label (this, idx)
 Get integral label at specific index. More...
 
real(wp) function get_coefficient (this, idx, n1, n2)
 Get coefficient at specific index. More...
 
subroutine get_coeff_and_integral (this, idx, coeff, label)
 Get both label and coeffcient at specific index. More...
 
integer function get_size (this)
 Returns the number of symbolic elements stored. More...
 
integer function get_num_targets_sym1 (this)
 
integer function get_num_targets_sym2 (this)
 
subroutine destroy (this)
 Cleans up the class by deallocating arrays. More...
 
subroutine print_symbols (this)
 Print currently stored symbols. More...
 
logical function estimate_synchronize_cost (this)
 

Variables

class(contractedsymbolicelementvector), pointer to_be_synched
 

Detailed Description

Symbolic module.

Authors
A Al-Refaie
Date
2017

This module handles the storage of symbolic elements produced from Slater rules when integrating configuration state functions.

Note
30/01/2017 - Ahmed Al-Refaie: Initial documentation version
16/01/2019 - Jakub Benda: Unifom coding style and expanded documentation.
22/02/2019 - Jakub Benda: Removed dependency on C++ std::map.

Function/Subroutine Documentation

◆ add_symbols()

subroutine contracted_symbolic_module::add_symbols ( class(contractedsymbolicelementvector this,
class(symbolicelementvector), intent(in)  rhs,
real(wp), dimension(this % num_states_1, this % num_states_2)  alpha 
)
private

Inserts one symbolic vector into another scaled by.

Authors
A Al-Refaie
Date
2017
Parameters
[in,out]thisVector object to update.
[in]rhsThe symbolic vector to add into this class
[in]alphaThe scaling value to be applied to each coefficient

Definition at line 413 of file Contracted_Symbolic_Module.f90.

◆ bstree_compare()

integer function contracted_symbolic_module::bstree_compare ( class(contractedsymbolicelementvector), intent(in)  this,
integer, intent(in)  i,
integer, intent(in)  j,
type(c_ptr), intent(in), optional  data 
)
private

Compare two integral index sets.

Authors
J Benda
Date
2019

This is the predicate (order-defining function) used by the binary search tree. Given two pointers into the electron integral array, it returns 0 when the corresponding integral index sets are equal, -1 when the first one is (lexicographically) less, and +1 when the first one is (lexicographically) greater.

When either of the indices is non-positive, the dummy value stored in the dummy argument data is used instead of the corresponding index set.

Parameters
[in]thisSymbolic vector containing the reference electron_integral storage.
[in]iPosition of the first integral index set.
[in]jPosition of the first integral index set.
[in]dataIntegral index set to which compare the set being processed.
Returns
-1/0/+1 as a lexicographical spaceship operator applied on the index sets.

Definition at line 132 of file Contracted_Symbolic_Module.f90.

◆ check_bounds()

logical function contracted_symbolic_module::check_bounds ( class(contractedsymbolicelementvector this,
integer, intent(in)  i 
)
private

Simply checks the index and wheter it exists within the array.

Authors
A Al-Refaie
Date
2017
Parameters
[in,out]thisVector object to update.
[in]iThe index we wish to access.

Definition at line 541 of file Contracted_Symbolic_Module.f90.

◆ check_constructed()

subroutine contracted_symbolic_module::check_constructed ( class(contractedsymbolicelementvector this)
private

A simple class to check if this has been properly constructed.

Authors
A Al-Refaie
Date
2017

Definition at line 168 of file Contracted_Symbolic_Module.f90.

◆ check_same_integral()

logical function contracted_symbolic_module::check_same_integral ( class(contractedsymbolicelementvector), intent(in)  this,
integer(longint), dimension(2), intent(in), target  integral,
integer, intent(out)  idx 
)
private

A function to check whether the same integral label exists.

Authors
A Al-Refaie
Date
2017
Parameters
[in,out]thisVector object to query.
[in]integralPacked integral label
[out]idxThe index to the electron integral array, -1 if not found, positive otherwise
Returns
check_same_integral True: we found one the same one. False: there isn't one

Definition at line 235 of file Contracted_Symbolic_Module.f90.

◆ clear()

subroutine contracted_symbolic_module::clear ( class(contractedsymbolicelementvector this)
private

Clear our array (not really but it essentialy resets the symbol counter to zero which is way quicker).

Authors
A Al-Refaie
Date
2017

Definition at line 598 of file Contracted_Symbolic_Module.f90.

◆ construct()

subroutine contracted_symbolic_module::construct ( class(contractedsymbolicelementvector this,
integer  n1,
integer  n2,
real(wp), intent(in), optional  threshold,
integer, intent(in), optional  initial_size 
)
private

Constructs the class by allocating space for the electron integrals.

Authors
A Al-Refaie
Date
2017
Parameters
[in,out]thisVector object to update.
[in]n1Number of states 1.
[in]n2Number of states 2.
[in]thresholdThe mininum integral coefficient threshold we should store
[in]initial_sizeDeprecated, doesnt do anything

Definition at line 188 of file Contracted_Symbolic_Module.f90.

◆ destroy()

subroutine contracted_symbolic_module::destroy ( class(contractedsymbolicelementvector this)
private

Cleans up the class by deallocating arrays.

Authors
A Al-Refaie
Date
2017

Definition at line 688 of file Contracted_Symbolic_Module.f90.

◆ estimate_synchronize_cost()

logical function contracted_symbolic_module::estimate_synchronize_cost ( class(contractedsymbolicelementvector this)
private

Definition at line 726 of file Contracted_Symbolic_Module.f90.

◆ expand_array()

subroutine contracted_symbolic_module::expand_array ( class(contractedsymbolicelementvector this)
private

This is the array expansion subroutine.

Authors
A Al-Refaie
Date
2017

It simply copies the coeffcieint and integral array into a temporary one, reallocates a new array increased by expand_size and then recopies the elements and updates max capacity.

Definition at line 343 of file Contracted_Symbolic_Module.f90.

◆ get_coeff_and_integral()

subroutine contracted_symbolic_module::get_coeff_and_integral ( class(contractedsymbolicelementvector), intent(in)  this,
integer, intent(in)  idx,
real(wp), dimension(this % num_states_1, this % num_states_2), intent(out)  coeff,
integer(longint), dimension(2), intent(out)  label 
)
private

Get both label and coeffcient at specific index.

Authors
A Al-Refaie
Date
2017

Definition at line 648 of file Contracted_Symbolic_Module.f90.

◆ get_coefficient()

real(wp) function contracted_symbolic_module::get_coefficient ( class(contractedsymbolicelementvector this,
integer, intent(in)  idx,
integer, intent(in)  n1,
integer, intent(in)  n2 
)
private

Get coefficient at specific index.

Authors
A Al-Refaie
Date
2017

Definition at line 634 of file Contracted_Symbolic_Module.f90.

◆ get_integral_label()

integer(longint) function, dimension(2) contracted_symbolic_module::get_integral_label ( class(contractedsymbolicelementvector this,
integer, intent(in)  idx 
)
private

Get integral label at specific index.

Authors
A Al-Refaie
Date
2017

Definition at line 620 of file Contracted_Symbolic_Module.f90.

◆ get_num_targets_sym1()

integer function contracted_symbolic_module::get_num_targets_sym1 ( class(contractedsymbolicelementvector this)
private

Definition at line 672 of file Contracted_Symbolic_Module.f90.

◆ get_num_targets_sym2()

integer function contracted_symbolic_module::get_num_targets_sym2 ( class(contractedsymbolicelementvector this)
private

Definition at line 678 of file Contracted_Symbolic_Module.f90.

◆ get_size()

integer function contracted_symbolic_module::get_size ( class(contractedsymbolicelementvector this)
private

Returns the number of symbolic elements stored.

Authors
A Al-Refaie
Date
2017

Definition at line 666 of file Contracted_Symbolic_Module.f90.

◆ insert_ijklm_symbol()

subroutine contracted_symbolic_module::insert_ijklm_symbol ( class(contractedsymbolicelementvector this,
integer, intent(in)  i,
integer, intent(in)  j,
integer, intent(in)  k,
integer, intent(in)  l,
integer, intent(in)  m,
real(wp), dimension(this % num_states_1, this % num_states_2), intent(in)  coeffs,
logical, intent(in), optional  check_same_ 
)
private

Insert unpacked integral labels.

Authors
A Al-Refaie
Date
2017

Wraps insert_symbol by automatically packing.

Parameters
[in,out]thisVector object to update.
[in]i,j,k,lThe integral labels
[in]mPositron label
[in]coeffsThe integral coefficient
[in]check_same_Deprecated, orginally used to debug but now does nothing

Definition at line 261 of file Contracted_Symbolic_Module.f90.

◆ insert_symbol()

subroutine contracted_symbolic_module::insert_symbol ( class(contractedsymbolicelementvector this,
integer(longint), dimension(2), intent(in)  integral_label,
real(wp), dimension(this % num_states_1, this % num_states_2), intent(in)  coeffs,
logical, intent(in), optional  check_same_ 
)
private

Insert a packed integral symbol into the class.

Authors
A Al-Refaie
Date
2017

This subroutine is used to insert the integral into the class, it performs a check to see if it exists, if not then it will insert (and expand if needed) into the integral array. Otherwise it will simply add the coefficients to found integral index.

Parameters
[in,out]thisVector object to update.
[in]integral_labelPacked integral label
[in]coeffsThe integral coefficient
[in]check_same_Deprecated, orginally used to debug but now does nothing

Definition at line 295 of file Contracted_Symbolic_Module.f90.

◆ is_empty()

logical function contracted_symbolic_module::is_empty ( class(contractedsymbolicelementvector this)
private

Simply returns whether we are storing integrals and coeffs or not.

Authors
A Al-Refaie
Date
2017
Returns
True if empty or False if we have any symbols

Definition at line 585 of file Contracted_Symbolic_Module.f90.

◆ modify_coeff()

subroutine contracted_symbolic_module::modify_coeff ( class(contractedsymbolicelementvector this,
integer, intent(in)  idx,
real(wp)  coeff 
)
private

Definition at line 608 of file Contracted_Symbolic_Module.f90.

◆ print_symbols()

subroutine contracted_symbolic_module::print_symbols ( class(contractedsymbolicelementvector this)
private

Print currently stored symbols.

Authors
A Al-Refaie
Date
2017

Definition at line 711 of file Contracted_Symbolic_Module.f90.

◆ reduce_symbols()

subroutine contracted_symbolic_module::reduce_symbols ( class(contractedsymbolicelementvector this,
class(contractedsymbolicelementvector), intent(in)  rhs 
)
private

Definition at line 429 of file Contracted_Symbolic_Module.f90.

◆ remove_symbol_at()

subroutine contracted_symbolic_module::remove_symbol_at ( class(contractedsymbolicelementvector this,
integer, intent(in)  idx 
)
private

Removes an integral and coefficient, never been used and pretty much useless.

Authors
A Al-Refaie
Date
2017

Definition at line 560 of file Contracted_Symbolic_Module.f90.

◆ synchronize_symbols()

subroutine contracted_symbolic_module::synchronize_symbols ( class(contractedsymbolicelementvector this)
private

Definition at line 443 of file Contracted_Symbolic_Module.f90.

◆ synchronize_symbols_ii()

subroutine contracted_symbolic_module::synchronize_symbols_ii ( class(contractedsymbolicelementvector), target  this)
private

Definition at line 513 of file Contracted_Symbolic_Module.f90.

Variable Documentation

◆ to_be_synched

class(contractedsymbolicelementvector), pointer contracted_symbolic_module::to_be_synched
private

Definition at line 110 of file Contracted_Symbolic_Module.f90.