qunits logo qunits logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qunits.registry

The qunits.registry module provides the unit registry u, which includes all predefined units with prefixes. If you don't want to add custom units, you simply need to import u.

  from qunits import u
  

The registry contains the following units, each with the prefixes for powers of 1000 in the given range, e.g. u.fs, u.ps, ..., u.s. The attosecond is u.attosecond, because as is a keyword. u.I is the dimensionless unit.

UnitDimensionPrefixes
percentDimensionlessnone
radDimensionless, anglenrad – rad
piDimensionless, anglenone
mLengthqm – km
gMassfg – kg
u (atomic mass unit)Massnone
sTimeqs – s
AElectricCurrentfA – MA
KTemperaturefK – K
molAmountOfSubstancefmol – kmol
cdLuminousIntensityfcd – Gcd
HzFrequencyfHz – QHz
c (speed of light)Velocitynone
NForcefN – PN
PaPressurefPa – PPa
JEnergyfJ – PJ
eVEnergyfeV – PeV
WPowerfW – PW
h (Planck constant)Actionnone
VVoltagefV – GV
FCapacitancefF – kF
OhmResistancefOhm – GOhm
CChargefC – GC
e (elementary charge)Chargenone
TMagneticInductionfT – PT
G (gauss)MagneticInductionpG – EG