Hi Aamir,
amset hasn’t been designed specially for 2D materials but it should be possible to run them just like a 3D system, provided you include enough vacuum in your structure. I’ve not tried this before though, so please let me know if you run into any issues.
For parallelism: Only the interpolation routines are currently parallelised. Hopefully in the future I will parallelise the scattering and transport routines too.
The scattering rate is written to the mesh.h5
file if write_mesh
is set to True (see the docs).
The mesh.h5
file is in HDF5 format but there is a helper function that converts the file to a python dictionary format:
from amset.io import load_mesh
data = load_mesh("mesh.h5")
print(data.keys())
# ['doping', 'efermi', 'energies', 'fd_cutoffs', 'fermi_levels',
# 'ir_kpoints', 'ir_to_full_kpoint_mapping', 'is_metal',
# 'kpoints', 'num_electrons', 'scattering_labels',
# 'scattering_rates', 'soc', 'structure', 'temperatures',
# 'vb_idx', 'velocities']
The scattering rates are stored as a dictionary, with a key for the spin up and spin down bands. If the system is not spin polarised then there will only be spin up bands. In each spin channel, the scattering rates are stored as numpy arrays, with the data shape (n_scattering_mechanisms, n_doping, n_temperatures, n_bands, n_ir_kpoints)
.
from pymatgen import Spin
rates = data["scattering_rates"]
print(rates[Spin.up].shape)
# (2, 6, 1, 10, 12341)
You can see which scattering mechanisms correspond to which dimension using:
print(data["scattering_labels"])
# ['IMP', 'ADP']
To get the overall scattering rate, you need to sum the rates from all mechanisms:
import numpy as np
overall_rates = np.sum(rates[Spin.up], axis=0)
# print the overall rate for the second doping, first temperature, third band, and tenth k-point
doping_idx = 1
temperature_idx = 0
band_idx = 2
kpoint_idx = 9
print("doping: {:.0g} cm^-3".format(data["doping"][doping_idx]))
print("temperature: {:d} K".format(data["temperatures"][temperature_idx]))
print("kpoint:", data["ir_kpoints"][kpoint_idx])
print("rate: {:.3g} s^-1".format(overall_rates[doping_idx, temperature_idx, band_idx, kpoint_idx]))
# doping: -2e+15 cm^-3
# temperature: 300 K
# kpoint: [0.11111111 0. 0. ]
# rate: 5.52e+12 s^-1
Hope that helps.
Best,
Alex