Skip to content

Commit d4b28ba

Browse files
add error message when Gaussian input orientation is missing (#568)
Fix #512. --------- Signed-off-by: Jinzhe Zeng <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f608def commit d4b28ba

File tree

3 files changed

+368
-0
lines changed

3 files changed

+368
-0
lines changed

dpdata/gaussian/log.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@
1111

1212

1313
def to_system_data(file_name, md=False):
14+
"""Read Gaussian log file.
15+
16+
Parameters
17+
----------
18+
file_name : str
19+
file name
20+
md : bool, default False
21+
whether to read multiple frames
22+
23+
Returns
24+
-------
25+
data : dict
26+
system data
27+
28+
Raises
29+
------
30+
RuntimeError
31+
if the input orientation is not found
32+
"""
1433
data = {}
1534
# read from log lines
1635
flag = 0
@@ -20,6 +39,7 @@ def to_system_data(file_name, md=False):
2039
forces_t = []
2140
cells_t = []
2241
nopbc = True
42+
coords = None
2343

2444
with open(file_name) as fp:
2545
for line in fp:
@@ -44,6 +64,12 @@ def to_system_data(file_name, md=False):
4464
elif flag == 4:
4565
# forces
4666
if line.startswith(" -------"):
67+
if coords is None:
68+
raise RuntimeError(
69+
"Input orientation is not found. Using Gaussian keyword "
70+
"`Geom=PrintInputOrient` to always print the input orientation. "
71+
"See https://gaussian.com/geom/ for more details."
72+
)
4773
forces_t.append(forces)
4874
energy_t.append(energy)
4975
coords_t.append(coords)
@@ -55,6 +81,7 @@ def to_system_data(file_name, md=False):
5581
[[100.0, 0.0, 0.0], [0.0, 100.0, 0.0], [0.0, 0.0, 100.0]]
5682
)
5783
flag = 0
84+
coords = None
5885
else:
5986
s = line.split()
6087
if line[14:16] == "-2":
Lines changed: 331 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,331 @@
1+
Entering Gaussian System, Link 0=g16
2+
Initial command:
3+
/home/jzzeng/soft/g16/l1.exe "/home/jzzeng/test/Gau-15026.inp" -scrdir="/home/jzzeng/test/"
4+
Entering Link 1 = /home/jzzeng/soft/g16/l1.exe PID= 15028.
5+
6+
Copyright (c) 1988,1990,1992,1993,1995,1998,2003,2009,2016,
7+
Gaussian, Inc. All Rights Reserved.
8+
9+
This is part of the Gaussian(R) 16 program. It is based on
10+
the Gaussian(R) 09 system (copyright 2009, Gaussian, Inc.),
11+
the Gaussian(R) 03 system (copyright 2003, Gaussian, Inc.),
12+
the Gaussian(R) 98 system (copyright 1998, Gaussian, Inc.),
13+
the Gaussian(R) 94 system (copyright 1995, Gaussian, Inc.),
14+
the Gaussian 92(TM) system (copyright 1992, Gaussian, Inc.),
15+
the Gaussian 90(TM) system (copyright 1990, Gaussian, Inc.),
16+
the Gaussian 88(TM) system (copyright 1988, Gaussian, Inc.),
17+
the Gaussian 86(TM) system (copyright 1986, Carnegie Mellon
18+
University), and the Gaussian 82(TM) system (copyright 1983,
19+
Carnegie Mellon University). Gaussian is a federally registered
20+
trademark of Gaussian, Inc.
21+
22+
This software contains proprietary and confidential information,
23+
including trade secrets, belonging to Gaussian, Inc.
24+
25+
This software is provided under written license and may be
26+
used, copied, transmitted, or stored only in accord with that
27+
written license.
28+
29+
The following legend is applicable only to US Government
30+
contracts under FAR:
31+
32+
RESTRICTED RIGHTS LEGEND
33+
34+
Use, reproduction and disclosure by the US Government is
35+
subject to restrictions as set forth in subparagraphs (a)
36+
and (c) of the Commercial Computer Software - Restricted
37+
Rights clause in FAR 52.227-19.
38+
39+
Gaussian, Inc.
40+
340 Quinnipiac St., Bldg. 40, Wallingford CT 06492
41+
42+
43+
---------------------------------------------------------------
44+
Warning -- This program may not be used in any manner that
45+
competes with the business of Gaussian, Inc. or will provide
46+
assistance to any competitor of Gaussian, Inc. The licensee
47+
of this program is prohibited from giving any competitor of
48+
Gaussian, Inc. access to this program. By using this program,
49+
the user acknowledges that Gaussian, Inc. is engaged in the
50+
business of creating and licensing software in the field of
51+
computational chemistry and represents and warrants to the
52+
licensee that it is not a competitor of Gaussian, Inc. and that
53+
it will not use this program in any manner prohibited above.
54+
---------------------------------------------------------------
55+
56+
57+
Cite this work as:
58+
Gaussian 16, Revision A.03,
59+
M. J. Frisch, G. W. Trucks, H. B. Schlegel, G. E. Scuseria,
60+
M. A. Robb, J. R. Cheeseman, G. Scalmani, V. Barone,
61+
G. A. Petersson, H. Nakatsuji, X. Li, M. Caricato, A. V. Marenich,
62+
J. Bloino, B. G. Janesko, R. Gomperts, B. Mennucci, H. P. Hratchian,
63+
J. V. Ortiz, A. F. Izmaylov, J. L. Sonnenberg, D. Williams-Young,
64+
F. Ding, F. Lipparini, F. Egidi, J. Goings, B. Peng, A. Petrone,
65+
T. Henderson, D. Ranasinghe, V. G. Zakrzewski, J. Gao, N. Rega,
66+
G. Zheng, W. Liang, M. Hada, M. Ehara, K. Toyota, R. Fukuda,
67+
J. Hasegawa, M. Ishida, T. Nakajima, Y. Honda, O. Kitao, H. Nakai,
68+
T. Vreven, K. Throssell, J. A. Montgomery, Jr., J. E. Peralta,
69+
F. Ogliaro, M. J. Bearpark, J. J. Heyd, E. N. Brothers, K. N. Kudin,
70+
V. N. Staroverov, T. A. Keith, R. Kobayashi, J. Normand,
71+
K. Raghavachari, A. P. Rendell, J. C. Burant, S. S. Iyengar,
72+
J. Tomasi, M. Cossi, J. M. Millam, M. Klene, C. Adamo, R. Cammi,
73+
J. W. Ochterski, R. L. Martin, K. Morokuma, O. Farkas,
74+
J. B. Foresman, and D. J. Fox, Gaussian, Inc., Wallingford CT, 2016.
75+
76+
******************************************
77+
Gaussian 16: ES64L-G16RevA.03 25-Dec-2016
78+
25-Jun-2019
79+
******************************************
80+
%nproc=28
81+
Will use up to 28 processors via shared memory.
82+
--------------------
83+
#force b3lyp/6-31g**
84+
--------------------
85+
1/10=7,30=1,38=1/1,3;
86+
2/12=2,17=6,18=5,40=1/2;
87+
3/5=1,6=6,7=101,11=2,25=1,30=1,71=1,74=-5/1,2,3;
88+
4//1;
89+
5/5=2,38=5/2;
90+
6/7=2,8=2,9=2,10=2,28=1/1;
91+
7/29=1/1,2,3,16;
92+
1/10=7,30=1/3;
93+
99//99;
94+
-------
95+
methane
96+
-------
97+
Symbolic Z-matrix:
98+
Charge = 0 Multiplicity = 1
99+
C 1.07422 -0.06034 0.02917
100+
H 2.16642 -0.06034 0.02917
101+
H 0.71015 -0.92887 -0.52401
102+
H 0.71015 0.85299 -0.44641
103+
H 0.71015 -0.10514 1.05793
104+
105+
106+
GradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGrad
107+
Berny optimization.
108+
Initialization pass.
109+
Trust Radius=3.00D-01 FncErr=1.00D-07 GrdErr=1.00D-07 EigMax=2.50D+02 EigMin=1.00D-04
110+
Number of steps in this run= 2 maximum allowed number of steps= 2.
111+
GradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGrad
112+
113+
Distance matrix (angstroms):
114+
1 2 3 4 5
115+
1 C 0.000000
116+
2 H 1.092200 0.000000
117+
3 H 1.092199 1.783557 0.000000
118+
4 H 1.092197 1.783556 1.783549 0.000000
119+
5 H 1.092200 1.783557 1.783554 1.783550 0.000000
120+
Stoichiometry CH4
121+
Framework group C1[X(CH4)]
122+
Deg. of freedom 9
123+
Full point group C1 NOp 1
124+
Largest Abelian subgroup C1 NOp 1
125+
Largest concise Abelian subgroup C1 NOp 1
126+
Standard orientation:
127+
---------------------------------------------------------------------
128+
Center Atomic Atomic Coordinates (Angstroms)
129+
Number Number Type X Y Z
130+
---------------------------------------------------------------------
131+
1 6 0 -0.000001 0.000000 0.000000
132+
2 1 0 -1.092201 0.000000 0.000000
133+
3 1 0 0.364069 -0.813864 -0.630855
134+
4 1 0 0.364069 -0.139406 1.020252
135+
5 1 0 0.364069 0.953270 -0.389397
136+
---------------------------------------------------------------------
137+
Rotational constants (GHZ): 157.6380023 157.6375616 157.6370163
138+
Standard basis: 6-31G(d,p) (6D, 7F)
139+
There are 35 symmetry adapted cartesian basis functions of A symmetry.
140+
There are 35 symmetry adapted basis functions of A symmetry.
141+
35 basis functions, 56 primitive gaussians, 35 cartesian basis functions
142+
5 alpha electrons 5 beta electrons
143+
nuclear repulsion energy 13.4083363407 Hartrees.
144+
NAtoms= 5 NActive= 5 NUniq= 5 SFac= 1.00D+00 NAtFMM= 60 NAOKFM=F Big=F
145+
Integral buffers will be 131072 words long.
146+
Raffenetti 2 integral format.
147+
Two-electron integral symmetry is turned on.
148+
One-electron integrals computed using PRISM.
149+
NBasis= 35 RedAO= T EigKep= 1.79D-02 NBF= 35
150+
NBsUse= 35 1.00D-06 EigRej= -1.00D+00 NBFU= 35
151+
ExpMin= 1.61D-01 ExpMax= 3.05D+03 ExpMxC= 4.57D+02 IAcc=3 IRadAn= 5 AccDes= 0.00D+00
152+
Harris functional with IExCor= 402 and IRadAn= 5 diagonalized for initial guess.
153+
HarFok: IExCor= 402 AccDes= 0.00D+00 IRadAn= 5 IDoV= 1 UseB2=F ITyADJ=14
154+
ICtDFT= 3500011 ScaDFX= 1.000000 1.000000 1.000000 1.000000
155+
FoFCou: FMM=F IPFlag= 0 FMFlag= 100000 FMFlg1= 0
156+
NFxFlg= 0 DoJE=T BraDBF=F KetDBF=T FulRan=T
157+
wScrn= 0.000000 ICntrl= 500 IOpCl= 0 I1Cent= 200000004 NGrid= 0
158+
NMat0= 1 NMatS0= 1 NMatT0= 0 NMatD0= 1 NMtDS0= 0 NMtDT0= 0
159+
Petite list used in FoFCou.
160+
Keep R1 ints in memory in canonical form, NReq=24354403.
161+
Requested convergence on RMS density matrix=1.00D-08 within 128 cycles.
162+
Requested convergence on MAX density matrix=1.00D-06.
163+
Requested convergence on energy=1.00D-06.
164+
No special actions if energy rises.
165+
Integral accuracy reduced to 1.0D-05 until final iterations.
166+
Initial convergence to 1.0D-05 achieved. Increase integral accuracy.
167+
SCF Done: E(RB3LYP) = -40.5240137309 A.U. after 8 cycles
168+
NFock= 8 Conv=0.23D-08 -V/T= 2.0111
169+
170+
**********************************************************************
171+
172+
Population analysis using the SCF density.
173+
174+
**********************************************************************
175+
176+
Orbital symmetries:
177+
Occupied (A) (A) (A) (A) (A)
178+
Virtual (A) (A) (A) (A) (A) (A) (A) (A) (A) (A) (A) (A)
179+
(A) (A) (A) (A) (A) (A) (A) (A) (A) (A) (A) (A)
180+
(A) (A) (A) (A) (A) (A)
181+
The electronic state is 1-A.
182+
Alpha occ. eigenvalues -- -10.16717 -0.69034 -0.38827 -0.38827 -0.38827
183+
Alpha virt. eigenvalues -- 0.11818 0.17670 0.17670 0.17670 0.52921
184+
Alpha virt. eigenvalues -- 0.52921 0.52921 0.87424 0.87424 0.87424
185+
Alpha virt. eigenvalues -- 0.92208 1.10023 1.36345 1.36345 2.04806
186+
Alpha virt. eigenvalues -- 2.04806 2.04806 2.05141 2.05142 2.05142
187+
Alpha virt. eigenvalues -- 2.62952 2.62953 2.62953 2.91074 2.91074
188+
Alpha virt. eigenvalues -- 3.11458 3.41994 3.41994 3.41994 4.42248
189+
Condensed to atoms (all electrons):
190+
1 2 3 4 5
191+
1 C 4.899051 0.392830 0.392830 0.392830 0.392830
192+
2 H 0.392830 0.573073 -0.027832 -0.027832 -0.027832
193+
3 H 0.392830 -0.027832 0.573075 -0.027833 -0.027832
194+
4 H 0.392830 -0.027832 -0.027833 0.573074 -0.027833
195+
5 H 0.392830 -0.027832 -0.027832 -0.027833 0.573075
196+
Mulliken charges:
197+
1
198+
1 C -0.470371
199+
2 H 0.117593
200+
3 H 0.117593
201+
4 H 0.117593
202+
5 H 0.117593
203+
Sum of Mulliken charges = 0.00000
204+
Mulliken charges with hydrogens summed into heavy atoms:
205+
1
206+
1 C 0.000000
207+
Electronic spatial extent (au): <R**2>= 35.4329
208+
Charge= 0.0000 electrons
209+
Dipole moment (field-independent basis, Debye):
210+
X= 0.0000 Y= -0.0000 Z= 0.0000 Tot= 0.0000
211+
Quadrupole moment (field-independent basis, Debye-Ang):
212+
XX= -8.2465 YY= -8.2465 ZZ= -8.2465
213+
XY= -0.0000 XZ= 0.0000 YZ= 0.0000
214+
Traceless Quadrupole moment (field-independent basis, Debye-Ang):
215+
XX= 0.0000 YY= -0.0000 ZZ= -0.0000
216+
XY= -0.0000 XZ= 0.0000 YZ= 0.0000
217+
Octapole moment (field-independent basis, Debye-Ang**2):
218+
XXX= -0.7604 YYY= 0.2130 ZZZ= 0.4937 XYY= 0.3802
219+
XXY= -0.0000 XXZ= 0.0000 XZZ= 0.3802 YZZ= -0.2130
220+
YYZ= -0.4937 XYZ= 0.0000
221+
Hexadecapole moment (field-independent basis, Debye-Ang**3):
222+
XXXX= -14.9429 YYYY= -15.1704 ZZZZ= -15.1704 XXXY= -0.0000
223+
XXXZ= 0.0000 YYYX= 0.1275 YYYZ= 0.0000 ZZZX= 0.2954
224+
ZZZY= -0.0000 XXYY= -5.2843 XXZZ= -5.2843 YYZZ= -5.0568
225+
XXYZ= 0.0000 YYXZ= -0.2954 ZZXY= -0.1275
226+
N-N= 1.340833634068D+01 E-N=-1.198747475070D+02 KE= 4.007727827872D+01
227+
Calling FoFJK, ICntrl= 2127 FMM=F ISym2X=0 I1Cent= 0 IOpClX= 0 NMat=1 NMatS=1 NMatT=0.
228+
***** Axes restored to original set *****
229+
-------------------------------------------------------------------
230+
Center Atomic Forces (Hartrees/Bohr)
231+
Number Number X Y Z
232+
-------------------------------------------------------------------
233+
1 6 -0.000000623 -0.000000654 0.000000794
234+
2 1 -0.000215948 -0.000000016 -0.000000010
235+
3 1 0.000072325 0.000170842 0.000109258
236+
4 1 0.000071925 -0.000178640 0.000093176
237+
5 1 0.000072322 0.000008469 -0.000203220
238+
-------------------------------------------------------------------
239+
Cartesian Forces: Max 0.000215948 RMS 0.000111163
240+
241+
GradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGrad
242+
Berny optimization.
243+
Search for a local minimum.
244+
Step number 1 out of a maximum of 2
245+
All quantities printed in internal units (Hartrees-Bohrs-Radians)
246+
Second derivative matrix not updated -- first step.
247+
The second derivative matrix:
248+
X1 Y1 Z1 X2 Y2
249+
X1 0.66422
250+
Y1 -0.00000 0.66422
251+
Z1 0.00000 -0.00000 0.66422
252+
X2 -0.34560 -0.00000 0.00000 0.34560
253+
Y2 -0.00000 -0.07628 -0.00000 0.00000 0.05678
254+
Z2 0.00000 -0.00000 -0.07628 -0.00000 0.00000
255+
X3 -0.10621 -0.07139 -0.04547 -0.00000 -0.02998
256+
Y3 -0.07139 -0.24659 -0.10847 0.00000 0.00907
257+
Z3 -0.04547 -0.10847 -0.14537 0.00000 0.00550
258+
X4 -0.10621 0.07507 -0.03909 -0.00000 0.03153
259+
Y4 0.07507 -0.26461 0.09806 -0.00000 0.00998
260+
Z4 -0.03909 0.09806 -0.12735 0.00000 -0.00497
261+
X5 -0.10621 -0.00368 0.08456 0.00000 -0.00155
262+
Y5 -0.00368 -0.07674 0.01040 -0.00000 0.00046
263+
Z5 0.08456 0.01041 -0.31522 0.00000 -0.00053
264+
Z2 X3 Y3 Z3 X4
265+
Z2 0.05678
266+
X3 -0.01910 0.08887
267+
Y3 0.00550 0.07656 0.23942
268+
Z3 0.00394 0.04876 0.11633 0.13087
269+
X4 -0.01642 0.00867 -0.01076 0.01119 0.08887
270+
Y4 -0.00497 0.00975 -0.01251 0.01323 -0.08051
271+
Z4 0.00302 0.01208 -0.01579 0.01685 0.04192
272+
X5 0.03551 0.00867 0.00559 -0.01448 0.00867
273+
Y5 -0.00053 0.01507 0.01062 -0.02659 -0.01533
274+
Z5 0.01255 0.00372 0.00244 -0.00628 0.00240
275+
Y4 Z4 X5 Y5 Z5
276+
Y4 0.25875
277+
Z4 -0.10517 0.11154
278+
X5 -0.00431 -0.01491 0.08887
279+
Y5 0.00840 0.02787 0.00395 0.05726
280+
Z5 -0.00116 -0.00406 -0.09068 -0.01116 0.31302
281+
ITU= 0
282+
Eigenvalues --- 0.11268 0.11268 0.13515 0.13515 0.13515
283+
Eigenvalues --- 0.34560 0.81139 0.81139 0.81140
284+
Angle between quadratic step and forces= 0.37 degrees.
285+
Linear search not attempted -- first point.
286+
B after Tr= -0.000001 0.000000 -0.000000
287+
Rot= 1.000000 0.000000 -0.000000 -0.000000 Ang= 0.00 deg.
288+
Variable Old X -DE/DX Delta X Delta X Delta X New X
289+
(Linear) (Quad) (Total)
290+
X1 2.02998 -0.00000 0.00000 -0.00000 -0.00000 2.02998
291+
Y1 -0.11403 -0.00000 0.00000 0.00000 0.00000 -0.11403
292+
Z1 0.05512 0.00000 0.00000 -0.00000 -0.00000 0.05512
293+
X2 4.09394 -0.00022 0.00000 -0.00063 -0.00063 4.09331
294+
Y2 -0.11403 -0.00000 0.00000 -0.00000 -0.00000 -0.11403
295+
Z2 0.05512 -0.00000 0.00000 0.00000 -0.00000 0.05512
296+
X3 1.34199 0.00007 0.00000 0.00021 0.00021 1.34220
297+
Y3 -1.75531 0.00017 0.00000 0.00049 0.00049 -1.75482
298+
Z3 -0.99024 0.00011 0.00000 0.00032 0.00032 -0.98992
299+
X4 1.34199 0.00007 0.00000 0.00021 0.00021 1.34220
300+
Y4 1.61192 -0.00018 0.00000 -0.00051 -0.00051 1.61140
301+
Z4 -0.84359 0.00009 0.00000 0.00027 0.00027 -0.84332
302+
X5 1.34199 0.00007 0.00000 0.00021 0.00021 1.34220
303+
Y5 -0.19869 0.00001 0.00000 0.00002 0.00002 -0.19866
304+
Z5 1.99920 -0.00020 0.00000 -0.00059 -0.00059 1.99861
305+
Item Value Threshold Converged?
306+
Maximum Force 0.000216 0.000450 YES
307+
RMS Force 0.000111 0.000300 YES
308+
Maximum Displacement 0.000628 0.001800 YES
309+
RMS Displacement 0.000322 0.001200 YES
310+
Predicted change in Energy=-2.681743D-07
311+
Optimization completed.
312+
-- Stationary point found.
313+
GradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGradGrad
314+
315+
1\1\GINC-LOCALHOST\Force\RB3LYP\6-31G(d,p)\C1H4\JZZENG\25-Jun-2019\0\\
316+
#force b3lyp/6-31g**\\methane\\0,1\C,1.07422,-0.06034,0.02917\H,2.1664
317+
2,-0.06034,0.02917\H,0.71015,-0.92887,-0.52401\H,0.71015,0.85299,-0.44
318+
641\H,0.71015,-0.10514,1.05793\\Version=ES64L-G16RevA.03\State=1-A\HF=
319+
-40.5240137\RMSD=2.291e-09\RMSF=1.112e-04\Dipole=-0.0000018,0.0000007,
320+
-0.0000007\Quadrupole=0.0000105,-0.0000083,-0.0000022,-0.000001,0.0000
321+
01,0.0000025\PG=C01 [X(C1H4)]\\@
322+
323+
324+
SEE YOU NOW,
325+
YOUR BAIT OF FALSEHOOD TAKES THIS CARP OF TRUTH.
326+
AND THUS DO WE OF WISDOM AND OF REACH...
327+
BY INDIRECTIONS FIND DIRECTIONS OUT. -- HAMLET, II, 1
328+
Job cpu time: 0 days 0 hours 1 minutes 11.1 seconds.
329+
Elapsed time: 0 days 0 hours 0 minutes 3.2 seconds.
330+
File lengths (MBytes): RWF= 6 Int= 0 D2E= 0 Chk= 1 Scr= 1
331+
Normal termination of Gaussian 16 at Tue Jun 25 00:14:07 2019.

0 commit comments

Comments
 (0)