Source code for reasitic.quality
"""Quality factor (Q) computation for an inductor.
Q is the ratio of imaginary to real part of the input impedance:
.. math::
Q = \\frac{\\omega L}{R(\\omega)}
For a planar inductor on a lossy substrate the full Q-factor includes
substrate-loss contributions; this initial implementation gives the
metal-loss-only Q, which is the upper bound and the value the binary
prints as ``Q_metal`` for spirals far below their self-resonance.
"""
from __future__ import annotations
from reasitic.geometry import Shape
from reasitic.inductance import compute_self_inductance
from reasitic.resistance import compute_ac_resistance
from reasitic.tech import Tech
from reasitic.units import GHZ_TO_HZ, NH_TO_H, TWO_PI