Skip to content

Commit 112c267

Browse files
Run CCS/VTZ for [H] instead of more complex WF methods (#790)
Methods such as `DLPNO-CCSD(T)` which is frequenctly used for kinetics due to it's efficiency and relatively good accuracy cannot be applied for `[H]`. This method relies on electron pairs for defining correlation spaces, and the H radical has only one electron. Therefore, reactions such as `RH + H <=> R + H2` cannot be computed using this method. However, since the energy of H is relatively simple, it is "known" percisely or can be computed using another Coupled-Cluster method without the DLPNO (Domain-based Local Pair Natural Orbital) assumption. This PR runs a simple and quick CC job for H if a DLPNO method was requested for it.
2 parents 827a08e + 09d79eb commit 112c267

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

arc/job/ssh.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,8 +578,7 @@ def check_job_status_in_stdout(job_id: int,
578578
return 'errored'
579579
elif servers[server]['cluster_soft'].lower() == 'htcondor':
580580
return 'running'
581-
else:
582-
raise ValueError(f'Unknown cluster software {servers[server]["cluster_soft"]}')
581+
raise ValueError(f'Unknown cluster software {servers[server]["cluster_soft"]}')
583582

584583

585584
def delete_all_arc_jobs(server_list: list,

arc/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def __init__(self,
384384
indices_to_pop.append(i)
385385
converted_reactions.append(ARCReaction(reaction_dict=rxn, species_list=self.species))
386386
elif not isinstance(rxn, ARCReaction):
387-
raise ValueError(f'A reaction should either be an `ARCReaction` object.\nGot {type(rxn)} for {rxn}')
387+
raise ValueError(f'An input reaction should be an `ARCReaction` object. Got:\n{type(rxn)} for {rxn}')
388388
for i in reversed(range(len(self.reactions))): # pop from the end, so other indices won't change
389389
if i in indices_to_pop:
390390
self.reactions.pop(i)

arc/scheduler.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,12 @@ def end_job(self, job: 'JobAdapter',
989989
self.running_jobs[label].pop(self.running_jobs[label].index(job_name))
990990
return False
991991

992+
RETRY_COUNT, RETRY_SLEEP_SECONDS = 5, 10
993+
i = RETRY_COUNT
994+
while i and not os.path.isfile(job.local_path_to_output_file):
995+
i -= 1
996+
time.sleep(RETRY_SLEEP_SECONDS)
997+
992998
if not os.path.isfile(job.local_path_to_output_file) and not job.execution_type == 'incore':
993999
job.rename_output_file()
9941000
if not os.path.isfile(job.local_path_to_output_file) and not job.execution_type == 'incore':
@@ -1274,10 +1280,10 @@ def run_sp_job(self,
12741280

12751281
if self.job_types['conf_sp'] and conformer is not None and self.conformer_sp_level != self.conformer_opt_level:
12761282
self.run_job(label=label,
1277-
xyz=self.species_dict[label].conformers[conformer],
1278-
level_of_theory=self.conformer_sp_level,
1279-
job_type='conf_sp',
1280-
conformer=conformer)
1283+
xyz=self.species_dict[label].conformers[conformer],
1284+
level_of_theory=self.conformer_sp_level,
1285+
job_type='conf_sp',
1286+
conformer=conformer)
12811287
return
12821288
# determine_occ(xyz=self.xyz, charge=self.charge)
12831289
if level == self.opt_level and not self.composite_method \
@@ -1348,6 +1354,10 @@ def run_sp_job(self,
13481354
xyz=self.species_dict[label].get_xyz(generate=False),
13491355
level_of_theory='ccsd/vdz',
13501356
job_type='sp')
1357+
mol = self.species_dict[label].mol
1358+
if mol is not None and len(mol.atoms) == 1 and mol.atoms[0].element.symbol == 'H' and 'DLPNO' in level.method:
1359+
# Run only CCSD for an H atom instead of DLPNO-CCSD(T) / etc.
1360+
level = Level(repr='ccsd/vtz', software=level.software, args=level.args)
13511361
if self.job_types['sp']:
13521362
if self.species_dict[label].multi_species:
13531363
if self.output_multi_spc[self.species_dict[label].multi_species].get('sp', False):

arc/species/species.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,14 +1076,16 @@ def is_isomorphic(self, other: Union['ARCSpecies', Molecule]) -> Optional[bool]:
10761076
other_aromatic = generate_aromatic_resonance_structure(mol=other, copy=False) if other.is_cyclic() else []
10771077
other = other_aromatic[0] if len(other_aromatic) else other
10781078
if isinstance(other, Molecule):
1079+
if len(self.mol.atoms) != len(other.atoms):
1080+
return False
10791081
if self.mol_list is not None and len(self.mol_list):
10801082
for mol_ in [self.mol] + self.mol_list:
10811083
if mol_.copy(deep=True).is_isomorphic(other):
10821084
return True
10831085
return False
10841086
else:
10851087
return self.mol.copy(deep=True).is_isomorphic(other)
1086-
raise SpeciesError(f'Can only compare isomorphism to other ARCSpecies, RMG Species, or Molecule '
1088+
raise SpeciesError(f'Can only compare isomorphism to other ARCSpecies or Molecule '
10871089
f'object instances, got {other} which is of type {type(other)}.')
10881090

10891091
def generate_conformers(self,

0 commit comments

Comments
 (0)