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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(lMat_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | filename |
name of the integrals file |
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
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sparse_lMat_t), | intent(in) | :: | this | |||
| integer(kind=int64), | intent(in) | :: | index |
contiguous index of the element to be retrieved |
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
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sparse_lMat_t), | intent(inout) | :: | this | |||
| integer(kind=int64), | intent(in) | :: | index |
contiguous index of the element (not the one in the sparse array) |
||
| real(kind=dp), | intent(in) | :: | element |
new value of the element |
Allocate memory for the sparse storage of the 6-index integrals
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sparse_lMat_t), | intent(inout) | :: | this | |||
| integer(kind=int64), | intent(in) | :: | size |
number of non-zero integrals |
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
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(sparse_lMat_t), | intent(inout) | :: | this | |||
| character(len=*), | intent(in) | :: | filename |
name of the file to read from |
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.
| 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
| 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
| 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