Skip to content

Commit 6141529

Browse files
committed
Switch the default HFX algo Thresholded -> MatrixBased
1 parent 1276115 commit 6141529

7 files changed

Lines changed: 196 additions & 5 deletions

File tree

src/dftbp/dftbplus/oldcompat.F90

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ subroutine convert_13_14(root)
904904
call getChildValue(ch2, "", iOrder, child=ch3)
905905
if (iOrder > 1) then
906906
write(strtmp,"(A,I0,A,I0,A)")"Older Methfessel-Paxton requested order of ", iOrder,&
907-
& " is now equvalent to ", (iOrder -1), " from parser version 14."
907+
& " is now equivalent to ", (iOrder -1), " from parser version 14."
908908
call detailedWarning(ch2, strTmp)
909909
elseif (iOrder == 1) then
910910
write(strtmp,"(A)")"Older Methfessel-Paxton requested order of 1 is now&
@@ -914,7 +914,7 @@ subroutine convert_13_14(root)
914914
call detailedWarning(ch2, strTmp)
915915
else
916916
write(strtmp,"(A,I0,A,I0,A)")"Older Methfessel-Paxton requested order of ", iOrder,&
917-
& " is now equvalent to a negative order of ", (iOrder -1), " from parser version 14&
917+
& " is now equivalent to a negative order of ", (iOrder -1), " from parser version 14&
918918
& and is incorrect."
919919
call detailedError(ch2, strTmp)
920920
end if
@@ -930,6 +930,17 @@ subroutine convert_13_14(root)
930930

931931
end if
932932

933+
call getDescendant(root, "Hamiltonian/DFTB/Hybrid/LC", ch1)
934+
if (associated(ch1)) then
935+
call getDescendant(ch1, "Screening", ch2)
936+
if (.not. associated(ch2)) then
937+
call setChild(ch1, "Screening", ch2)
938+
call setChild(ch2, "Thresholded", ch3)
939+
call setUnprocessed(ch1)
940+
call setUnprocessed(ch2)
941+
end if
942+
end if
943+
933944
end subroutine convert_13_14
934945

935946

src/dftbp/dftbplus/parser.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7982,7 +7982,7 @@ subroutine parseHybridBlock(node, input, geo, skFiles)
79827982

