Skip to content

Commit

Permalink
Intrinsic Atomic Orbitals (G. Knizia JCTC 9 4834 (2013) (#2707)
Browse files Browse the repository at this point in the history
  • Loading branch information
juerghutter committed Apr 4, 2023
1 parent 77ac925 commit 8205297
Show file tree
Hide file tree
Showing 18 changed files with 2,415 additions and 248 deletions.
64 changes: 63 additions & 1 deletion src/auto_basis.F
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ MODULE auto_basis

CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'auto_basis'

PUBLIC :: create_ri_aux_basis_set, create_aux_fit_basis_set, create_lri_aux_basis_set
PUBLIC :: create_ri_aux_basis_set, create_aux_fit_basis_set, create_lri_aux_basis_set, &
create_oce_basis

CONTAINS

Expand Down Expand Up @@ -566,6 +567,67 @@ SUBROUTINE create_aux_fit_basis_set(aux_fit_basis, qs_kind, basis_cntrl)
END IF

END SUBROUTINE create_aux_fit_basis_set

! **************************************************************************************************
!> \brief ...
!> \param oce_basis ...
!> \param orb_basis ...
!> \param lmax_oce ...
!> \param nbas_oce ...
! **************************************************************************************************
SUBROUTINE create_oce_basis(oce_basis, orb_basis, lmax_oce, nbas_oce)
TYPE(gto_basis_set_type), POINTER :: oce_basis, orb_basis
INTEGER, INTENT(IN) :: lmax_oce, nbas_oce

CHARACTER(LEN=default_string_length) :: bsname
INTEGER :: i, l, lmax, lx, nset, nx
INTEGER, ALLOCATABLE, DIMENSION(:) :: lmin, lset, npgf
INTEGER, ALLOCATABLE, DIMENSION(:, :) :: nl
INTEGER, DIMENSION(:), POINTER :: npgf_orb
REAL(KIND=dp) :: cval, x, z0, z1
REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: zet
REAL(KIND=dp), DIMENSION(0:9) :: zeff, zmax, zmin

CALL get_basis_keyfigures(orb_basis, lmax, zmin, zmax, zeff)
IF (nbas_oce < 1) THEN
CALL get_gto_basis_set(gto_basis_set=orb_basis, nset=nset, npgf=npgf_orb)
nx = SUM(npgf_orb(1:nset))
ELSE
nx = 0
END IF
nset = MAX(nbas_oce, nx)
lx = MAX(lmax_oce, lmax)
!
bsname = "OCE-"//TRIM(orb_basis%name)
ALLOCATE (lmin(nset), lset(nset), nl(0:9, nset), npgf(nset), zet(1, nset))
lmin = 0
lset = 0
nl = 1
npgf = 1
zet = 0.0_dp
!
z0 = MINVAL(zmin(0:lmax))
z1 = MAXVAL(zmax(0:lmax))
x = 1.0_dp/REAL(nset - 1, KIND=dp)
cval = (z1/z0)**x
zet(1, nset) = z0
DO i = nset - 1, 1, -1
zet(1, i) = zet(1, i + 1)*cval
END DO
DO i = 1, nset
x = zet(1, i)
DO l = 1, lmax
z1 = 1.05_dp*zmax(l)
IF (x < z1) lset(i) = l
END DO
IF (lset(i) == lmax) lset(i) = lx
END DO
!
CALL create_aux_basis(oce_basis, bsname, nset, lmin, lset, nl, npgf, zet)
!
DEALLOCATE (lmin, lset, nl, npgf, zet)

END SUBROUTINE create_oce_basis
! **************************************************************************************************
!> \brief ...
!> \param basis_set ...
Expand Down
17 changes: 16 additions & 1 deletion src/common/bibliography.F
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ MODULE bibliography
Behler2007, Behler2011, Schran2020a, Schran2020b, &
Rycroft2009, Thomas2015, Brehm2018, Brehm2020, Shigeta2001, Heinecke2016, &
Brehm2021, Bussy2021a, Bussy2021b, Ditler2021, Ditler2022, Mattiat2019, Mattiat2022, &
Belleflamme2023
Belleflamme2023, Knizia2013

CONTAINS

Expand Down Expand Up @@ -4807,6 +4807,21 @@ SUBROUTINE add_all_references()
"ER"), &
DOI="10.1063/5.0122671")

CALL add_reference(key=Knizia2013, ISI_record=s2a( &
"TY JOUR", &
"PT J", &
"AU Knizia Gerald", &
"TI Intrinsic Atomic Orbitals: An Unbiased Bridge between Quantum", &
" Theory and Chemical Concepts", &
"SO Journal of Chemical Theory and Computation", &
"PY 2013", &
"VL 9", &
"BP 4834", &
"EP 4843", &
"DI 10.1021/ct400687b", &
"ER"), &
DOI="10.1021/ct400687b")

END SUBROUTINE add_all_references

END MODULE bibliography
3 changes: 1 addition & 2 deletions src/ec_efield_local.F
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,11 @@ SUBROUTINE ec_efield_integrals(qs_env, ec_env, rpoint)

INTEGER :: handle, i
TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: dipmat, matrix_s
TYPE(dft_control_type), POINTER :: dft_control
TYPE(efield_berry_type), POINTER :: efield, efieldref

CALL timeset(routineN, handle)

CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, efield=efieldref)
CALL get_qs_env(qs_env=qs_env, efield=efieldref)
efield => ec_env%efield
CALL init_efield_matrices(efield)
matrix_s => ec_env%matrix_s(:, 1)
Expand Down
9 changes: 8 additions & 1 deletion src/force_env_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MODULE force_env_methods
USE cell_types, ONLY: cell_clone,&
cell_create,&
cell_release,&
cell_sym_triclinic,&
cell_type,&
init_cell,&
real_to_scaled,&
Expand Down Expand Up @@ -544,7 +545,7 @@ SUBROUTINE force_env_calc_num_pressure(force_env, dx)
REAL(kind=dp), PARAMETER :: default_dx = 0.001_dp
INTEGER :: i, ip, iq, j, k, natom, ncore, nshell, &
output_unit
output_unit, symmetry_id
REAL(KIND=dp) :: dx_w
REAL(KIND=dp), DIMENSION(2) :: numer_energy
REAL(KIND=dp), DIMENSION(3) :: s
Expand Down Expand Up @@ -608,6 +609,10 @@ SUBROUTINE force_env_calc_num_pressure(force_env, dx)
END DO
END IF
CALL force_env_get(force_env, cell=cell)
! Save cell symmetry (distorted cell has no symmetry)
symmetry_id = cell%symmetry_id
cell%symmetry_id = cell_sym_triclinic
!
CALL cell_create(cell_local)
CALL cell_clone(cell, cell_local)
! First change box
Expand Down Expand Up @@ -662,6 +667,8 @@ SUBROUTINE force_env_calc_num_pressure(force_env, dx)
END DO
! Reset positions and rebuild original environment
cell%symmetry_id = symmetry_id
CALL init_cell(cell)
DO i = 1, natom
particles%els(i)%r = ref_pos_atom(i, :)
END DO
Expand Down

0 comments on commit 8205297

Please sign in to comment.