From e80c8d51ed35e46fc46b3aa199dc1f7ac5f6abb0 Mon Sep 17 00:00:00 2001 From: v1j4y Date: Mon, 25 Oct 2021 15:29:08 +0200 Subject: [PATCH] Added AO Normalization in trexio read. #41 --- org/qmckl_trexio.org | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/org/qmckl_trexio.org b/org/qmckl_trexio.org index 9662938..9faac75 100644 --- a/org/qmckl_trexio.org +++ b/org/qmckl_trexio.org @@ -704,6 +704,42 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file) } #+end_src +*** AO Normalization + #+begin_src c :tangle (eval c) + { + qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; + mem_info.size = ao_num * sizeof(double); + + double* ao_normalization = (double*) qmckl_malloc(context, mem_info); + + if (ao_normalization == NULL) { + return qmckl_failwith( context, + QMCKL_ALLOCATION_FAILED, + "qmckl_trexio_read_ao_normalization_X", + NULL); + } + + assert (ao_normalization != NULL); + + rcio = trexio_read_ao_normalization_64(file, ao_normalization); + if (rcio != TREXIO_SUCCESS) { + return qmckl_failwith( context, + QMCKL_FAILURE, + "trexio_read_ao_normalization", + trexio_string_of_error(rcio)); + } + + rc = qmckl_set_ao_basis_ao_factor(context, ao_normalization); + + qmckl_free(context, ao_normalization); + ao_normalization = NULL; + + if (rc != QMCKL_SUCCESS) + return rc; + } + #+end_src + + #+begin_src c :tangle (eval c) @@ -711,7 +747,6 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file) } #endif #+end_src - ** Molecular orbitals In this section we read the MO coefficients.