Elphem: Calculating electron-phonon interactions with the empty lattice.
Project description
Elphem
Electron-Phonon Interactions with Empty Lattice
Installation
From PyPI
pip install elphem
From GitHub
git clone git@github.com:cohsh/elphem.git
cd elphem
pip install -e .
Features
Currently, 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.
- spectral functions.
Examples
Calculation of spectral functions (examples/spectrum.py
)
"""Example: bcc-Li"""
import numpy as np
import matplotlib.pyplot as plt
from elphem import *
def main():
a = 2.98 * Length.ANGSTROM["->"]
mass = AtomicWeight.table["Li"] * Mass.DALTON["->"]
debye_temperature = 344.0
lattice = EmptyLattice('bcc', a)
electron = FreeElectron(lattice, n_band=8, n_electron=1)
phonon = DebyeModel(lattice, debye_temperature, 1, mass)
temperature = 3 * debye_temperature
self_energy = SelfEnergy(lattice, electron, phonon, temperature, sigma=0.5, eta=0.1)
n_q = np.array([10]*3)
n_omega = 1000
range_omega = [-8 * Energy.EV["->"], 6 * Energy.EV["->"]]
k_names = ["G", "H", "N", "G", "P", "H"]
n_split = 20
x, y, spectrum, special_x = Spectrum(self_energy).calculate_with_path(k_names, n_split, n_q, n_omega, range_omega)
y_mesh, x_mesh = np.meshgrid(y, x)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
mappable = ax.pcolormesh(x_mesh, y_mesh * Energy.EV["<-"], spectrum / Energy.EV["<-"])
for x0 in special_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_title("Spectral function of bcc-Li")
fig.colorbar(mappable, ax=ax)
fig.savefig("example_spectrum.png")
if __name__ == "__main__":
main()
Calculation of the electron-phonon renormalization (EPR) (examples/electron_phonon_renormalization.py
)
"""Example: bcc-Li"""
import numpy as np
import matplotlib.pyplot as plt
from elphem import *
def main():
a = 2.98 * Length.ANGSTROM["->"]
mass = AtomicWeight.table["Li"] * Mass.DALTON["->"]
debye_temperature = 344.0
temperature = 3 * debye_temperature
n_band = 20
lattice = EmptyLattice('bcc', a)
electron = FreeElectron(lattice, n_band, 1)
phonon = DebyeModel(lattice, temperature, 1, mass)
self_energy = SelfEnergy(lattice, electron, phonon, temperature, eta=0.05)
k_names = ["G", "H", "N", "G", "P", "H"]
n_split = 20
n_q = np.array([8]*3)
k, eig, epr, special_k = EPR(self_energy).calculate_with_path(k_names, n_split, n_q)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
for n in range(n_band):
if n == 0:
ax.plot(k, eig[n] * Energy.EV["<-"], color="tab:blue", label="w/o EPR")
ax.plot(k, (eig[n] + epr[n]) * Energy.EV["<-"], color="tab:orange", label="w/ EPR")
else:
ax.plot(k, eig[n] * Energy.EV["<-"], color="tab:blue")
ax.plot(k, (eig[n] + epr[n]) * Energy.EV["<-"], color="tab:orange")
for k0 in special_k:
ax.axvline(x=k0, color="black", linewidth=0.3)
ax.set_xticks(special_k)
ax.set_xticklabels(k_names)
ax.set_ylabel("Energy ($\mathrm{eV}$)")
ax.set_title("Example: Band structure of bcc-Li")
ax.set_ylim([-10,20])
ax.legend()
fig.savefig("example_epr.png")
if __name__ == "__main__":
main()
Calculation of the electronic band structure (examples/band_structure.py
)
"""Example: bcc-Li"""
import matplotlib.pyplot as plt
from elphem import *
def main():
a = 2.98 * Length.ANGSTROM["->"]
lattice = EmptyLattice('bcc', a)
electron = FreeElectron(lattice, n_band=50, n_electron=1)
k_names = ["G", "H", "N", "G", "P", "H"]
k, eig, special_k = electron.get_band_structure(k_names, n_split=20)
fig, ax = plt.subplots()
for band in eig:
ax.plot(k, band * Energy.EV["<-"], color="tab:blue")
ax.vlines(special_k, ymin=-10, ymax=50, color="black", linewidth=0.3)
ax.set_xticks(special_k)
ax.set_xticklabels(k_names)
ax.set_ylabel("Energy ($\mathrm{eV}$)")
ax.set_ylim([-10,50])
fig.savefig("example_band_structure.png")
if __name__ == "__main__":
main()
Calculation of the phonon dispersion (examples/phonon_dispersion.py
)
"""Example: bcc-Li"""
import matplotlib.pyplot as plt
from elphem import *
def main():
a = 2.98 * Length.ANGSTROM["->"]
mass = AtomicWeight.table["Li"] * Mass.DALTON["->"]
lattice = EmptyLattice('bcc', a)
debye_temperature = 344.0
phonon = DebyeModel(lattice, debye_temperature, 1, mass)
q_names = ["G", "H", "N", "G", "P", "H"]
q, omega, special_q = phonon.get_dispersion(q_names, n_split=20)
fig, ax = plt.subplots()
ax.plot(q, omega * Energy.EV["<-"] * 1.0e+3, color="tab:blue")
for q0 in special_q:
ax.axvline(x=q0, color="black", linewidth=0.3)
ax.set_xticks(special_q)
ax.set_xticklabels(q_names)
ax.set_ylabel("Energy ($\mathrm{meV}$)")
fig.savefig("example_phonon_dispersion.png")
if __name__ == "__main__":
main()
License
MIT
Author
Kohei Ishii
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
elphem-0.2.0.tar.gz
(19.8 kB
view details)
Built Distribution
elphem-0.2.0-py3-none-any.whl
(26.4 kB
view details)
File details
Details for the file elphem-0.2.0.tar.gz
.
File metadata
- Download URL: elphem-0.2.0.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 985cf673e83dc939f1daac10120ac7a435929abfe46ae43d6ae038909d631e53 |
|
MD5 | 645c7f4f55d34f624a6dcff8bf5389bd |
|
BLAKE2b-256 | 521faaa0fae848bbd1fe865e9e34f9801bc1e3b11db48213e54ee4b68da50708 |
File details
Details for the file elphem-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: elphem-0.2.0-py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10150712bb2e4da3006486b618a9836446885470333b798bda32445eed891509 |
|
MD5 | 4d66b2ba7590837a227abf604839ad44 |
|
BLAKE2b-256 | 03748349be7a11c17015a28f1daafc0f7197e16922980ff1592cd625462291bb |