Repository navigation
Add Debye-Waller factors as an option of the phonon makers - #1580
hrushikesh-s wants to merge 55 commits into
Conversation
Co-authored-by: Ruby Keesey <164552150+rkeesey@users.noreply.github.com>
Co-authored-by: Ruby Keesey <164552150+rkeesey@users.noreply.github.com>
…nto debye-waller # Conflicts: # pyproject.toml
|
Could you check the frequency_cutoff and convergence with q points? 11 years ago, I did some relevant tests: https://doi.org/10.1039/c5ce01219h EDIT: |
|
Also, there is a bit of a disconnect now. The phonon workflow already has an option to compute thermal displacement parameters and can save it as well |
@JaGeo, yes, I am still running the benchmarking and comparison tests for this workflow from @rkeesey.
Yes, let me look into this as well... |
…n phonopy finds complex matrices
…des, compute them once per job
With a cutoff of 0 THz on the default q-point mesh, the acoustic modes at Gamma made U far too large or crashed phonopy, and U converges only as 1/N with the mesh number N. I fixed this for all phonon workflows in #1590, with a benchmark on 51 materials, and #1580 now takes U directly from the phonon flow, so there is no second implementation and no separate frequency_cutoff. Does this make sense? |
|
The tutorial in #1592 now also uses this option, and its rerun gives the same results for the six materials. |
|
@hrushikesh-s Phonopy's default TDM matrices use Cartesian coordinates, and the CIF convention is only applied when specifically requested (the YAML files with the TDMs in the phonon database include both conventions). Would it be beneficial to implement a method of DWF calculation using Cartesian coordinates as well? |
@rkeesey, thanks! The Debye-Waller job already starts from phonopy’s Cartesian U, and its output stores both conventions. It converts U to the CIF convention only because pymatgen’s XRD, ND, and TEM calculators read the U11_cif to U12_cif site properties. Both are the same tensor in different bases, so the factors match exp(-2π² gᵀUg) from the Cartesian U to machine precision, which I checked on a triclinic cell. |
@JaGeo, materialsproject/pymatgen#4715 is now merged. |
…nto thermal-displacements-fix
…nto debye-waller
… displacement data
|
When reviewing this PR, I noticed the Debye-Waller document embeds a full copy of the phonon document's thermal displacement data: from_phonon_doc stores data.model_dump() here (L170), and the EMT test (tests/forcefields/flows/test_debye_waller.py L63-65) asserts the two copies are identical. Can you confirm the dual copy in storage is intended by design? If so, a short note in the field description would preempt the |
Yes, the copy is on purpose. The patterns are listed per temperature of this data, and the Debye-Waller document has no other temperatures, so it needs the copy to be read on its own. I have added this to the field description. Does that look fine? |
| The Debye-Waller factor of a site for the reciprocal lattice vector $g$, with $|g| = 1/d_{hkl}$, is $\exp(-2\pi^2 g^T U g)$. | ||
| For an isotropic $U = U_\mathrm{iso} I$, this is $\exp(-B s^2)$ with $B = 8\pi^2 U_\mathrm{iso}$ and $s = |g|/2$. | ||
| The patterns are computed at each temperature of $U$, from 0 K to 1000 K in steps of 100 K by default, and once without the factors. | ||
| The phonon frequencies are not renormalized with temperature. |
There was a problem hiding this comment.
I guess one can use this with any of the harmonic phonon approaches right?
There was a problem hiding this comment.
Yes, create_debye_waller is an option of the base phonon maker, so the phonopy, pheasy, and hiPhive makers all have it.
The pheasy and hiPhive flows build emmet’s phonon document, though, which does not store the primitive cell of the matrices yet. So for them, the compute_debye_waller job fails until materialsproject/emmet#1536 is released....
There was a problem hiding this comment.
If this is true, i don't understand the sentence about the T renormalization
There was a problem hiding this comment.
The sentence only means that
Summary
Include a summary of major changes in bullet points:
create_debye_waller=True, a last job computes the XRD, neutron and TEM patterns with the anisotropic Debye-Waller factors at each temperature, and once without them.create_thermal_displacements=True.imaginary_modes_thermal_displacementsis set (Breaking: Leave out the acoustic modes at Gamma in the thermal displacement matrices #1590).compute_debye_wallerjob andDebyeWallerDocumentschema. The patterns go to the data store. A Debye-Waller section in docs/user/codes/vasp.md.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.
Needs pymatgen 2026.10.24 or newer, the first release with the anisotropic Debye-Waller factors of Add anisotropic Debye-Waller factors to
XRDCalculator,NDCalculatorandTEMCalculatorpymatgen#4715. The newdebye-wallerextra installs it, so the other workflows keep the current pymatgen lower bound.CI installs the extra in a separate step, since the strict extras pin an older pymatgen. A new matrix entry runs only the Debye-Waller tests.
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.