natural.py 909 B

123456789101112131415161718192021222324252627
  1. """
  2. Naturalunit system.
  3. The natural system comes from "setting c = 1, hbar = 1". From the computer
  4. point of view it means that we use velocity and action instead of length and
  5. time. Moreover instead of mass we use energy.
  6. """
  7. from sympy.physics.units import DimensionSystem
  8. from sympy.physics.units.definitions import c, eV, hbar
  9. from sympy.physics.units.definitions.dimension_definitions import (
  10. action, energy, force, frequency, length, mass, momentum,
  11. power, time, velocity)
  12. from sympy.physics.units.prefixes import PREFIXES, prefix_unit
  13. from sympy.physics.units.unitsystem import UnitSystem
  14. # dimension system
  15. _natural_dim = DimensionSystem(
  16. base_dims=(action, energy, velocity),
  17. derived_dims=(length, mass, time, momentum, force, power, frequency)
  18. )
  19. units = prefix_unit(eV, PREFIXES)
  20. # unit system
  21. natural = UnitSystem(base_units=(hbar, eV, c), units=units, name="Natural system")