MPI-SCATCI 2.0
An MPI version of SCATCI
Loading...
Searching...
No Matches
Contracted_Symbolic_module::ContractedSymbolicElementVector Type Reference

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

Inheritance diagram for Contracted_Symbolic_module::ContractedSymbolicElementVector:
Collaboration diagram for Contracted_Symbolic_module::ContractedSymbolicElementVector:

Public Member Functions

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

Public Attributes

real(wp), dimension(:,:,:), allocatable coeffs
 The coefficients of the integral.
integer n = 0
 Number of elements in the array of both the integral and coefficients.
logical constructed = .false.
 Whether this class has been constructed.
real(wp) threshold = 0.0
 The integral threshold.
integer num_states_1 = 0
integer num_states_2 = 0
integer max_capacity = 0
 The number of free slots in the array.
integer expand_size = 100
 How much we have to expand each.

Private Member Functions

procedure, private expand_array (this)
 This is the array expansion subroutine.
procedure, private check_bounds (this, i)
 Simply checks the index and wheter it exists within the array.
procedure, private check_constructed (this)
 A simple class to check if this has been properly constructed.
procedure, private synchronize_symbols_II synchronize_symbols_ii

Private Attributes

integer(longint), dimension(:,:), allocatable electron_integral
 The packed integral storage.

Detailed Description

This class handles the storage symbolic elements.

Authors
A Al-Refaie
Date
2017

This class handles the storage symbolic elements and also expands the vector size if we have reached max capacity Additionaly, uses a binary search tree to perform a binary search on integrals labels during insertion to ensure no repeating elements this is automatic and removes the compression stage in the original SCATCI code.

Definition at line 62 of file Contracted_Symbolic_Module.f90.

Member Function/Subroutine Documentation

◆ add_symbols()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::add_symbols ( class(contractedsymbolicelementvector) this,
class(symbolicelementvector), intent(in) rhs,
real(wp), dimension(this % num_states_1, this % num_states_2) alpha )

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 96 of file Contracted_Symbolic_Module.f90.

◆ check_bounds()

procedure, private Contracted_Symbolic_module::ContractedSymbolicElementVector::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 102 of file Contracted_Symbolic_Module.f90.

◆ check_constructed()

procedure, private Contracted_Symbolic_module::ContractedSymbolicElementVector::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 104 of file Contracted_Symbolic_Module.f90.

◆ check_same_integral()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::check_same_integral ( class(contractedsymbolicelementvector), intent(in) this,
integer(longint), dimension(nidx), intent(in), target integral,
integer, intent(out) idx )

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 86 of file Contracted_Symbolic_Module.f90.

◆ clear()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::clear ( class(contractedsymbolicelementvector) this)

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 85 of file Contracted_Symbolic_Module.f90.

◆ compare()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::compare ( class(contractedsymbolicelementvector), intent(in) this,
integer, intent(in) i,
integer, intent(in) j,
type(c_ptr), intent(in), optional data )

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 77 of file Contracted_Symbolic_Module.f90.

◆ construct()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::construct ( class(contractedsymbolicelementvector) this,
integer n1,
integer n2,
real(wp), intent(in), optional threshold,
integer, intent(in), optional initial_size )

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 80 of file Contracted_Symbolic_Module.f90.

◆ destroy()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::destroy ( class(contractedsymbolicelementvector) this)

Cleans up the class by deallocating arrays.

Authors
A Al-Refaie
Date
2017

Definition at line 103 of file Contracted_Symbolic_Module.f90.

◆ estimate_synchronize_cost()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::estimate_synchronize_cost ( class(contractedsymbolicelementvector) this)

Definition at line 89 of file Contracted_Symbolic_Module.f90.

◆ expand_array()

procedure, private Contracted_Symbolic_module::ContractedSymbolicElementVector::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 101 of file Contracted_Symbolic_Module.f90.

◆ get_coeff_and_integral()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::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(:), intent(out) label )

Get both label and coeffcient at specific index.

Authors
A Al-Refaie
Date
2017

Definition at line 92 of file Contracted_Symbolic_Module.f90.

◆ get_coefficient()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::get_coefficient ( class(contractedsymbolicelementvector) this,
integer, intent(in) idx,
integer, intent(in) n1,
integer, intent(in) n2 )

Get coefficient at specific index.

Authors
A Al-Refaie
Date
2017

Definition at line 91 of file Contracted_Symbolic_Module.f90.

◆ get_integral_label()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::get_integral_label ( class(contractedsymbolicelementvector) this,
integer, intent(in) idx )

Get integral label at specific index.

Authors
A Al-Refaie
Date
2017

Definition at line 87 of file Contracted_Symbolic_Module.f90.

