diff --git a/qcelemental/physical_constants/ureg.py b/qcelemental/physical_constants/ureg.py index 3e000e7a..b82af0da 100644 --- a/qcelemental/physical_constants/ureg.py +++ b/qcelemental/physical_constants/ureg.py @@ -43,6 +43,9 @@ def build_units_registry(context): ureg.define("wavenumber = 1 / centimeter") ureg.define("Angstrom = angstrom") + # Time + ureg.define(f"au_time = {phys_const['atomic unit of time']['value']} * {phys_const['atomic unit of time']['unit']}") + # Masses ureg.define( "atomic_mass_unit = {} * kilogram = u = amu = dalton = Da".format(phys_const["atomic mass constant"]["value"]) diff --git a/qcelemental/tests/test_units.py b/qcelemental/tests/test_units.py index 0b19334b..b1cabbfb 100644 --- a/qcelemental/tests/test_units.py +++ b/qcelemental/tests/test_units.py @@ -78,3 +78,14 @@ def test_quantities_smoke(): Smoke test to ensure Quantities are correctly returned """ assert 5 == qcelemental.constants.Quantity("5 kcal").magnitude + + +def test_speed_of_light(): + assert ( + pytest.approx( + qcelemental.constants.speed_of_light_in_vacuum + * qcelemental.constants.conversion_factor("m/s", "bohr/au_time"), + 1e-8, + ) + == qcelemental.constants.c_au + )