Skip to content

Feat: lematrho, populate forces, stress_tensor, energy from static DFT runs.#50

Open
speckhard wants to merge 2 commits intomainfrom
feat/lematrho-forces-energy
Open

Feat: lematrho, populate forces, stress_tensor, energy from static DFT runs.#50
speckhard wants to merge 2 commits intomainfrom
feat/lematrho-forces-energy

Conversation

@speckhard
Copy link
Copy Markdown
Collaborator

Summary

  • Source fix: vasprun is now sourced from LeMatRhoStaticMaker (NSW=0,
    already-relaxed geometry) instead of LeMatRhoRelaxMaker_1. Forces/stress
    from the static run are the physically meaningful residual forces at the
    relaxed geometry.
  • New fields populated: forces (nsites×3, eV/Å), stress_tensor (3×3, kBar),
    energy (eV), and energy_corrected (eV — equals energy for R2SCAN since
    the MP 2020 correction is PBE-only).
  • Functional fix: changed from Functional.PBE to Functional.r2SCAN,
    confirmed from INCAR files in S3 (METAGGA = R2scan).
  • Single download loop: vasprun.xml.gz merged into the existing STATIC_FILES
    loop, removing a separate relax-vasprun download step.

Test plan

  • 46 unit tests pass, 2 integration tests skipped (require .env.integration)
  • Smoke test on 3 real S3 materials: functional=r2scan, non-null forces,
    stress_tensor, energy, energy_corrected == energy
  • TestVasprunForces added covering parse_vasprun_output and end-to-end
    pass-through into the Parquet row

…sprun

- Add vasprun.xml.gz to STATIC_FILES so it downloads in the same loop
  as charge density files; remove the now-redundant separate relax
  vasprun download
- Replace parse_vasprun_structure (returned only Structure) with
  parse_vasprun_output (returns structure, forces, stress_tensor, energy)
  by parsing ionic_steps[-1] and vasprun.final_energy
- Wire forces, stress_tensor, and energy into the OptimadeStructure
  constructor; energy_corrected is auto-computed (equals energy for
  R2SCAN since the MP 2020 correction is PBE-only)
- Fix functional from Functional.PBE to Functional.r2SCAN (confirmed
  from INCAR: METAGGA = R2scan)
- Update all test patches and mock return values accordingly; add
  TestVasprunForces covering parse_vasprun_output and end-to-end
  pass-through of forces/stress/energy into the Parquet row
@speckhard speckhard requested review from Ramlaoui and mfranckel April 13, 2026 12:04
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