index | modules | gitlab | page source

# Band gap

`ase.dft.bandgap.``bandgap`(calc=None, direct=False, spin=None, output='-', eigenvalues=None, efermi=None, kpts=None)

  Calculates the band-gap.

  Parameters:

  calc: Calculator object
    Electronic structure calculator object.
  direct: bool
    Calculate direct band-gap.
  spin: int or None
    For spin-polarized systems, you can use spin=0 or spin=1 to look only at a single spin-channel.
  output: file descriptor
    Use output=None for no text output or ‘-‘ for stdout (default).
  eigenvalues: ndarray of shape (nspin, nkpt, nband) or (nkpt, nband)
    Eigenvalues.
  efermi: float
    Fermi level (defaults to 0.0).
  kpts: ndarray of shape (nkpt, 3)
    For pretty text output only.

  Returns a (gap, p1, p2) tuple where p1 and p2 are tuples of indices of the valence and conduction points (s, k, n).

  Example:

      >>> gap, p1, p2 = bandgap(silicon.calc)
      Gap: 1.2 eV
      Transition (v -> c):
          [0.000, 0.000, 0.000] -> [0.500, 0.500, 0.000]
      >>> print(gap, p1, p2)
      1.2 (0, 0, 3), (0, 5, 4)
      >>> gap, p1, p2 = bandgap(silicon.calc, direct=True)
      Direct gap: 3.4 eV
      Transition at: [0.000, 0.000, 0.000]
      >>> print(gap, p1, p2)
      3.4 (0, 0, 3), (0, 0, 4)

Documentation v: 3.19.0

Versions
  3.20.0b1 (development)
  3.19.0 (latest stable)