From 1e12737e0ebc45818404df1a8c19f6e96639b1bd Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 26 May 2015 21:37:17 +0200 Subject: [PATCH] Changed pseudo_ao in EZFIO --- scripts/get_basis.sh | 2 + src/MRCC/README.rst | 45 ++++++++++++++ src/Pseudo/EZFIO.cfg | 14 +++-- src/QmcChem/README.rst | 33 +++++++++++ src/QmcChem/pot_ao_pseudo_ints.irp.f | 89 ++++++++++++++++++++++++---- src/QmcChem/pseudo.irp.f | 2 +- src/QmcChem/save_for_qmcchem.irp.f | 6 +- 7 files changed, 172 insertions(+), 19 deletions(-) diff --git a/scripts/get_basis.sh b/scripts/get_basis.sh index a2f07e4e..5db71852 100755 --- a/scripts/get_basis.sh +++ b/scripts/get_basis.sh @@ -51,5 +51,7 @@ then ${EMSL_API_ROOT}/EMSL_api.py get_basis_data --treat_l --save --path="${tmpfile}" --basis="${basis}" else ${EMSL_API_ROOT}/EMSL_api.py get_basis_data --save --path="${tmpfile}" --basis="${basis}" --db_path="${EMSL_API_ROOT}/db/Pseudo.db" +# echo ${EMSL_API_ROOT}/EMSL_api.py get_basis_data --save --path="${tmpfile}" --basis="${basis}" --db_path="${EMSL_API_ROOT}/db/Pseudo.db" 1>&2 +# echo $PWD/BASIS fi diff --git a/src/MRCC/README.rst b/src/MRCC/README.rst index ece272a1..091aa1b2 100644 --- a/src/MRCC/README.rst +++ b/src/MRCC/README.rst @@ -20,6 +20,51 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. +`davidson_diag_hjj_mrcc `_ + Davidson diagonalization with specific diagonal elements of the H matrix + .br + H_jj : specific diagonal H matrix elements to diagonalize de Davidson + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + iunit : Unit for the I/O + .br + Initial guess vectors are not necessarily orthonormal + +`davidson_diag_mrcc `_ + Davidson diagonalization. + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + iunit : Unit number for the I/O + .br + Initial guess vectors are not necessarily orthonormal + +`h_u_0_mrcc `_ + Computes v_0 = H|u_0> + .br + n : number of determinants + .br + H_jj : array of + `mrcc `_ Undocumented diff --git a/src/Pseudo/EZFIO.cfg b/src/Pseudo/EZFIO.cfg index bf3909d1..9804c807 100644 --- a/src/Pseudo/EZFIO.cfg +++ b/src/Pseudo/EZFIO.cfg @@ -59,19 +59,25 @@ default: False type: integer doc: Nb of points of the QMC grid interface: input -default: 100 +default: 1000 [pseudo_grid_rmax] type: double precision doc: R_maxof the QMC grid interface: input -default: 4.0 +default: 10.0 -[pseudo_grid] +[ao_pseudo_grid] type: double precision doc: QMC grid interface: output -size: (pseudo.pseudo_grid_size,ao_basis.ao_num,-pseudo.pseudo_lmax:pseudo.pseudo_lmax,0:pseudo.pseudo_lmax,nuclei.nucl_num) +size: (ao_basis.ao_num,-pseudo.pseudo_lmax:pseudo.pseudo_lmax,0:pseudo.pseudo_lmax,nuclei.nucl_num,pseudo.pseudo_grid_size) + +[mo_pseudo_grid] +type: double precision +doc: QMC grid +interface: output +size: (ao_basis.ao_num,-pseudo.pseudo_lmax:pseudo.pseudo_lmax,0:pseudo.pseudo_lmax,nuclei.nucl_num,pseudo.pseudo_grid_size) [pseudo_matrix] type: double precision diff --git a/src/QmcChem/README.rst b/src/QmcChem/README.rst index c4b467d7..8019accc 100644 --- a/src/QmcChem/README.rst +++ b/src/QmcChem/README.rst @@ -8,6 +8,39 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. +`ao_pseudo_grid `_ + Grid points for f(|r-r_A|) = \int Y_{lm}^{C} (|r-r_C|, \Omega_C) \chi_i^{A} (r-r_A) d\Omega_C + .br + + +`aux_pseudo_integral `_ + Pseudo-potential + +`aux_pseudo_integral_local `_ + Local pseudo-potential + +`aux_pseudo_integral_non_local `_ + Local pseudo-potential + +`mo_pseudo_grid `_ + Grid points for f(|r-r_A|) = \int Y_{lm}^{C} (|r-r_C|, \Omega_C) \phi_i^{A} (r-r_A) d\Omega_C + .br + + +`test_pseudo_grid `_ + Undocumented + +`pseudo_matrix `_ + Pseudo-potential expressed in the basis of ao products + +`write_pseudopotential `_ + Write the pseudo_potential into the EZFIO file + +`save_for_qmc `_ + Undocumented + Needed Modules diff --git a/src/QmcChem/pot_ao_pseudo_ints.irp.f b/src/QmcChem/pot_ao_pseudo_ints.irp.f index 24d75504..4e1f92c5 100644 --- a/src/QmcChem/pot_ao_pseudo_ints.irp.f +++ b/src/QmcChem/pot_ao_pseudo_ints.irp.f @@ -220,9 +220,9 @@ END_PROVIDER deallocate(n_kl_dump,v_kl_dump, dz_kl_dump) - END_PROVIDER +END_PROVIDER -BEGIN_PROVIDER [ double precision, pseudo_grid, (pseudo_grid_size,ao_num,-pseudo_lmax:pseudo_lmax,0:pseudo_lmax,nucl_num) ] +BEGIN_PROVIDER [ double precision, ao_pseudo_grid, (ao_num,-pseudo_lmax:pseudo_lmax,0:pseudo_lmax,nucl_num,pseudo_grid_size) ] implicit none BEGIN_DOC ! Grid points for f(|r-r_A|) = \int Y_{lm}^{C} (|r-r_C|, \Omega_C) \chi_i^{A} (r-r_A) d\Omega_C @@ -249,19 +249,19 @@ BEGIN_PROVIDER [ double precision, pseudo_grid, (pseudo_grid_size,ao_num,-pseudo r(j) = r(j-1) + dr enddo - pseudo_grid = 0.d0 - do k=1,nucl_num - c(1:3) = nucl_coord(k,1:3) - do l=0,pseudo_lmax - do i=1,ao_num - a(1:3) = nucl_coord(ao_nucl(i),1:3) - n_a(1:3) = ao_power(i,1:3) - do j=1,pseudo_grid_size + ao_pseudo_grid = 0.d0 + do j=1,pseudo_grid_size + do k=1,nucl_num + c(1:3) = nucl_coord(k,1:3) + do l=0,pseudo_lmax + do i=1,ao_num + a(1:3) = nucl_coord(ao_nucl(i),1:3) + n_a(1:3) = ao_power(i,1:3) do p=1,ao_prim_num(i) g_a = ao_expo_ordered_transp(p,i) do m=-l,l y = ylm_orb(l,m,c,a,n_a,g_a,r(j)) - pseudo_grid(j,i,m,l,k) = pseudo_grid(j,i,m,l,k) + & + ao_pseudo_grid(i,m,l,k,j) = ao_pseudo_grid(i,m,l,k,j) + & ao_coef_normalized_ordered_transp(p,i)*y enddo enddo @@ -273,3 +273,70 @@ BEGIN_PROVIDER [ double precision, pseudo_grid, (pseudo_grid_size,ao_num,-pseudo END_PROVIDER +BEGIN_PROVIDER [ double precision, mo_pseudo_grid, (mo_tot_num,-pseudo_lmax:pseudo_lmax,0:pseudo_lmax,nucl_num,pseudo_grid_size) ] + implicit none + BEGIN_DOC +! Grid points for f(|r-r_A|) = \int Y_{lm}^{C} (|r-r_C|, \Omega_C) \phi_i^{A} (r-r_A) d\Omega_C +! +! + END_DOC + ! l,m : Y(l,m) parameters + ! c(3) : pseudopotential center + ! a(3) : Atomic Orbital center + ! n_a(3) : Powers of x,y,z in the Atomic Orbital + ! g_a : Atomic Orbital exponent + ! r : Distance between the Atomic Orbital center and the considered point + double precision, external :: ylm_orb + integer :: n_a(3) + double precision :: a(3), c(3), g_a + integer :: i,j,k,l,m,n,p + double precision :: r(pseudo_grid_size), dr, Ulc + double precision :: y + + dr = pseudo_grid_rmax/dble(pseudo_grid_size) + r(1) = 0.d0 + do j=2,pseudo_grid_size + r(j) = r(j-1) + dr + enddo + + mo_pseudo_grid = 0.d0 + do n=1,pseudo_grid_size + do k=1,nucl_num + do l=0,pseudo_lmax + do m=-l,l + do j=1,mo_tot_num + do i=1,ao_num +! mo_pseudo_grid( +! ao_pseudo_grid(j,i,m,l,k) = ao_pseudo_grid(j,i,m,l,k) + & + enddo + enddo + enddo + enddo + enddo + enddo + +END_PROVIDER + +double precision function test_pseudo_grid(i,j) + implicit none + integer, intent(in) :: i,j + integer :: k,l,m,n + double precision :: r, dr,u + dr = pseudo_grid_rmax/dble(pseudo_grid_size) + + test_pseudo_grid = 0.d0 + r = 0.d0 + do k=1,pseudo_grid_size + do n=1,nucl_num + do l = 0,pseudo_lmax + u = pseudo_v_kl(n,l,1) * exp(-pseudo_dz_kl(n,l,1)*r*r)* r*r*dr + do m=-l,l + test_pseudo_grid += ao_pseudo_grid(i,m,l,n,k) * ao_pseudo_grid(j,m,l,n,k) * u + enddo + enddo + enddo + r = r+dr + enddo +end +! diff --git a/src/QmcChem/pseudo.irp.f b/src/QmcChem/pseudo.irp.f index b0cd57a5..547ce393 100644 --- a/src/QmcChem/pseudo.irp.f +++ b/src/QmcChem/pseudo.irp.f @@ -4,7 +4,7 @@ subroutine write_pseudopotential ! Write the pseudo_potential into the EZFIO file END_DOC ! call ezfio_set_pseudo_pseudo_matrix(pseudo_matrix) - call ezfio_set_pseudo_pseudo_grid(pseudo_grid) + call ezfio_set_pseudo_ao_pseudo_grid(ao_pseudo_grid) end diff --git a/src/QmcChem/save_for_qmcchem.irp.f b/src/QmcChem/save_for_qmcchem.irp.f index cfc18338..4b028a7c 100644 --- a/src/QmcChem/save_for_qmcchem.irp.f +++ b/src/QmcChem/save_for_qmcchem.irp.f @@ -1,8 +1,8 @@ program save_for_qmc read_wf = .True. TOUCH read_wf -! call save_dets_qmcchem call write_spindeterminants -! call write_pseudopotential -! call save_aux_basis + if (do_pseudo) then + call write_pseudopotential + endif end