-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of the density tight-binding (PTB) method #948
Conversation
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
…ator Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
…s type required now Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
…t with scaled HO overlap from ptb Signed-off-by: Marcel Müller <[email protected]>
…ysis implementation Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
…RO and CPX Signed-off-by: Marcel Mueller <[email protected]>
…ock; correct formattings. Signed-off-by: Marcel Mueller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Mueller <[email protected]>
Signed-off-by: Marcel Mueller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Mueller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
…ce of an external field Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
…nitial IR implementation Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
… (then without PTB support) Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
Signed-off-by: Marcel Müller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution.
-
Your formatting changes are intermixed with the actual PTB implementation, which produces 16k lines to review, which is quite challenging. Can you please separate these into two distinct PRs?
-
Regarding the code style, I believe it would be best to maintain the current indentation for routines with numerous lines (like
xtbMain
) to preserve readability.
This pull request contains the full implementation of the PTB method as described in: J. Chem. Phys. 158, 124111 (2023) The implementation is based on infrastructure and standard routines provided by tblite. Thus, PTB is only available if
WITH_TBLITE
istrue
; in other cases, the program is terminated. A key design principle in this implementation was that the code is located in thextb
source code but (except for printouts and similar things) does not rely onxtb
infrastructure but on more moderntblite
,mctc-lib
,multicharge
routines. All empirical parameters are included in the source code, so no parameter file is necessary/possible. This includes also the vDZP basis set, as published with the ωB97X-3c method.A reference stand-alone implementation is provided in grimme-lab/ptb. The results should be similar, however, the reference implementation partially uses single-precision while the present implementation is (currently) based on double precision matrices throughout. That's why the differences can be at the level of 10⁻⁵ (charges) up to 10⁻¹ (polarizabilities).
A typical calculation is invoked via
xtb <struc_file> --ptb
. Additionally, the run type--alpha
is new and refers to the calculation of the polarizability tensor via PTB (not (yet) possible with GFNn-xTB/FF). The mixed vibrational spectra are accessible withxtb <struc_file> --ptb --hess [--alpha]
.The procedure that is undergone after the command above is the following:
src/main/setup.f90
andsrc/ptb/calculator.F90
.src/ptb/calculator.F90
and add a newtblite
wavefunction. Doing it earlier in the code would be possible but restarting PTB is not possible anyway, which is why I decided against it.twostepscf
procedure (src/ptb/twostepscf.F90
), which is designed not as a two-fold iterative cycle but as a one-shot procedure containing two diagonalizations. The reason for this design decision is mainly that the similarity between the first and the second iteration is limited – the employed routines are the same but the parameters entering and some adaptions to the variables are different for many contributions.twostepscf
works only as a wrapper module for collecting the distinct Hamiltonian contribution. Since PTB works differently compared to GFNn-xTB (many variables are re-used several times), all required overlap matrices and coordination numbers are calculated at the beginning of the actual procedure. Then, the approximated effective core potential (ECP), the shell levels, and the EEQ guess charges are calculated.After setting up the EEQ guess and the initial Coulomb matrix, the first iteration starts. Within both iterations,
H0
is collected and added onto the (constant)V_ECP
. After that, the different density-dependent potentials (2nd and 3rd-order electrostatics, Pauli-XC, DFT+U, and (if present) an external electric field are added. Each iteration ends with diagonalizing the fullH
matrix and calculating the mixed Mulliken-Löwdin charges.twostepscf
provides a complete wavefunction including the density and atomic/shell charges. Additionally, the dipole and quadrupole moments, all required integrals, and the bond orders are stored.tblite
wavefunction type is then copied onto thextb
wavefunction type to be able to usextb
property evaluation and printout routines down the road.--alpha
),numgrad_polarizability
is called after thetwostepscf
. It is a "modified" numerical differentiation of the dipole moment with respect to an infinitesimally small external electric field, in which not the standardtwostepscf
but a single diagonalization-variant inonestepscf
is called. The principle in the construction of the effective Hamiltonian is the same, however.singlepoint
routine, almost no results are printed except for a "Setup" block similar to what GFN-xTB does.xtb
and special (new) PTB routines is invoked (seeptb_property
andmain_ptb_json
).A noteworthy addition within this PR is the functionality of mixing GFNn-xTB/FF frequencies with PTB dipole moment derivatives or polarizability derivatives to obtain higher-quality IR and Raman spectra. Currently, this is limited to the combination of GFN2-xTB+PTB as shown in the PTB publication, but principle-wise this could be handled also generally in the future.
Furthermore, the correct Raman activities and absolute differential Raman scattering cross-sections (in m^2/sr) are implemented into
src/hessian.F90
andsrc/freq/io.f90
. In this course, also thevibspectrum
file was updated.The implementation comes with tests for the full Hamiltonian including the response approximation and the polarizability itself. It should work with both
meson
andCMake
.Moreover, some files were reformatted via
fprettify
and the following settings: