Coverage for strongcoca/units.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-10-26 18:44 +0000

1# This module contains components adapted from GPAW: 

2# gpaw.tddft.units 

3# https://gitlab.com/gpaw/gpaw/-/blob/aca9ed6f520d6a855013247119b50c630f5eebc9/gpaw/tddft/units.py 

4import numpy as np 

5 

6from ase.units import Hartree, Bohr, _hbar, _eps0, _me, _e 

7 

8 

9# Conversion factors between atomic units and eV/as 

10_autime: float = _hbar**3 * (4 * np.pi * _eps0)**2 / (_me * _e**4) 

11 

12au_to_as: float = _autime / 1e-18 

13as_to_au: float = 1 / au_to_as 

14au_to_fs: float = _autime / 1e-15 

15fs_to_au: float = 1 / au_to_fs 

16 

17au_to_eV: float = Hartree 

18eV_to_au: float = 1 / au_to_eV 

19 

20au_to_A: float = Bohr 

21A_to_au: float = 1 / au_to_A 

22 

23au_to_eA: float = Bohr * 1 

24eA_to_au: float = 1 / au_to_eA 

25 

26# force 

27au_to_eVA: float = Hartree / Bohr 

28eVA_to_au: float = 1 / au_to_eVA