10
1
mirror of https://gitlab.com/scemama/qmcchem.git synced 2024-11-07 06:33:38 +01:00

added context

This commit is contained in:
Anthony Scemama 2021-09-23 15:50:50 +02:00
parent 7591af6ca9
commit b33952fcec

View File

@ -0,0 +1,56 @@
BEGIN_PROVIDER [ integer*8, qmckl_ctx ]
use qmckl
implicit none
BEGIN_DOC
! Context for the QMCKL library
END_DOC
qmckl_ctx = qmckl_context_create()
integer :: rc
! Nuclei
rc = 0
rc = rc + qmckl_set_nucleus_num (qmckl_ctx, int(nucl_num,8))
rc = rc + qmckl_set_nucleus_coord (qmckl_ctx, 'T', dble(nucl_coord(1:nucl_num,1:3)))
rc = rc + qmckl_set_nucleus_charge(qmckl_ctx, dble(nucl_charge))
if (rc /= QMCKL_SUCCESS) stop -1
rc = rc + qmckl_set_nucleus_num (qmckl_ctx, int(nucl_num,8))
rc = rc + qmckl_set_nucleus_coord (qmckl_ctx, 'T', dble(nucl_coord(1:nucl_num,1:3)))
rc = rc + qmckl_set_nucleus_charge(qmckl_ctx, dble(nucl_charge))
if (rc /= QMCKL_SUCCESS) stop -1
! Basis
rc = rc + qmckl_set_ao_basis_type(qmckl_ctx, 'G')
rc = rc + qmckl_set_ao_basis_shell_num(qmckl_ctx, shell_num)
rc = rc + qmckl_set_ao_basis_prim_num(qmckl_ctx, prim_num)
rc = rc + qmckl_set_ao_basis_nucleus_index(qmckl_ctx, nucleus_index-1_8)
rc = rc + qmckl_set_ao_basis_nucleus_shell_num(qmckl_ctx, nucleus_shell_num)
rc = rc + qmckl_set_ao_basis_shell_ang_mom(qmckl_ctx, shell_ang_mom)
rc = rc + qmckl_set_ao_basis_shell_prim_num(qmckl_ctx, shell_prim_num)
rc = rc + qmckl_set_ao_basis_shell_prim_index(qmckl_ctx, shell_prim_index-1_8)
rc = rc + qmckl_set_ao_basis_shell_factor(qmckl_ctx, shell_factor)
rc = rc + qmckl_set_ao_basis_exponent(qmckl_ctx, prim_expo)
rc = rc + qmckl_set_ao_basis_coefficient(qmckl_ctx, prim_coef)
rc = rc + qmckl_set_ao_basis_prim_factor(qmckl_ctx, prim_factor)
rc = rc + qmckl_set_ao_basis_ao_num(qmckl_ctx, int(ao_num,8))
rc = rc + qmckl_set_ao_basis_ao_factor(qmckl_ctx, ao_factor)
if (rc /= QMCKL_SUCCESS) stop -2
! Electrons
rc = rc + qmckl_set_electron_num(qmckl_ctx, int(elec_alpha_num,8), int(elec_beta_num,8))
rc = rc + qmckl_set_electron_walk_num(qmckl_ctx, int(walk_num,8))
rc = rc + qmckl_set_electron_coord(qmckl_ctx, 'T', dble(elec_coord_full(1:elec_num,1:3,1:walk_num)))
if (rc /= QMCKL_SUCCESS) stop -3
ao_elec = 1
TOUCH ao_elec
END_PROVIDER
BEGIN_PROVIDER [ integer, qmckl_precision ]
use qmckl
implicit none
BEGIN_DOC
! Precision used in QMCKL
END_DOC
qmckl_precision = qmckl_get_numprec_precision(qmckl_ctx)
END_PROVIDER