Implementation for sparsely stored 6-index objects
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
procedure(lMatInd_t), | public, | nopass, pointer | :: | indexFunc | => | lMatIndSym | |
type(shared_array_real_t), | private | :: | nonzero_vals | ||||
type(index_rhash_t), | private | :: | htable |
Read in the 6-index integrals from disk and histogram the integrals. The file itself only has to store the nonzero integrals, either in ASCII or in HDF5 format. For conventions in the HDF5 format, please refer to the developer’s guide. @param[in] filename name of the integrals file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(lMat_t), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | filename |
Return the max. index appearing in this lMat_t (i.e. the number of 6-index integrals) @return size The number of 6-index integrals of this object, depending on the symmetry.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(lMat_t), | intent(in) | :: | this |
Generate a histogram of the 6-index integrals and write it to stdout
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(lMat_t), | intent(in) | :: | this |
Retrieve an element from the 6-index integrals stored in sparse format @param[in] index contiguous index of the element to be retrieved @return element value of the element with the given contiguous index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(in) | :: | this | |||
integer(kind=int64), | intent(in) | :: | index |
Set an element to the sparsely stored 6-index integrals. This requires the hash table to be set up and CANNOT be done once htable%finalize_setup has been called @param[in] index contiguous index of the element (not the one in the sparse array) @param[in] element new value of the element
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this | |||
integer(kind=int64), | intent(in) | :: | index | |||
real(kind=dp), | intent(in) | :: | element |
Allocate memory for the sparse storage of the 6-index integrals @param[in] size number of non-zero integrals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this | |||
integer(kind=int64), | intent(in) | :: | size |
Deallocate memory used for the sparse storage of the 6-index integrals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this |
Read the 6-index integrals from a file to sparse format @param[in] filename name of the file to read from
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this | |||
character(len=*), | intent(in) | :: | filename |
This is the operation to be performed for sparse storage on each block of data read from an hdf5 file both arguments may or may not be still allocated upon return. @param[in,out] indices chunk of indices read in from the file @param[in,out] entries chunk of corresponding values
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this | |||
integer(kind=int64), | intent(inout), | allocatable | :: | indices(:,:) | ||
integer(kind=int64), | intent(inout), | allocatable | :: | entries(:,:) |
Add the (combined) indices and the corresponding integral values to the sparse storage @param[in] indices chunk of combined 6-index values @param[in] entries corresponding values of the 6-index integrals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this | |||
integer(kind=int64), | intent(in) | :: | indices(:) | |||
integer(kind=int64), | intent(in) | :: | entries(:) |
Loop through a chunk of indices and count the number of hash conflicts. This is required for setting up the hash table @param[in] indices chunk combined 6-index values for the 6-index integrals
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(sparse_lMat_t), | intent(inout) | :: | this | |||
integer(kind=int64), | intent(in) | :: | indices(:) |
type, extends(lMat_t) :: sparse_lMat_t
private
! The values of the nonzero integrals
#ifdef CMPLX_
type(shared_array_cmplx_t) :: nonzero_vals
#else
type(shared_array_real_t) :: nonzero_vals
#endif
! read-only shared memory hash table
type(index_rhash_t) :: htable
contains
! Element getters/setters
procedure :: get_elem => get_elem_sparse
procedure, private :: set_elem => set_elem_sparse
! Allocation routines
procedure :: alloc => alloc_sparse
procedure :: safe_dealloc => dealloc_sparse
! I/O routines
procedure, private :: read_kernel => read_sparse
procedure, private :: read_op_hdf5 => read_op_sparse
! These are auxiliary internal I/O routines
procedure, private :: read_data
procedure, private :: count_conflicts
end type sparse_lMat_t