aiida_quantumespresso.utils.bands

aiida_quantumespresso.utils.bands#

Utilities for BandsData nodes.

Module Contents#

Functions#

get_highest_occupied_band(bands[, threshold])

Retun the index of the highest-occupied molecular orbital.

aiida_quantumespresso.utils.bands.get_highest_occupied_band(bands, threshold=0.005)[source]#

Retun the index of the highest-occupied molecular orbital.

The expected structure of the bands node is the following:

  • an array called occupations

  • with 3 dimensions if spin polarized, otherwise 2 dimensions

  • dimensions loop over, spin channel, kpoints, bands

Note

The threshold is used both as a limit below which a band is considered as unoccupied as well as a measure of numerical noise in the occupancies. The first band to have an occupancy below the threshold at all kpoints is marked as the LUMO. All subsequent bands are then expected to have an occupation that is less than twice the threshold. The reason for the factor two is that in the worst case when the LUMO has an occupation exactly equal to the threshold and a subsequent has twice that value, we can still consider that as not to break the requirement of all bands above the LUMO to be empty. It can be considered as having the exact same value (equal to the threshold) plus an numerical error also equal to the threshold.

Parameters:
  • bands – the BandsData node

  • threshold – raise a ValueError if the last band has an occupation above this threshold at any k-point

Raises:
  • ValueError – if bands is not a BandsData node

  • ValueError – if bands does not contain the array occupations

  • ValueError – if occupations array has an invalid shape

  • ValueError – if any occupation above LUMO exceeds 2 * threshold

  • ValueError – if the last band has an occupation above the threshold