79837983
allocate(input)
79847984
input%hybridXcType = hybridXcSkType
7985-
call getChildValue(hybridValue, "Screening", screeningValue, "Thresholded",&
7985+
call getChildValue(hybridValue, "Screening", screeningValue, "MatrixBased",&
79867986
& child=screeningChild)
79877987

79887988
call getNodeName(screeningValue, buffer)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
orbital_charges :real:2:4,30
2+
0.118242895956883E+001 0.956661557491219E+000 0.103401157974012E+001
3+
0.971185004457117E+000 0.113298132425525E+001 0.925329969501732E+000
4+
0.967340637711014E+000 0.924889535334856E+000 0.117391539205166E+001
5+
0.952956312046392E+000 0.102268220998950E+001 0.967931153181793E+000
6+
0.113010807725269E+001 0.926432747379670E+000 0.971438268868349E+000
7+
0.927458789762522E+000 0.112989682205830E+001 0.923896347020746E+000
8+
0.970657370149845E+000 0.929502124198319E+000 0.117261024984877E+001
9+
0.951324828565298E+000 0.102698964468206E+001 0.967320098571851E+000
10+
0.112833357722180E+001 0.925947723336923E+000 0.974927321303393E+000
11+
0.925771297010330E+000 0.117320183868339E+001 0.953547085715379E+000
12+
0.101880042758497E+001 0.965881914068678E+000 0.112834743273958E+001
13+
0.925184327249052E+000 0.971479170957986E+000 0.925731525718185E+000
14+
0.114812302627010E+001 0.926502262617711E+000 0.970807273149853E+000
15+
0.919115703183318E+000 0.116629526560285E+001 0.949424126973457E+000
16+
0.100228855882235E+001 0.964845204371142E+000 0.116054564984091E+001
17+
0.967441130816471E+000 0.999874659051946E+000 0.939710097795720E+000
18+
0.116048824677655E+001 0.955187886935982E+000 0.998565574469869E+000
19+
0.952032325578455E+000 0.116636144343726E+001 0.950564237170725E+000
20+
0.100672938927699E+001 0.962462244216734E+000 0.116661789927514E+001
21+
0.950712414273666E+000 0.100426326382959E+001 0.963179917999409E+000
22+
0.116054868534001E+001 0.955469375885068E+000 0.999254164737235E+000
23+
0.951883979212940E+000 0.116055453196741E+001 0.967506653562751E+000
24+
0.998632570999309E+000 0.939832049338923E+000 0.116657650924899E+001
25+
0.948502796493501E+000 0.100515150777514E+001 0.965262509605358E+000
26+
0.907293408611276E+000 0.000000000000000E+000 0.000000000000000E+000
27+
0.000000000000000E+000 0.931981951344660E+000 0.000000000000000E+000
28+
0.000000000000000E+000 0.000000000000000E+000 0.931520925946940E+000
29+
0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000
30+
0.931971888870277E+000 0.000000000000000E+000 0.000000000000000E+000
31+
0.000000000000000E+000 0.933641018111486E+000 0.000000000000000E+000
32+
0.000000000000000E+000 0.000000000000000E+000 0.934053009471857E+000
33+
0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000
34+
0.933925413117565E+000 0.000000000000000E+000 0.000000000000000E+000
35+
0.000000000000000E+000 0.933193242544175E+000 0.000000000000000E+000
36+
0.000000000000000E+000 0.000000000000000E+000 0.933190683655463E+000
37+
0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000
38+
0.933808530651682E+000 0.000000000000000E+000 0.000000000000000E+000
39+
0.000000000000000E+000 0.933803519144433E+000 0.000000000000000E+000
40+
0.000000000000000E+000 0.000000000000000E+000 0.933200627349796E+000
41+
0.000000000000000E+000 0.000000000000000E+000 0.000000000000000E+000
42+
mermin_energy :real:0:
43+
-0.429927848659386E+002
44+
end_coords :real:2:3,30
45+
-0.937473054326264E+001 -0.120220470853992E+002 -0.277541581724350E+000
46+
-0.878163050807953E+001 -0.943647542375730E+001 0.259350057772419E+000
47+
-0.108130653421194E+002 -0.778750133681579E+001 0.798754342517095E+000
48+
-0.103956062461030E+002 -0.522938058132579E+001 0.132885397459708E+001
49+
-0.785262443510681E+001 -0.425147661062806E+001 0.132639824279369E+001
50+
-0.582965722700599E+001 -0.587118522928033E+001 0.793951929516909E+000
51+
-0.623379033061945E+001 -0.845668836378867E+001 0.256810064976924E+000
52+
-0.420235828959457E+001 -0.101056588659200E+002 -0.282631834007663E+000
53+
-0.461979871889768E+001 -0.126638628090377E+002 -0.812343907853831E+000
54+
-0.716275752436968E+001 -0.136418148657030E+002 -0.809713366947867E+000
55+
-0.754943177460753E+001 -0.162635637685928E+002 -0.135627547226619E+001
56+
-0.553925400523030E+001 -0.178194858222259E+002 -0.187369392859140E+001
57+
-0.302757847966363E+001 -0.168535867157055E+002 -0.187613185142810E+001
58+
-0.257699808443579E+001 -0.143513506265648E+002 -0.136123096724440E+001
59+
-0.124383222340687E+002 -0.354192851552467E+001 0.187814547314373E+001
60+
-0.119876873070180E+002 -0.103972164154775E+001 0.239316739219830E+001
61+
-0.947602131133948E+001 -0.738262058390193E-001 0.239052953502920E+001
62+
-0.746586043233314E+001 -0.162979255103993E+001 0.187318536761205E+001
63+
-0.111254719777267E+002 -0.127688958827480E+002 -0.275635453103162E+000
64+
-0.127533849759289E+002 -0.853277742293868E+001 0.800681522118877E+000
65+
-0.388990555223208E+001 -0.512443486775827E+001 0.792178940973330E+000
66+
-0.226207202267685E+001 -0.936029938052004E+001 -0.284805137947267E+000
67+
-0.948704841806228E+001 -0.170124348713261E+002 -0.135506697265437E+001
68+
-0.585235538347946E+001 -0.198284508448321E+002 -0.229134726840836E+001
69+
-0.144978613961539E+001 -0.181354551223346E+002 -0.229547126278666E+001
70+
-0.636901827198546E+000 -0.136089248727320E+002 -0.136382289651307E+001
71+
-0.143783905210936E+002 -0.428438102598776E+001 0.188106229789936E+001
72+
-0.135654181043600E+002 0.242122703389314E+000 0.281278967078193E+001
73+
-0.916287254443171E+001 0.193514700780343E+001 0.280806461692763E+001
74+
-0.552822673788079E+001 -0.880954474669791E+000 0.187204608148224E+001
75+
dipole_moments :real:2:3,1
76+
0.252974474059131E-002 0.818105721899471E-002 0.397246951480371E-002
77+
scaled_dipole :real:2:3,1
78+
0.252974474059131E-002 0.818105721899471E-002 0.397246951480371E-002
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Geometry = GenFormat {
2+
<<< geo.gen
3+
}
4+
5+
Hamiltonian = DFTB {
6+
7+
Solver = QR {}
8+
9+
SCC = Yes
10+
SCCTolerance = 1.0E-12
11+
12+
MaxAngularMomentum = {
13+
H = "s"
14+
C = "p"
15+
}
16+
17+
SlaterKosterFiles = Type2FileNames {
18+
Prefix = "slakos/origin/ob2-1-1/shift/"
19+
Separator = "-"
20+
Suffix = ".skf"
21+
}
22+
23+
Hybrid = LC {
24+
# The new default (since parser version 14) is:
25+
# Screening = MatrixBased {}
26+
27+
# Test the backwards compatibility of the default screening algorithm.
28+
# The results obtained for this input should be equivalent to the old
29+
# default:
30+
# Screening = Thresholded {Threshold = 1.0E-6}
31+
}
32+
33+
}
34+
35+
Options {
36+
WriteAutotestTag = Yes
37+
}
38+
39+
Analysis {
40+
PrintForces = No
41+
}
42+
43+
ParserOptions {
44+
ParserVersion = 13
45+
}
46+
47+
Parallel {
48+
# Allow OMP threads explicitely to test for hybrid parallelisation with
49+
# MPI-binary. (Check the manual before using this in production runs!)
50+
UseOmpThreads = Yes
51+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
30 C
2+
C H
3+
1 1 -0.4960894119E+01 -0.6361793804E+01 -0.1468686907E+00
4+
2 1 -0.4647039074E+01 -0.4993568105E+01 0.1372421501E+00
5+
3 1 -0.5722028171E+01 -0.4120968534E+01 0.4226826256E+00
6+
4 1 -0.5501118315E+01 -0.2767269230E+01 0.7031992906E+00
7+
5 1 -0.4155430196E+01 -0.2249784697E+01 0.7018997732E+00
8+
6 1 -0.3084921974E+01 -0.3106897648E+01 0.4201412979E+00
9+
7 1 -0.3298780018E+01 -0.4475087084E+01 0.1358980437E+00
10+
8 1 -0.2223792399E+01 -0.5347684758E+01 -0.1495623364E+00
11+
9 1 -0.2444692377E+01 -0.6701428083E+01 -0.4298739144E+00
12+
10 1 -0.3790368322E+01 -0.7218938062E+01 -0.4284818920E+00
13+
11 1 -0.3994987538E+01 -0.8606307934E+01 -0.7177101233E+00
14+
12 1 -0.2931247196E+01 -0.9429666486E+01 -0.9915161986E+00
15+
13 1 -0.1602125651E+01 -0.8918534654E+01 -0.9928062919E+00
16+
14 1 -0.1363688757E+01 -0.7594408244E+01 -0.7203324585E+00
17+
15 1 -0.6582077142E+01 -0.1874307988E+01 0.9938718547E+00
18+
16 1 -0.6343611391E+01 -0.5501970380E+00 0.1266409737E+01
19+
17 1 -0.5014494889E+01 -0.3906714851E-01 0.1265013843E+01
20+
18 1 -0.3950763485E+01 -0.8624491386E+00 0.9912470797E+00
21+
19 2 -0.5887346655E+01 -0.6757009196E+01 -0.1458600108E+00
22+
20 2 -0.6748801177E+01 -0.4515351683E+01 0.4237024452E+00
23+
21 2 -0.2058449519E+01 -0.2711734346E+01 0.4192030727E+00
24+
22 2 -0.1197037050E+01 -0.4953257476E+01 -0.1507123994E+00
25+
23 2 -0.5020330183E+01 -0.9002593484E+01 -0.7170706128E+00
26+
24 2 -0.3096933322E+01 -0.1049276507E+02 -0.1212528844E+01
27+
25 2 -0.7671938410E+00 -0.9596870251E+01 -0.1214711168E+01
28+
26 2 -0.3370339568E+00 -0.7201533426E+01 -0.7217040485E+00
29+
27 2 -0.7608717141E+01 -0.2267196965E+01 0.9954153720E+00
30+
28 2 -0.7178510634E+01 0.1281258261E+00 0.1488464300E+01
31+
29 2 -0.4848783686E+01 0.1024035770E+01 0.1485963909E+01
32+
30 2 -0.2925411817E+01 -0.4661810654E+00 0.9906441954E+00
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
############################################################################
2+
#
3+
# Local config file for the tagdiff utility:
4+
#
5+
############################################################################
6+
7+
# NOTE: The tolerances have to distinguish between the results of the
8+
# 'Thresholded' algorithm with default integral screening, i.e.
9+
# Screening = Thresholded {Threshold = 1.0E-6}
10+
# and the exact 'NeighbourBased'/'MatrixBased' algorithms, i.e.
11+
# Screening = MatrixBased {}
12+
# or
13+
# Screening = NeighbourBased {}
14+
.*:real: @ 1.0e-7
15+
.*:complex: @ 1.0e-7
16+
.*:integer:.*: @ 0
17+
.*:logical: @ 0
18+

test/app/dftb+/tests

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ hybrid/cluster/C18H12-force-cam #? MPI_PROCS <= 4
106106
hybrid/cluster/C18H12-nbscreening #? not WITH_MPI
107107
hybrid/cluster/C18H12-matrix #? MPI_PROCS <= 4
108108
hybrid/cluster/CH3 #? not WITH_MPI
109+
hybrid/cluster/CH3-default-compat #? MPI_PROCS <= 1
109110
hybrid/cluster/CH3-matrix #? MPI_PROCS <= 1
110111
hybrid/cluster/C60-nb #? not WITH_MPI
111112
hybrid/cluster/C60-nb-cutoff #? not WITH_MPI
@@ -119,8 +120,8 @@ hybrid/cluster/Thymine-spin-matrix-force-mpi-grp2 #? MPI_PROCS == 2
119120
hybrid/cluster/C4H6-Casida-S1-Force #? not WITH_MPI
120121
hybrid/cluster/Benzene-Spinpol-matrix #? MPI_PROCS <= 1
121122
hybrid/cluster/Benzene-Casida-S5-Force #? not WITH_MPI
122-
hybrid/cluster/C4H6-TD-LC-Triplet #? MPI_PROCS <= 4
123-
hybrid/cluster/Benzene-TD-LC-Spinpol #? MPI_PROCS <= 4
123+
hybrid/cluster/C4H6-TD-LC-Triplet #? MPI_PROCS <= 4
124+
hybrid/cluster/Benzene-TD-LC-Spinpol #? MPI_PROCS <= 4
124125
hybrid/cluster/Benzene-TD-LC-Spinpol-Force #? not WITH_MPI
125126
hybrid/cluster/Benzene-TD-LC-Spinpol-Iter #? MPI_PROCS <= 4
126127

0 commit comments

Comments
 (0)