My question may sound trivial, but I need some advice. What are the best free tools/software to plot band structure and phonon dispersion from the Quantum ESPRESSO output?
$\begingroup$ $\endgroup$
1 - $\begingroup$ I am not sure what you meant by best but if you want customized plots, python is a good choice. Lots of code snippets are already available online such as this or this. If python seems complicated, you may try gnuplot or xmgrace. QE output data can be readily plotted by these. $\endgroup$AbdulMuhaymin– AbdulMuhaymin2024-09-02 03:52:14 +00:00Commented Sep 2, 2024 at 3:52
Add a comment |
1 Answer
$\begingroup$ $\endgroup$
I also use from Quantum Espresso to simulate materials. I recommend to use from python matplotlib module or gnuplot, especially both of them are free. I think that you also use from this procedure;
- scf calculation with option: calculation='scf' using pw.x
- bands calculation with option calculation='bands' using pw.x
- bands data generation using bands.x When you use from this procedure, bands.x generates data files with extension of .dat, .dat.gnu, and .dat.rap. It is possible to visualize the band structure from .dat.gnu file directly using gnuplot by using given code below:
set output 'band_structure.png' set encoding utf8 set terminal pngcairo font "Helvetica,16" data='path_to_file/filename.dat.gnu' unset key set origin 0, 0 set size 0.75, 1 set ylabel "Energy (eV)" set xrange [0:3.2808] set yrange [-5:10] set xtics ("Γ" 0.0000, "X" 0.5001,"M" 1.0002, "Γ" 1.7074, "R" 2.5736, "X" 3.2808) set grid xtics lt -1 lw 1.0 set arrow from 0,0 to 3.2808,0 lc rgb 'black' lt 1 lw 1 dt 2 nohead plot 'data' using 1:2 with lines lw 2 unset output Another way to plot band structure is using from matplotlib module of python. In python, you need to use from .dat.gnu file to plot. You can use code given below:
import matplotlib.pyplot as plt from matplotlib import rcParamsDefault import numpy as np plt.rcParams["figure.dpi"]=150 plt.rcParams["figure.facecolor"]="white" plt.rcParams["figure.figsize"]=(8, 6) filename='path_to_file/example.dat.gnu' data = np.loadtxt(filename) k = np.unique(data[:, 0]) bands = np.reshape(data[:, 1], (-1, len(k))) for band in range(len(bands)): plt.plot(k, bands[band, :], linewidth=1, alpha=0.5, color='blue') plt.xlim(min(k), max(k)) plt.axvline(0.8660, linewidth=0.75, color='k', alpha=0.5) plt.axvline(1.3660, linewidth=0.75, color='k', alpha=0.5) plt.axvline(1.8660, linewidth=0.75, color='k', alpha=0.5) plt.xticks(ticks= [0, 0.8660, 1.3660, 1.8660, 2.5731], \ labels=['R', '$\Gamma$', 'X', 'M', '$\Gamma$']) plt.ylabel("Energy (eV)") plt.show()