Ejemplo n.º 1
0
 def plot_band_fitting(self,
                       kvectors=np.array([[0, 0, 0], [0.5, 0, 0],
                                          [0.5, 0.5, 0], [0, 0, 0],
                                          [.5, .5, .5]]),
                       knames=['$\Gamma$', 'X', 'M', '$\Gamma$', 'R'],
                       supercell_matrix=None,
                       npoints=100,
                       efermi=None,
                       erange=None,
                       fullband_color='blue',
                       downfolded_band_color='green',
                       marker='o',
                       ax=None,
                       savefig='Downfolded_band.png',
                       cell=np.eye(3),
                       show=True):
     """
     Parameters:
     ========================================
     kvectors: coordinates of special k-points
     knames: names of special k-points
     supercell_matrix: If the structure is a supercell, the band can be in the primitive cell.
     npoints: number of k-points in the band.
     efermi: Fermi energy.
     erange: range of energy to be shown. e.g. [-5,5]
     fullband_color: the color of the full band structure.
     downfolded_band_color: the color of the downfolded band structure.
     marker: the marker of the downfolded band structure.
     ax: matplotlib axes object.
     savefig: the filename of the figure to be saved.
     show: whether to show the band structure.
     """
     ax = plot_band(self.model,
                    kvectors=kvectors,
                    knames=knames,
                    supercell_matrix=supercell_matrix,
                    npoints=npoints,
                    color=fullband_color,
                    alpha=0.8,
                    marker='',
                    erange=erange,
                    efermi=efermi,
                    cell=cell,
                    ax=ax)
     ax = plot_band(self.ewf,
                    kvectors=kvectors,
                    knames=knames,
                    supercell_matrix=supercell_matrix,
                    npoints=npoints,
                    efermi=efermi,
                    color=downfolded_band_color,
                    alpha=0.5,
                    marker=marker,
                    erange=erange,
                    cell=cell,
                    ax=ax)
     if savefig is not None:
         plt.savefig(savefig)
     if show:
         plt.show()
Ejemplo n.º 2
0
    def save_to_nc(self, output_path='./', prefix='Downfolded'):
        txt_fname = os.path.join(output_path, f"{prefix}_up.txt")
        nc_fname = os.path.join(output_path, f"{prefix}_up.nc")
        self.lwf_up.save_txt(txt_fname)
        self.lwf_up.write_nc(nc_fname, atoms=self.atoms)

        txt_fname = os.path.join(output_path, f"{prefix}_down.txt")
        nc_fname = os.path.join(output_path, f"{prefix}_down.nc")
        self.lwf_down.save_txt(txt_fname)
        self.lwf_down.write_nc(nc_fname, atoms=self.atoms)

        from banddownfolder.plot import plot_band
        ax = plot_band(self.lwf_up)

        ax = plot_band(self.lwf_down, color='red')
Ejemplo n.º 3
0
 def plot_band(self, **kwargs):
     plot_band(self, **kwargs)
Ejemplo n.º 4
0
 def plot_band(self, **kwargs):
     ax=plot_band(self, **kwargs)
     return ax