This is the documentation for asr.c2db.shg-recipe. This recipe is comprised of a single instruction, namely:

Run this recipe through the CLI interface

$ asr run asr.c2db.shg

or as a python module

$ python -m asr.c2db.shg



asr.c2db.shg.main(atoms, calculator={'charge': 0, 'convergence': {'bands': 'CBM+3.0'}, 'kpts': {'density': 12.0, 'gamma': True}, 'mode': {'ecut': 800, 'name': 'pw'}, 'name': 'gpaw', 'nbands': '200%', 'occupations': {'name': 'fermi-dirac', 'width': 0.05}, 'txt': 'gs.txt', 'xc': 'PBE'}, kptdensity=25.0, gauge='lg', bandfactor=4, eta=0.05, maxomega=10.0, nromega=1000, removefiles=False)[source]

Calculate the SHG spectrum, only independent tensor elements.

The recipe computes the SHG spectrum. The tensor in general have 18 independent tensor elements (since it is symmetric). However, the point group symmety reduces the number of independent tensor elements. The SHG spectrum is calculated using perturbation theory, where the perturbation can be written in either the length gauge (r.E) or velocity gauge (p.A).

  • gs (str) – The ground state filename.

  • kptdensity (float) – K-point density.

  • gauge (str) – Selected gauge (length “lg” or velocity “vg”).

  • bandfactor (int) – Number of unoccupied bands: (#occ. bands) * bandfactor.

  • eta (float) – Broadening used for finding the spectrum.

  • maxomega (float) – Max pump frequency.

  • nromega (int) – Number of pump frequencies.

  • removefiles (bool) – Remove intermediate files that are created.

  • atoms (ase.atoms.Atoms) –

  • calculator (dict) –

Return type


class asr.c2db.shg.Result(chi, symm, freqs)[source]
property chi: Dict[str, Any]

Non-zero SHG tensor elements in SI units

property freqs: List[float]

Pump photon energy [eV]

property symm: Dict[str, str]

Symmetry relation of SHG tensor