Skip to content

Commit

Permalink
documentation batch 3 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
neelravi authored Oct 2, 2024
1 parent 5f6a8ae commit e575acc
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 128 deletions.
12 changes: 6 additions & 6 deletions src/vmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ if (MPI_Fortran_FOUND)
lapack_wrapper.f90
main.f90
matinv.f90
new_parser_read_data.f90
read_trexio_data.f90
read_data_parser.f90
read_data_trexio.f90
fitting.f90
olbfgs.f90
optgeo_convcartzmat.f90
Expand All @@ -140,7 +140,7 @@ if (MPI_Fortran_FOUND)
)

set_property(
SOURCE new_parser_read_data.f90
SOURCE read_data_parser.f90
APPEND
PROPERTY COMPILE_DEFINITIONS
CMAKE_Fortran_COMPILER=\"${CMAKE_Fortran_COMPILER}\"
Expand All @@ -153,7 +153,7 @@ if (MPI_Fortran_FOUND)

set(ENABLE_GPU ${ENABLE_GPU} PARENT_SCOPE)
message (STATUS "GPU IS ENABLED")

set(ENABLE_TREXIO ${ENABLE_TREXIO} PARENT_SCOPE)
set(ENABLE_QMCKL ${ENABLE_QMCKL} PARENT_SCOPE)

Expand Down Expand Up @@ -194,8 +194,8 @@ if (MPI_Fortran_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/optgeo_convcartzmat.f90
${CMAKE_CURRENT_SOURCE_DIR}/optgeo_coords_int.f90
${CMAKE_CURRENT_SOURCE_DIR}/optgeo_hessian.f90
${CMAKE_CURRENT_SOURCE_DIR}/new_parser_read_data.f90
${CMAKE_CURRENT_SOURCE_DIR}/read_trexio_data.f90
${CMAKE_CURRENT_SOURCE_DIR}/read_data_parser.f90
${CMAKE_CURRENT_SOURCE_DIR}/read_data_trexio.f90
${CMAKE_CURRENT_SOURCE_DIR}/set_input_data.f90
${CMAKE_CURRENT_SOURCE_DIR}/pot_local.f90
${CMAKE_CURRENT_SOURCE_DIR}/pcm_3dgrid.f90
Expand Down
12 changes: 7 additions & 5 deletions src/vmc/basis_fns.f90
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
!> calculate the values of the basis functions and their derivatives
!> ider = 0 -> value
!> ider = 1 -> value, gradient
!> ider = 2 -> value, gradient, laplacian
!> ider = 3 -> value, gradient, laplacian, forces
module basis_fns_mod
contains
subroutine basis_fns(ie1,ie2,ncoord,rvec_en,r_en,ider)
! calculate the values of the basis functions and their derivatives
! ider = 0 -> value
! ider = 1 -> value, gradient
! ider = 2 -> value, gradient, laplacian
! ider = 3 -> value, gradient, laplacian, forces

use m_force_analytic, only: iforce_analy
use multiple_geo, only: iwf
Expand Down Expand Up @@ -229,6 +229,7 @@ subroutine basis_fns(ie1,ie2,ncoord,rvec_en,r_en,ider)
return
end
!-------------------------------------------------------------------
!> Calculates the wavefunction and its derivatives and laplacian
subroutine phi_combine(l,xc,ri,ri2,wfv,y,dy,ddy,ddy_lap,dlapy,phi,dphi,d2phi,d2phi_all,d3phi,ider)
use precision_kinds, only: dp
implicit none
Expand Down Expand Up @@ -310,6 +311,7 @@ subroutine phi_combine(l,xc,ri,ri2,wfv,y,dy,ddy,ddy_lap,dlapy,phi,dphi,d2phi,d2p
return
end
!-------------------------------------------------------------------
!> n0_inc subroutine
subroutine n0_inc(l,k,ic)

use phifun, only: dphin,n0_ibasis,n0_ic,n0_nbasis,phin
Expand Down
28 changes: 0 additions & 28 deletions src/vmc/commands.p2

This file was deleted.

65 changes: 31 additions & 34 deletions src/vmc/cuspexact4.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
!> The last 2 columns are what we care about in the foll. table
!>------------------------------------------------------------------------------
!> ord # of cumul. # terms # terms # 3-body Cumul. # Cumul # indep
!> terms # terms even t odd t terms 3-body terms 3-body terms
!> n (n+1)* (n^3+5n)/6 int((n+1)/2 nterms
!> (n+2)/2 +n^2+n *int((n+2)/2
!>------------------------------------------------------------------------------
!> 1 3 3 2 1 0 0 0
!> 2 6 9 4 2 2 2 0
!> 3 10 19 6 4 4 6 2
!> 4 15 34 9 6 7 13 7
!> 5 21 55 12 9 10 23 15
!> 6 28 83 16 12 14 37 27
!> 7 36 119 20 16 18 55 43
!>------------------------------------------------------------------------------
!>
!> Dependent coefs. fixed by e-e and e-n cusp conditions resp. are;
!> order: 2 3 4 5 6 7 2 3 4 5 6 7
!> coefs: 1 4 10 19 32 49 2 6 12 22 35 53
!>
!> So the terms varied for a 5th, 6th order polynomial are:
!> 3 5 7 8 9 11 13 14 15 16 17 18 20 21 23 (iwjasc(iparm),iparm=1,nparmc)
!> 3 5 7 8 9 11 13 14 15 16 17 18 20 21 23 24 25 26 27 28 29 30 31 33 34 36 37
!> (iwjasc(iparm),iparm=1,nparmc)
!>
!>
!> All the dependent variables, except one (the one from the 2nd order
!> e-n cusp) depend only on independent variables. On the other hand
!> the one from the 2nd order e-n cusp depends only on other dependent
!> variables.
!>@author Cyrus Umrigar
module cuspexact4_mod
contains
subroutine cuspexact4(iprin,iadiag)
! Written by Cyrus Umrigar
use cuspmat4, only: d,iwc4,nterms
use jastrow, only: c,nordc
use precision_kinds, only: dp
Expand All @@ -11,39 +41,6 @@ subroutine cuspexact4(iprin,iadiag)
integer :: i, iadiag, iprin, it, j
real(dp) :: sum



! The last 2 columns are what we care about in the foll. table
!------------------------------------------------------------------------------
! ord # of cumul. # terms # terms # 3-body Cumul. # Cumul # indep
! terms # terms even t odd t terms 3-body terms 3-body terms
! n (n+1)* (n^3+5n)/6 int((n+1)/2 nterms
! (n+2)/2 +n^2+n *int((n+2)/2
!------------------------------------------------------------------------------
! 1 3 3 2 1 0 0 0
! 2 6 9 4 2 2 2 0
! 3 10 19 6 4 4 6 2
! 4 15 34 9 6 7 13 7
! 5 21 55 12 9 10 23 15
! 6 28 83 16 12 14 37 27
! 7 36 119 20 16 18 55 43
!------------------------------------------------------------------------------

! Dependent coefs. fixed by e-e and e-n cusp conditions resp. are;
! order: 2 3 4 5 6 7 2 3 4 5 6 7
! coefs: 1 4 10 19 32 49 2 6 12 22 35 53

! So the terms varied for a 5th, 6th order polynomial are:
! 3 5 7 8 9 11 13 14 15 16 17 18 20 21 23 (iwjasc(iparm),iparm=1,nparmc)
! 3 5 7 8 9 11 13 14 15 16 17 18 20 21 23 24 25 26 27 28 29 30 31 33 34 36 37
! (iwjasc(iparm),iparm=1,nparmc)


! All the dependent variables, except one (the one from the 2nd order
! e-n cusp) depend only on independent variables. On the other hand
! the one from the 2nd order e-n cusp depends only on other dependent
! variables.

do it=1,nctype

! Set dep. variables from e-e cusp
Expand Down
22 changes: 11 additions & 11 deletions src/vmc/davidson_wrap.f90
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
!>----------------------------------------------------------------------------
!>
!> ... iterative solution of the eigenvalue problem:
!>
!> ... ( H - e S ) * v = 0
!>
!> ... where H is an hermitean operator, e is a real scalar,
!> ... S is an symmetric matrix, v is a real vector
!> ... (real wavefunctions with only half plane waves stored)
!>
module davidson_wrap_mod
contains
SUBROUTINE davidson_wrap(nparm, nparmx, nvec, nvecx, mvec, eigenvectors, ethr, &
eigenvalues, btype, notcnv, dav_iter, ipr, method)
!----------------------------------------------------------------------------
!
! ... iterative solution of the eigenvalue problem:
!
! ... ( H - e S ) * v = 0
!
! ... where H is an hermitean operator, e is a real scalar,
! ... S is an symmetric matrix, v is a real vector
! ... (real wavefunctions with only half plane waves stored)
!

use array_utils, only: eye,write_matrix,write_vector
use contrl_file, only: errunit,ounit
use davidson, only: davidson_parameters,fun_mtx_gemv,fun_stx_gemv
Expand All @@ -23,7 +24,6 @@ SUBROUTINE davidson_wrap(nparm, nparmx, nvec, nvecx, mvec, eigenvectors, ethr, &

IMPLICIT NONE


!> \param npram dimension of the matrix to be diagonalized
!> \param nparmx leading dimension of matrix eigenvectors
!> \param nvec integer number of searched low-lying roots
Expand Down
10 changes: 6 additions & 4 deletions src/vmc/dumper.f90
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
!> MPI version created by Claudia Filippi starting from serial version
!> routine to pick up and dump everything needed to restart
!> job where it left off
!> @author Claudia Filippi
module dumper_mod
! MPI version created by Claudia Filippi starting from serial version
! routine to pick up and dump everything needed to restart
! job where it left off

use config, only: xold
use contrl_file, only: ounit
use csfs, only: nstates
Expand Down Expand Up @@ -47,6 +47,7 @@ module dumper_mod
implicit none

contains
!> routine to dump everything needed to restart
subroutine dumper
implicit none
integer :: i, id, idfrom, idget, ierr
Expand Down Expand Up @@ -102,6 +103,7 @@ subroutine dumper
end subroutine

!-----------------------------------------------------------------------
!> routine to pick up everything needed to restart
subroutine startr
implicit none
integer :: i, id, idfrom, idget, ierr
Expand Down
5 changes: 4 additions & 1 deletion src/vmc/dumper_more.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module dumper_more_mod
!> Module to dump and restart data for a calculation
module dumper_more_mod

use basis, only: zex
use constants, only: hb
Expand Down Expand Up @@ -54,6 +55,7 @@ module dumper_more_mod
implicit none

contains
!> \brief Dumps the data to a file
subroutine dumper_more
implicit none
integer :: i, ib, ic, ifr, istate
Expand Down Expand Up @@ -118,6 +120,7 @@ subroutine dumper_more
end subroutine

!-----------------------------------------------------------------------
!> \brief Restarts the data from a file
subroutine startr_more
implicit none
integer :: i, ib, ic, ifr, istate
Expand Down
20 changes: 11 additions & 9 deletions src/vmc/ewald.f90
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,15 @@ subroutine set_ewald
end
!-----------------------------------------------------------------------

!> Written by Cyrus Umrigar
!> distcell(i) is the perpendicular distance between cell faces parallel
!> to the other 2 directions from i.
!> dist_min is the shortest of these three.
!> By choosing the range of the short-range part of the Ewald sums to be
!> <= half the shortest perpendicular distance we ensure that the short-range
!> part has zero or one terms.
subroutine short_distance(vector,volume,dist_min,distcell)
! Written by Cyrus Umrigar
! distcell(i) is the perpendicular distance between cell faces parallel
! to the other 2 directions from i.
! dist_min is the shortest of these three.
! By choosing the range of the short-range part of the Ewald sums to be
! <= half the shortest perpendicular distance we ensure that the short-range
! part has zero or one terms.

use contrl_file, only: ounit
use precision_kinds, only: dp
implicit none
Expand Down Expand Up @@ -407,8 +408,9 @@ subroutine short_distance(vector,volume,dist_min,distcell)
end
!-----------------------------------------------------------------------

!> evaluates the cross-product of v1 and v2 and puts it in v3
!> @author Edgar Josue Landinez Borda
subroutine cross(v1,v2,v3)
! evaluates the cross-product of v1 and v2 and puts it in v3

use precision_kinds, only: dp
implicit none
Expand Down Expand Up @@ -1510,7 +1512,7 @@ subroutine dvlrange_ee(ngnorm,gnorm,igmult,cos_sum,sin_sum,dcos_g,dsin_g,ddcos_g
enddo
ddvl=ddvl+2*y(1)*(ddcos_g(ir,ivec)*cos_sum(1)+ddsin_g(ir,ivec)*sin_sum(1)+gnorm(1)*gnorm(1))
enddo

do k=2,ngnorm
do im=1,igmult(k)
ivec=ivec+1
Expand Down
11 changes: 6 additions & 5 deletions src/vmc/fitting.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!> Module for fitting methods.
module fitting_methods

implicit none
Expand All @@ -8,10 +9,10 @@ module fitting_methods
contains

subroutine exp_fit(x, y, n, a, b)
!! This subroutine takes an array of floating point numbers and fits them to
!! an exponential function in the form of y = a*exp(-b*x).
!! @Author: Ravindra Shinde
!! @Date: Tue May 18 13:54:00 EDT 2022
!> This subroutine takes an array of floating point numbers and fits them to
!> an exponential function in the form of y = a*exp(-b*x).
!> @author: Ravindra Shinde
!> @date: Tue May 18 13:54:00 EDT 2022
!> \param[in] x: Array of floating point numbers.
!> \param[in] y: Array of floating point numbers.
!> \param[in] n: Number of elements in x or y.
Expand Down Expand Up @@ -43,7 +44,7 @@ subroutine exp_fit(x, y, n, a, b)
xx_sum = 0.0

do i = 1, n

w(i) = log(dabs(y(i)))
x_sum = x_sum + x(i)
y_sum = y_sum + y(i)
Expand Down
15 changes: 7 additions & 8 deletions src/vmc/gauss.f90
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
module gauss_mod
contains
function gauss()
! Written by Cyrus Umrigar
!:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
! Generate a gaussian random number using Box-Mueller method.
! Rewrote inline function as a function so that there would be no ambiquity as to
! the order in which the 2 rannyu's are evaluated.
! Could generate 2 numbers for almost the same price, but for
! backward compatibility generate just 1.
!:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
!> @author Cyrus Umrigar
!>
!> Generate a gaussian random number using Box-Mueller method.
!> Rewrote inline function as a function so that there would be no ambiquity as to
!> the order in which the 2 rannyu's are evaluated.
!> Could generate 2 numbers for almost the same price, but for
!> backward compatibility generate just 1.
use constants, only: pi
use precision_kinds, only: dp
use random_mod, only: random_dp
Expand Down
1 change: 1 addition & 0 deletions src/vmc/get_norbterm.f90
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!> Module that computes the number of orbital parameters needed for the allocations of the arrays.
module get_norbterm_mod
contains
subroutine get_norbterm
Expand Down
11 changes: 8 additions & 3 deletions src/vmc/hpsi.f90
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
module hpsi_mod
contains
subroutine hpsi(coord,psid,psij,ekin,energy,ipass,ifr)

! Written by Cyrus Umrigar, modified by Claudia Filippi and A. Scemama
! modified by Claudio Amovilli and Franca Floris for PCM and QM-MMPOl
!> @author Cyrus Umrigar
!> @author Claudia Filippi
!> @author Anthony Scemama
!> @author Claudio Amovilli
!> @author Franca Floris
!>
!> Written by Cyrus Umrigar, modified by Claudia Filippi and A. Scemama
!> modified by Claudio Amovilli and Franca Floris for PCM and QM-MMPOl

use Bloc, only: tildem,tildemkin,b,bkin
use casula, only: i_vpsp,t_vpsp
Expand Down
Loading

0 comments on commit e575acc

Please sign in to comment.