-
Notifications
You must be signed in to change notification settings - Fork 101
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
Anharmonicity Quantification workflow #901
Conversation
remove hard-coded constants
If relaxation changes structure it must be read from phonon doc
Tests should now work outside of socket calcs
similar to what is done with the phonon workflow
Default is still to start from phonons for consistency between anharmonic and phonon calcs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some smaller comments for now. Will think more carefully about it next week as well.
Co-authored-by: J. George <JaGeo@users.noreply.github.com>
Tests are failing here. I think you have to fix the torchdata version similar to #940 . |
Let me know if I should do another review round. Currently, there are some conflicts |
@JaGeo I just pushed a version that implemented the mode resolved sigma^A and fixed all the things you brought up previously |
] | ||
|
||
|
||
def get_sigma_per_element( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@4kevinbeck5 this looks very good.
The only comment that I have is that some of these are functions and are not really jobs. @utf should we move those somewhere else? common/utils
would be a possibility but it might get messy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale for making those functions rather than jobs was just to reduce the number of jobs per flow on the HPC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is completely fine and desired. I am just wondering if functions should be in the jobs
folder/file.
I just committed a version that passes the linting this time. There was a small mistake I made before in the conftest.py file |
@4kevinbeck5 I will check! Thanks! Could you also add yourself to the list of contributors 😃? |
@JaGeo I just pushed the contributors.md file with my info added! |
) | ||
jobs.append(force_calcs) | ||
|
||
sigma_a_vals = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
@4kevinbeck5 I removed one dict initialization and checked if the torchdata pin is still needed. I am now happy with the changes. I am enabling auto merge! Thank you for your contribution! If I have some time, I might implement a VASP interface. It might, however, be that this will be next year ;). |
* Generated displaced structures * Implemented sigma_A oneshot calculations * Added some needed object attributes * Added some object attributes * Added pieces to flow to utilize PhononBSDOSDoc * Added a prefactor method to find dynamical matrix * Fixed issue with prefactor method * Made creation of dynamical matrix indep of phonon * Added helper function to make Phonopy objects * Finished writing flow * Made all functions independent of passing Phonopy * Code for anharmonicity code and starter for test * o Debug sigma^A calculations 1) Temperature needs to be in eV (kB / e) 2) Consistent supercells: phonopy and pymatgen use different standards 3) Use a BasePhononMaker instead of copy/paste * Update anharmonicity tests * Use pymatgen.core.units.kb remove hard-coded constants * Fixed assert statement * The phonon supercell now determined to from phonon document If relaxation changes structure it must be read from phonon doc * Modification for mock_aims to work * Add the test data for mock aims Tests should now work outside of socket calcs * Add an aims only workflow and generalize the common one similar to what is done with the phonon workflow * Add functionality to create an anharmonicity flow from a PhononBSDOSDoc Default is still to start from phonons for consistency between anharmonic and phonon calcs * Actually add Aims workflow for anharm * Made to work with anharmonicity schema doc * Added function to make anharmonicity doc * Cleaned up anharmonicity flow test * Wrote tests for anharm schema * Added fields to anharm schema * Added flag and function for full sigma^A * Added files for mock_aims * Added test for full sigma A with mock_aims * Added capability to pass a seed for rng * Added files for mock aims * Added pytest fixture for NaCl structure * Added atom-resolved sigma A calculation and test * Fixed bug when atom_resolved was False * Added mock_aims files for mode_resolved sigma^A * Added mode resolved sigma^A test w/ mock_aims * Implemented mode resolved sigma^A calcs * Made tests work with sigma_dict * Returns a dictionary with computed sigma values * Cleaned up code with pre-commit * Fixed bug in test_anharmonicity.py * Fixed anharm quant one-shot socket test * Fixed typo in docstring * Added return info to docstrings * Refactored code to make cleaner * Fix lint errors in tests * Remove typing.Self call Tested on python 3.11 * Fixed lint and typing errors. * Fixed tests to pass on github. * Update src/atomate2/aims/flows/anharmonicity.py Co-authored-by: J. George <JaGeo@users.noreply.github.com> * Changed omega_to_THz to be imported from atomate2 * Made separate eigenvec/val solver for dynamical matrix and added clean_dir to tests * Fixed torchdata version * Re-implemented get_phonon_supercell * Added mode-resolved sigma^A calculation * Fixed linting issues * Add @4kevinbeck5 to contributors.md file * remove dict initalisation * test if pip on torch data is really needed --------- Co-authored-by: Tom Purcell <purcellt@arizona.edu> Co-authored-by: J. George <JaGeo@users.noreply.github.com> Co-authored-by: JaGeo <janinegeorge.ulfen@gmail.com>
Summary
Creates a workflow for anharmonicity quantification as defined in Knoop 2020
Additional dependencies introduced (if any)
TODO (if any)
Larger scale testing in progress
Checklist
Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.
Before a pull request can be merged, the following items must be checked:
The easiest way to handle this is to run the following in the correct sequence on
your local machine. Start with running
ruff
andruff format
on your new code. This willautomatically reformat your code to PEP8 conventions and fix many linting issues.
Run ruff on your code.
type check your code.
Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
recommended that you use the pre-commit hook provided in the repository. Simply run
pre-commit install
and a check will be run prior to allowing commits.