Repository navigation
[WIP] Use the Q-Chem input set generators from pymatgen - #1658
Draft
rkingsbury wants to merge 1 commit into
Draft
rkingsbury wants to merge 1 commit into
rkingsbury wants to merge 1 commit into
Conversation
The Q-Chem input set (QCInputSet) and input set generators (QCInputGenerator, SinglePointSetGenerator, OptSetGenerator, TransitionStateSetGenerator, ForceSetGenerator, FreqSetGenerator, PESScanSetGenerator) now live in pymatgen.io.qchem.sets. The makers import them from there, and atomate2.qchem.sets.base / atomate2.qchem.sets.core only re-export them so that existing imports keep working. This needs a pymatgen-core release that ships the generators; the pymatgen-core requirement has to be raised to that release before this can be merged. Changes in behavior: - Default basis sets follow pymatgen: def2-tzvpd for single point and force jobs, def2-svpd for optimization, transition state, frequency and PES scan jobs (previously def2-tzvppd for all of them). - dft_rung=2 writes "method = b97-d3" instead of "method = b97d3". - Empty $nbo and $geom_opt sections are no longer written. - Generator arguments are named as in pymatgen: opt_variables, scan_variables and geom_opt replace opt_dict, scan_dict and new_geom_opt. The derived rem_dict, pcm_dict, solv_dict, smx_dict, vdw_dict and plots_dict fields are gone; use overwrite_inputs to change individual sections. - Generators are no longer modified by get_input_set and can be reused. - New settings: qchem_version, isosvp_dielectric, cmirs_solvent, cdft_constraints, almo_coupling_states, output_wavefunction and extra_scf_print. The solvent_data file of custom SMD solvents is written. - A PES scan without scan variables raises an error. BaseQCMaker no longer generates the input set twice. The reference inputs of the frequency flattening tests lose their empty $nbo and $geom_opt sections, and test_frequency_opt_maker sets the basis set of its reference data. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Pt7k6Qb7T25NTifwGtpu2
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the discussion in materialsproject/atomate2#689, where it was agreed that the Q-Chem input sets should eventually move into pymatgen. That move is materialsproject/pymatgen-core#315; this PR is the atomate2 side.
QCInputSet,QCInputGeneratorand the six job-type generators (SinglePointSetGenerator,OptSetGenerator,TransitionStateSetGenerator,ForceSetGenerator,FreqSetGenerator,PESScanSetGenerator) are now imported frompymatgen.io.qchem.sets. The atomate2 copies are removed.atomate2.qchem.sets.baseandatomate2.qchem.sets.coreremain as re-exports, so existing imports keep working.BaseQCMaker.makeno longer generates the input set twice.get_input_set, so a generator (and the maker holding it) can be reused for any number of molecules. The old ones accumulated state inrem_dictetc. on every call.qchem_version,isosvp_dielectric,cmirs_solvent,cdft_constraints,almo_coupling_states,output_wavefunction,extra_scf_print. Thesolvent_datafile needed for custom SMD solvents in Q-Chem 5 is now written.Changes in behavior
Found by diffing the default input of every maker before and after the change:
def2-tzvpdfor single point and force jobs,def2-svpdfor optimization, transition state, frequency and PES scan jobs. Previouslydef2-tzvppdfor all of them.BaseQCMakerkeeps its explicitdef2-qzvppddefault.dft_rung=2writesmethod = b97-d3instead ofmethod = b97d3.$nboand$geom_optsections are no longer written to every input.opt_variables,scan_variablesandgeom_optreplaceopt_dict,scan_dictandnew_geom_opt. The derivedrem_dict,pcm_dict,solv_dict,smx_dict,vdw_dictandplots_dictfields are gone; useoverwrite_inputsto change individual sections.$scansection.Tests
tests/qchem/sets/test_core.pyandtests/qchem/test_sets.pyare rewritten against the pymatgen API.test_overwritepreviously asserted nothing (its branches compareddict.keys()to a string or list); it now checks the overwritten sections.tests/test_data/qchem/ffopt*lose their empty$nbo/$geom_optsections. Nothing else in them changed.test_frequency_opt_makersetsdef2-tzvppdexplicitly, since that is the basis set its reference data was computed with.Additional dependencies introduced (if any)
pymatgen-core(see TODO).TODO (if any)
ImportErrorinatomate2.qchemuntil then.pymatgen-corerequirement inpyproject.toml(the floor independenciesand the pin in thestrictextra) to that release. Not done here because the version does not exist yet.atomate2.qchem.setsshould stay as a re-export or be removed.Checklist
ruff checkandruff format --checkpass onsrc/atomate2/qchemandtests/qchem.mypy src/atomate2/qchemreports the same 15 errors before and after this change (none introduced here).pytest tests/qchemgives 57 passed with the pymatgen-core branch of the PR above installed (48 passed onmainbefore the change). The full test suite was not run, and CI cannot pass until the pymatgen-core release exists.🤖 Generated with Claude Code