Skip to content

load_many from fchk fails if the Gaussian job is an optimization of a single atom #386

@mbocus

Description

@mbocus

Hi all,

I have stumbled upon an issue when loading a formatted checkpoint file of Gaussian (*.fchk). I have a script that checks the job type and, if it is an optimization, uses the load_many function to parse the output. If the optimization of a species with more than one atom finishes in one step (i.e., the structure is already optimized), all works as intended. For example:

for mol in load_many("water.fchk"):
    print(mol.atcoords)

returns

[[-3.13242678e-34 -7.31649715e-35  2.40261291e-01]
 [-2.33989326e-32  1.43244075e+00 -9.61045165e-01]
 [-1.75423398e-16 -1.43244075e+00 -9.61045165e-01]]

On the other hand, in the limiting case in which a single atom is "optimized" (which is obviously meaningless, but something that can happen in automated workflows), the reading fails with the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mbocus/miniconda3/envs/iodata_env/lib/python3.11/site-packages/iodata/api.py", line 219, in load_many
    for data in format_module.load_many(lit, **kwargs):
  File "/home/mbocus/miniconda3/envs/iodata_env/lib/python3.11/site-packages/iodata/formats/fchk.py", line 329, in load_many
    raise LoadError("Cannot find IRC or Optimization trajectory in FCHK file.", lit)
iodata.utils.LoadError: Cannot find IRC or Optimization trajectory in FCHK file. (atom.fchk:1044)

I am using the latest iodata release (v1.0.0a8) and, attached, you may find the two fchk files I used for testing.

Thanks a lot in advance,
Massimo

water.fchk.txt
atom.fchk.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions