Skip to content

Add a tutorial for the Debye-Waller workflow - #1592

Open
hrushikesh-s wants to merge 51 commits into
materialsproject:mainfrom
hrushikesh-s:debye-waller-tutorial
Open

hrushikesh-s wants to merge 51 commits into
materialsproject:mainfrom
hrushikesh-s:debye-waller-tutorial

Conversation

@hrushikesh-s

@hrushikesh-s hrushikesh-s commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Include a summary of major changes in bullet points:

  • Add tutorials/debye_waller_workflow.ipynb for the Debye-Waller factors of Add Debye-Waller factors as an option of the phonon makers #1580, which needs Add Debye-Waller factors as an option of the phonon makers #1580 and Breaking: Leave out the acoustic modes at Gamma in the thermal displacement matrices #1590. It runs the force field PhononMaker with create_thermal_displacements=True and create_debye_waller=True. It follows the layout of the thermal expansion and CALPHAD tutorials. Part A runs the workflows (cells tagged skip-execution). Part B draws all tables and figures from the stored numbers in tests/test_data/forcefields/debye_waller_tutorial/dw_results.json.gz (36 KB) and dw_mlip_results.json.gz (84 KB), and CI runs it with nbmake in a few seconds.
  • We ran Cu, W, Si, NaCl, MgO and ZnO with MACE-OMAT-0-medium, and with MACE-Field Born charges for the polar materials. Part B compares U_iso at 300 K with U from the force constants of the Materials Project's Harmonic Phonon Database (PBEsol) and with experiment. The mean absolute difference from experiment is 6.8% for MACE and 8.2% for DFT.
  • Part B also shows the anisotropic U of ZnO and its eigenvalues against temperature, log10(I_T/I_0) of the XRD peaks against 2θ, a Wilson fit of the XRD and ND patterns that gives back B = 8π²U_iso, the electron diffraction spots of Si, and the 1/N convergence of U with the q-point mesh for Cu (the default density gives U_iso 2.8% below the extrapolated value).
  • Part A5 runs the same workflow with five potentials (MACE-OMAT-0, MACE-MATPES-PBE-0, MACE-MATPES-r2SCAN-0, MatPES-PBE, MatPES-r2SCAN) for the six materials, eight test materials with imaginary modes and AgBr, which has no pheasy force constants. Only the calculator changes, and write_u writes one U file per material and potential. B7 compares the eigenvalues of U with the pheasy reference. For the six stable materials at 300 K, MACE-OMAT-0 has the smallest MAE (6.3e-4 Ų) and the PBE potentials give U 20% to 27% larger than the PBEsol reference. B7 also plots the median and IQR of the eigenvalues over all sites against temperature, and compares each potential with experiment. MACE-OMAT-0 is closest, with a mean absolute difference of 6.7%.
  • The test materials use imaginary_modes_thermal_displacements="exclude" with freq_min_thermal_displacements = 0.1 THz from Breaking: Leave out the acoustic modes at Gamma in the thermal displacement matrices #1590. The pheasy reference is also computed with "absolute", which counts each imaginary mode as a real mode of the same absolute frequency, as in R. Keesey's calculations. B8 compares the two. "absolute" makes the eigenvalues 4.6% larger in the median and up to 67 times larger for single sites, so U of these materials is only a rough estimate.
  • The export keeps only the diffraction peaks found at every temperature, since pymatgen leaves out peaks below 1e-5 of the strongest one. This changed the stored XRD peaks of NaCl only.
  • We reran all of Part A with the phonon maker option. The numbers of the six materials are the same as with the earlier Debye-Waller maker. The MACE runs agree within 0.03%. The MatPES numbers change by less than 2% between two runs, except for UO3 (5%) and RbLaSiS4 (up to 60%). With MatPES-r2SCAN, one run of RbLaSiS4 had imaginary modes and the other had none.
  • Link the notebook from the Debye-Waller section of docs/user/codes/vasp.md and add it to tutorials/tutorials.md.

Part of #1591.

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. Part A needs the MACE-Field fork and the pymatgen of Add Debye-Waller factors as an option of the phonon makers #1580, as listed in the notebook. Part B needs only atomate2.

TODO (if any)

If this is a work-in-progress, write something about what else needs to be done.

  • Add more materials with measured displacement parameters to the comparison, and more stable materials to the comparison of the potentials.

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:

  • Code is in the standard Python style.
    The easiest way to handle this is to run the following in the correct sequence on
    your local machine. Start with running ruff and ruff format on your new code. This will
    automatically reformat your code to PEP8 conventions and fix many linting issues.
  • Doc strings have been added in the Numpy docstring format.
    Run ruff on your code.
  • Type annotations are highly encouraged. Run mypy to
    type check your code.
  • Tests have been added for any new functionality or bug fixes.
  • All linting and tests pass.

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.

…nto thermal-displacements-fix

# Conflicts:
#	src/atomate2/common/schemas/phonons.py
…nto debye-waller

# Conflicts:
#	src/atomate2/common/schemas/phonons.py
…nto debye-waller-tutorial

# Conflicts:
#	src/atomate2/common/schemas/phonons.py
# Conflicts:
#	docs/user/codes/vasp.md
#	src/atomate2/forcefields/flows/debye_waller.py
@hrushikesh-s
hrushikesh-s marked this pull request as ready for review October 12, 2026 23:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant