Repository navigation
Add an opt-in linear fit of the vibrational free energy for QHA volumes with imaginary modes - #1632
hrushikesh-s wants to merge 6 commits into
Conversation
…es with imaginary modes
|
It could be good to also add it as an alternative to "ignore_imaginary_frequencies" and simply fit them from the ones that are real. A common scenario could be: you compress a material and it switches the phase. While it is stable at extended volumes. |
… none, and document fit_imaginary_volumes in the QHA makers
|
Good point. fit_imaginary_volumes=True now works as an alternative to ignore_imaginary_modes. Whenever at least 2 volumes have no imaginary modes, the volumes with imaginary modes are kept instead of left out. Their vibrational free energies come from a linear fit in the volume to the stable volumes, at each temperature. In your eg, the compressed volumes would now stay in the QHA. |
|
@hrushikesh-s that's great! Thanks. Will add another preprint where we used such an approach here soon. Maybe you can check the approach when you keep 4 out of 7 volumes, for example |
|
@JaGeo, thanks, would be happy to cite your preprint in the docs once it is out... I checked this with the force field QHAs from the description whose 7 volumes all have no imaginary modes (23 with MACE, 17 with UPET). I kept the 4 smallest or the 4 largest volumes, and treated the other 3 as if they had imaginary modes. The 4 largest is your example of unstable compressed volumes. Then I compared the thermal expansion at 300 K with the QHA from all 7 volumes. With the other 3 volumes fitted, the typical error is 5% to 10%, and the worst is 41%. The fit also keeps the bulk modulus the same as with all 7 volumes, while leaving the volumes out changes it by up to 19%. The table and the raw data are now in the PR description, and the docs are updated. |
|
Very nice! That's pretty cool that you were able to test this this fast! |
| t_max: float | None = None | ||
| pressure: float | None = None | ||
| ignore_imaginary_modes: bool = False | ||
| fit_imaginary_volumes: bool = False |
There was a problem hiding this comment.
There is one potential problem here: we need to check if this argument and the one before are switched om at the same time
There was a problem hiding this comment.
Thanks, good catch!
With ignore_imaginary_modes=True all volumes are already kept, so the fit silently did nothing.
The QHA maker and analyze_free_energy now raise an error if both are True, with a test for each.
Does that look fine?
|
@hrushikesh-s This is the preprint that I mentioned: https://arxiv.org/abs/2611.15767v1 Maybe you can add it in a follow-up PR. |
|
@JaGeo Thanks! Since this PR is still open, I went ahead and added Bustamante et al. ( |
Summary
Include a summary of major changes in bullet points:
fit_imaginary_volumestoanalyze_free_energyand the QHA makers. It is off by default.The fit does not change the bulk modulus, since the electronic energies of all volumes are kept. Leaving 3 volumes out changes it by up to 19%. The fit gives only an estimate, which is why it is opt-in. The raw data and the scripts are attached: qha_fit_imaginary_volumes.zip and qha_fit_4of7.zip
Additional dependencies introduced (if any)
List all new dependencies needed and justify why. While adding dependencies that bring
significantly useful functionality is perfectly fine, adding ones that add trivial
functionality, e.g., to use one single easily implementable function, is frowned upon.
Justify why that dependency is needed. Especially frowned upon are circular dependencies.
None
TODO (if any)
If this is a work-in-progress, write something about what else needs to be done.
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
ruffandruff formaton 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 installand a check will be run prior to allowing commits.