Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VASP] final_magmoms not parsed. #1423

Closed
pmrv opened this issue May 21, 2024 · 16 comments · Fixed by #1424
Closed

[VASP] final_magmoms not parsed. #1423

pmrv opened this issue May 21, 2024 · 16 comments · Fixed by #1424
Labels
bug Something isn't working

Comments

@pmrv
Copy link
Contributor

pmrv commented May 21, 2024

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?

@pmrv pmrv added the bug Something isn't working label May 21, 2024
@ligerzero-ai
Copy link
Contributor

I have, and I think it should!? If not, I'll hop on this asap. I'll check and fix it this week

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

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.

@ligerzero-ai
Copy link
Contributor

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

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

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?

@ligerzero-ai
Copy link
Contributor

self.parse_dict["final_magmoms"] = final_magmom_lst

To access:

outcar = Outcar()
outcar.from_file(filename = outcar_path)
magmoms = np.array(outcar.parse_dict["final_magmoms"])

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

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

@ligerzero-ai
Copy link
Contributor

your magmoms look weird - are you sure that's an accepted format? can you send me the outcar, I'll scroll through

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

Dunno, that's how pyiron writes it when I set the initial magmoms.

OUTCAR.txt

@ligerzero-ai
Copy link
Contributor

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.

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

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!

@ligerzero-ai
Copy link
Contributor

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

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

I also checked it with 6.4.4, but maybe I didn't read carefully enough.

@pmrv
Copy link
Contributor Author

pmrv commented May 21, 2024

It seems it was also discovered here: #1060 I'll add a FAQ entry for it tomorrow.

@jan-janssen
Copy link
Member

@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?

@ligerzero-ai
Copy link
Contributor

#1424 fixes this and #1060

@ligerzero-ai ligerzero-ai linked a pull request May 21, 2024 that will close this issue
@pmrv
Copy link
Contributor Author

pmrv commented May 22, 2024

@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?

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.

@pmrv pmrv closed this as completed Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants