Skip to content

Water slab dipoles#349

Open
MandyHoffmann wants to merge 53 commits intoddmms:mainfrom
MandyHoffmann:water_slab_dipoles
Open

Water slab dipoles#349
MandyHoffmann wants to merge 53 commits intoddmms:mainfrom
MandyHoffmann:water_slab_dipoles

Conversation

@MandyHoffmann
Copy link
Copy Markdown

Pre-review checklist for PR author

PR author must check the checkboxes below when creating the PR.

Summary

Physicality test for total dipole distribution of water slabs, checks standard deviation and number of candidates for dielectric breakdown.

Linked issue

Resolves #348

Progress

  • Calculations
  • Analysis
  • Application
  • Documentation

I think I did everything, but please check! For actually running it, the MD calculation time can be adjusted based on how well sampled you want it; longer simulation times are required for a proper Gaussian-shaped histogram. Similarly, one could consider changing the bins to be even smaller.

Currently, no hover templates are set for the histograms.

Testing

Tested on one of my own water models and the small mace-mp0-a model. Calculations are quite expensive (>12 h for the mace-mp0 one).

New decorators/callbacks

Build a new decorator for histograms, oriented at the scatter plot one, included in this PR. Not sure all the callbacks work properly, but one can see the plots.

@ElliottKasoar ElliottKasoar added the new benchmark Proposals and suggestions for new benchmarks label Feb 6, 2026
Copy link
Copy Markdown
Collaborator

@ElliottKasoar ElliottKasoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for this, @MandyHoffmann, it's looking really good!

Are you able to share (e.g. via slack/onedrive) some full results for this, so I can test the analysis/app more carefully?

Comment thread pyproject.toml Outdated
Comment thread ml_peg/models/models.yml Outdated
Comment thread ml_peg/calcs/physicality/water_slab_dipoles/data/init_38A_slab.xyz Outdated
Comment thread docs/source/user_guide/benchmarks/physicality.rst Outdated
Comment thread docs/source/user_guide/benchmarks/physicality.rst Outdated
Comment thread ml_peg/analysis/utils/decorators.py Outdated
Comment thread ml_peg/app/physicality/water_slab_dipoles/app_water_slab_dipoles.py Outdated
Comment thread ml_peg/calcs/physicality/water_slab_dipoles/calc_water_slab_dipoles.py Outdated
Comment thread ml_peg/calcs/physicality/water_slab_dipoles/calc_water_slab_dipoles.py Outdated
@joehart2001
Copy link
Copy Markdown
Collaborator

Also one small thing, could you remove the data dir @MandyHoffmann as you’ve now added the download

This was referenced Apr 15, 2026
Comment thread ml_peg/app/physicality/water_slab_dipoles/app_water_slab_dipoles.py Outdated
Comment thread ml_peg/analysis/physicality/water_slab_dipoles/analyse_water_slab_dipoles.py Outdated
Comment thread ml_peg/analysis/physicality/water_slab_dipoles/analyse_water_slab_dipoles.py Outdated
Comment thread ml_peg/analysis/utils/decorators.py Outdated
Comment thread ml_peg/analysis/utils/decorators.py Outdated
Comment thread ml_peg/analysis/utils/decorators.py Outdated
Comment thread ml_peg/analysis/utils/decorators.py Outdated
Comment thread ml_peg/analysis/utils/decorators.py Outdated
MandyHoffmann and others added 17 commits April 21, 2026 08:36
…es.py

Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Calculation of dipole like in https://arxiv.org/abs/2603.04228v1 (charge determined there to match revPBE-D3 water dipole). The threshold for a bad dipole is the value at which a closed bandgap is expected, based on the DFT bandgap in the preprint of revPBE-D3 water.
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Co-authored-by: Elliott Kasoar <45317199+ElliottKasoar@users.noreply.github.com>
Updated the documentation for the filename parameter in the plot function.
Copy link
Copy Markdown
Collaborator

@ElliottKasoar ElliottKasoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for addressing so many comments, @MandyHoffmann!

Would you be able to run the pre-commit to tidy up a a couple of formatting issues it's complaining about?

The pre-commit is also picking up on the numpy import in the calculation script. Since you don't explicitly call any np functions, it shouldn't be needed. It's only used in the analysis from what I can see.

One final thing (I (almost) promise!) is I think it would be good to consider structure visualisation. I suggest this would be a new PR once this is merged and we've started collecting the real data since we'd be collecting the outputs we need anyway, but do you think it might be interesting to show either some of the trajectory or the final structure?

)
dipoles_unit_area = dipoles / atoms[0].cell[0, 0] / atoms[0].cell[1, 1]
results[model_name] = dipoles_unit_area
np.save(model_dir / "dipoles.npy", dipoles_unit_area)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of saving these dipole.npy files?

The danger here is if we re-run the calculation after running the analysis for some reason (e.g. with different MD settings, model precision, etc.), when we then run the analysis again, we'd end up using the cached dipoles.npy file and not analyse the new data, I think?

If this part of the analysis is particularly expensive, we could consider moving it to the end of calculation instead, but perhaps we just don't need it?

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

Labels

new benchmark Proposals and suggestions for new benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Water Slab Dipole Distributions

3 participants