Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new standard outputs for atomistic models #654

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

frostedoyster
Copy link
Contributor

@frostedoyster frostedoyster commented Jun 16, 2024

This PR implements ensembles of energies as a new standard output for atomistic models (#650). It also makes the necessary changes to the ASE calculator to make this property (which is not standard in ASE) available to the user. In addition, the dipole is also registered as a new property and added to the ASE calculator

TODO: actual conversion factors for dipoles

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

馃摎 Download documentation preview for this pull-request

@frostedoyster frostedoyster linked an issue Jun 16, 2024 that may be closed by this pull request
@frostedoyster frostedoyster force-pushed the new-properties branch 3 times, most recently from 1fae531 to ea5b5ef Compare June 16, 2024 07:38
@frostedoyster frostedoyster marked this pull request as ready for review June 17, 2024 10:46
Copy link
Contributor

@Luthaf Luthaf left a comment

Choose a reason for hiding this comment

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

This is changing way too many things at the same time. Could you have one PR for energy-ensemble, one PR for dipole and one PR changing the ASE calculator?

The new outputs need code to check that the data matches the specification in https://github.com/lab-cosmo/metatensor/blob/master/python/metatensor-torch/metatensor/torch/atomistic/outputs.py

@@ -1032,6 +1034,29 @@ static std::unordered_map<std::string, Quantity> KNOWN_QUANTITIES = {
{"J", "Joule"},
{"Ry", "Rydberg"},
}}},
{"energy_ensemble", Quantity{/* name */ "energy", /* baseline */ "eV", {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be needed, energy_ensemble should be able to re-use the energy quantity and associated units

{"dipole", Quantity{/* name */ "dipole", /* baseline */ "D", {
{"Debye", 1.0},
{"Coulomb-meter", 1000.0},
{"atomic units", 0.03674932247495664},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I love having a space inside the unit =/

Comment on lines +77 to +82
:param properties_to_store: list of model outputs to store as results of the ASE
calculator at every step. This is useful when you want to store properties
that are not used in the propagation of the dynamics and/or are not standard
ASE properties ('energy', 'forces', 'stress', 'stresses', 'dipole',
'charges', 'magmom', 'magmoms', 'free_energy', 'energies'). These properties
will be available as ``atoms.calc.results['<stored_property>']``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this typical in ASE? The idea for properties not part of the standard was to use the run_model function.

In general, this does not seems to be required for dipole, since ASE already supports them as property.

}, {
// alternative names
{"D", "Debye"},
{"C-m", "Coulomb-meter"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be C.m? That's what https://en.wikipedia.org/wiki/Electric_dipole_moment uses

{"J", "Joule"},
{"Ry", "Rydberg"},
}}},
{"dipole", Quantity{/* name */ "dipole", /* baseline */ "D", {
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to call this electric_dipole?

@frostedoyster
Copy link
Contributor Author

Ok, I will open different PRs

@sirmarcel
Copy link
Contributor

Thx Guillaume & Filippo. Feel free to re-assign me for ASE changes or ensemble stuff. 馃憤

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.

Passing ensemble predictions to MD engines
3 participants