From 745317f3f16f1359c7cfd9bc25d29d82a26b9f46 Mon Sep 17 00:00:00 2001 From: q-posev <45995097+q-posev@users.noreply.github.com> Date: Mon, 23 May 2022 14:15:52 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20TREX-CoE?= =?UTF-8?q?/trexio@9186a9493f1e5dbf849b6cd32982f375dc05d906=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.html | 4 +- examples.html | 82 +++--- index.html | 4 +- templator_front.html | 612 +++++++++++++++++++++++-------------------- templator_hdf5.html | 70 ++--- templator_text.html | 88 +++---- trex.html | 134 +++++----- 7 files changed, 526 insertions(+), 468 deletions(-) diff --git a/README.html b/README.html index 3889a1a..0aef40e 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +program print_energy @@ -411,8 +411,8 @@ One needs to read from the TREXIO file:
integer :: i, j, k, l, m @@ -427,8 +427,8 @@ One needs to read from the TREXIO file:
call getarg(1, filename) @@ -444,8 +444,8 @@ f = trexio_open (filename, 'r', TREXIO_HDF5
rc = trexio_read_nucleus_repulsion(f, E_nn)
@@ -459,8 +459,8 @@ f = trexio_open (filename, 'r', TREXIO_HDF5
rc = trexio_read_mo_num(f, n)
@@ -474,8 +474,8 @@ f = trexio_open (filename, 'r', TREXIO_HDF5
allocate( D(n,n), h0(n,n) )
@@ -487,8 +487,8 @@ W(:,:,:,:) = 0.d0
rc = trexio_has_mo_1e_int_core_hamiltonian(f) @@ -520,8 +520,8 @@ rc = trexio_read_rdm_1e(f, D)
Reading is done with OpenMP. Each thread reads its own buffer, and @@ -537,8 +537,8 @@ to be protected in the critical section when modified.
rc = trexio_has_mo_2e_int_eri(f) @@ -587,8 +587,8 @@ icount = BUFSIZE
rc = trexio_has_rdm_2e(f) @@ -632,8 +632,8 @@ icount = bufsize
When the orbitals are real, we can use @@ -679,8 +679,8 @@ E = E + E_nn
deallocate( D, h0, G, W )
@@ -695,7 +695,7 @@ E = E + E_nn
stdint.h
Memory allocation of structures can be facilitated by using the @@ -551,8 +551,8 @@ The maximum string size for the filenames is 4096 characters.
All calls to TREXIO are thread-safe. @@ -560,10 +560,10 @@ TREXIO front end is modular, which simplifies implementation of new back ends.
trexio_exit_code
@@ -6061,8 +6061,8 @@ This section concerns API calls related to Slater determinants.
The Fortran
templates that provide an access to the C
API calls from Fortran.
@@ -6219,8 +6219,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
def write_determinant_list(trexio_file: File, offset_file: int, buffer_size: int, determinants: list) -> None:
@@ -6564,8 +6564,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
This section contains general helper functions like trexio_info
.
@@ -6599,8 +6599,8 @@ of the determinant and returns two list of orbitals each corresponding to a diff
trexio_exit_code trexio_info(void); @@ -6681,7 +6681,7 @@ of the determinant and returns two list of orbitals each corresponding to a diff pos = trailz(tmp); if (pos < 0) return TREXIO_FAILURE; - list[k] = ( (int32_t) pos) + shift; + list[k] = ( (int32_t) pos) + shift - 1; tmp ^= ( ((bitfield_t) 1) << pos); k++; } @@ -6795,8 +6795,8 @@ of the determinant and returns two list of orbitals each corresponding to a diff
interface @@ -6810,35 +6810,39 @@ of the determinant and returns two list of orbitals each corresponding to a diff-interface - integer(trexio_exit_code) function trexio_to_orbital_list_up_dn(N_int, d1, list_up, list_dn, occ_num_up, occ_num_dn) bind(C) +interface - integer(trexio_exit_code) function trexio_to_orbital_list(N_int, d1, list, occupied_num) bind(C) + integer(trexio_exit_code) function trexio_to_orbital_list_c(N_int, d1, list, occupied_num) bind(C, name="trexio_to_orbital_list") use, intrinsic :: iso_c_binding import integer(c_int32_t), intent(in), value :: N_int integer(c_int64_t), intent(in) :: d1(*) - integer(c_int32_t), intent(out) :: list(*) + integer(c_int32_t), intent(inout) :: list(*) integer(c_int32_t), intent(inout) :: occupied_num - end function trexio_to_orbital_list + end function trexio_to_orbital_list_c end interface +++interface + integer(trexio_exit_code) function trexio_to_orbital_list_up_dn_c(N_int, d1, list_up, list_dn, occ_num_up, occ_num_dn) & + bind(C, name="trexio_to_orbital_list_up_dn") use, intrinsic :: iso_c_binding import integer(c_int32_t), intent(in), value :: N_int integer(c_int64_t), intent(in) :: d1(*) - integer(c_int32_t), intent(out) :: list_up(*) - integer(c_int32_t), intent(out) :: list_dn(*) + integer(c_int32_t), intent(inout) :: list_up(*) + integer(c_int32_t), intent(inout) :: list_dn(*) integer(c_int32_t), intent(inout) :: occ_num_up integer(c_int32_t), intent(inout) :: occ_num_dn - end function trexio_to_orbital_list_up_dn + end function trexio_to_orbital_list_up_dn_c end interface
def info(): @@ -6914,8 +6918,8 @@ of the determinant and returns two list of orbitals each corresponding to a diff
The function below adapts the original C-based trexio_open
for Fortran.
@@ -6966,7 +6970,61 @@ Note, that Fortran interface calls the main TREXIO
API, which is wr
filename_c = trim(filename) // c_null_char
trexio_inquire = trexio_inquire_c(filename_c)
end function trexio_inquire
+
+
+The subrotine below wrap the to_orbital_list
functions to shift the MO indices
+by 1 since in Fortran arrays are 1-based and C/Python they are 0-based.
+
integer(trexio_exit_code) function trexio_to_orbital_list(N_int, d1, list, occupied_num) + use, intrinsic :: iso_c_binding + implicit none + + integer(c_int32_t), intent(in), value :: N_int + integer(c_int64_t), intent(in) :: d1(*) + integer(c_int32_t), intent(out) :: list(*) + integer(c_int32_t), intent(out) :: occupied_num + + integer :: i + + trexio_to_orbital_list = trexio_to_orbital_list_c(N_int, d1, list, occupied_num) + if (trexio_to_orbital_list /= TREXIO_SUCCESS) then + return + endif + + do i = 1,occupied_num + list(i) = list(i) + 1 + enddo +end function trexio_to_orbital_list + + +integer(trexio_exit_code) function trexio_to_orbital_list_up_dn(N_int, d1, list_up, list_dn, occ_num_up, occ_num_dn) + use, intrinsic :: iso_c_binding + implicit none + integer(c_int32_t), intent(in), value :: N_int + integer(c_int64_t), intent(in) :: d1(*) + integer(c_int32_t), intent(out) :: list_up(*) + integer(c_int32_t), intent(out) :: list_dn(*) + integer(c_int32_t), intent(out) :: occ_num_up + integer(c_int32_t), intent(out) :: occ_num_dn + + integer :: i + + trexio_to_orbital_list_up_dn = trexio_to_orbital_list_up_dn_c(N_int, d1, list_up, list_dn, occ_num_up, occ_num_dn) + if (trexio_to_orbital_list_up_dn /= TREXIO_SUCCESS) then + return + endif + + do i = 1,occ_num_up + list_up(i) = list_up(i) + 1 + enddo + do i = 1,occ_num_dn + list_dn(i) = list_dn(i) + 1 + enddo +end function trexio_to_orbital_list_up_dn
assert
statement pass.
#define $GROUP$_GROUP_NAME "$group$" @@ -339,8 +339,8 @@ for the JavaScript code in this tag.
Polymorphism of the trexio_t
type is handled by ensuring that the
@@ -360,8 +360,8 @@ corresponding types for all back ends can be safely casted to
trexio_exit_code
@@ -466,8 +466,8 @@ corresponding types for all back ends can be safely casted to
trexio_exit_code
@@ -571,8 +571,8 @@ corresponding types for all back ends can be safely casted to
trexio_exit_code
@@ -706,8 +706,8 @@ corresponding types for all back ends can be safely casted to
Sparse data is stored using extensible datasets of HDF5. Extensibility is required @@ -910,8 +910,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
trexio_exit_code
@@ -1109,8 +1109,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
trexio_exit_code
@@ -1237,8 +1237,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
Note: in early versions of the HDF5 library (v < 1.10) unlinking an object was not working as expected
@@ -1278,8 +1278,8 @@ Thus, any corrupted/lost file space will remain in the first file. The use of
Each array is stored in a separate HDF5 dataset due to the fact that determinant I/O has to be decoupled. @@ -1532,8 +1532,8 @@ Size specifies the number of data items (e.g. determinants) to process.
trexio_exit_code
@@ -1796,7 +1796,7 @@ Size specifies the number of data items (e.g. determinants) to process.
typedef struct $group$_s { @@ -366,8 +366,8 @@ The file is written when closed, or when the flush function is called.
Polymorphism of the trexio_t
type is handled by ensuring that the
@@ -387,8 +387,8 @@ corresponding types for all back ends can be safely casted to
trexio_exit_code
@@ -531,8 +531,8 @@ corresponding types for all back ends can be safely casted to
trexio_exit_code
@@ -554,8 +554,8 @@ corresponding types for all back ends can be safely casted to
$group$_t* @@ -779,8 +779,8 @@ trexio_text_read_$group$ (trexio_text_t*
trexio_exit_code @@ -844,8 +844,8 @@ trexio_text_read_$group$ (trexio_text_t*
Memory is allocated when reading. The following function frees memory.
@@ -914,8 +914,8 @@ This function is called upon the non-successful exit from the trexio_text_
trexio_exit_code
@@ -978,8 +978,8 @@ This function is called upon the non-successful exit from the trexio_text_
The group_dset
array is assumed allocated with the appropriate size.
@@ -1075,8 +1075,8 @@ The group_dset
array is assumed allocated with the appropriate size
The group_dset
array is assumed allocated with the appropriate size.
@@ -1177,8 +1177,8 @@ The group_dset
array is assumed allocated with the appropriate size
trexio_exit_code
@@ -1252,8 +1252,8 @@ The group_dset
array is assumed allocated with the appropriate size
Each sparse array is stored in a separate .txt
file due to the fact that sparse I/O has to be decoupled
@@ -1526,8 +1526,8 @@ User provides indices and values of the sparse array as two separate variables.
trexio_exit_code
@@ -1555,8 +1555,8 @@ User provides indices and values of the sparse array as two separate variables.
Each array is stored in a separate .txt
file due to the fact that determinant I/O has to be decoupled
@@ -1960,7 +1960,7 @@ Size specifies the number of data items, e.g. determinants.
As we expect our files to be archived in open-data repositories, we @@ -422,7 +422,7 @@ which have participated to the creation of the file, a list of authors of the file, and a textual description.
-