# Set up lattice
lattice = FaceCenteredCubic(7.166*Angstrom)
# Define elements
elements = [Silicon, Silicon, Oxygen, Oxygen, Oxygen, Oxygen]
# Define coordinates
fractional_coordinates = [[ 0.125, 0.125, 0.125],
[ 0.875, 0.875, 0.875],
[ 0, 0, 0],
[ 0, 0.5, 0],
[ 0.5, 0, 0],
[ 0, 0, 0.5]]
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
numerical_accuracy_parameters = NumericalAccuracyParameters(
k_point_sampling=(3, 3, 3),
)
calculator = LCAOCalculator(
numerical_accuracy_parameters=numerical_accuracy_parameters,
)
bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()
nlsave('sio2_bs_pO.nc', bulk_configuration)
# -------------------------------------------------------------
# Bandstructure
# -------------------------------------------------------------
################## THE IMPORTANT PART ##################
project_oxygen_p = ProjectionList(elements=[Oxygen], angular_momenta=[1])
####################################################
bandstructure = Bandstructure(
configuration=bulk_configuration,
route=['G', 'X', 'W', 'L', 'G', 'K', 'X', 'U', 'W', 'K', 'L'],
points_per_segment=60,
bands_above_fermi_level=All,
projection_list=project_oxygen_p, # IT GOES HERE
)
nlsave('sio2_bs_pO.nc', bandstructure)
It's possible to project the band structure, like the DOS, on orbitals and atoms. There is no GUI component for this yet, but here is an example which make a project of the band structure of SiO2 (cristobalite) on the oxygen p-orbitals:Code: python# Set up lattice
lattice = FaceCenteredCubic(7.166*Angstrom)
# Define elements
elements = [Silicon, Silicon, Oxygen, Oxygen, Oxygen, Oxygen]
# Define coordinates
fractional_coordinates = [[ 0.125, 0.125, 0.125],
[ 0.875, 0.875, 0.875],
[ 0, 0, 0],
[ 0, 0.5, 0],
[ 0.5, 0, 0],
[ 0, 0, 0.5]]
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
fractional_coordinates=fractional_coordinates
)
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
numerical_accuracy_parameters = NumericalAccuracyParameters(
k_point_sampling=(3, 3, 3),
)
calculator = LCAOCalculator(
numerical_accuracy_parameters=numerical_accuracy_parameters,
)
bulk_configuration.setCalculator(calculator)
nlprint(bulk_configuration)
bulk_configuration.update()
nlsave('sio2_bs_pO.nc', bulk_configuration)
# -------------------------------------------------------------
# Bandstructure
# -------------------------------------------------------------
################## THE IMPORTANT PART ##################
project_oxygen_p = ProjectionList(elements=[Oxygen], angular_momenta=[1])
####################################################
bandstructure = Bandstructure(
configuration=bulk_configuration,
route=['G', 'X', 'W', 'L', 'G', 'K', 'X', 'U', 'W', 'K', 'L'],
points_per_segment=60,
bands_above_fermi_level=All,
projection_list=project_oxygen_p, # IT GOES HERE
)
nlsave('sio2_bs_pO.nc', bandstructure)
from NanoLanguage import *
ncfile = 'gold.nc'
plotfile = 'plot.png'
colors = ['r','b','g','m']
ymin = -10
ymax = 10
conf = nlread(ncfile, object_id='gID000')[-1]
bs_s = Bandstructure(conf, projection_list=ProjectionList(angular_momenta=[0]))
bs_p = Bandstructure(conf, projection_list=ProjectionList(angular_momenta=[1]))
bandstructures = [bs_s,bs_p]
import pylab as P
for j,bs in enumerate(bandstructures):
P.plot(bs._axisGUI(), bs.evaluate(), colors[j])
kticks = [ tick[0] for tick in bs._ticksGUI() ]
ticklabels = [ tick[1].replace('Γ','$\Gamma$') for tick in bs._ticksGUI() ]
P.xticks(kticks,ticklabels)
P.grid(kticks)
P.ylim(ymin,ymax)
#P.savefig(plotfile)
P.show()
from NanoLanguage import *
plotfile = 'plot.png'
colors = ['r','b','g','m']
ymin = -10
ymax = 10
bs1 = nlread('Band1.nc', BandStructure)[-1]
bs2 = nlread('Band2.nc', BandStructure)[-1]
...
# same as before
...