Modules for prediciting theoretical solar-cell efficiency.

Submodules module

Calculate spectroscopy limited maximum efficiency (SLME) given dielectric function data.

Forked and adjusted from :

References: 1) &


Calculate the optical absorption coefficient from an input set of pymatgen vasprun dielectric constant data.


dielectric (list) – A list containing the dielectric response function in the pymatgen vasprun format. - element 0: list of energies - element 1: real dielectric tensors, in [xx, yy, zz, xy, xz, yz] format. - element 2: imaginary dielectric tensors, in [xx, yy, zz, xy, xz, yz] format.


absorption coefficient using eV as frequency units (cm^-1).

Return type:



Get direct and indirect bandgaps for a vasprun.xml.


Helper function to calculate optical absorption coefficient.


Convert a set of 2D vasprun formatted dielectric data to the eigenvalues of each corresponding 3x3 symmetric numpy matrices.


data (list) – length N list of dielectric data. Each entry should be a list of [xx, yy, zz, xy , xz, yz ] dielectric tensor elements.


a Nx3 numpy array. Each row contains the eigenvalues

for the corresponding row in data.

Return type:


slme(material_energy_for_absorbance_data, material_absorbance_data, material_direct_allowed_gap, material_indirect_gap, thickness=5e-05, temperature=293.15, absorbance_in_inverse_centimeters=False, cut_off_absorbance_below_direct_allowed_gap=True, plot_current_voltage=False)[source]

Calculate the SLME.

  • material_energy_for_absorbance_data – energy grid for absorbance data

  • material_absorbance_data – absorption coefficient in m^-1

  • material_direct_allowed_gap – direct bandgap in eV

  • material_indirect_gap – indirect bandgap in eV

  • thickness – thickness of the material in m

  • temperature – working temperature in K

  • absorbance_in_inverse_centimeters – whether the absorbance data is in the unit of cm^-1

  • cut_off_absorbance_below_direct_allowed_gap – whether to discard all absorption below bandgap

  • plot_current_voltage – whether to plot the current-voltage curve


The calculated maximum efficiency.

to_matrix(xx, yy, zz, xy, yz, xz)[source]

Convert a list of matrix components to a symmetric 3x3 matrix. Inputs should be in the order xx, yy, zz, xy, yz, xz.

  • xx (float) – xx component of the matrix.

  • yy (float) – yy component of the matrix.

  • zz (float) – zz component of the matrix.

  • xy (float) – xy component of the matrix.

  • yz (float) – yz component of the matrix.

  • xz (float) – xz component of the matrix.


The matrix, as a 3x3 numpy array.

Return type: