Engineering/Mathematics/Preliminaries
Modulus of a Complex Number
The modulus is the single non-negative real number attached to a complex number, and the only quantity derived from it that may legitimately appear in an inequality. Every notion of size in complex linear algebra — vector norms, matrix norms, spectral radius, convergence — is built from it.
- Foundation level
- Stream: complex
- Reading time 12 min
- Ref KVS-ENG-MATH-0119
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Complex conjugation
- Definition
- , always a non-negative real
- Key property
- Multiplicative:
- Not
- Additive — only the triangle inequality holds
- Generalises to
- Vector norm, matrix norm, spectral radius
Overview
Multiplying a complex number by its conjugate produces , a real number that is non-negative and vanishes only when is zero. Its non-negative square root is the modulus of , written . On the real numbers, where , this reduces to , the ordinary absolute value, which is why the same vertical-bar notation is used for both.
The modulus is the bridge between the unordered field and the ordered field . No inequality can be written between two complex numbers, but any statement about their sizes can be written between their moduli. Convergence, boundedness, tolerance, stability and error are all statements of this kind, so essentially every quantitative claim about complex data passes through the modulus at some point.
Two properties carry the weight. The modulus is multiplicative: exactly, with no error term, and the same holds for quotients. It is only sub-additive: , with equality only when the two numbers point in the same direction. That asymmetry is inherited by every norm built on the modulus, and it is why estimates in numerical analysis multiply cleanly but add only with an inequality.
In linear algebra the modulus appears in three recurring roles. It defines the norm of a complex vector as the square root of a sum of squared moduli, which is what makes the inner product a genuine measure of length. It defines the spectral radius of a matrix as the largest modulus among the eigenvalues, which decides whether iterated multiplication converges to zero or diverges. And it defines the magnitude used for pivoting in complex factorisations, since the entries themselves cannot be compared.
Definition
Modulus of a Complex Number
MCNFor a complex number with and real, the modulus of is the non-negative real number .
The quantity under the root is real by construction, because , so the positive square root is always well defined. Also called the complex absolute value or, for a phasor, its magnitude.
Modulus Squared
MCN-SQThe quantity is the modulus without the square root. It is exact in rational arithmetic, cheaper to compute, and sufficient for every comparison, since if and only if for non-negative moduli.
Preferring the squared form is the standard optimisation in pivoting, sorting and nearest-neighbour tests, and it is also what keeps exactness in symbolic computation, where the modulus itself is usually irrational.
Spectral Radius
SRFor a square matrix with eigenvalues , the spectral radius is , the largest modulus in the spectrum. The powers converge to the zero matrix as grows if and only if .
The spectral radius is not a matrix norm, but it is bounded above by every matrix norm, and it is the exact threshold for convergence of the power sequence and of stationary iterative solvers.
Concepts
Why the conjugate product is the right starting point
Defining size as would fail immediately: is generally complex and can even be negative real, as with . The conjugate product repairs this. Because , the cross terms cancel exactly, leaving a sum of real squares. That expression is non-negative, and it is zero only when both and are zero, which are precisely the two properties a measure of size must have. The definition is therefore forced rather than chosen.
Multiplicativity is exact; additivity is not
From and non-negativity of moduli, follows with no approximation. The same argument gives and . Addition behaves differently: only holds, the triangle inequality, with equality exactly when one of the numbers is a non-negative real multiple of the other. The practical consequence is that a chain of multiplications has a modulus that is computable exactly from the factors, whereas a sum admits only a bound.
The reverse triangle inequality and stability of the modulus
Applying the triangle inequality twice yields . Read as a statement about perturbation, this says the modulus is a non-expansive function: perturbing a complex number by changes its modulus by at most . That is why the modulus is a numerically well-behaved quantity to report and to threshold, in contrast to the argument or phase, which is arbitrarily sensitive near the origin.
From modulus to vector norm
The norm of a complex column vector is , and because the inner product conjugates one argument, each term of that sum is . The vector norm is therefore the root of a sum of squared moduli — the entrywise modulus is what makes the definition work. Substituting the plain square of each entry would allow a non-zero vector to have zero norm, which would destroy the entire metric structure of the space.
Modulus decides discrete-time behaviour; real part decides continuous-time behaviour
For an iteration , the component along an eigenvector is multiplied by at each step, so its size is multiplied by . Convergence to zero therefore requires for every eigenvalue, that is . For a differential equation whose state derivative is , the component evolves as , whose size is , so decay requires . Both are statements about a real quantity extracted from a complex eigenvalue, but they are different real quantities, and interchanging them is a classic modelling error.
Pivoting and comparison in complex arithmetic
Numerical algorithms that select the largest available entry — partial pivoting in Gaussian elimination, column selection in rank-revealing factorisations, thresholding in sparse elimination — cannot compare complex entries directly, because carries no compatible order. Every such algorithm therefore compares moduli. Since only the ordering matters, implementations compare or the cheaper surrogate , avoiding a square root in the inner loop while preserving the intent.
Decision path: choosing the right real quantity
Equations
Definition of the modulus
EQ-MCN-01Always a non-negative real number. On the reals it reduces to the ordinary absolute value, which is why the notation is shared.
Modulus squared and the conjugate
EQ-MCN-02The squared form is exact in rational arithmetic and sufficient for every comparison, so the square root should be deferred until a value is genuinely needed.
Positivity and definiteness
EQ-MCN-03Conjugation is a reflection and preserves distance from the origin, so a number and its conjugate always have the same modulus.
Multiplicative property
EQ-MCN-04Exact identities with no error term. A product of many factors has a modulus obtained by multiplying the individual moduli.
Triangle and reverse triangle inequalities
EQ-MCN-05Addition admits only a bound. The reverse form states that the modulus is non-expansive, so it is stable under perturbation of its argument.
Bounds on the parts
EQ-MCN-06Each part is bounded by the modulus, and the modulus by their sum. The right-hand bound is the basis of the cheap magnitude surrogate used in pivoting.
Vector norm from entrywise moduli
EQ-MCN-07The complex vector norm is the root of a sum of squared moduli, which is exactly what the conjugation inside the inner product produces.
Spectral radius and convergence
EQ-MCN-08The threshold for convergence of a matrix power sequence, of a stationary iterative solver, and of a discrete-time dynamical model.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Complex number | The number whose size is being measured, | complex scalar | |
| Modulus | Non-negative real size of ; distance from the origin in the plane | real, non-negative | |
| Conjugate | Companion of whose product with gives | complex scalar | |
| Real part | Bounded in size by the modulus; controls continuous-time growth of | real number | |
| Imaginary part | Bounded in size by the modulus; controls oscillation frequency | real number | |
| Eigenvalue | Per-step multiplier along an eigendirection; its modulus is the per-step gain | complex scalar | |
| Spectral radius | Largest modulus among the eigenvalues of | real, non-negative | |
| Vector norm | Root of the sum of squared entrywise moduli | real, non-negative |
Worked Numerical Example
Problem statement
A digital controller updates its two-state estimator once per sample using with the real matrix having first row and second row . Determine whether the estimator error decays, how fast, and how many samples are needed for an initial error to fall below one per cent.
Form the characteristic polynomial
The trace is and the determinant is . For a two-by-two matrix the characteristic polynomial is .
Solve for the eigenvalues
The discriminant is , so the roots are complex and, the entries being real, form a conjugate pair.
Compute the modulus
Apply the definition directly to either root; conjugation does not change the modulus, so one calculation covers both. The squared modulus is exact, and here its square root happens to be exact too.
Cross-check against the determinant
For a real two-by-two matrix with a conjugate pair of eigenvalues, the determinant is the product . That the determinant computed in the first step equals confirms the modulus independently of the root-finding arithmetic.
Read off the spectral radius and decide stability
Both eigenvalues have the same modulus, so the spectral radius is . Since this is strictly less than one, the powers of converge to the zero matrix and every initial error decays to zero.
Convert the modulus into a decay rate
Because the modulus is multiplicative, the size of the error after steps is scaled by : the amplitude halves at every sample. Solve for the smallest integer .
Separate size from oscillation
The modulus governs amplitude only. The non-zero imaginary part means the error also rotates in the state plane, completing one turn every samples. Amplitude and phase are independent readings of the same eigenvalue, and only the first is a modulus question.
The estimator is asymptotically stable with spectral radius . Error amplitude halves every sample, so seven samples reduce any initial error below one per cent of its starting size, and the response spirals rather than decays monotonically because the eigenvalues are not real. The single number that decided stability was a modulus, and the determinant provided an independent check on it at no extra cost.
Applications & Industry Use
Discrete-time stability margins
A sampled-data controller is stable exactly when every closed-loop pole lies inside the unit circle, that is when the largest eigenvalue modulus is less than one. The gap between that modulus and one is the stability margin, and it converts directly into a settling time in samples, which is the quantity a designer actually specifies.
Convergence of iterative solvers
Stationary iterations such as Jacobi and Gauss-Seidel converge if and only if the spectral radius of their iteration matrix is below one, and the number of iterations required for a given tolerance scales as the logarithm of that tolerance divided by the logarithm of the spectral radius. Preconditioning is, in these terms, the business of reducing a modulus.
Phasor magnitude and apparent power
The magnitude of a voltage or current phasor is its modulus, and apparent power is the product of two such magnitudes. Because the modulus is exactly multiplicative, apparent power follows from the magnitudes alone, while the split into real and reactive power requires the phase information the modulus deliberately discards.
Magnitude spectra and filter gain
The magnitude response of a filter at a given frequency is the modulus of its complex frequency response, and a power spectrum is a plot of squared moduli. Implementations compute the squared modulus and defer or omit the square root entirely, since a decibel scale takes a logarithm that absorbs the factor of two.
Transmissibility and resonance amplification
The ratio of response amplitude to excitation amplitude in a vibrating structure is the modulus of a complex transfer function. Peaks in that modulus locate resonances, and the peak value is the amplification factor that a mounting or isolator must be designed to tolerate.
Distance tests without square roots
Proximity queries, clustering and collision tests compare distances, and comparing squared distances gives the same ordering while avoiding a square root per test. This is the modulus-squared optimisation applied at scale, and in fixed-point or GPU pipelines it is often the difference between meeting and missing a frame budget.
Design Considerations
Compare squared moduli, compute the modulus only when reporting
Ordering by and ordering by give identical results, because the square root is monotone on non-negative reals. Deferring the root removes a transcendental operation from every inner loop and keeps exact arithmetic exact. Take the root only where the number itself is the deliverable.
Choose the modulus or the real part deliberately
Discrete-time growth is governed by ; continuous-time growth by . The two criteria are unrelated: an eigenvalue with large modulus can have negative real part, and one with modulus below one can have positive real part. State in the model documentation which time domain is in force before quoting a stability condition.
Do not treat the spectral radius as a norm
The spectral radius is not sub-additive and not sub-multiplicative for general matrices, so it cannot be used in the chained bounds that a norm supports. It is bounded above by every induced norm and is the exact asymptotic growth rate, but transient growth can far exceed it for non-normal matrices. Where transient behaviour matters, bound with a norm and use the spectral radius only for the long-run rate.
Use a scaled magnitude routine in floating point
Computing directly overflows when either part exceeds about the square root of the largest representable number, even though the modulus itself is representable, and underflows to zero for very small parts. A scaled hypotenuse routine factors out the larger part first. This roughly squares the usable dynamic range and costs a division and a comparison.
Set thresholds on a scaled modulus, never an absolute one
A tolerance such as "discard if " is meaningless without a reference scale, since the same physical quantity in different units crosses the threshold or not. Normalise against the largest modulus present, or against a norm of the data, and state the reference explicitly alongside the tolerance.
Prefer the modulus to the argument for reporting
The modulus is non-expansive, so a small perturbation of a complex number produces a small change in its modulus. The argument has no such property: near the origin an arbitrarily small perturbation can change the phase by any amount. Quantities intended for thresholds, plots and acceptance tests should therefore be built from moduli wherever there is a choice.
Standards & Codes
Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.
| Reference | Title | Relevance to this topic |
|---|---|---|
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Defines the vertical-bar notation for the modulus of a complex number and its consistency with the absolute value of a real number, and distinguishes it from the double bars used for a norm. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Specifies the exponent range within which overflows or underflows, and recommends a correctly-rounded hypotenuse operation that computes the modulus over the full range of representable inputs. |
ISO/IEC 9899 (C) | Programming languages — C, complex.h and math.h | Provides cabs for the complex modulus and hypot for the underlying scaled computation, and requires that hypot avoid spurious overflow for representable results. |
BLAS Level 1 | Basic Linear Algebra Subprograms, vector norms | The reference implementation of dznrm2 accumulates squared moduli with dynamic rescaling rather than summing directly, which is the vector-level version of the same overflow avoidance. |
IEC 61000-4-30 | Testing and measurement techniques — Power quality measurement methods | Defines voltage and current magnitude as the modulus of the corresponding phasor and fixes the aggregation intervals over which those magnitudes are reported, making the modulus a metrological quantity rather than only a mathematical one. |
Material Selection
For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.
| Representation | Select when | Trade-off |
|---|---|---|
| Exact squared modulus over the rationals | Symbolic work, certification that an eigenvalue lies on or inside the unit circle, or exact comparison of magnitudes. | is exactly representable when the parts are rational; generally is not, so the square root must be carried symbolically or deferred entirely. |
| IEEE 754 binary64 with a scaled hypotenuse routine | General engineering computation of magnitudes, norms and spectral radii. | Full dynamic range and about half an ulp of error, at the cost of a division and branch compared with the naive formula. |
| IEEE 754 binary64, naive | Data known in advance to be well scaled, inside a hot loop where the branch cost matters. | Fastest correct-for-most-inputs option, but overflows for parts above about and underflows for parts below about . |
| Squared modulus only, square root omitted | Pivoting, sorting, nearest-neighbour and threshold tests where only the ordering matters. | Removes the square root from the inner loop entirely, but halves the usable exponent range because the square itself can overflow. |
| Alpha-max-plus-beta-min approximation | Fixed-point DSP and FPGA magnitude estimation where a few per cent of error is acceptable. | Uses only additions, comparisons and shifts, with worst-case error around four per cent; unacceptable wherever the magnitude feeds a stability decision. |
| CORDIC magnitude and phase | Hardware that needs both modulus and argument, such as a demodulator or a polar transmitter. | Delivers both quantities with shift-and-add hardware only, at a latency of one iteration per output bit and with a known scaling factor to compensate. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Cost of the four common formulations
The squared modulus costs two multiplications and one addition. The direct modulus adds a square root. A scaled hypotenuse costs a comparison, a division, a multiplication, an addition and a square root, and is the only form safe across the full exponent range. The alpha-max-plus-beta-min surrogate costs two absolute values, a comparison, two multiplications by constants and an addition, with no square root at all.
Why the naive formula fails and how scaling repairs it
In binary64 the largest representable number is about , so overflows once exceeds roughly even though the modulus remains representable. Factoring out the larger part, for , keeps every intermediate between one and two and extends the safe range to the full format. Library hypot implementations do this or better.
Computing the spectral radius in practice
Computing the full spectrum to obtain one number is wasteful for large matrices. Power iteration converges to the dominant eigenvalue and hence to at a rate given by the ratio of the two largest moduli, and needs only matrix-vector products. When a rigorous bound suffices rather than the exact value, any induced norm bounds the spectral radius from above, and gives arbitrarily tight bounds at increasing cost.
Library behaviour
NumPy's numpy.abs on a complex array returns entrywise moduli using a scaled algorithm, and numpy.linalg.norm builds vector and matrix norms on top of it. C provides cabs and hypot; C++ provides std::abs for std::complex together with std::norm, which returns the squared modulus — a naming choice that regularly surprises readers expecting a vector norm.
Verification identities worth asserting
Three checks cost almost nothing and catch most errors. Confirm that equals to within rounding, since multiplicativity is exact in theory. Confirm that a computed modulus is unchanged by conjugating the input. And for a real two-by-two matrix with complex eigenvalues, confirm that the determinant equals the squared modulus of either eigenvalue, which validates the eigenvalue computation independently.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Computing the modulus as | high | Transferring the real formula directly, forgetting that is complex and can be negative real. | Always use the conjugate product . The cancellation of cross terms is what produces a non-negative real result. |
| Overflow in the naive magnitude formula | high | Evaluating for a well-scaled complex number whose parts are near the top of the exponent range. | Call a scaled hypotenuse routine, or normalise the data before computing magnitudes. Never hand-code the direct formula in a general-purpose library. |
| Using the modulus for continuous-time stability | high | Applying the discrete-time criterion to a differential-equation model, where the correct test is . | State the time domain of the model before quoting any stability condition, and check that the criterion matches. The two tests agree only by coincidence. |
| Assuming the modulus is additive | medium | Writing by analogy with the exact multiplicative rule. | Only the inequality holds, with equality restricted to the case where one number is a non-negative real multiple of the other. Sums give bounds, products give values. |
| Treating the spectral radius as a norm | medium | Chaining bounds such as , which is false for general matrices. | Use an induced matrix norm for chained estimates and reserve the spectral radius for asymptotic growth rate. For non-normal matrices, transient growth can exceed the spectral radius by orders of magnitude. |
| Absolute rather than relative tolerance on a modulus | medium | Comparing against a fixed constant with no reference to the scale of the problem or the units in use. | Normalise against the largest modulus present or a norm of the data, and record the reference quantity alongside the threshold. |
| Confusing the modulus with the real part | medium | Reading off as when the imaginary part is small but non-zero, or reporting as the magnitude. | The bound is an inequality, not an identity. Compute both parts and combine them, however small one appears. |
| Taking a square root that is never needed | low | Computing the modulus inside a comparison, sort key or nearest-neighbour loop where the squared value would order identically. | Compare squared moduli. Watch that squaring halves the usable exponent range, and rescale first if the data spans many decades. |
FAQs
Why is the modulus defined with a conjugate rather than as an ordinary square?
Because is generally complex, and can even be a negative real number, so its square root would not be a usable measure of size. The conjugate product cancels the cross terms exactly, leaving : real, non-negative, and zero only for . Those are precisely the properties a size function must have.
Is the modulus the same as the absolute value?
It is the direct generalisation. For a real number, written as , the modulus is , so the two agree on the reals and share the vertical-bar notation. The distinction is that the absolute value can be described as removing a sign, whereas the modulus is a distance from the origin in the plane.
Why does decide stability for iterations but not for differential equations?
An iteration multiplies by at each step, so after steps the size is multiplied by , which shrinks only when the modulus is below one. A differential equation produces , whose size is , so decay depends on the sign of the real part alone. Different dynamics extract different real quantities from the same complex eigenvalue.
Should I ever compute the modulus rather than the modulus squared?
Only when the number itself is the output — a reported magnitude, a plotted response, a physical amplitude. Every comparison, sort, threshold and pivot selection gives the same answer using the squared value, and skipping the square root is both faster and, in exact arithmetic, the only way to stay exact.
Does the spectral radius bound how much a matrix can amplify a vector?
Not in general, and this is a frequent trap. The spectral radius gives the asymptotic growth rate of , but for a non-normal matrix the intermediate powers can amplify enormously before decaying. A genuine amplification bound requires an induced matrix norm; the spectral radius is a limit, not a uniform bound.
Why does the reverse triangle inequality matter in practice?
It states that changing a complex number by changes its modulus by at most , so the modulus is stable under measurement noise and rounding. The argument has no comparable property: near the origin an arbitrarily small perturbation can swing the phase through any angle, which is why phase-based thresholds are unreliable for small signals.
How accurate is the alpha-max-plus-beta-min magnitude approximation?
Taking the larger part plus a fixed fraction of the smaller gives a worst-case error of a few per cent depending on the constants chosen, using only comparisons, shifts and additions. It is entirely adequate for automatic gain control or a display bar graph, and entirely inadequate for a stability margin or a convergence test, where the error would sit directly on the decision threshold.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section CNO, Subsection MCN. Licensed under the GNU Free Documentation License v1.2.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic. Institute of Electrical and Electronics Engineers.
- Higham, N. J. Accuracy and Stability of Numerical Algorithms, 2nd edition. Society for Industrial and Applied Mathematics, 2002. Scaled computation of magnitudes and norms.
- Horn, R. A. and Johnson, C. R. Matrix Analysis, 2nd edition. Cambridge University Press, 2013. Spectral radius, matrix norms and the relationship between them.
- Volder, J. E. The CORDIC Trigonometric Computing Technique. IRE Transactions on Electronic Computers, 1959.
AI Suggested Questions
- Show me a non-normal matrix whose spectral radius is below one but whose powers grow by several orders of magnitude before decaying.
- Derive the scaled hypotenuse formula and identify the exact input range over which the naive formula overflows in binary64.
- Give a matrix whose eigenvalues have modulus less than one but positive real part, and explain what that means for the two time domains.
- How many iterations does a stationary solver need for a given tolerance as a function of its spectral radius?
- Compare the worst-case error of the alpha-max-plus-beta-min magnitude estimate against a true modulus over a full quadrant.
- Why is the argument of a complex number numerically unstable near the origin while the modulus is not?
Related Calculators
Compute and with both the naive and the scaled algorithms, and report where the two diverge.
Spectral Radius CalculatorReturn every eigenvalue modulus of a square matrix, the spectral radius, and the implied per-step decay factor.
Discrete-Time Stability CheckerTest whether all eigenvalues lie inside the unit circle and convert the spectral radius into a settling time in samples.
