Band structure with Quantum ESPRESSO (PBE)#
Band structure for ferromagnetic iron with Quantum ESPRESSO#
For band structures, always use the primitive unit cell.
Primitive unit cell of Fe#
from scm.base import ChemicalSystem
from scm.plams import view
d = 1.435
cs = ChemicalSystem(
f"""
System
Atoms
Fe 0.0 0.0 0.0
End
Lattice
{-d} {d} {d}
{d} {-d} {d}
{d} {d} {-d}
End
End"""
)
cs.guess_bonds() # does not affect the Quantum ESPRESSO DFT engine, just for visualization
view(cs, width=150, height=150)
Set up PBE band structure calculation with Quantum ESPRESSO#
from scm.inputs import AMS, QuantumEspresso
from scm.plams import Settings, AMSJob
s = Settings()
s.input = AMS(Task="SinglePoint")
s.input.Engine = QuantumEspresso()
s.input.Engine.BandStructure.K_Points.header = "ams_kpath"
s.input.Engine.BandStructure.K_Points.lines = [""]
s.input.Engine.DOS.PDOS = True
s.input.Engine.K_Points.header = "automatic"
s.input.Engine.K_Points.lines = ["8 8 8 0 0 0"]
s.input.Engine.Properties.BandStructure = True
s.input.Engine.Properties.DOS = True
s.input.Engine.Pseudopotentials.Family = "pslibrary-US"
s.input.Engine.Pseudopotentials.Functional = "PBE"
s.input.Engine.System.degauss = "0.01"
s.input.Engine.System.ecutwfc = "50.0"
s.input.Engine.System.nspin = "Collinear"
s.input.Engine.System.occupations = "Smearing"
s.input.Engine.System.starting_magnetization = [{"Label": "Fe", "Value": "1.0"}]
s.runscript.preamble_lines = ["export SCM_DISABLE_MPI=1"] # needed for Quantum ESPRESSO calculations with AMS
s.runscript.postamble_lines = []
job = AMSJob(settings=s, molecule=cs, name="ferromagnetic-Fe")
job.run();
[09.10|17:27:26] JOB ferromagnetic-Fe STARTED
[09.10|17:27:26] JOB ferromagnetic-Fe RUNNING
[09.10|17:27:44] JOB ferromagnetic-Fe FINISHED
[09.10|17:27:44] JOB ferromagnetic-Fe SUCCESSFUL
Get the band structure data and plot it#
from scm.plams.tools.plot import plot_band_structure
x, y_spin_up, y_spin_down, labels, fermi_energy = job.results.get_band_structure(unit="eV")
ax = plot_band_structure(x, y_spin_up, y_spin_down, labels, fermi_energy, zero="fermi")
ax.set_ylim(-10, 10)
ax.set_ylabel("$E - E_{Fermi}$ (eV)")
ax.set_xlabel("Path")
ax.set_title("Ferromagnetic iron with PBE and Quantum ESPRESSO")
ax;
See also#
Python Script#
#!/usr/bin/env python
# coding: utf-8
# ## Band structure for ferromagnetic iron with Quantum ESPRESSO
#
# For band structures, **always** use the **primitive unit cell**.
#
# ### Primitive unit cell of Fe
from scm.base import ChemicalSystem
from scm.plams import view
d = 1.435
cs = ChemicalSystem(
f"""
System
Atoms
Fe 0.0 0.0 0.0
End
Lattice
{-d} {d} {d}
{d} {-d} {d}
{d} {d} {-d}
End
End"""
)
cs.guess_bonds() # does not affect the Quantum ESPRESSO DFT engine, just for visualization
view(cs, width=150, height=150, picture_path="picture1.png")
# ### Set up PBE band structure calculation with Quantum ESPRESSO
from scm.inputs import AMS, QuantumEspresso
from scm.plams import Settings, AMSJob
s = Settings()
s.input = AMS(Task="SinglePoint")
s.input.Engine = QuantumEspresso()
s.input.Engine.BandStructure.K_Points.header = "ams_kpath"
s.input.Engine.BandStructure.K_Points.lines = [""]
s.input.Engine.DOS.PDOS = True
s.input.Engine.K_Points.header = "automatic"
s.input.Engine.K_Points.lines = ["8 8 8 0 0 0"]
s.input.Engine.Properties.BandStructure = True
s.input.Engine.Properties.DOS = True
s.input.Engine.Pseudopotentials.Family = "pslibrary-US"
s.input.Engine.Pseudopotentials.Functional = "PBE"
s.input.Engine.System.degauss = "0.01"
s.input.Engine.System.ecutwfc = "50.0"
s.input.Engine.System.nspin = "Collinear"
s.input.Engine.System.occupations = "Smearing"
s.input.Engine.System.starting_magnetization = [{"Label": "Fe", "Value": "1.0"}]
s.runscript.preamble_lines = ["export SCM_DISABLE_MPI=1"] # needed for Quantum ESPRESSO calculations with AMS
s.runscript.postamble_lines = []
job = AMSJob(settings=s, molecule=cs, name="ferromagnetic-Fe")
job.run();
# ### Get the band structure data and plot it
from scm.plams.tools.plot import plot_band_structure
x, y_spin_up, y_spin_down, labels, fermi_energy = job.results.get_band_structure(unit="eV")
ax = plot_band_structure(x, y_spin_up, y_spin_down, labels, fermi_energy, zero="fermi")
ax.set_ylim(-10, 10)
ax.set_ylabel("$E - E_{Fermi}$ (eV)")
ax.set_xlabel("Path")
ax.set_title("Ferromagnetic iron with PBE and Quantum ESPRESSO")
ax;
ax.figure.savefig("picture2.png")