Plotting Mulliken-Projected Band StructuresΒΆ
[1]:
%matplotlib inline
# these two lines are only necessary to make the jupyter notebooks run on binder
import sys
sys.path.insert(0, "../..")
# We load the respective module
from aimstools.bandstructures import MullikenBandStructure as MBS
# We initialize the MullikenBandStructure object from a directory.
# The bandmlkxxxx.out files can become very large, so reading them in can take up some time.
bs = MBS("fatbands", soc=True)
INFO Reading in mulliken bandfiles in serial ...
INFO ... processed bandmlk1001.out in 0.18 seconds.
INFO ... processed bandmlk1002.out in 0.20 seconds.
INFO ... processed bandmlk1003.out in 0.24 seconds.
INFO Creating spectrum from bands took 0.00 seconds.
[2]:
%matplotlib inline
import matplotlib.pyplot as plt
# We set up a figure and some axes
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(15,5))
# On the first one, we draw just the band structure, in this case with spin-orbit coupling:
ax1 = bs.plot(axes=ax1, color="royalblue")
ax1.set_title("Band Structure with SOC")
# On the second one, we draw the contribution of all species overlaid:
ax2 = bs.plot_all_species(axes=ax2)
ax2.set_ylabel("")
ax2.set_yticks([])
ax2.set_title("Projection on species")
# On the third one, we draw the difference of the contributions as a gradient:
ax3 = bs.plot_difference_contribution("Mo", "Se", axes=ax3)
ax3.set_ylabel("")
ax3.set_yticks([])
ax3.set_title("Projection on contribution difference")
plt.show()
[3]:
# Mulliken band structures typically need some customization to make them look good.
# You have many options to choose how to plot the mulliken band structure.
%matplotlib inline
import matplotlib.pyplot as plt
# We set up a figure and some axes
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(15,5))
# We can plot the contributions as a sequential or continuous color map.
# A sequential map is less cluttered and often more readable when many species are involved.
# But, it hides a lot of information.
# Compare this representation to the gradient representation:
# It becomes more clear which parts of the bands belong to which atom,
# but in reality, this cannot be assigned as exactly as is suggested by this figure.
ax1 = bs.plot_majority_contribution(axes=ax1, colors=["red", "blue"])
ax1.set_title("Majority contribution")
# On the other hand side, for orbitals this representation is recommended:
ax2 = bs.plot_all_angular_momenta(axes=ax2)
ax2.set_title("Angular momenta")
ax2.set_ylabel("")
ax2.set_yticks([])
# Alternatively, you can also choose a scattered representation.
# It simply depends on your system which representation looks best.
ax3 = bs.plot_contributions(contributions="Mo", axes=ax3, mode="scatter", color="blue", interpolate=True)
ax3.set_ylabel("")
ax3.set_yticks([])
ax3.set_title("Scatter mode")
plt.show()
[4]:
%matplotlib inline
import matplotlib.pyplot as plt
from aimstools.bandstructures import MullikenBandStructure as MBS
# A more complicated example is shown here
bs = MBS("larger_fatbands")
contributions = [("CH", "tot"), "O", "N"]
colors = ["black", "red", "blue"]
bs.plot_contributions(contributions=contributions,
colors=colors,
window=6,
bandpath="NGM,XGY,LGZ",
y_tick_locator=1.0,
show_bandgap_vertices=False,
mode="majority",
show_colorbar=True,
interpolate=True)
INFO Reading in mulliken bandfiles in serial ...
INFO ... processed bandmlk1001.out in 0.22 seconds.
INFO ... processed bandmlk1002.out in 0.33 seconds.
INFO ... processed bandmlk1003.out in 0.37 seconds.
INFO ... processed bandmlk1004.out in 0.29 seconds.
INFO ... processed bandmlk1005.out in 0.45 seconds.
INFO ... processed bandmlk1006.out in 0.24 seconds.
INFO ... processed bandmlk1007.out in 0.26 seconds.
INFO Creating spectrum from bands took 0.01 seconds.
[4]:
<AxesSubplot:ylabel='E - E$_{\\mathrm{F}}$ [eV]'>