Inconsistency in positions and scaled_positions in Atoms
This is something I just realised albeit it's at the very core of ASE. I understand it might not be possible to change at this point but I would like to know at least if there's a rationale or some mitigation strategy advised on how to deal with it, and what parts of this behaviour can be guaranteed and relied on even in future versions.
Fundamentally, my problem is how differently positions
and scaled_positions
treat periodic boundary conditions. This example code:
a = Atoms('H', cell=[2,2,2], positions=[[2.5,1,1]], pbc=True)
print(a.get_positions())
print(a.get_scaled_positions())
will print out [[2.5,1,1]]
as positions
, but [[0.25,0.5,0.5]]
as scaled_positions
. Because pbc=True
, the fractional coordinates are wrapped around, but the same does not happen to the absolute ones. My worry with this is that this may create confusion. For example, if I create a copy of a
, is it guaranteed that internally it will always be positions
, and not scaled_positions
, that will be set in the new object? Could I perform some operation (like building a supercell with make_supercell
) that at some point, without my realising, sets the scaled_positions
again and thus wraps around the absolute ones? I think this behaviour could be potentially dangerous and inconsistent.