Skip to content

Commit 12e268a

Browse files
authored
ORCA Freq Parser (TS) (#818)
ORCA, when used to parse for neg freq in a TS, would not pick up the negative freq. It would throw it away due to the line of code saying freq > 0.
2 parents cfebdfb + e808e8e commit 12e268a

3 files changed

Lines changed: 1646 additions & 1 deletion

File tree

arc/parser/adapters/orca.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def parse_frequencies(self) -> Optional[np.ndarray]:
139139
if len(parts) >= 2 and parts[0].rstrip(':').isdigit():
140140
try:
141141
freq = float(parts[1])
142-
if freq > 0:
142+
# Keep negative freqs (imaginary modes), drop exact zeros (translations/rotations).
143+
if abs(freq) > 0.0:
143144
frequencies.append(freq)
144145
found_freqs = True
145146
except ValueError:

arc/parser/parser_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def test_parse_frequencies(self):
5656
ch2o_path_terachem_output = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'formaldehyde_freq_terachem_output.out')
5757
ncc_path_terachem_output = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'ethylamine_freq_terachem_output.out')
5858
orca_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'orca_example_freq.log')
59+
orca_ts_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'orca_neg_freq_ts.out')
5960
dual_freq_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'dual_freq_output.out')
6061
co2_xtb_freqs_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'CO2_xtb.out')
6162
ts_xtb_freqs_path = os.path.join(ARC_PATH, 'arc', 'testing', 'freq', 'TS_NH2+N2H3_xtb.out')
@@ -72,6 +73,7 @@ def test_parse_frequencies(self):
7273
ch2o_terachem_output_freqs = parser.parse_frequencies(log_file_path=ch2o_path_terachem_output) # TeraChem
7374
ncc_terachem_output_freqs = parser.parse_frequencies(log_file_path=ncc_path_terachem_output) # TeraChem
7475
orca_freqs = parser.parse_frequencies(log_file_path=orca_path) # Orca
76+
orca_ts_freqs = parser.parse_frequencies(log_file_path=orca_ts_path) # Orca TS (imaginary mode)
7577
dual_freqs = parser.parse_frequencies(log_file_path=dual_freq_path) # Gaussian
7678
co2_xtb_freqs = parser.parse_frequencies(log_file_path=co2_xtb_freqs_path)
7779
ts_xtb_freqs = parser.parse_frequencies(log_file_path=ts_xtb_freqs_path)
@@ -106,6 +108,10 @@ def test_parse_frequencies(self):
106108
3087.60678739, 3447.41720077, 3529.23879182], np.float64))
107109
np.testing.assert_almost_equal(orca_freqs,
108110
np.array([1151.03, 1250.19, 1526.12, 1846.4, 3010.49, 3070.82], np.float64))
111+
np.testing.assert_almost_equal(orca_ts_freqs,
112+
np.array([-1271.62, 9.95, 340.56, 351.84, 723.13, 895.07, 1159.62, 1269.11,
113+
1377.92, 1448.9, 1461.05, 3090.01, 3217.06, 3220.87, 3812.33],
114+
np.float64))
109115
np.testing.assert_almost_equal(dual_freqs,
110116
np.array([-1617.8276, 56.9527, 76.681, 121.4038, 182.1572, 194.9796,
111117
202.4056, 209.9621, 273.506, 342.468, 431.985, 464.0768,

0 commit comments

Comments
 (0)