siesta-project / aiida_siesta_plugin

Source code for the AiiDA-Siesta package (plugin and workflows). See wiki
Other
6 stars 11 forks source link

EoS workchain fails if structure has multiple site's names with the same symbol. #87

Open bosonie opened 3 years ago

bosonie commented 3 years ago

The problem is due to the fact that the rescale method (used to change the volume of the structure), also renames the atoms in case multiple site's names are associated to the same symbol. This results on a structure whose sites do not match the pseudopotentials dictionary.

Let's suppose to have an hydrogen crystal with two sites:

 s.append_atom(position=(0.000, 2.233, 1.754), symbols=['H'])
 s.append_atom(position=(0.000, -1.225, 2.327), symbols=['H'], name="Hbis")

The structure returned by rescale has the volume changed, but also sites:

<Site: kind name 'H' @ 0.000, 2.233, 1.754>
<Site: kind name 'H1' @ 0.000, -1.225, 2.327>

"Hbis" became "H1" because the correct label is lost in the passage between the StructureData and the ase structure inside rescale. However the pseudopotential input dictionary still presents the key "Hbis", leading to an error ValueError: no pseudo available for element H1.