[VASP] final_magmoms not parsed.
Closed this issue · 16 comments
When running a spin polarized calculation (ISPIN=2, collinear) it seems that the optimized magnetic moments (output/generic/dft/final_magmoms
) are never read back in to pyiron, only the total magnetization (output/generic/dft/magnetization
).
@ligerzero-ai Have you ever run spin stuff via pyiron?
I have, and I think it should!? If not, I'll hop on this asap. I'll check and fix it this week
It seems our code expects some per direction output in the OUTCAR that is not present or I'm missing some input flag that makes VASP write this only conditionally.
It must lie in the way it is written to hdf, since the infrastructure (i.e. the parser parses magmoms properly). So the breakdown must be between the parser and the hdf5 information writer
This is my INCAR
['SYSTEM=test_ni #jobname\n',
'PREC=Accurate\n',
'ALGO=Fast\n',
'LREAL=.FALSE.\n',
'LWAVE=.FALSE.\n',
'LORBIT=0\n',
'ISIF=2\n',
'IBRION=2\n',
'NELM=400\n',
'NSW=100\n',
'EDIFFG=-0.01\n',
'ISPIN=2\n',
'MAGMOM=1 1 1 1\n']
Is the parser reading it from vasprun.xml or OUTCAR (it seems the latter). Do you know off hand where I can reach into the parser directly?
To access:
outcar = Outcar()
outcar.from_file(filename = outcar_path)
magmoms = np.array(outcar.parse_dict["final_magmoms"])
Yeah, that one's empty, which is why it doesn't appear in the output. The pymatgen parser also doesn't return it for, so it does seem like I'm missing something when I start the run? :S
your magmoms look weird - are you sure that's an accepted format? can you send me the outcar, I'll scroll through
Dunno, that's how pyiron writes it when I set the initial magmoms.
ahhhh lmfao, you need to set LORBIT = 10
in the INCAR to make sure magnetisation is actually written to the outcar, else it doesn't.
I'll patch it in when magmoms are specified.
Ah, I thought it must be something like this. I do love how I even was on the correct page in the VASP wiki for LORBIT, but closed it again, because this is nowhere mentioned.
Anyway, thanks for your quick help!
I have suspicion that it's removed from the wiki because it is no longer a necessity in the latest vasp versions, but if you are running old vasp it will require it. I remember it being on their wiki but they must have removed it. I see that vasp 5.4.4 is specified on your OUTCAR.
Still really dumb, regardless
I also checked it with 6.4.4, but maybe I didn't read carefully enough.
@pmrv How did you define the MAGMOM
? Did you manually set it? Did you set the magnetic moments using the ASE structure? Can you share the pyiron
input script?
@pmrv How did you define the
MAGMOM
? Did you manually set it? Did you set the magnetic moments using the ASE structure? Can you share thepyiron
input script?
I used this line to set up the moments as is done also in our unit tests.
j.structure.set_initial_magnetic_moments(1.0 * np.random.rand(4))
So the MAGMOM
was pyiron generated. Anyway it worked after setting LORBIT.