Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gradient, Hessian, and orbital coeffs scratch file parsers to pymatgen.io.qchem.outputs #3483

Merged
merged 47 commits into from
Dec 2, 2023

Conversation

Andrew-S-Rosen
Copy link
Member

@Andrew-S-Rosen Andrew-S-Rosen commented Nov 26, 2023

Summary

This PR adds function to pymatgen.io.qchem.outputs to parse (scratch) gradient, Hessian, and previous orbital coefficient files made by Q-Chem.

Note: 99% of the credit for this goes to @samblau. I am simply moving it into pymatgen where it belongs.

Todos

I need to add tests. There are also some things that are definitely better done with numpy vectorization, but it's not a huge issue.

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • [] If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

@Andrew-S-Rosen Andrew-S-Rosen changed the title [WIP] Add a Hessian parser to pymatgen.io.qchem.outputs [WIP] Add a gradient and Hessian parser to pymatgen.io.qchem.outputs Nov 26, 2023
@Andrew-S-Rosen Andrew-S-Rosen changed the title [WIP] Add a gradient and Hessian parser to pymatgen.io.qchem.outputs [WIP] Add a gradient and Hessian scratch file parser to pymatgen.io.qchem.outputs Nov 26, 2023
@Andrew-S-Rosen Andrew-S-Rosen changed the title [WIP] Add a gradient and Hessian scratch file parser to pymatgen.io.qchem.outputs [WIP] Add gradient, Hessian, and orbital coeffs scratch file parsers to pymatgen.io.qchem.outputs Nov 26, 2023
@Andrew-S-Rosen
Copy link
Member Author

Andrew-S-Rosen commented Nov 29, 2023

@janosh: This should be ready for review. As I mentioned above, this code was largely written by @samblau --- I added some simple tests and cleaned up the linting errors. Longer term, it would probably make sense to create a new QCScratch(MSONable) class that parses scratch files in a directory. However, I have not implemented that here (unless you feel it necessary).

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Andrew-S-Rosen, looks great! Just a minor suggestion re test file compression.

it would probably make sense to create a new QCScratch(MSONable) class that parses scratch files in a directory. However, I have not implemented that here (unless you feel it necessary).

Tbh I don't feel qualified to make that call

@Andrew-S-Rosen
Copy link
Member Author

@janosh: Thanks! I gzip'd the files. Should be good to go from my end at least :)

@Andrew-S-Rosen
Copy link
Member Author

@janosh: All good now!

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Andrew-S-Rosen! 👍

@janosh janosh merged commit 166535a into materialsproject:master Dec 2, 2023
@janosh janosh added enhancement A new feature or improvement to an existing one molecules Molecule stuff qchem Q-Chem general-purpose electronic structure package io Input/output functionality labels Dec 19, 2023
Andrew-S-Rosen added a commit to Quantum-Accelerators/quacc that referenced this pull request Dec 19, 2023
Enabled by materialsproject/pymatgen#3483.
Waiting on the next release of pymatgen.

---------

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement to an existing one io Input/output functionality molecules Molecule stuff qchem Q-Chem general-purpose electronic structure package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants