mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 01:56:18 +01:00
Working on e-n cusp
This commit is contained in:
parent
4241461a20
commit
21336e0178
@ -2587,7 +2587,7 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
|
||||
/* ao_ang_mom */
|
||||
{
|
||||
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);
|
||||
|
||||
@ -2598,36 +2598,39 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
|
||||
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);
|
||||
|
||||
if (ctx->ao_basis.ao_ang_mom == NULL) {
|
||||
if (ctx->ao_basis.ao_nucl == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_ALLOCATION_FAILED,
|
||||
"ao_basis.ao_nucl",
|
||||
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;
|
||||
for (int64_t inucl=0 ; inucl<nucl_num ; ++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];
|
||||
for (int64_t ishell = ishell_start ; ishell < ishell_end ; ++ishell) {
|
||||
const int l = ctx->ao_basis.shell_ang_mom[ishell];
|
||||
const int mmax = l*(l+1)*(l+2)/6;
|
||||
const int64_t iprim_start = ctx->ao_basis.shell_prim_index[ishell];
|
||||
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++) {
|
||||
assert (l<32);
|
||||
for (int m=lstart[l] ; m < lstart[l+1]; m++) {
|
||||
ctx->ao_basis.ao_ang_mom[ao_idx] = l;
|
||||
ctx->ao_basis.ao_nucl[ao_idx] = inucl;
|
||||
++ao_idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert( ao_idx == ctx->ao_basis.ao_num );
|
||||
}
|
||||
|
||||
|
||||
/* Normalize coefficients */
|
||||
{
|
||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||
|
@ -1225,7 +1225,7 @@ qmckl_check(context, rc);
|
||||
|
||||
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);
|
||||
|
||||
assert(qmckl_mo_basis_provided(context));
|
||||
|
@ -697,7 +697,7 @@ assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
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(qmckl_mo_basis_provided(context));
|
||||
|
914
org/qmckl_mo.org
914
org/qmckl_mo.org
File diff suppressed because it is too large
Load Diff
@ -1030,7 +1030,7 @@ qmckl_trexio_read_mo_X(qmckl_context context, trexio_t* const file)
|
||||
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);
|
||||
mo_coef = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user