pyiron / pyiron_atomistics

pyiron_atomistics - an integrated development environment (IDE) for atomistic simulation in computational materials science.
https://pyiron-atomistics.readthedocs.io
BSD 3-Clause "New" or "Revised" License
44 stars 15 forks source link

What's the difference between `spins` and `initial_magmoms`? #896

Open samwaseda opened 1 year ago

samwaseda commented 1 year ago

I see initial_magmoms in structure.arrays and spin in tags. In HDF, the one is stored in structure/spins and the other one in structure/tags/spin. And in structure attributes, the one is used in structure.spins, the other is used in structure.get_initial_magnetic_moments(). Is there a particular reason for this?

pmrv commented 1 year ago

If I remember correctly one is from default from ASE and then we bolted our own on top. I think the double storing comes from the fact that ASE already defines .spins as equivalent to {get,set}_initial_magnetic_moments(), but we overload getattr/setattr to go into the tag list. I recently changed this a bit here, but I don't remember the details. :|