Logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

Tutorials

The tutorials show how to use the units defined in qunits and how to add your own units. The tutorials assume you have already installed qunits. All units predefined in qunits can be accessed by importing u.

from qunits import u

q = 2 * u.e  # >>> 2.0 e
v = 2e5 * u.m / u.s  # >>> 200000.0 m/s
B = 0.42 * u.mT  # >>> 0.42 mT

F = q * v * B  # >>> 2.69165674512e-17 N

The following tutorials guide you though the features and behavior of qunits. The code from the tutorials and additional examples can be downloaded from the GitHub repository.

  1. Getting started
  2. Benchmark