nomad-coe / nomad-simulations

A NOMAD plugin containing base sections for simulations.
https://nomad-coe.github.io/nomad-simulations/
Apache License 2.0
5 stars 1 forks source link

Add Hamiltonian components to the ModelMethod #105

Open ndaelman-hu opened 2 months ago

ndaelman-hu commented 2 months ago

Add the method counterpart of EnergyContribution and make it so the latter can refer to it. The Hamiltonian terms will have name and formula (free text) sections. Constructing a formalized approach to writing formulas goes outside the scope of this issue / project.

The need for Hamiltonian terms became evident from the #101, where Quick step is split by this distinction.

JosePizarro3 commented 2 months ago

ModelMethod has a subsection called contributions whose objective is precisely this one.

I like the idea of the "free text for formulas", and it is also in my mind to implement. Maybe we could implement something like latex_formula and interface with some package to show full hamiltonians and their contributions in a future. This is something QMC and modeling people will be very interested of.

ndaelman-hu commented 2 months ago

I like the idea of the "free text for formulas", and it is also in my mind to implement.

100 %

ModelMethod has a subsection called contributions whose objective is precisely this one.

@JosePizarro3 thank you for pointing this out. Indeed, I figured this out shortly after posting this issue.

problem statement

Still, even when I already knew about PropertyContribution, it was hard to find the connection on the ModelMethod side. @Bernadette-Mohr and @EBB2675 what are your perspectives, looking at this with a fresh pair of eyes?

solution 1

I have 2 kinds of suggestions to clarify the connection. First, we should (on both ends) mention that there's a link. This can either be

  1. via (py)docs.
  2. via the code, i.e. typing system or interfaces.

solution 2

Second, the structure differs between both ends. Not every PhysicalProperty is a PropertyContribution: you have (sum) total properties and then their terms. ModelMethod.contributions, meanwhile, is self-referential, i.e. it contains other ModelMethod.

Ideally, both would follow the same structure, though I understand that different considerations may be at play. PhysicalProperty's approach limits the nesting to only 1 layer, since more aren't necessary. ModelMethod, conversely, allows methods that are standalone in some contexts to serve as building blocks in other, larger methods. This is relevant for hybrid DFs and lattice models for example.

Any opinions?