gvallverdu / bandstructureplots Goto Github PK
View Code? Open in Web Editor NEWBand structure plots using pymatgen and a rgb scale to look at atomic or orbital contributions.
License: MIT License
Band structure plots using pymatgen and a rgb scale to look at atomic or orbital contributions.
License: MIT License
Hi,
im evaluating my DFT calculation from vasp with your plotting python script.
When im executing i receive two warnings:
/usr/local/lib/python2.7/dist-packages/pymatgen/io/vasp/outputs.py:543: UserWarning: Final e_wo_entrp differs from the final electronic step. VASP may have included some corrections, e.g., vdw. Vasprun will return the final e_wo_entrp, i.e., including corrections in such instances.
warnings.warn("Final e_wo_entrp differs from the final "
/usr/lib/pymodules/python2.7/matplotlib/collections.py:548: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if self._edgecolors == 'face':
What can i do to avoid that warnings?
Nevertheless the PDOS and Bandstructure are looking good.
Thanks for your great work!
Hi,
Why is not the sum of projected DoS for s, pxpy and pz equal to the total DoS data? It is expecially clear near the cone here:
https://github.com/gVallverdu/bandstructureplots/blob/master/graphene/graphene.png
Cheers
Hi Germain,
Thanks for your script
I calculated the band structure of GaAs using VASP. I want to plot s & p orbital of Ga-atom and s & p orbital of As-atom. In the all script, you plotted only three orbital with three different color.
Can you give any suggestion,
How to plot the band structure for specific orbital [ Ga (s, p), As (s, p)]?
Dear Germain,
First of all, I want to say that you wrote a very nice script for plotting the orbital-projected band structure of graphene.
However, it seems that there is a finite gap in the dos (which should be vanishing in graphene due to its gapless feature). Do you know how to remove this gap as well as how to set appropriate parameters in INCAR file ? Thanks a lot in advance.
Best,
Lee
Dear Vallverdu,
I am trying to follow your template "bands_Si.py" to plot my bandstructures and DOS calculated with VASP but i keep running into problems because of outdated modules. Is a similar template with the newest modules of pymatgen available? Any help or pointers will be greatly appreciated.
Best regards,
Hi,
I have run the script successfully. Thank you for this nice script. I have few questions..
In case of spin-polarization, How to plot bands for both spin(spin up and spin down)?
I am interested to look DOS and band structure near Fermi level. How can I specify the energy range in the plot?
Is is possible to plot the band structure with specific orbital(like the DOS of d_xy, d_yz……or t_2g and e_g)?
Dear Users
I want to plot bandstructure and DOS in the specific range. I have changed the value code as given below,but it does not effect on plot,Secondly I also want to delete the gap between DOS and Bandstructure diagram.please suggest solution.
Thanks in Advance
emin =5.
emax =-5.
for spin in bands.bands.keys():
for b in range(bands.nb_bands):
emin = min(emin, min(bands.bands[spin][b]))
emax = max(emax, max(bands.bands[spin][b]))
emin -= bands.efermi + 1
emax -= bands.efermi - 1
ax1.set_ylim(emin, emax)
ax2.set_ylim(emin, emax)
Hi Sir,
How to plot band for different atoms in same graphe taking their overall orbital contribution?
Thank you in advance
Hi Germain,
Thank you for your code!
I used your bands_Si.py as template to plot the DOS and band structure for my system.
I ran into an Error that :
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/Users/hbliu/plot_bandos_test.py in <module>()
83 for b in range(bands.nb_bands):
84 for k in range(len(bands.kpoints)):
---> 85 sc = pbands[Spin.up][b][k][name]["s"]**2
86 pc = pbands[Spin.up][b][k][name]["p"]**2
87 dc = pbands[Spin.up][b][k][name]["d"]**2
KeyError: <Spin.up: 1>
Do you have any idea to fix this error? Thank you so much!
Hi
I'm currently trying to plot bandstructures of compounds that have at least 3 branches in their HighSymmKPath. Your code relies on the fact that you have only one branch and that the highSymmetry Kpoints are evenly spaced.
I developped the following addition to your code : although it does not renders as beautifully as yours, it has the advantage of providing labels and index of all the Kpoints in all the branches :
(as i am new to git hub, i don't know exactly how to submit a pull that is not fully finished so i post it here) :
I would replace the following lines :
nlabs = len(labels)
step = len(bands.kpoints) / (nlabs - 1)
for i, lab in enumerate(labels):
ax1.vlines(i * step, emin, emax, "k")
ax1.set_xticks([i * step for i in range(nlabs)])
ax1.set_xticklabels(labels)
ax1.set_xlim(0, len(bands.kpoints))
With this code :
#Scanning the branches in the HighSymmKpath
index=0
branch_list=[]
while index < len(bands.kpoints) :
branch=bands.get_branch(index)[0]
branch_list.append(branch)
index=branch['end_index']+2
print(branch_list)
#Scanning the branch_list to extract start and end points of those branches
point_list=[]
for i,branch in enumerate(branch_list) :
pt=[branch['start_index'] , branch['name'].split("-")[0]]
# print(pt,i)
#if the previous end point is the same as the current start one, we dont ass it
if i==0 or (pt[1] != point_list[-1][1]) :
point_list.append(pt)
point_list.append([branch['end_index'] , branch['name'].split("-")[-1]])
print(point_list)
#adding the HighSymm Kpoints through their labels and index
for point in point_list :
p=ax.vlines(point[0],emin, emax,"k")
Xticks=ax.set_xticks([point_list[i][0] for i in range(len(point_list))])
Xtickslabel=ax.set_xticklabels([point_list[i][1] for i in range(len(point_list))])
Thanks
(See You in January !)
Dear Germain,
Thank you very much for your code.
Don't you know yet, how to make different distances between k-points?
Where could be find an information about?
Thank you very much!
Hello Germain,
Thank you so much for such a nice script. I can run it and get plots. I have small question about image format.
When I run it on cluster and save the image as .pdf, .jpg or any other supported format, and move it to my local computer , I cannot see my Image, it appears blank.
Here I have attached files as they appear.
Thanks in advance.
Very nice scripts.
I don't really understand why you squaring the contribution of differnent orbitals.
What pricinple are you based on?
Thanks a lot!
Dear sir,
thank you for sharing this very useful code. I would like to know if it is possible to calculated orbital projected band structure for systems with spin-orbit coupling. Thanks in advance!
best,
Rajdeep Banerjee
PhD
JNCASR, Bangalore
India
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.