nuclear_derivatives Module

This module calculates nuclear coordinate derivatives of total Energy (T=0) or the grand potential (T/=0) written by Kota Hanasaki in 2014 at DESY CFEL being modified by Sang-Kil Son since 2019


fd2toSD2 : converts a full(L,L) matrix to packed (L*(L+1)/2) array


calculate_dEnuc_dR : derivative of Nuc-Nuc repulsion energy A A+B Z_j Z_i E_nuc = (1/2) SUM SUM ------- NOTE: convention of i and j are flipped over j i/=j R_ji DON'T FORGET a factor of 1/2!!!

d E_nuc A+B (X_i - X_j) ------- = SUM ----------- Z_j Z_i NOTE: be careful with a sign of d X_j i/=j R_ji^3 ( X_i - X_j ) WHERE IS 1/2? SEE BELOW



contract_S2 : internal use only \sum \sum D_{i,j} G_{i,j} where D and G are both SYMMETRIC real matrices we use summation over dot products sum_{j} DOT( D(:,j) G(:,j) )


------ Optimization ------- pure real(long) braket_df_###_f_b (G,B,(V,), dfdR, i,j, N_nuc, iStart, iEnd) result(value)

istart/iend are G%i_start/G%i_end

real(long) function braket_df_h1P_f_s( G, B, V, dfdR, i, j, N_nuc,istart,iend) result (value)

FN : braket_df_ovlp_f_b( G, B, dfdR, i, j, N_nuc,istart,iend,yes_overlap) calculates dfdR(:,i) B%func(:,j) this uses yes_overlap to truncate dfdR * f integral.

real(long) function braket_df_h1P_f( G, B, V, dfdR, i, j) result (value)



Derived Types

type, public ::  localgrid

Data Structure to calculate 3-center integrals

Components

Type Visibility Attributes Name Initial
integer, public :: ngloc_max
integer, public :: nnucunq
integer, public :: ng_loc
integer, public, allocatable :: ioff(:)
integer, public, allocatable :: nuc_indices(:)
real(kind=long), public, allocatable :: wgdcmp(:)
real(kind=long), public, allocatable :: weight(:)

Subroutines

public subroutine calculate_dedr(ret, p, a, g, b, f, jnuc_want, nwant, ds_out, dh_out, djh_out, dvxc_out, ja_out, yes_printout, read_veed, yes_fockexchange)

calculate_dEdR : MAIN routine Jnuc_want(Nwant) : iNuc indices of your need ret(3,Nwant) : contains dE/dR vectors

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=long), dimension(3, nwant) :: ret
type(param), intent(in) :: p
type(atom_set), intent(in) :: a(:)
type(grid3d), intent(in) :: g
type(basis), intent(in) :: b
type(wf_data), intent(inout) :: f
integer, dimension(nwant) :: jnuc_want
integer, intent(in) :: nwant
real(kind=long), intent(out), optional :: ds_out(b%n_basis*(b%n_basis+1)/2)
real(kind=long), intent(out), optional :: dh_out(b%n_basis*(b%n_basis+1)/2)
real(kind=long), intent(out), optional :: djh_out(b%n_basis*(b%n_basis+1)/2)
real(kind=long), intent(out), optional :: dvxc_out(b%n_basis*(b%n_basis+1)/2)
integer, optional :: ja_out(2)
logical, intent(in), optional :: yes_printout
logical, optional :: read_veed
logical, optional :: yes_fockexchange