32 KiB
Slater Determinant
The slater deteminant is required for the calculation of the wavefunction, gradient, and derivatives. These quantities will be used to calculate the local Energy (\[E_L\]).
ψ(x) = det|ϕ₁(x₁)…ϕᵢ(yᵢ)…ϕₙ(xₙ)|
The above slater-matrix is also required and is denoted by Dᵢⱼ(x) such that:
ψ(x) = det|Dᵢⱼ(x)|
We also require the inverse of the slater-matrix which is denoted by D⁻¹ᵢⱼ(x). Using this notation, the acceptance probability which is proportional to ψ(y)/ψ(x) can be calculated as follows:
ψ(yᵢ)/ψ(xᵢ) = ∑ⱼDᵢⱼ(y)D⁻¹ⱼᵢ(x)
Concerning the gradient and laplacian, in fact what is actually calculated is the ratio of the gradient/laplacian and the determinant of the slater matrix:
∇ψ(x)/ψ(x)
and
∇²ψ(x)/ψ(x)
This avoids the unnecessary multiplication and division of by the determinant ψ(x).
Context
The following arrays are stored in the context:
type |
char |
α ('A' ) or β ('B' ) determinant |
walk_num |
int64_t |
Number of walkers |
det_num |
int64_t |
Number of determinants per walker |
fermi_num |
int64_t |
Number of number of fermions |
mo_index_list |
mo_index[walk_num][det_num] |
Index of MOs for each walker |
Computed data:
det_value_list |
[walk_num][det_num] |
The slater matrix for each determinant of each walker. |
det_value_list_date |
int64_t |
The slater matrix for each determinant of each walker. |
det_adj_matrix_list |
[walk_num][det_num][fermi_num][fermi_num] |
Adjoint of the slater matrix for each determinant of each walker. |
det_adj_matrix_list_date |
int64_t |
Adjoint of the slater matrix for each determinant of each walker. |
det_vgl |
[5][walk_num][det_num][fermi_num][fermi_num] |
Value, gradients, Laplacian of Dᵢⱼ(x) at electron positions |
det_vgl_date |
int64_t |
Late modification date of Value, gradients, Laplacian of the MOs at electron positions |
det_inv_matrix_list |
[walk_num][det_num][fermi_num][fermi_num] |
Inverse of the slater matrix for each determinant of each walker. |
det_inv_matrix_list_date |
int64_t |
Inverse of the slater matrix for each determinant of each walker. |
Data structure
typedef struct qmckl_determinant_struct {
char type;
int64_t walk_num;
int64_t det_num;
int64_t fermi_num;
int64_t* mo_index_list;
double * det_matrix_list;
double * det_adj_matrix_list;
double * det_inv_matrix_list;
double * det_vgl;
int64_t det_matrix_list_date;
int64_t det_adj_matrix_list_date;
int64_t det_inv_matrix_list_date;
int64_t det_vgl_date;
int32_t uninitialized;
bool provided;
} qmckl_determinant_struct;
The uninitialized
integer contains one bit set to one for each
initialization function which has not been called. It becomes equal
to zero after all initialization functions have been called. The
struct is then initialized and provided == true
.
Some values are initialized by default, and are not concerned by
this mechanism.
Access functions
When all the data for the slater determinants have been provided, the following
function returns true
.
bool qmckl_determinant_provided (const qmckl_context context);
#+NAME:post
Initialization functions
To set the basis set, all the following functions need to be called.
qmckl_exit_code qmckl_set_determinant_type (const qmckl_context context, const char *t);
qmckl_exit_code qmckl_set_determinant_walk_num (const qmckl_context context, const int64_t walk_num);
qmckl_exit_code qmckl_set_determinant_det_num (const qmckl_context context, const int64_t det_num);
qmckl_exit_code qmckl_set_determinant_fermi_num (const qmckl_context context, const int64_t fermi_num);
qmckl_exit_code qmckl_set_determinant_mo_index_list (const qmckl_context context, const int64_t* mo_index_list);
#+NAME:pre2
#+NAME:post2
When the basis set is completely entered, other data structures are computed to accelerate the calculations.
Fortran Interfaces
Test
Computation
Determinant matrix
Get
qmckl_context |
context |
in | Global state |
double |
det_inv_list[5][walk_num][det_num] |
out | Value, gradients and Laplacian of the MOs |
qmckl_exit_code qmckl_get_determinant_det_inv_list(qmckl_context context, double* const det_inv_list);
qmckl_exit_code qmckl_compute_get_determinant_vgl (
const qmckl_context context,
double* const det_vgl );
Provide
Compute
qmckl_context |
context |
in | Global state |
int64_t |
walk_num |
in | Number of walkers |
int64_t |
fermi_num |
in | Number of electrons |
int64_t |
mo_index_list[fermi_num] |
in | Number of electrons |
int64_t |
mo_num |
in | Number of MOs |
double |
mo_vgl[5][walk_num][fermi_num][mo_num] |
in | Value, gradients and Laplacian of the MOs |
double |
det_vgl[5][walk_num][fermi_num][fermi_num] |
out | Value, gradients and Laplacian of the Det |
integer function qmckl_compute_det_vgl_f(context, &
walk_num, fermi_num, mo_index_list, mo_num, mo_vgl, det_vgl) &
result(info)
use qmckl
implicit none
integer(qmckl_context) , intent(in) :: context
integer*8, intent(in) :: walk_num
integer*8, intent(in) :: fermi_num
integer*8, intent(in) :: mo_num
integer*8, intent(in) :: mo_index_list(fermi_num)
double precision, intent(in) :: mo_vgl(mo_num, fermi_num, walk_num, 5)
double precision, intent(inout) :: det_vgl(fermi_num, fermi_num, walk_num, 5)
integer*8 :: iwalk, ielec, mo_id, imo
info = QMCKL_SUCCESS
if (context == QMCKL_NULL_CONTEXT) then
info = QMCKL_INVALID_CONTEXT
return
endif
if (walk_num <= 0) then
info = QMCKL_INVALID_ARG_2
return
endif
if (fermi_num <= 0) then
info = QMCKL_INVALID_ARG_3
return
endif
do iwalk = 1, walk_num
do ielec = 1, fermi_num
do imo = 1, fermi_num
mo_id = mo_index_list(imo)
! Value
det_vgl(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 1)
! Grad_x
det_vgl(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 2)
! Grad_y
det_vgl(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 3)
! Grad_z
det_vgl(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 4)
! Lap
det_vgl(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 5)
end do
end do
end do
end function qmckl_compute_det_vgl_f
qmckl_exit_code qmckl_compute_det_vgl (
const qmckl_context context,
const int64_t walk_num,
const int64_t fermi_num,
const int64_t* mo_index_list,
const int64_t mo_num,
const double* mo_vgl,
double* const det_vgl );
Test
Inverse of Determinant matrix
Get
qmckl_context |
context |
in | Global state |
double |
det_inv_matrix_list[5][walk_num][det_num] |
out | Value, gradients and Laplacian of the MOs |
qmckl_exit_code qmckl_get_det_inv_matrix(qmckl_context context, double* const det_inv_matrix);
qmckl_exit_code qmckl_compute_get_det_inv_matrix (
const qmckl_context context,
double* const det_inv_matrix_list );
Provide
Compute
qmckl_context |
context |
in | Global state |
int64_t |
walk_num |
in | Number of walkers |
int64_t |
fermi_num |
in | Number of electrons |
int64_t |
mo_index_list[fermi_num] |
in | Number of electrons |
int64_t |
mo_num |
in | Number of MOs |
double |
mo_vgl[5][walk_num][fermi_num][mo_num] |
in | Value, gradients and Laplacian of the MOs |
double |
det_inv_matrix_list[5][walk_num][fermi_num][fermi_num] |
out | Value, gradients and Laplacian of the Det |
integer function qmckl_compute_det_inv_matrix_f(context, &
walk_num, fermi_num, mo_index_list, mo_num, mo_vgl, det_inv_matrix_list) &
result(info)
use qmckl
implicit none
integer(qmckl_context) , intent(in) :: context
integer*8, intent(in) :: walk_num
integer*8, intent(in) :: fermi_num
integer*8, intent(in) :: mo_num
integer*8, intent(in) :: mo_index_list(fermi_num)
double precision, intent(in) :: mo_vgl(mo_num, fermi_num, walk_num, 5)
double precision, intent(inout) :: det_inv_matrix_list(fermi_num, fermi_num, walk_num, 5)
integer*8 :: iwalk, ielec, mo_id, imo
info = QMCKL_SUCCESS
if (context == QMCKL_NULL_CONTEXT) then
info = QMCKL_INVALID_CONTEXT
return
endif
if (walk_num <= 0) then
info = QMCKL_INVALID_ARG_2
return
endif
if (fermi_num <= 0) then
info = QMCKL_INVALID_ARG_3
return
endif
do iwalk = 1, walk_num
do ielec = 1, fermi_num
do imo = 1, fermi_num
mo_id = mo_index_list(imo)
! Value
det_inv_matrix_list(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 1)
end do
end do
end do
end function qmckl_compute_det_inv_matrix_f
qmckl_exit_code qmckl_compute_det_inv_matrix (
const qmckl_context context,
const int64_t walk_num,
const int64_t fermi_num,
const int64_t* mo_index_list,
const int64_t mo_num,
const double* mo_vgl,
double* const det_inv_matrix_list );