pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

Q-Chem: `QCInput` could handle `JOBTYPE` better in various ways

Open Andrew-S-Rosen opened this issue 1 year ago • 0 comments

Problem

Part 1

https://github.com/materialsproject/pymatgen/blob/c8154cd5c1591734795232b1c7be581417f270b5/pymatgen/io/qchem/inputs.py#L178-L188

image

The list of valid job types in QCInput does not include all the valid ones that Q-Chem takes. I must admit, I don't really know why Pymatgen is bothering with checking the validity of the input flags (seems out of scope), but regardless, there are several missing.

Part 2

Also, QCInput will raise a ValueError if no job type is specified, but the default value in Q-Chem is "SP". So, QCInput should still be able to write an input file if no job type is explicitly specified by the user.

Part 3

EDIT: I guess this is more just me being pedantic. Let's ignore this one.

The appropriate name for the job type according to the Q-Chem manual is JOBTYPE (case-insensitive). However, QCInput internally uses job_type (with the underscore). To make sure QCInput handles things appropriately, it will automatically convert jobtype to job_type. This is, in principle, fine. However, one would expect that the written input file would revert back to what the Q-Chem manual states, which is jobtype without the underscore. QCInput does not do this.

Yes, this is minor, but I found this incredibly confusing as a new user of QCInput but existing user of Q-Chem itself. Presumably, Q-Chem ignores the underscores, although I was not aware of this since it doesn't seem to be documented anywhere.

Proposed Solution

Part 1

Add support for additional job types listed in the above table. While QCInput might not actually support all the various features, there are several job types that are valid and missing, e.g. "SINGLE_POINT" as a synonym to "SP". If some are not explicitly supported by QCInput, a different error should be raised specifically for those.

Part 2

Allow for no job type at all (i.e. effectively a single point).

Part 3

In the __str__ method of QCInput, switch back to using jobtype to be in alignment with the Q-Chem manual.

Alternatives

No response

Andrew-S-Rosen avatar Nov 21 '23 07:11 Andrew-S-Rosen