#!/usr/bin/env python # # This example shows how to plot the phonon band structure of AlAs. # See tutorial/lesson_rf2.html # FIXME: LO-TO splitting and phonon displacements instead of eigenvectors. from abipy.abilab import PhononBands, PHDOS_Reader, PHDOS_File import abipy.data as abidata # Path to the PHBST file produced by anaddb. phbst_file = abidata.ref_file("trf2_5.out_PHBST.nc") # Create the object from file. phbands = PhononBands.from_file(phbst_file) # Read the Phonon DOS from the netcd file produced by anaddb (prtdos 2) phdos_file = abidata.ref_file("trf2_5.out_PHDOS.nc") with PHDOS_Reader(phdos_file) as r: phdos = r.read_phdos() # plot phonon bands and DOS. phbands.plot_with_phdos(phdos, title="AlAs Phonon bands and DOS")
#!/usr/bin/env python # # This example shows how to plot the phonon band structure with markers. from abipy.abilab import PhononBands import abipy.data as abidata # Create the object from file. phbands = PhononBands.from_file(abidata.ref_file("trf2_5.out_PHBST.nc")) # Create the marker. Here we just use the phonon frequency as size of the marker. x = [] for q in range(phbands.num_qpoints): x.extend(phbands.num_branches * [q]) xys = [ x, phbands.phfreqs.ravel(), phbands.phfreqs.ravel(), ] phbands.set_marker("fake marker", xys) # Plot the phonon frequencies. Note that the labels for the q-points # are found automatically by searching in an internal database. phbands.plot(title="AlAs phonon band structure with omega(q, nu) as marker", marker="fake marker:10000")
#!/usr/bin/env python # # This example shows how to plot the phonon fatbands of AlAs. # See tutorial/lesson_rf2.html from abipy.abilab import PhononBands import abipy.data as abidata # Path to the PHBST file produced by anaddb. filename = abidata.ref_file("trf2_5.out_PHBST.nc") # Create the object from file. phbands = PhononBands.from_file(filename) # Mapping reduced coordinates -> labels qlabels = { (0, 0, 0): "$\Gamma$", (0.375, 0.375, 0.75): "K", (0.5, 0.5, 1.0): "X", (0.5, 0.5, 0.5): "L", (0.5, 0.0, 0.5): "X", (0.5, 0.25, 0.75): "W", } # Plot the phonon band structure. phbands.plot_fatbands(title="AlAs phonon fatbands without LO-TO splitting", qlabels=qlabels)