From 1c7524e86be8c19ed76b15e20b4ec4793fcd5028 Mon Sep 17 00:00:00 2001 From: "Johann Potot." Date: Mon, 19 May 2025 21:03:49 +0200 Subject: [PATCH] Jvp gfn1 period (#4209) Co-authored-by: Johann Pototschnig --- src/common/bibliography.F | 19 +- src/cp_control_utils.F | 15 +- src/input_cp2k_tb.F | 12 +- src/qs_scf_output.F | 42 +++-- src/tblite_interface.F | 169 ++++++++---------- tests/TEST_DIRS | 3 +- .../CH2O_gfn1.inp | 42 +++++ .../{hf.inp => COBe_gfn1.inp} | 22 +-- .../regtest-tblite-gfn1-periodic/Si_gfn1.inp | 50 ++++++ .../TEST_FILES.toml | 9 + .../regtest-tblite-gfn1-periodic/hf_old.inp | 58 ------ 11 files changed, 240 insertions(+), 201 deletions(-) create mode 100644 tests/xTB/regtest-tblite-gfn1-periodic/CH2O_gfn1.inp rename tests/xTB/regtest-tblite-gfn1-periodic/{hf.inp => COBe_gfn1.inp} (57%) create mode 100644 tests/xTB/regtest-tblite-gfn1-periodic/Si_gfn1.inp create mode 100644 tests/xTB/regtest-tblite-gfn1-periodic/TEST_FILES.toml delete mode 100644 tests/xTB/regtest-tblite-gfn1-periodic/hf_old.inp diff --git a/src/common/bibliography.F b/src/common/bibliography.F index e638d85351..602aadba57 100644 --- a/src/common/bibliography.F +++ b/src/common/bibliography.F @@ -76,8 +76,8 @@ MODULE bibliography Stoychev2016, Futera2017, Bailey2006, Papior2017, Lehtola2018, & Brieuc2016, Barca2018, Scheiber2018, Huang2011, Heaton_Burgess2007, & Schuett2018, Holmberg2018, Togo2018, Staub2019, Grimme2013, Grimme2016, & - Grimme2017, Kondov2007, Clabaut2020, Clabaut2021, & - Ren2011, Ren2013, Cohen2000, Rogers2002, Filippetti2000, & + Grimme2017, Asgeirsson2017, Bannwarth2019, Kondov2007, Clabaut2020, & + Clabaut2021, Ren2011, Ren2013, Cohen2000, Rogers2002, Filippetti2000, & Limpanuparb2011, Martin2003, Yin2017, Goerigk2017, & Wilhelm2016a, Wilhelm2016b, Wilhelm2017, Wilhelm2018, Wilhelm2021, Lass2018, & cp2kqs2020, Behler2007, Behler2011, Schran2020a, Schran2020b, & @@ -734,6 +734,21 @@ CONTAINS source="J. Chem. Theory Comput.", volume="13", pages="1989", & year=2017, doi="10.1021/acs.jctc.7b00118") + CALL add_reference(key=Asgeirsson2017, & + authors=s2a("V. Asgeirsson", "C. A. Bauer", "S. Grimme"), & + title="Quantum chemical calculation of electron ionization mass spectra "// & + "for general organic and inorganic molecules", & + source="Chem. Sci.", volume="8", pages="4879-4895", & + year=2017, doi="10.1039/C7SC00601B") + + CALL add_reference(key=Bannwarth2019, & + authors=s2a("C. Bannwarth", "S. Ehlert", "S. Grimme"), & + title="GFN2-xTB--An Accurate and Broadly Parametrized Self-Consistent "// & + "Tight-Binding Quantum Chemical Method with Multipole Electrostatics "// & + "and Density-Dependent Dispersion Contributions", & + source="J. Chem. Theory Comput.", volume="15", pages="1652-1671", & + year=2019, doi="10.1021/acs.jctc.8b01176") + CALL add_reference(key=Branduardi2007, & authors=s2a("D. Branduardi", "F. L. Gervasio", "M. Parrinello"), & title="From A to B in free energy space", & diff --git a/src/cp_control_utils.F b/src/cp_control_utils.F index 8d1a6ffb9c..6e6c319f97 100644 --- a/src/cp_control_utils.F +++ b/src/cp_control_utils.F @@ -10,11 +10,11 @@ ! ************************************************************************************************** MODULE cp_control_utils USE bibliography, ONLY: & - Andreussi2012, Dewar1977, Dewar1985, Elstner1998, Fattebert2002, Grimme2017, Hu2007, & - Krack2000, Lippert1997, Lippert1999, Porezag1995, Pracht2019, Repasky2002, Rocha2006, & - Schenter2008, Seifert1996, Souza2002, Stengel2009, Stewart1989, Stewart2007, Thiel1992, & - Umari2002, VanVoorhis2015, VandeVondele2005a, VandeVondele2005b, Yin2017, Zhechkov2005, & - cite_reference + Andreussi2012, Asgeirsson2017, Bannwarth2019, Caldeweyher2017, Caldeweyher2020, Dewar1977, & + Dewar1985, Elstner1998, Fattebert2002, Grimme2017, Hu2007, Krack2000, Lippert1997, & + Lippert1999, Porezag1995, Pracht2019, Repasky2002, Rocha2006, Schenter2008, Seifert1996, & + Souza2002, Stengel2009, Stewart1989, Stewart2007, Thiel1992, Umari2002, VanVoorhis2015, & + VandeVondele2005a, VandeVondele2005b, Yin2017, Zhechkov2005, cite_reference USE cp_control_types, ONLY: & admm_control_create, admm_control_type, ddapc_control_create, ddapc_restraint_type, & dft_control_create, dft_control_type, efield_type, expot_control_create, & @@ -1605,6 +1605,11 @@ CONTAINS CALL section_vals_val_get(xtb_tblite, "METHOD", & i_val=qs_control%xtb_control%tblite_method) IF (qs_control%xtb_control%do_tblite) THEN + CALL cite_reference(Caldeweyher2017) + CALL cite_reference(Caldeweyher2020) + CALL cite_reference(Asgeirsson2017) + CALL cite_reference(Grimme2017) + CALL cite_reference(Bannwarth2019) !Ewald sum included in tblite qs_control%xtb_control%do_ewald = .FALSE. END IF diff --git a/src/input_cp2k_tb.F b/src/input_cp2k_tb.F index 757447954c..c37106cea1 100644 --- a/src/input_cp2k_tb.F +++ b/src/input_cp2k_tb.F @@ -12,12 +12,9 @@ !> \author fawzi ! ************************************************************************************************** MODULE input_cp2k_tb - USE bibliography, ONLY: Elstner1998,& - Grimme2017,& - Hu2007,& - Porezag1995,& - Seifert1996,& - Zhechkov2005 + USE bibliography, ONLY: & + Asgeirsson2017, Bannwarth2019, Caldeweyher2017, Caldeweyher2020, Elstner1998, Grimme2017, & + Hu2007, Porezag1995, Seifert1996, Zhechkov2005 USE eeq_input, ONLY: create_eeq_control_section USE input_constants, ONLY: dispersion_d2,& dispersion_d3,& @@ -559,7 +556,8 @@ CONTAINS CPASSERT(.NOT. ASSOCIATED(section)) CALL section_create(section, __LOCATION__, name="TBLITE", & description="Section used to specify options for an xTB computation using tblite.", & - n_keywords=1, n_subsections=0, repeats=.FALSE.) + n_keywords=1, n_subsections=0, repeats=.FALSE., citations=(/Caldeweyher2017, Caldeweyher2020, & + Asgeirsson2017, Grimme2017, Bannwarth2019/)) NULLIFY (keyword) CALL keyword_create(keyword, __LOCATION__, name="_SECTION_PARAMETERS_", & diff --git a/src/qs_scf_output.F b/src/qs_scf_output.F index 1154fcd734..7b3a5944b4 100644 --- a/src/qs_scf_output.F +++ b/src/qs_scf_output.F @@ -669,27 +669,37 @@ CONTAINS WRITE (UNIT=output_unit, FMT="(T3,A,T56,F25.14)") & "Electric field interaction energy: ", energy%efield ELSEIF (dft_control%qs_control%xtb) THEN - IF (dft_control%qs_control%xtb_control%gfn_type == 0) THEN + IF (dft_control%qs_control%xtb_control%do_tblite) THEN WRITE (UNIT=output_unit, FMT="(/,(T3,A,T56,F25.14))") & "Core Hamiltonian energy: ", energy%core, & "Repulsive potential energy: ", energy%repulsive, & - "SRB Correction energy: ", energy%srb, & - "Charge equilibration energy: ", energy%eeq, & - "Dispersion energy: ", energy%dispersion - ELSEIF (dft_control%qs_control%xtb_control%gfn_type == 1) THEN - WRITE (UNIT=output_unit, FMT="(/,(T3,A,T56,F25.14))") & - "Core Hamiltonian energy: ", energy%core, & - "Repulsive potential energy: ", energy%repulsive, & - "Electronic energy: ", energy%hartree, & - "DFTB3 3rd order energy: ", energy%dftb3, & - "Dispersion energy: ", energy%dispersion - IF (dft_control%qs_control%xtb_control%xb_interaction) & - WRITE (UNIT=output_unit, FMT="(T3,A,T56,F25.14)") & + "Electrostatic energy: ", energy%el_stat, & + "Non-self consistent dispersion energy: ", energy%dispersion, & + "Self-consistent dispersion energy: ", energy%dispersion_sc, & "Correction for halogen bonding: ", energy%xtb_xb_inter - ELSEIF (dft_control%qs_control%xtb_control%gfn_type == 2) THEN - CPABORT("gfn_typ 2 NYA") ELSE - CPABORT("invalid gfn_typ") + IF (dft_control%qs_control%xtb_control%gfn_type == 0) THEN + WRITE (UNIT=output_unit, FMT="(/,(T3,A,T56,F25.14))") & + "Core Hamiltonian energy: ", energy%core, & + "Repulsive potential energy: ", energy%repulsive, & + "SRB Correction energy: ", energy%srb, & + "Charge equilibration energy: ", energy%eeq, & + "Dispersion energy: ", energy%dispersion + ELSEIF (dft_control%qs_control%xtb_control%gfn_type == 1) THEN + WRITE (UNIT=output_unit, FMT="(/,(T3,A,T56,F25.14))") & + "Core Hamiltonian energy: ", energy%core, & + "Repulsive potential energy: ", energy%repulsive, & + "Electronic energy: ", energy%hartree, & + "DFTB3 3rd order energy: ", energy%dftb3, & + "Dispersion energy: ", energy%dispersion + IF (dft_control%qs_control%xtb_control%xb_interaction) & + WRITE (UNIT=output_unit, FMT="(T3,A,T56,F25.14)") & + "Correction for halogen bonding: ", energy%xtb_xb_inter + ELSEIF (dft_control%qs_control%xtb_control%gfn_type == 2) THEN + CPABORT("gfn_typ 2 NYA") + ELSE + CPABORT("invalid gfn_typ") + END IF END IF IF (dft_control%qs_control%xtb_control%do_nonbonded) & WRITE (UNIT=output_unit, FMT="(T3,A,T56,F25.14)") & diff --git a/src/tblite_interface.F b/src/tblite_interface.F index fca9f6ed59..77df6c99a0 100644 --- a/src/tblite_interface.F +++ b/src/tblite_interface.F @@ -176,7 +176,6 @@ CONTAINS #if defined(__TBLITE) - REAL(KIND=dp), PARAMETER :: K2Eh = 3.16681156346E-06_dp INTEGER, PARAMETER :: nSpin = 1 !number of spin channels TYPE(scf_info) :: info @@ -187,7 +186,7 @@ CONTAINS IF (info%quadrupole > atom_resolved) & CPABORT("tblite: no support shell resolved quadrupole moment") - CALL new_wavefunction(tb%wfn, tb%mol%nat, tb%calc%bas%nsh, tb%calc%bas%nao, nSpin, 0.0_dp*K2Eh) + CALL new_wavefunction(tb%wfn, tb%mol%nat, tb%calc%bas%nsh, tb%calc%bas%nao, nSpin, 0.0_dp) CALL new_potential(tb%pot, tb%mol, tb%calc%bas, tb%wfn%nspin) @@ -632,11 +631,18 @@ CONTAINS CALL get_iterator_info(nl_iterator, ikind=ikind, jkind=jkind, & iatom=iatom, jatom=jatom, r=rij, cell=cell) + icol = MAX(iatom, jatom) + irow = MIN(iatom, jatom) + IF (icol == jatom) THEN + rij = -rij + i = ikind + ikind = jkind + jkind = i + END IF + dr = NORM2(rij(:)) ic = 1 - icol = MAX(iatom, jatom) - irow = MIN(iatom, jatom) NULLIFY (sblock) CALL dbcsr_get_block_p(matrix=matrix_s(1, ic)%matrix, & row=irow, col=icol, BLOCK=sblock, found=found) @@ -652,9 +658,9 @@ CONTAINS IF (.NOT. ASSOCIATED(basis_set_a)) CYCLE basis_set_b => basis_set_list(jkind)%gto_basis_set IF (.NOT. ASSOCIATED(basis_set_b)) CYCLE - atom_a = atom_of_kind(iatom) - atom_b = atom_of_kind(jatom) - ! basis ikind + atom_a = atom_of_kind(icol) + atom_b = atom_of_kind(irow) + ! basis a first_sgfa => basis_set_a%first_sgf la_max => basis_set_a%lmax la_min => basis_set_a%lmin @@ -665,7 +671,7 @@ CONTAINS set_radius_a => basis_set_a%set_radius scon_a => basis_set_a%scon zeta => basis_set_a%zet - ! basis jkind + ! basis b first_sgfb => basis_set_b%first_sgf lb_max => basis_set_b%lmax lb_min => basis_set_b%lmin @@ -724,18 +730,17 @@ CONTAINS END DO ! update S matrix - IF (iatom <= jatom) THEN + IF (icol <= irow) THEN sblock(:, :) = sblock(:, :) + sint(:, :, 1) ELSE sblock(:, :) = sblock(:, :) + TRANSPOSE(sint(:, :, 1)) END IF ! --------- Hamiltonian - - IF (iatom == jatom) THEN + IF (icol == irow .AND. dr < 0.001_dp) THEN !get diagonal F matrix from selfenergy n1 = 0 - DO ishell = 1, iatom - 1 + DO ishell = 1, icol - 1 n1 = n1 + tb%calc%bas%nsh_at(ishell) END DO DO iset = 1, nseta @@ -749,13 +754,13 @@ CONTAINS !get off-diagonal F matrix rr = SQRT(dr/(h0%rad(jkind) + h0%rad(ikind))) n1 = 0 - DO ishell = 1, iatom - 1 + DO ishell = 1, icol - 1 n1 = n1 + tb%calc%bas%nsh_at(ishell) END DO DO iset = 1, nseta sgfa = first_sgfa(1, iset) n2 = 0 - DO jshell = 1, jatom - 1 + DO jshell = 1, irow - 1 n2 = n2 + tb%calc%bas%nsh_at(jshell) END DO DO jset = 1, nsetb @@ -764,7 +769,6 @@ CONTAINS *(1.0_dp + h0%shpoly(jset, jkind)*rr) hij = 0.5_dp*(tb%selfenergy(n1 + iset) + tb%selfenergy(n2 + jset)) & *h0%hscale(iset, jset, ikind, jkind)*shpoly - DO ia = sgfa, sgfa + nsgfa(iset) - 1 DO ib = sgfb, sgfb + nsgfb(jset) - 1 hint(ia, ib, 1) = hij*sint(ia, ib, 1) @@ -775,7 +779,7 @@ CONTAINS END IF ! update F matrix - IF (iatom <= jatom) THEN + IF (icol <= irow) THEN fblock(:, :) = fblock(:, :) + hint(:, :, 1) ELSE fblock(:, :) = fblock(:, :) + TRANSPOSE(hint(:, :, 1)) @@ -1245,6 +1249,13 @@ CONTAINS icol = MAX(iatom, jatom) irow = MIN(iatom, jatom) + IF (icol == jatom) THEN + rij = -rij + i = ikind + ikind = jkind + jkind = i + END IF + ic = cell_to_index(cellind(1), cellind(2), cellind(3)) CPASSERT(ic > 0) @@ -1291,8 +1302,8 @@ CONTAINS IF (ASSOCIATED(tb%dipbra)) THEN CALL neighbor_list_iterator_create(nl_iterator, n_list) DO WHILE (neighbor_list_iterate(nl_iterator) == 0) - CALL get_iterator_info(nl_iterator, ikind=ikind, jkind=jkind, & - iatom=iatom, jatom=jatom, r=rij, cell=cellind) + CALL get_iterator_info(nl_iterator, & + iatom=iatom, jatom=jatom, cell=cellind) icol = MAX(iatom, jatom) irow = MIN(iatom, jatom) @@ -1336,8 +1347,8 @@ CONTAINS IF (ASSOCIATED(tb%quadbra)) THEN CALL neighbor_list_iterator_create(nl_iterator, n_list) DO WHILE (neighbor_list_iterate(nl_iterator) == 0) - CALL get_iterator_info(nl_iterator, ikind=ikind, jkind=jkind, & - iatom=iatom, jatom=jatom, r=rij, cell=cellind) + CALL get_iterator_info(nl_iterator, & + iatom=iatom, jatom=jatom, cell=cellind) icol = MAX(iatom, jatom) irow = MIN(iatom, jatom) @@ -1433,8 +1444,7 @@ CONTAINS INTEGER :: ikind, jkind, iatom, jatom, icol, irow, iset, jset, ityp, jtyp INTEGER :: nkind, natom, handle, nimg, i, inda, indb INTEGER :: atom_a, atom_b, nseta, nsetb, ia, ib, ij - INTEGER, DIMENSION(3) :: cell - LOGICAL :: found, bra2ket + LOGICAL :: found REAL(KIND=dp) :: r2 REAL(KIND=dp), DIMENSION(3) :: rij INTEGER, DIMENSION(:), POINTER :: la_max, lb_max @@ -1518,20 +1528,22 @@ CONTAINS CALL neighbor_list_iterator_create(nl_iterator, sab_orb) DO WHILE (neighbor_list_iterate(nl_iterator) == 0) CALL get_iterator_info(nl_iterator, ikind=ikind, jkind=jkind, & - iatom=iatom, jatom=jatom, r=rij, cell=cell) + iatom=iatom, jatom=jatom, r=rij) - r2 = SUM(rij(:)**2) + r2 = NORM2(rij(:))**2 icol = MAX(iatom, jatom) irow = MIN(iatom, jatom) - IF (icol == iatom) THEN - bra2ket = .FALSE. - ELSE - bra2ket = .TRUE. + + IF (icol == jatom) THEN + rij = -rij + i = ikind + ikind = jkind + jkind = i END IF - ityp = tb%mol%id(iatom) - jtyp = tb%mol%id(jatom) + ityp = tb%mol%id(icol) + jtyp = tb%mol%id(irow) NULLIFY (dip_bra1, dip_bra2, dip_bra3) CALL dbcsr_get_block_p(matrix=tb%dipbra(1)%matrix, & @@ -1600,24 +1612,23 @@ CONTAINS IF (.NOT. ASSOCIATED(basis_set_a)) CYCLE basis_set_b => basis_set_list(jkind)%gto_basis_set IF (.NOT. ASSOCIATED(basis_set_b)) CYCLE - atom_a = atom_of_kind(iatom) - atom_b = atom_of_kind(jatom) - ! basis ikind + atom_a = atom_of_kind(icol) + atom_b = atom_of_kind(irow) + ! basis a first_sgfa => basis_set_a%first_sgf la_max => basis_set_a%lmax nseta = basis_set_a%nset nsgfa => basis_set_a%nsgf_set - ! basis jkind + ! basis b first_sgfb => basis_set_b%first_sgf lb_max => basis_set_b%lmax nsetb = basis_set_b%nset nsgfb => basis_set_b%nsgf_set ! --------- Hamiltonian - IF (iatom == jatom) THEN + IF (icol == irow) THEN DO iset = 1, nseta DO jset = 1, nsetb - CALL multipole_cgto(tb%calc%bas%cgto(jset, ityp), tb%calc%bas%cgto(iset, ityp), & & r2, -rij, tb%calc%bas%intcut, stmp, dtmp, qtmp) @@ -1648,7 +1659,6 @@ CONTAINS quad_bra4(ib, ia) = qtmp(4, ij) quad_bra5(ib, ia) = qtmp(5, ij) quad_bra6(ib, ia) = qtmp(6, ij) - END DO END DO END DO @@ -1661,73 +1671,38 @@ CONTAINS CALL multipole_cgto(tb%calc%bas%cgto(iset, ityp), tb%calc%bas%cgto(jset, jtyp), & & r2, rij, tb%calc%bas%intcut, stmp, dtmpj, qtmpj) - IF (bra2ket) THEN - DO inda = 1, nsgfa(iset) - ia = first_sgfa(1, iset) - first_sgfa(1, 1) + inda - DO indb = 1, nsgfb(jset) - ib = first_sgfb(1, jset) - first_sgfb(1, 1) + indb + DO inda = 1, nsgfa(iset) + ia = first_sgfa(1, iset) - first_sgfa(1, 1) + inda + DO indb = 1, nsgfb(jset) + ib = first_sgfb(1, jset) - first_sgfb(1, 1) + indb - ij = indb + nsgfb(jset)*(inda - 1) + ij = indb + nsgfb(jset)*(inda - 1) - dip_ket1(ia, ib) = dtmp(1, ij) - dip_ket2(ia, ib) = dtmp(2, ij) - dip_ket3(ia, ib) = dtmp(3, ij) + dip_bra1(ib, ia) = dtmp(1, ij) + dip_bra2(ib, ia) = dtmp(2, ij) + dip_bra3(ib, ia) = dtmp(3, ij) - quad_ket1(ia, ib) = qtmp(1, ij) - quad_ket2(ia, ib) = qtmp(2, ij) - quad_ket3(ia, ib) = qtmp(3, ij) - quad_ket4(ia, ib) = qtmp(4, ij) - quad_ket5(ia, ib) = qtmp(5, ij) - quad_ket6(ia, ib) = qtmp(6, ij) + quad_bra1(ib, ia) = qtmp(1, ij) + quad_bra2(ib, ia) = qtmp(2, ij) + quad_bra3(ib, ia) = qtmp(3, ij) + quad_bra4(ib, ia) = qtmp(4, ij) + quad_bra5(ib, ia) = qtmp(5, ij) + quad_bra6(ib, ia) = qtmp(6, ij) - ij = inda + nsgfa(iset)*(indb - 1) + ij = inda + nsgfa(iset)*(indb - 1) - dip_bra1(ia, ib) = dtmpj(1, ij) - dip_bra2(ia, ib) = dtmpj(2, ij) - dip_bra3(ia, ib) = dtmpj(3, ij) + dip_ket1(ib, ia) = dtmpj(1, ij) + dip_ket2(ib, ia) = dtmpj(2, ij) + dip_ket3(ib, ia) = dtmpj(3, ij) - quad_bra1(ia, ib) = qtmpj(1, ij) - quad_bra2(ia, ib) = qtmpj(2, ij) - quad_bra3(ia, ib) = qtmpj(3, ij) - quad_bra4(ia, ib) = qtmpj(4, ij) - quad_bra5(ia, ib) = qtmpj(5, ij) - quad_bra6(ia, ib) = qtmpj(6, ij) - END DO + quad_ket1(ib, ia) = qtmpj(1, ij) + quad_ket2(ib, ia) = qtmpj(2, ij) + quad_ket3(ib, ia) = qtmpj(3, ij) + quad_ket4(ib, ia) = qtmpj(4, ij) + quad_ket5(ib, ia) = qtmpj(5, ij) + quad_ket6(ib, ia) = qtmpj(6, ij) END DO - ELSE - DO inda = 1, nsgfa(iset) - ia = first_sgfa(1, iset) - first_sgfa(1, 1) + inda - DO indb = 1, nsgfb(jset) - ib = first_sgfb(1, jset) - first_sgfb(1, 1) + indb - - ij = indb + nsgfb(jset)*(inda - 1) - - dip_bra1(ib, ia) = dtmp(1, ij) - dip_bra2(ib, ia) = dtmp(2, ij) - dip_bra3(ib, ia) = dtmp(3, ij) - - quad_bra1(ib, ia) = qtmp(1, ij) - quad_bra2(ib, ia) = qtmp(2, ij) - quad_bra3(ib, ia) = qtmp(3, ij) - quad_bra4(ib, ia) = qtmp(4, ij) - quad_bra5(ib, ia) = qtmp(5, ij) - quad_bra6(ib, ia) = qtmp(6, ij) - - ij = inda + nsgfa(iset)*(indb - 1) - - dip_ket1(ib, ia) = dtmpj(1, ij) - dip_ket2(ib, ia) = dtmpj(2, ij) - dip_ket3(ib, ia) = dtmpj(3, ij) - - quad_ket1(ib, ia) = qtmpj(1, ij) - quad_ket2(ib, ia) = qtmpj(2, ij) - quad_ket3(ib, ia) = qtmpj(3, ij) - quad_ket4(ib, ia) = qtmpj(4, ij) - quad_ket5(ib, ia) = qtmpj(5, ij) - quad_ket6(ib, ia) = qtmpj(6, ij) - END DO - END DO - END IF + END DO END DO END DO END IF diff --git a/tests/TEST_DIRS b/tests/TEST_DIRS index ec193e99ee..4d1a941dea 100644 --- a/tests/TEST_DIRS +++ b/tests/TEST_DIRS @@ -4,6 +4,7 @@ # in case a new directory is added just add it at the top of the list.. # the order will be regularly checked and modified... HP-DFT +xTB/regtest-tblite-gfn1-periodic tblite xTB/regtest-tblite-ipea1 tblite xTB/regtest-tblite-gfn2 tblite xTB/regtest-tblite-gfn1 tblite @@ -389,4 +390,4 @@ Fist/regtest-quip quip QS/regtest-eht-guess libdftd4 QS/regtest-trexio trexio QS/regtest-trexio-2 trexio libgrpp -QS/regtest-rtbse-gxac libint greenx \ No newline at end of file +QS/regtest-rtbse-gxac libint greenx diff --git a/tests/xTB/regtest-tblite-gfn1-periodic/CH2O_gfn1.inp b/tests/xTB/regtest-tblite-gfn1-periodic/CH2O_gfn1.inp new file mode 100644 index 0000000000..bfc8bbb408 --- /dev/null +++ b/tests/xTB/regtest-tblite-gfn1-periodic/CH2O_gfn1.inp @@ -0,0 +1,42 @@ +&GLOBAL + PRINT_LEVEL HIGH + PROJECT CH2O + RUN_TYPE ENERGY +&END GLOBAL + +&FORCE_EVAL + &DFT + &KPOINTS + SCHEME NONE + &END KPOINTS + &QS + METHOD xTB + &XTB + &TBLITE + METHOD GFN1 + &END TBLITE + &END XTB + &END QS + &SCF + EPS_SCF 1.e-8 + MAX_SCF 100 + SCF_GUESS MOPAC + &MIXING + ALPHA 0.2 + METHOD DIRECT_P_MIXING + &END MIXING + &END SCF + &END DFT + &SUBSYS + &CELL + ABC 5.0 5.0 5.0 + PERIODIC XYZ + &END CELL + &COORD + O 0.051368 0.000000 0.000000 + C 1.278612 0.000000 0.000000 + H 1.870460 -0.939607 0.000000 + H 1.870460 0.939607 0.000000 + &END COORD + &END SUBSYS +&END FORCE_EVAL diff --git a/tests/xTB/regtest-tblite-gfn1-periodic/hf.inp b/tests/xTB/regtest-tblite-gfn1-periodic/COBe_gfn1.inp similarity index 57% rename from tests/xTB/regtest-tblite-gfn1-periodic/hf.inp rename to tests/xTB/regtest-tblite-gfn1-periodic/COBe_gfn1.inp index c88a5f4ddf..a4c93e174e 100644 --- a/tests/xTB/regtest-tblite-gfn1-periodic/hf.inp +++ b/tests/xTB/regtest-tblite-gfn1-periodic/COBe_gfn1.inp @@ -1,6 +1,6 @@ &GLOBAL PRINT_LEVEL HIGH - PROJECT hf_periodic_tblite + PROJECT COBe RUN_TYPE ENERGY &END GLOBAL @@ -9,44 +9,36 @@ &DFT &KPOINTS SCHEME NONE - #SCHEME GAMMA - #SCHEME MONKHORST-PACK 1 1 1 &END KPOINTS &QS METHOD xTB &XTB - #HYDROGEN_STO_NG 4 - #STO_NG 6 - &PARAMETER - DISPERSION_PARAMETER_FILE dftd3.dat - &END PARAMETER &TBLITE METHOD GFN1 &END TBLITE &END XTB &END QS &SCF - EPS_SCF 1.e-7 + EPS_SCF 1.e-8 MAX_SCF 100 SCF_GUESS MOPAC &MIXING - ALPHA 0.30 + ALPHA 0.2 METHOD DIRECT_P_MIXING &END MIXING &END SCF &END DFT &SUBSYS &CELL - ABC 4.0 4.0 4.0 - MULTIPLE_UNIT_CELL 1 1 1 + ABC 6.0 6.0 6.0 PERIODIC XYZ &END CELL &COORD - H 0.000000 0.000000 0.000000 - F 0.980000 0.000000 0.000000 + O -0.564000 0.000000 0.000000 + C 0.564000 0.000000 0.000000 + Be 0.000000 4.000000 0.000000 &END COORD &TOPOLOGY - MULTIPLE_UNIT_CELL 1 1 1 &CENTER_COORDINATES &END CENTER_COORDINATES &END TOPOLOGY diff --git a/tests/xTB/regtest-tblite-gfn1-periodic/Si_gfn1.inp b/tests/xTB/regtest-tblite-gfn1-periodic/Si_gfn1.inp new file mode 100644 index 0000000000..abfdb19b41 --- /dev/null +++ b/tests/xTB/regtest-tblite-gfn1-periodic/Si_gfn1.inp @@ -0,0 +1,50 @@ +@SET NREP 1 +&FORCE_EVAL + METHOD QS + &DFT + &KPOINTS + SCHEME NONE + &END KPOINTS + &QS + METHOD xTB + &XTB + &TBLITE + METHOD GFN1 + &END TBLITE + &END XTB + &END QS + &SCF + EPS_SCF 1.e-8 + MAX_SCF 100 + SCF_GUESS MOPAC + &MIXING + ALPHA 0.2 + METHOD DIRECT_P_MIXING + &END MIXING + &END SCF + &END DFT + &SUBSYS + &CELL + ABC 5.4310000000 5.4310000000000 5.431000000000 + PERIODIC XYZ + &END CELL + &COORD + Si 0.00000000 0.00000000 0.00000000 + Si 2.71550000 2.71550000 0.00000000 + Si 2.71550000 0.00000000 2.71550000 + Si 0.00000000 2.71550000 2.71550000 + Si 1.35775000 1.35775000 1.35775000 + Si 1.35775000 4.10040500 4.10040500 + Si 4.10040500 1.35775000 4.10040500 + Si 4.10040500 4.10040500 1.35775000 + &END COORD + &TOPOLOGY + &END TOPOLOGY + &END SUBSYS +&END FORCE_EVAL + +&GLOBAL + PRINT_LEVEL HIGH + PROJECT Si + RUN_TYPE ENERGY +&END GLOBAL diff --git a/tests/xTB/regtest-tblite-gfn1-periodic/TEST_FILES.toml b/tests/xTB/regtest-tblite-gfn1-periodic/TEST_FILES.toml new file mode 100644 index 0000000000..2b64c8d678 --- /dev/null +++ b/tests/xTB/regtest-tblite-gfn1-periodic/TEST_FILES.toml @@ -0,0 +1,9 @@ +# runs are executed in the same order as in this file +# the second field tells which test should be run in order to compare with the last available output +# e.g. 0 means do not compare anything, running is enough +# 1 compares the last total energy in the file +# for details see cp2k/tools/do_regtest +"CH2O_gfn1.inp" = [{matcher="E_total", tol=1.0E-8, ref=-7.8503584208}] +"COBe_gfn1.inp" = [{matcher="E_total", tol=1.0E-8, ref=-7.4250395488}] +"Si_gfn1.inp" = [{matcher="E_total", tol=1.0E-8, ref=-14.4521172972}] +#EOF diff --git a/tests/xTB/regtest-tblite-gfn1-periodic/hf_old.inp b/tests/xTB/regtest-tblite-gfn1-periodic/hf_old.inp deleted file mode 100644 index 1ebed453f2..0000000000 --- a/tests/xTB/regtest-tblite-gfn1-periodic/hf_old.inp +++ /dev/null @@ -1,58 +0,0 @@ -&GLOBAL - PRINT_LEVEL HIGH - PROJECT hf_periodic - RUN_TYPE ENERGY -&END GLOBAL - -&FORCE_EVAL - METHOD QS - &DFT - &KPOINTS - SCHEME NONE - #SCHEME GAMMA - #SCHEME MONKHORST-PACK 1 1 1 - &END KPOINTS - &POISSON - &EWALD - #ALPHA 10.0 - #EWALD_TYPE EWALD - &END EWALD - &END POISSON - &QS - METHOD xTB - &XTB - DO_EWALD T - #HYDROGEN_STO_NG 4 - #STO_NG 6 - &PARAMETER - DISPERSION_PARAMETER_FILE dftd3.dat - &END PARAMETER - &END XTB - &END QS - &SCF - EPS_SCF 1.e-7 - MAX_SCF 100 - SCF_GUESS MOPAC - &MIXING - ALPHA 0.30 - METHOD DIRECT_P_MIXING - &END MIXING - &END SCF - &END DFT - &SUBSYS - &CELL - ABC 4.0 4.0 4.0 - MULTIPLE_UNIT_CELL 1 1 1 - PERIODIC XYZ - &END CELL - &COORD - H 0.000000 0.000000 0.000000 - F 0.980000 0.000000 0.000000 - &END COORD - &TOPOLOGY - MULTIPLE_UNIT_CELL 1 1 1 - &CENTER_COORDINATES - &END CENTER_COORDINATES - &END TOPOLOGY - &END SUBSYS -&END FORCE_EVAL