Package: elphem
ElphemPython Library for Calculations ofElectron-Phonon Interactions withEmpty LatticeSupportPython 3.10 and 3.11Installationgitclonegit@github.com:cohsh/elphem.gitcdelphem
pipinstall.FeaturesCurrently, Elphem allows calculations of(reciprocal) lattice vectors from lattice constants.electronic structures with empty lattice approximation.phonon dispersion relations with Debye model.first-order electron-phonon couplings.one-electron self-energies.ExamplesCalculation of the electronic band structureimportnumpyasnpimportmatplotlib.pyplotaspltfromelphemimportSpecialPoints,Energy,Length,LatticeConstant,EmptyLattice,FreeElectrondefmain():# Example: Li (BCC)a=2.98*Length.ANGSTROM["->"]alpha=109.47lattice_constant=LatticeConstant(a,a,a,alpha,alpha,alpha)lattice=EmptyLattice(lattice_constant)n_cut=np.array([2]*3)electron=FreeElectron(lattice,1)k_names=["G","H","N","G","P","H"]k_via=[SpecialPoints.BCC[name]fornameink_names]x,eig,x_special=electron.get_band_structure(n_cut,*k_via)fig,ax=plt.subplots()forbandineig:ax.plot(x,band*Energy.EV["<-"],color="tab:blue")ax.vlines(x_special,ymin=-10,ymax=50,color="black",linewidth=0.3)ax.set_xticks(x_special)ax.set_xticklabels(k_names)ax.set_ylabel("Energy ($\mathrm{eV}$)")ax.set_ylim([-10,50])fig.savefig("test_band_structure.png")if__name__=="__main__":main()Calculation of the phonon dispersionimportosimportmatplotlib.pyplotaspltfromelphemimportLatticeConstant,EmptyLattice,DebyeModel,AtomicWeight,Energy,Mass,Length,SpecialPoints,Prefixdefmain():# Example: \gamma-Fe (FCC)a=2.58*Length.ANGSTROM["->"]lattice_constant=LatticeConstant(a,a,a,60,60,60)lattice=EmptyLattice(lattice_constant)debye_temperature=470.0phonon=DebyeModel(lattice,debye_temperature,1,AtomicWeight.table["Fe"]*Mass.DALTON["->"])q_names=["G","X","G","L"]q_via=[SpecialPoints.FCC[name]fornameinq_names]x,omega,x_special=phonon.get_dispersion(*q_via)fig,ax=plt.subplots()ax.plot(x,omega*Energy.EV["<-"]/Prefix.MILLI,color="tab:blue")forx0inx_special:ax.axvline(x=x0,color="black",linewidth=0.3)ax.set_xticks(x_special)ax.set_xticklabels(q_names)ax.set_ylabel("Energy ($\mathrm{meV}$)")fig.savefig("test_phonon_dispersion.png")if__name__=="__main__":main()Calculation of the electron-phonon renormalization (EPR)importnumpyasnpimportmatplotlib.pyplotaspltfromelphemimportLatticeConstant,EmptyLattice,FreeElectron,DebyeModel,SelfEnergy2ndfromelphem.constimportMass,Energy,Length,AtomicWeight,SpecialPointsdefmain():# Example: Li (BCC)a=2.98*Length.ANGSTROM["->"]alpha=109.47lattice_constant=LatticeConstant(a,a,a,alpha,alpha,alpha)lattice=EmptyLattice(lattice_constant)electron=FreeElectron(lattice,1)mass=AtomicWeight.table["Li"]*Mass.DALTON["->"]debye_temperature=344.0phonon=DebyeModel(lattice,debye_temperature,1,mass)self_energy=SelfEnergy2nd(lattice,electron,phonon)n_g=np.array([2]*3)g=lattice.grid(n_g).reshape(-1,3)n_g_inter=np.array([1]*3)n_q=np.array([10]*3)k_names=["G","H","N","G","P","H"]k_via=[SpecialPoints.BCC[name]fornameink_names]x,k,special_x=lattice.reciprocal_cell.path(20,*k_via)selfen=np.empty((len(k)),dtype=complex)fig=plt.figure()ax=fig.add_subplot(1,1,1)temperature=2*debye_temperatureforninrange(len(g)):eig=electron.eigenenergy(k+g[n])foriinrange(len(k)):selfen[i]=self_energy.calculate(temperature,g[n],k[i],n_g_inter,n_q)epr=selfen.realax.plot(x,eig*Energy.EV["<-"],color="tab:blue")ax.plot(x,(eig+epr)*Energy.EV["<-"],color="tab:orange")forx0inspecial_x:ax.axvline(x=x0,color="black",linewidth=0.3)ax.set_xticks(special_x)ax.set_xticklabels(k_names)ax.set_ylabel("Energy ($\mathrm{eV}$)")ax.set_ylim([-7,Energy.EV["<-"]])ax.set_title("Example: Band structure of bcc-Li")fig.savefig("test_epr.png")if__name__=="__main__":main()Calculation of scattering rateimportnumpyasnpimportmatplotlib.pyplotaspltfromelphemimportLatticeConstant,EmptyLattice,FreeElectron,DebyeModel,SelfEnergy2ndfromelphem.constimportMass,Energy,Prefix,Time,Length,AtomicWeightdefmain():# Example: Li (BCC)a=2.98*Length.ANGSTROM["->"]alpha=109.47lattice_constant=LatticeConstant(a,a,a,alpha,alpha,alpha)lattice=EmptyLattice(lattice_constant)electron=FreeElectron(lattice,1)mass=AtomicWeight.table["Li"]*Mass.DALTON["->"]debye_temperature=344.0phonon=DebyeModel(lattice,debye_temperature,1,mass)temperature=debye_temperatureself_energy=SelfEnergy2nd(lattice,electron,phonon)n_g=np.array([1]*3)n_k=np.array([6]*3)g,k=electron.grid(n_g,n_k)n_g_inter=np.array([1]*3)n_q=np.array([10]*3)selfen=self_energy.calculate(temperature,g,k,n_g_inter,n_q)epsilon_nk=electron.eigenenergy(k+g)fig=plt.figure()ax1=fig.add_subplot(2,1,1)ax2=fig.add_subplot(2,1,2)foraxin[ax1,ax2]:ax.scatter(epsilon_nk*Energy.EV["<-"],selfen.imag/(Time.SI["<-"]/Prefix.PICO),label="$\mathrm{Im}\Sigma^\mathrm{Fan}$")ax.set_ylabel("Scattering rate ($\mathrm{ps}^{-1}$)")ax.legend()ax2.set_xlabel("Electron energy ($\mathrm{eV}$)")ax2.set_yscale("log")ax1.set_title("Example: Scattering rate of bcc-Li")file_name="test_scattering_rate.png"fig.savefig(file_name)if__name__=="__main__":main()LicenseMIT