When we start of a workchain with a structure that has magnetic ordering, we have species with different kinds in StructureData to reflect this. For example:
Li Fe1 Fe2 P S
2 1 1 2 8
which would require LDAUU of:
0 5.3 5.3 0 0
Currently, if use requests DFT+U calculation, the LDAU section of INCAR is constructed in setup_protocols for all stages. This results in an issue that will cause wokchain to fail. Once a stage is finished with structure as output, and considering that we do not attach converged spins to the structure, the resulting structure will have species as:
Li Fe P S
2 2 2 8
which would require LDAUU of:
0 5.3 0 0
which is not given as it is made before this. This will result in parsing errors.
Solution:
[x] Move construction of LDAU section from setup_protocol to get_stage_incar. This way we ensure that we always construct the section for current structure.
[x] Attach information about converged spin to the relaxed structure when parsin it:
This needs to be done in parser.
We need to use site-projected magnetization for this purpose. However, these can have negligible but non-zero values that StructureData would treat them differently. Therefore, we consider a threshold (0.1) and will change the magnetization to zero if the absolute value of them is below threshold. So:
converged_magmoms will be modified:
magmoms = [0 if abs(mag)<0.1 else mag for mag in magmoms]
context:
When we start of a workchain with a structure that has magnetic ordering, we have species with different kinds in
StructureData
to reflect this. For example:which would require
LDAUU
of:Currently, if use requests
DFT+U
calculation, theLDAU
section ofINCAR
is constructed insetup_protocols
for all stages. This results in an issue that will cause wokchain to fail. Once a stage is finished withstructure
as output, and considering that we do not attach converged spins to the structure, the resulting structure will have species as:which would require
LDAUU
of:which is not given as it is made before this. This will result in parsing errors.
Solution:
LDAU
section fromsetup_protocol
toget_stage_incar
. This way we ensure that we always construct the section for current structure.site-projected
magnetization for this purpose. However, these can have negligible but non-zero values thatStructureData
would treat them differently. Therefore, we consider a threshold (0.1) and will change the magnetization tozero
if the absolute value of them is below threshold. So:converged_magmoms
will be modified:resulting in:
Then,