◆ get_num_targets_sym1()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::get_num_targets_sym1 ( class(contractedsymbolicelementvector) this)

Definition at line 94 of file Contracted_Symbolic_Module.f90.

◆ get_num_targets_sym2()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::get_num_targets_sym2 ( class(contractedsymbolicelementvector) this)

Definition at line 95 of file Contracted_Symbolic_Module.f90.

◆ get_size()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::get_size ( class(contractedsymbolicelementvector) this)

Returns the number of symbolic elements stored.

Authors
A Al-Refaie
Date
2017

Definition at line 93 of file Contracted_Symbolic_Module.f90.

◆ insert_ijklm_symbol()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::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_ )

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 81 of file Contracted_Symbolic_Module.f90.

◆ insert_symbol()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::insert_symbol ( class(contractedsymbolicelementvector) this,
integer(longint), dimension(nidx), intent(in) integral_label,
real(wp), dimension(this % num_states_1, this % num_states_2), intent(in) coeffs,
logical, intent(in), optional check_same_ )

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 82 of file Contracted_Symbolic_Module.f90.

◆ is_empty()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::is_empty ( class(contractedsymbolicelementvector) this)

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 84 of file Contracted_Symbolic_Module.f90.

◆ modify_coeff()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::modify_coeff ( class(contractedsymbolicelementvector) this,
integer, intent(in) idx,
real(wp) coeff )

Definition at line 90 of file Contracted_Symbolic_Module.f90.

◆ print()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::print ( class(contractedsymbolicelementvector) this)

Print currently stored symbols.

Authors
A Al-Refaie
Date
2017

Definition at line 98 of file Contracted_Symbolic_Module.f90.

◆ reduce_symbols()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::reduce_symbols ( class(contractedsymbolicelementvector) this,
class(contractedsymbolicelementvector), intent(in) rhs )

Definition at line 97 of file Contracted_Symbolic_Module.f90.

◆ remove_symbol_at()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::remove_symbol_at ( class(contractedsymbolicelementvector) this,
integer, intent(in) idx )

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

Authors
A Al-Refaie
Date
2017

Definition at line 83 of file Contracted_Symbolic_Module.f90.

◆ synchronize_symbols()

procedure, public Contracted_Symbolic_module::ContractedSymbolicElementVector::synchronize_symbols ( class(contractedsymbolicelementvector) this)

Definition at line 88 of file Contracted_Symbolic_Module.f90.

◆ synchronize_symbols_II()

procedure, private Contracted_Symbolic_module::ContractedSymbolicElementVector::synchronize_symbols_II
private

Definition at line 105 of file Contracted_Symbolic_Module.f90.

Member Data Documentation

◆ coeffs

real(wp), dimension(:,:,:), allocatable Contracted_Symbolic_module::ContractedSymbolicElementVector::coeffs

The coefficients of the integral.

Definition at line 66 of file Contracted_Symbolic_Module.f90.

◆ constructed

logical Contracted_Symbolic_module::ContractedSymbolicElementVector::constructed = .false.

Whether this class has been constructed.

Definition at line 69 of file Contracted_Symbolic_Module.f90.

◆ electron_integral

integer(longint), dimension(:,:), allocatable Contracted_Symbolic_module::ContractedSymbolicElementVector::electron_integral
private

The packed integral storage.

Definition at line 65 of file Contracted_Symbolic_Module.f90.

◆ expand_size

integer Contracted_Symbolic_module::ContractedSymbolicElementVector::expand_size = 100

How much we have to expand each.

Definition at line 74 of file Contracted_Symbolic_Module.f90.

◆ max_capacity

integer Contracted_Symbolic_module::ContractedSymbolicElementVector::max_capacity = 0

The number of free slots in the array.

Definition at line 73 of file Contracted_Symbolic_Module.f90.

◆ n

integer Contracted_Symbolic_module::ContractedSymbolicElementVector::n = 0

Number of elements in the array of both the integral and coefficients.

Definition at line 68 of file Contracted_Symbolic_Module.f90.

◆ num_states_1

integer Contracted_Symbolic_module::ContractedSymbolicElementVector::num_states_1 = 0

Definition at line 71 of file Contracted_Symbolic_Module.f90.

◆ num_states_2

integer Contracted_Symbolic_module::ContractedSymbolicElementVector::num_states_2 = 0

Definition at line 72 of file Contracted_Symbolic_Module.f90.

◆ threshold

real(wp) Contracted_Symbolic_module::ContractedSymbolicElementVector::threshold = 0.0

The integral threshold.

Definition at line 70 of file Contracted_Symbolic_Module.f90.


The documentation for this type was generated from the following file: