1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-11-03 20:54:09 +01:00

Working on e-n cusp

This commit is contained in:
Anthony Scemama 2023-03-14 14:59:14 +01:00
parent 4241461a20
commit 21336e0178
5 changed files with 864 additions and 77 deletions

View File

@ -2587,7 +2587,7 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
/* ao_ang_mom */ /* ao_ang_mom */
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = ctx->ao_basis.ao_num * sizeof(int64_t); mem_info.size = ctx->ao_basis.ao_num * sizeof(int32_t);
ctx->ao_basis.ao_ang_mom = (int32_t*) qmckl_malloc(context, mem_info); ctx->ao_basis.ao_ang_mom = (int32_t*) qmckl_malloc(context, mem_info);
@ -2598,36 +2598,39 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
NULL); NULL);
} }
mem_info = qmckl_memory_info_struct_zero;
mem_info.size = ctx->ao_basis.ao_num * sizeof(int64_t);
ctx->ao_basis.ao_nucl = (int64_t*) qmckl_malloc(context, mem_info); ctx->ao_basis.ao_nucl = (int64_t*) qmckl_malloc(context, mem_info);
if (ctx->ao_basis.ao_ang_mom == NULL) { if (ctx->ao_basis.ao_nucl == NULL) {
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED, QMCKL_ALLOCATION_FAILED,
"ao_basis.ao_nucl", "ao_basis.ao_nucl",
NULL); NULL);
} }
int64_t lstart[32];
for (int32_t l=0 ; l<32 ; ++l) {
lstart[l] = l*(l+1)*(l+2)/6;
}
int64_t ao_idx = 0; int64_t ao_idx = 0;
for (int64_t inucl=0 ; inucl<nucl_num ; ++inucl) { for (int64_t inucl=0 ; inucl<nucl_num ; ++inucl) {
const int64_t ishell_start = ctx->ao_basis.nucleus_index[inucl]; const int64_t ishell_start = ctx->ao_basis.nucleus_index[inucl];
const int64_t ishell_end = ctx->ao_basis.nucleus_index[inucl] + ctx->ao_basis.nucleus_shell_num[inucl]; const int64_t ishell_end = ctx->ao_basis.nucleus_index[inucl] + ctx->ao_basis.nucleus_shell_num[inucl];
for (int64_t ishell = ishell_start ; ishell < ishell_end ; ++ishell) { for (int64_t ishell = ishell_start ; ishell < ishell_end ; ++ishell) {
const int l = ctx->ao_basis.shell_ang_mom[ishell]; const int l = ctx->ao_basis.shell_ang_mom[ishell];
const int mmax = l*(l+1)*(l+2)/6; assert (l<32);
const int64_t iprim_start = ctx->ao_basis.shell_prim_index[ishell]; for (int m=lstart[l] ; m < lstart[l+1]; m++) {
const int64_t iprim_end = ctx->ao_basis.shell_prim_index[ishell] + ctx->ao_basis.shell_prim_num[ishell];
for (int64_t iprim = iprim_start ; iprim < iprim_end ; ++iprim) {
for (int m=0 ; m < mmax ; m++) {
ctx->ao_basis.ao_ang_mom[ao_idx] = l; ctx->ao_basis.ao_ang_mom[ao_idx] = l;
ctx->ao_basis.ao_nucl[ao_idx] = inucl; ctx->ao_basis.ao_nucl[ao_idx] = inucl;
++ao_idx; ++ao_idx;
} }
}
} }
} }
assert( ao_idx == ctx->ao_basis.ao_num );
} }
/* Normalize coefficients */ /* Normalize coefficients */
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;

View File

@ -1225,7 +1225,7 @@ qmckl_check(context, rc);
const double * mo_coefficient = &(chbrclf_mo_coef[0]); const double * mo_coefficient = &(chbrclf_mo_coef[0]);
rc = qmckl_set_mo_basis_coefficient(context, mo_coefficient); rc = qmckl_set_mo_basis_coefficient(context, mo_coefficient, chbrclf_mo_num*chbrclf_ao_num);
qmckl_check(context, rc); qmckl_check(context, rc);
assert(qmckl_mo_basis_provided(context)); assert(qmckl_mo_basis_provided(context));

View File

@ -697,7 +697,7 @@ assert (rc == QMCKL_SUCCESS);
const double * mo_coefficient = &(chbrclf_mo_coef[0]); const double * mo_coefficient = &(chbrclf_mo_coef[0]);
rc = qmckl_set_mo_basis_coefficient(context, mo_coefficient); rc = qmckl_set_mo_basis_coefficient(context, mo_coefficient, chbrclf_ao_num*chbrclf_mo_num);
assert (rc == QMCKL_SUCCESS); assert (rc == QMCKL_SUCCESS);
assert(qmckl_mo_basis_provided(context)); assert(qmckl_mo_basis_provided(context));

File diff suppressed because it is too large Load Diff

View File

@ -1030,7 +1030,7 @@ qmckl_trexio_read_mo_X(qmckl_context context, trexio_t* const file)
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_mo_basis_coefficient(context, mo_coef); rc = qmckl_set_mo_basis_coefficient(context, mo_coef, ao_num*mo_num);
qmckl_free(context, mo_coef); qmckl_free(context, mo_coef);
mo_coef = NULL; mo_coef = NULL;