-
Notifications
You must be signed in to change notification settings - Fork 76
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
Issue with plotting spin texture #143
Comments
Just a simple check, did you check that the calculation runs correctly for the noncollinear case? meaning, check the PROCAR file and see the 4 blocks you expect to see for each Kpoint, each corresponding to Sx, Sy and Sz and total S… if this is the case, we can check further… but first the PROCAR should be correct.
…______________________________________::::__________________________________________
Prof. Aldo Humberto Romero
Director Research Computing, West Virginia University
Eberly Family Distinguished Professor
Fellow American Physical Society
Editor Physica B, Assistant Editor EPJB, Editor Frontiers in Physics
Section Editor Papers in Physics
Member of the Editorial Board of “Materials” and “Symmetry Physics”
Physics and Astronomy Department
West Virginia University
135 Willey Street, PO Box 6315
111 White Hall
Morgantown, WV 26506
Phone: 304-293-6317
Fax: 304-293-5732
email: ***@***.***
From: malharkute ***@***.***>
Date: Thursday, April 11, 2024 at 8:17 PM
To: romerogroup/pyprocar ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [romerogroup/pyprocar] Issue with plotting spin texture (Issue #143)
Hello,
I'm trying to use pyprocar to plot the spin texture from a VASP calculation, but I'm finding conflicting documentation online. Here's how I'm calling the fermi2d function:
pyprocar.fermi2D('vasp', dirname=".", spin_texture=True, fermi=8.3106204826 - 0.1, spins=[1, 2], band_indices=[[46, 47], [46, 47]])
However, I get an error in the following line, as i_spin=2 is out of bounds.
indices = np.where( np.logical_and(ebs.bands[:,:,i_spin].min(axis=0) < energy, ebs.bands[:,:,i_spin].max(axis=0) > energy))
I did some digging and found that ebs.bands has shape (num_k, num_bands, 1), even though this is a non-collinear calculation. In my PROCAR files, I have Sx, Sy and Sz projections, yet it seems I can't plot these. Would you be able to help me figure out a workaround so I can plot the spin texture?
Thank you!
—
Reply to this email directly, view it on GitHub<#143>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB24DTJDHBSULMXJ6E4C3VLY44RYBAVCNFSM6AAAAABGDGPVZCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTQOBQG44TOOI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Hi Aldo,
Thanks for your quick response. Yes, the PROCAR files are indeed formatted as your described. I checked with two different PROCAR calculations, both non-collinear, and had the same issue in both cases.
Thanks for your help!
Malhar
…________________________________
From: Aldo Romero ***@***.***>
Sent: Thursday, April 11, 2024 5:47 PM
To: romerogroup/pyprocar ***@***.***>
Cc: Malhar Balkrishna Kute ***@***.***>; Author ***@***.***>
Subject: Re: [romerogroup/pyprocar] Issue with plotting spin texture (Issue #143)
Just a simple check, did you check that the calculation runs correctly for the noncollinear case? meaning, check the PROCAR file and see the 4 blocks you expect to see for each Kpoint, each corresponding to Sx, Sy and Sz and total S… if this is the case, we can check further… but first the PROCAR should be correct.
______________________________________::::__________________________________________
Prof. Aldo Humberto Romero
Director Research Computing, West Virginia University
Eberly Family Distinguished Professor
Fellow American Physical Society
Editor Physica B, Assistant Editor EPJB, Editor Frontiers in Physics
Section Editor Papers in Physics
Member of the Editorial Board of “Materials” and “Symmetry Physics”
Physics and Astronomy Department
West Virginia University
135 Willey Street, PO Box 6315
111 White Hall
Morgantown, WV 26506
Phone: 304-293-6317
Fax: 304-293-5732
email: ***@***.***
From: malharkute ***@***.***>
Date: Thursday, April 11, 2024 at 8:17 PM
To: romerogroup/pyprocar ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [romerogroup/pyprocar] Issue with plotting spin texture (Issue #143)
Hello,
I'm trying to use pyprocar to plot the spin texture from a VASP calculation, but I'm finding conflicting documentation online. Here's how I'm calling the fermi2d function:
pyprocar.fermi2D('vasp', dirname=".", spin_texture=True, fermi=8.3106204826 - 0.1, spins=[1, 2], band_indices=[[46, 47], [46, 47]])
However, I get an error in the following line, as i_spin=2 is out of bounds.
indices = np.where( np.logical_and(ebs.bands[:,:,i_spin].min(axis=0) < energy, ebs.bands[:,:,i_spin].max(axis=0) > energy))
I did some digging and found that ebs.bands has shape (num_k, num_bands, 1), even though this is a non-collinear calculation. In my PROCAR files, I have Sx, Sy and Sz projections, yet it seems I can't plot these. Would you be able to help me figure out a workaround so I can plot the spin texture?
Thank you!
—
Reply to this email directly, view it on GitHub<#143>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB24DTJDHBSULMXJ6E4C3VLY44RYBAVCNFSM6AAAAABGDGPVZCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZTQOBQG44TOOI>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub<#143 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWOKXRDEHJKNIHJC4X3CHA3Y44VLNAVCNFSM6AAAAABGDGPVZCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQG43TKNRYHA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hey Malhar, so the issue is specifying spins = [1,2]. The argument is for when the calculation is a spin-polarized calculation For non-collinear calculations, the ebs.bands will have a shape [nkpoints,nbands,1], i.e. the band energies for a kpoint do not change based on the spin projections. Now, ebs.projected will have a shape [n_kpoints,n_bands,4, n_orbitals,n_atoms]. Where the third dimension represents the different spin projections. Index 0 is the total, Index 1 is Sx, Index 2 is Sy, and index 3 is Sz. To fix your issue, just remove spins as an argument:
You can also see additional keyword arguments for this function by passing no_arrow: arrow_color: arrow_density: spin_projection: Logan Lang |
Hi Logan Thanks for your help! Your suggestion to remove the spin argument does allow the code the run without any errors. However, the resulting plot doesn't seem to have any arrows, rather just dots on a line (see below). It also doesn't seem to change when I alter the "arrow_size" parameter. Do you know what might be the reason for this? Thanks! |
Hey Malhar, I just noticed it works the opposite the way you think, so the closer you are to 0 the larger the arrows. It has been a while since I worked on this code and I can't seem to remember why I left it like this. The arrow density also works like this too I'll change this to what people would expect when you increase the size, the arrows should increase. |
Hey Malhar, I just updated github, so the arrow_density and the arrow_size scale the way you would expect. Meaning increasing number means increasing density/size. To see these updates clone the repository from github. Here are the commands for that.
I will try to get this in the Pypi version as soon as possible. There are some further additions I would like to add before updating PyPi. |
Great! Looks like I don't have permission to clone the repository: Please make sure you have the correct access rights |
So this is from you not having your ssh keys for your computer register with your GitHub account. If you search this on google, you can figure out how to do this. It's very handy to have it registered. Instead, you can download the zip of the repository, extract the zip on your computer, open a terminal inside the repo and do 'pip install .' |
Did you manage to download the repository from GitHub? |
Hello,
I'm trying to use pyprocar to plot the spin texture from a VASP calculation, but I'm finding conflicting documentation online. Here's how I'm calling the fermi2d function:
pyprocar.fermi2D('vasp', dirname=".", spin_texture=True, fermi=8.3106204826 - 0.1, spins=[1, 2], band_indices=[[46, 47], [46, 47]])
However, I get an error in the following line, as i_spin=2 is out of bounds.
indices = np.where( np.logical_and(ebs.bands[:,:,i_spin].min(axis=0) < energy, ebs.bands[:,:,i_spin].max(axis=0) > energy))
I did some digging and found that ebs.bands has shape (num_k, num_bands, 1), even though this is a non-collinear calculation. In my PROCAR files, I have Sx, Sy and Sz projections, yet it seems I can't plot these. Would you be able to help me figure out a workaround so I can plot the spin texture?
Thank you!
The text was updated successfully, but these errors were encountered: