atomec-project / atoMEC

Python-based average-atom code for simulations of high energy density phenomena such as in warm dense matter.
https://atomec-project.github.io/atoMEC/
BSD 3-Clause "New" or "Revised" License
17 stars 12 forks source link

Chemical potential should not stored as a `config` variable #124

Open timcallow opened 2 years ago

timcallow commented 2 years ago

The chemical potential (config.mu) is really a property of the staticKS.Orbitals class and thus should be moved there. Storing it as a variable in config causes a bug when post-processing a set of orbitals under different conditions, because the occupation numbers are recalculated with the last saved value of config.mu instead of their actual chemical potential.

timcallow commented 2 years ago

This became a problem with PR #123, as the occupation numbers are automatically recomputed with this PR. Needs to be fixed before #123 can be merged.

timcallow commented 2 years ago

The issue is no longer a problem for #123 as the code has been reverted back to its old state of only computing occupation numbers when explicitly required. However in the long term the chemical potential should become a property of the Orbitals so keeping this issue open