mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-08 20:33:40 +01:00
Update qmckl_determinant
This commit is contained in:
parent
bd36ed0b48
commit
d248a53ffa
@ -841,16 +841,18 @@ qmckl_exit_code qmckl_provide_det_vgl_beta(qmckl_context context) {
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_compute_det_vgl_alpha_args
|
#+NAME: qmckl_compute_det_vgl_alpha_args
|
||||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
| Variable | Type | In/Out | Description |
|
||||||
| ~int64_t~ | ~det_num_alpha~ | in | Number of determinants |
|
|------------------+------------------------------------------------------------+--------+-------------------------------------------|
|
||||||
| ~int64_t~ | ~walk_num~ | in | Number of walkers |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~int64_t~ | ~alpha_num~ | in | Number of electrons |
|
| ~det_num_alpha~ | ~int64_t~ | in | Number of determinants |
|
||||||
| ~int64_t~ | ~beta_num~ | in | Number of electrons |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~int64_t~ | ~elec_num~ | in | Number of electrons |
|
| ~alpha_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~int64_t~ | ~mo_index_alpha[det_num_alpha][walk_num][alpha_num]~ | in | MO indices for electrons |
|
| ~beta_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~int64_t~ | ~mo_num~ | in | Number of MOs |
|
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~double~ | ~mo_vgl[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs |
|
| ~mo_index_alpha~ | ~int64_t[det_num_alpha][walk_num][alpha_num]~ | in | MO indices for electrons |
|
||||||
| ~double~ | ~det_vgl_alpha[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | out | Value, gradients and Laplacian of the Det |
|
| ~mo_num~ | ~int64_t~ | in | Number of MOs |
|
||||||
|
| ~mo_vgl~ | ~double[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs |
|
||||||
|
| ~det_vgl_alpha~ | ~double[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | out | Value, gradients and Laplacian of the Det |
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
integer function qmckl_compute_det_vgl_alpha_f(context, &
|
integer function qmckl_compute_det_vgl_alpha_f(context, &
|
||||||
@ -987,16 +989,18 @@ end function qmckl_compute_det_vgl_alpha_f
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_compute_det_vgl_beta_args
|
#+NAME: qmckl_compute_det_vgl_beta_args
|
||||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
| Variable | Type | In/Out | Description |
|
||||||
| ~int64_t~ | ~det_num_beta~ | in | Number of determinants |
|
|-----------------+---------------------------------------------------------+--------+-------------------------------------------|
|
||||||
| ~int64_t~ | ~walk_num~ | in | Number of walkers |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~int64_t~ | ~alpha_num~ | in | Number of electrons |
|
| ~det_num_beta~ | ~int64_t~ | in | Number of determinants |
|
||||||
| ~int64_t~ | ~beta_num~ | in | Number of electrons |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~int64_t~ | ~elec_num~ | in | Number of electrons |
|
| ~alpha_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~int64_t~ | ~mo_index_beta[det_num_beta][walk_num][beta_num]~ | in | Number of electrons |
|
| ~beta_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~int64_t~ | ~mo_num~ | in | Number of MOs |
|
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~double~ | ~mo_vgl[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs |
|
| ~mo_index_beta~ | ~int64_t[det_num_beta][walk_num][beta_num]~ | in | Number of electrons |
|
||||||
| ~double~ | ~det_vgl_beta[det_num_beta][walk_num][5][beta_num][beta_num]~ | out | Value, gradients and Laplacian of the Det |
|
| ~mo_num~ | ~int64_t~ | in | Number of MOs |
|
||||||
|
| ~mo_vgl~ | ~double[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs |
|
||||||
|
| ~det_vgl_beta~ | ~double[det_num_beta][walk_num][5][beta_num][beta_num]~ | out | Value, gradients and Laplacian of the Det |
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
integer function qmckl_compute_det_vgl_beta_f(context, &
|
integer function qmckl_compute_det_vgl_beta_f(context, &
|
||||||
@ -1761,14 +1765,16 @@ qmckl_exit_code qmckl_provide_det_inv_matrix_beta(qmckl_context context) {
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_det_inv_matrix_alpha_args
|
#+NAME: qmckl_det_inv_matrix_alpha_args
|
||||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
| Variable | Type | In/Out | Description |
|
||||||
| ~int64_t~ | ~det_num_alpha~ | in | Number of determinants |
|
|------------------------+------------------------------------------------------------+--------+--------------------------------------------------------------|
|
||||||
| ~int64_t~ | ~walk_num~ | in | Number of walkers |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~int64_t~ | ~alpha_num~ | in | Number of electrons |
|
| ~det_num_alpha~ | ~int64_t~ | in | Number of determinants |
|
||||||
| ~double~ | ~det_vgl_alpha[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~double~ | ~det_value_alpha[det_num_alpha][walk_num]~ | out | value of determinant matrix |
|
| ~alpha_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~double~ | ~det_adj_matrix_alpha[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | adjoint of determinant matrix |
|
| ~det_vgl_alpha~ | ~double[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs |
|
||||||
| ~double~ | ~det_inv_matrix_alpha[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | inverse of determinant matrix |
|
| ~det_value_alpha~ | ~double[det_num_alpha][walk_num]~ | out | value of determinant matrix |
|
||||||
|
| ~det_adj_matrix_alpha~ | ~double[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | adjoint of determinant matrix |
|
||||||
|
| ~det_inv_matrix_alpha~ | ~double[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | inverse of determinant matrix |
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
integer function qmckl_compute_det_inv_matrix_alpha_f(context, &
|
integer function qmckl_compute_det_inv_matrix_alpha_f(context, &
|
||||||
@ -1816,10 +1822,19 @@ integer function qmckl_compute_det_inv_matrix_alpha_f(context, &
|
|||||||
do idet = 1, det_num_alpha
|
do idet = 1, det_num_alpha
|
||||||
do iwalk = 1, walk_num
|
do iwalk = 1, walk_num
|
||||||
! Value
|
! Value
|
||||||
matA(1:alpha_num,1:alpha_num) = det_vgl_alpha(1:alpha_num, 1:alpha_num, 1, iwalk, idet)
|
matA(1:alpha_num,1:alpha_num) = &
|
||||||
res = qmckl_adjugate(context, alpha_num, LDA, matA, det_l)
|
det_vgl_alpha(1:alpha_num, 1:alpha_num, 1, iwalk, idet)
|
||||||
det_adj_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet) = matA
|
|
||||||
det_inv_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet) = matA/det_l
|
res = qmckl_adjugate(context, &
|
||||||
|
alpha_num, matA, LDA, &
|
||||||
|
det_adj_matrix_alpha(1, 1, iwalk, idet), &
|
||||||
|
int(size(det_adj_matrix_alpha,1),8), &
|
||||||
|
det_l)
|
||||||
|
|
||||||
|
det_inv_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet) = &
|
||||||
|
(1.d0/det_l) * &
|
||||||
|
det_adj_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet)
|
||||||
|
|
||||||
det_value_alpha(iwalk, idet) = det_l
|
det_value_alpha(iwalk, idet) = det_l
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
@ -1892,14 +1907,16 @@ end function qmckl_compute_det_inv_matrix_alpha_f
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_det_inv_matrix_beta_args
|
#+NAME: qmckl_det_inv_matrix_beta_args
|
||||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
| Variable | Type | In/Out | Description |
|
||||||
| ~int64_t~ | ~det_num_beta~ | in | Number of determinants |
|
|-----------------------+---------------------------------------------------------+--------+--------------------------------------------------------------|
|
||||||
| ~int64_t~ | ~walk_num~ | in | Number of walkers |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~int64_t~ | ~beta_num~ | in | Number of electrons |
|
| ~det_num_beta~ | ~int64_t~ | in | Number of determinants |
|
||||||
| ~double~ | ~det_vgl_beta[det_num_beta][walk_num][5][beta_num][beta_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~double~ | ~det_value_beta[det_num_beta][walk_num]~ | out | value of determinant matrix |
|
| ~beta_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~double~ | ~det_adj_matrix_beta[det_num_beta][walk_num][beta_num][beta_num]~ | out | adjoint of determinant matrix |
|
| ~det_vgl_beta~ | ~double[det_num_beta][walk_num][5][beta_num][beta_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs |
|
||||||
| ~double~ | ~det_inv_matrix_beta[det_num_beta][walk_num][beta_num][beta_num]~ | out | inverse of determinant matrix |
|
| ~det_value_beta~ | ~double[det_num_beta][walk_num]~ | out | value of determinant matrix |
|
||||||
|
| ~det_adj_matrix_beta~ | ~double[det_num_beta][walk_num][beta_num][beta_num]~ | out | adjoint of determinant matrix |
|
||||||
|
| ~det_inv_matrix_beta~ | ~double[det_num_beta][walk_num][beta_num][beta_num]~ | out | inverse of determinant matrix |
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
integer function qmckl_compute_det_inv_matrix_beta_f(context, &
|
integer function qmckl_compute_det_inv_matrix_beta_f(context, &
|
||||||
@ -1947,14 +1964,24 @@ integer function qmckl_compute_det_inv_matrix_beta_f(context, &
|
|||||||
do idet = 1, det_num_beta
|
do idet = 1, det_num_beta
|
||||||
do iwalk = 1, walk_num
|
do iwalk = 1, walk_num
|
||||||
! Value
|
! Value
|
||||||
matA(1:beta_num,1:beta_num) = det_vgl_beta(1:beta_num, 1:beta_num, 1, iwalk, idet)
|
matA(1:beta_num,1:beta_num) = &
|
||||||
res = qmckl_adjugate(context, beta_num, LDA, matA, det_l)
|
det_vgl_beta(1:beta_num, 1:beta_num, 1, iwalk, idet)
|
||||||
det_adj_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet) = matA
|
|
||||||
det_inv_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet) = matA/det_l
|
res = qmckl_adjugate(context, &
|
||||||
|
beta_num, matA, LDA, &
|
||||||
|
det_adj_matrix_beta(1, 1, iwalk, idet), &
|
||||||
|
int(size(det_adj_matrix_beta,1),8), &
|
||||||
|
det_l)
|
||||||
|
|
||||||
|
det_inv_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet) = &
|
||||||
|
(1.d0/det_l) * &
|
||||||
|
det_adj_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet)
|
||||||
|
|
||||||
det_value_beta(iwalk, idet) = det_l
|
det_value_beta(iwalk, idet) = det_l
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
|
|
||||||
deallocate(matA)
|
deallocate(matA)
|
||||||
end function qmckl_compute_det_inv_matrix_beta_f
|
end function qmckl_compute_det_inv_matrix_beta_f
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -2015,8 +2042,7 @@ end function qmckl_compute_det_inv_matrix_beta_f
|
|||||||
end function qmckl_compute_det_inv_matrix_beta
|
end function qmckl_compute_det_inv_matrix_beta
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
*** Test :noexport:
|
||||||
*** Test
|
|
||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
// Get adjoint of the slater-determinant
|
// Get adjoint of the slater-determinant
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user