Engineering/Mathematics/Vectors
The Norm of a Vector
The norm is the single non-negative number that measures the size of a vector, defined from the moduli of its entries so that it works over exactly as length works in the plane. It is the square root of the inner product of a vector with itself, and that one identity is what ties geometry to algebra for the rest of the subject.
- Core level
- Stream: orthogonality
- Reading time 13 min
- Ref KVS-ENG-MATH-0031
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Inner product; modulus of a complex number
- Value
- A real scalar, always
- Key identity
- Zero only for
- The zero vector
- Cost
- multiplications, additions, one square root
Overview
Every quantitative statement about approximation, convergence, error or stability needs a way to say how big a vector is. The norm supplies it. For a vector with entries the norm is the square root of the sum of the squared moduli of those entries, which in and reproduces the Pythagorean length of an arrow and in extends that idea without modification to complex data.
Using the modulus rather than the entry itself is the whole trick. A complex entry such as has no meaningful sign, and squaring it directly would produce — a complex number that cannot be compared with zero. Squaring its modulus gives , a real non-negative contribution. Summing those contributions gives a real total that is zero only when every entry vanishes, so the norm can be relied upon to distinguish a vector from the zero vector.
The norm is not an independent construction bolted on beside the inner product; it is derived from it. The identity says that the inner product already contains the notion of length, and the positive-definiteness of the inner product is exactly what makes the square root well defined. This is why orthogonality, projection, least squares and the Gram-Schmidt procedure all work with the same single algebraic object.
In engineering practice the norm appears in three distinct roles. It is a magnitude: the total root-mean-square amplitude of a signal or a set of phasors. It is a metric: the distance between a measurement and a model, which is the quantity least squares minimises. And it is a scaling device: dividing a vector by its norm produces a unit vector that carries direction alone, which is the standard first step in normalising a basis, a search direction or a modal shape.
Definition
Norm of a Vector
NVFor , the norm of is the non-negative real scalar
When every entry is real the modulus is the absolute value, the squares are ordinary squares, and the formula collapses to the Pythagorean length familiar from geometry.
Unit Vector
UVA vector whose norm equals . Any non-zero is converted to a unit vector by normalisation: form . The result points in the same direction as and carries no magnitude information.
Distance Between Vectors
DBVThe distance between and in is . This function is symmetric, is zero exactly when , and satisfies the triangle inequality, so equipped with it is a metric space and every notion of convergence and approximation is available.
Concepts
The norm is the inner product in disguise
Expanding with the definition of the inner product gives , and the product of a complex number with its own conjugate is precisely the square of its modulus. So . The consequence is practical as well as conceptual: any expression involving can be manipulated with the bilinearity rules of the inner product without ever meeting a square root, which is why almost every proof about lengths is carried out on squared norms.
Positive definiteness and why it is not automatic
The statement , with equality if and only if , is called positive definiteness. It follows because the sum consists of squared moduli, each of which is a non-negative real number; a sum of non-negative reals is zero only when every term is zero, and a complex number of zero modulus is itself zero. Drop the conjugate from the definition of the inner product and this property is destroyed immediately — the vector would then satisfy and pass as a zero-length non-zero vector.
Absolute homogeneity, not linearity
Scaling a vector scales its norm by the modulus of the scalar: . The proof is a one-line consequence of the multiplicativity of the modulus. Note carefully that the norm is not a linear function — it cannot be, since it is always non-negative. Multiplying a vector by or by leaves its norm unchanged, which is the algebraic expression of the fact that a norm records magnitude and discards phase and sign entirely.
The triangle inequality and Cauchy-Schwarz
Two inequalities do most of the analytical work. The Cauchy-Schwarz inequality states , with equality exactly when the two vectors are scalar multiples of one another. The triangle inequality follows from it by expanding as an inner product. Together they guarantee that the norm behaves like a length: no route through an intermediate point is shorter than the direct one, and correlations between vectors are bounded by their magnitudes.
Normalisation and what it costs
Dividing by the norm produces a unit vector, which is the standard way to strip magnitude from direction. The operation is cheap but not free: it introduces a division and a square root, both of which lose accuracy relative to the multiply-add operations around them, and it fails outright on the zero vector. Production code normalises only when the direction is genuinely what is wanted; algorithms such as the power method and Gram-Schmidt normalise every iteration precisely to stop magnitudes drifting towards overflow or underflow.
One norm among many
This page defines the Euclidean or -norm, the only one induced by an inner product. Other norms are in routine use — the -norm (sum of moduli), the infinity norm (largest modulus), and weighted variants — and all of them satisfy the same three axioms of non-negativity, absolute homogeneity and the triangle inequality. What singles out the -norm is that it alone comes with orthogonality, projection and the Pythagorean identity, so all of the geometry in this library is written in terms of it. In finite dimensions the norms are equivalent, meaning each bounds a constant multiple of the others, so convergence statements do not depend on the choice.
Procedure: computing a norm without losing accuracy
xNRM2, and it is why calling the library beats writing the textbook formula.Equations
Definition of the norm
EQ-NV-01The moduli are squared, not the entries themselves. This is what keeps the sum real and non-negative for complex data.
Norm from the inner product
EQ-NV-02The bridge between the algebra of the inner product and the geometry of length. Every subsequent identity on this page is derived from it.
Positive definiteness
EQ-NV-03A sum of squared moduli vanishes only when every term does. This is the property that makes the square root well defined and the norm a genuine measure of size.
Absolute homogeneity
EQ-NV-04The modulus of the scalar, not the scalar. Multiplication by any unit-modulus factor such as or leaves the norm unchanged.
Normalisation to unit length
EQ-NV-05Direction without magnitude. Undefined for the zero vector, which is the one input every implementation must guard.
Cauchy-Schwarz inequality
EQ-NV-06Equality holds exactly when one vector is a scalar multiple of the other. Dividing through defines the correlation coefficient used throughout statistics and signal processing.
Triangle inequality and distance
EQ-NV-07The inequality makes a metric, which is what licenses talk of convergence, tolerance and approximation error.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Vector | The vector whose size is being measured | element of C^m | |
| Size | Number of entries in the vector | positive integer | |
| Entry | The -th component of | complex scalar | |
| Modulus | Distance of the complex number from the origin | non-negative real | |
| Norm | Euclidean length of the vector | non-negative real | |
| Inner product | Sesquilinear form whose diagonal values give squared norms | complex scalar | |
| Scalar | Multiplier applied to a vector | element of C | |
| Unit vector | Normalised version of , of norm one | element of C^m | |
| Scaling factor | Largest entry modulus, used to prevent overflow during accumulation | non-negative real |
Worked Numerical Example
Problem statement
Three parallel branches of a single-phase distribution board carry root-mean-square current phasors , and amperes. Each branch has the same resistance . Compute the norm of the current vector, use it to obtain the total dissipated power, and normalise the vector to a unit direction for use as a load-shape signature.
Assemble the phasor vector
Collect the three branch currents into a single vector in . Complex entries are unavoidable here: the real part is the in-phase component and the imaginary part the quadrature component, so no ordering or sign convention can replace them.
Square the modulus of each entry
The modulus of is , so its square is simply and no square root is needed at this stage. Working with squared moduli avoids introducing rounding error before the summation.
Sum and take the root
Adding the three contributions gives . Since , the square root simplifies exactly.
Cross-check against the inner product
The identity gives an independent route to the same number. Each term is an entry multiplied by its own conjugate, for example , and the three products again total . Agreement confirms both the arithmetic and the sign conventions.
Convert to a physical quantity
With equal branch resistance , the total average power dissipated is . The squared norm is the physically meaningful quantity; the norm itself is its root-mean-square scaling.
Normalise to a direction
Dividing each entry by produces a unit vector recording only how the current is distributed between branches, independent of total loading. Two boards operating at different total currents but with the same unit vector have identical load balance.
Interpret an imbalance measure
If the balanced reference vector for this board is , also normalised, then is a single scalar imbalance index in the range . The triangle inequality guarantees it behaves sensibly under composition, which is what makes it usable as an alarm threshold.
The current vector has norm and squared norm , so the board dissipates watts. The normalised vector separates the question of how much current flows from how it is shared, and the distance between normalised vectors gives a directly comparable imbalance metric across boards of different rating.
Applications & Industry Use
Root-mean-square magnitude of phasor sets
Bus voltage and branch current phasors are complex vectors. Their squared norms are proportional to stored energy and dissipated power, so norm-based indices are used for loading, imbalance and harmonic distortion without ever converting back to the time domain.
Modal normalisation and participation
Mode shapes from an eigenvalue extraction are determined only up to a scalar. Normalising each shape to unit norm, or to unit mass-weighted norm, makes participation factors and modal masses comparable between modes and between analysis runs.
Convergence and stopping criteria
Iterative solvers, state estimators and optimisers terminate on a norm: the residual or the step size falling below a tolerance. Because the norm collapses a whole vector to one number, it can be compared with a threshold, logged and alarmed.
Regularisation and feature scaling
Ridge regression penalises the squared norm of the parameter vector, shrinking coefficients towards zero and stabilising ill-conditioned fits. Separately, normalising feature vectors to unit norm makes the inner product between them a pure cosine similarity that ignores document or record length.
Distance, error and unit direction
Position error is the norm of the difference between commanded and measured pose vectors. Direction of travel is obtained by normalising a velocity vector, which separates the heading command from the speed command in a control law.
Signal energy and matched filtering
The squared norm of a sampled signal vector is its energy, by Parseval's relation equal to the energy of its spectrum. Matched filtering correlates against a unit-norm template so that the detection statistic depends on waveform shape rather than on template amplitude.
Design Considerations
Work with the squared norm wherever possible
Comparisons, minimisations and thresholds can almost always be restated in terms of . Doing so removes a square root from the inner loop, keeps the expression polynomial so it can be differentiated cleanly, and avoids the accuracy loss of a root near zero. Take the square root only when a human-readable magnitude is the output.
Never compute the norm from the naive formula on real data
Squaring entries can overflow when the largest modulus exceeds about in binary64, and can underflow to zero when it falls below about . Both produce a silently wrong answer from perfectly representable input. Use a scaled accumulation, hypot for two entries, or the library routine that already implements it.
Decide whether the norm should be weighted
The plain Euclidean norm treats every entry as equally important, which is wrong whenever the entries carry different units or different uncertainties. A weighted norm with a positive-definite — typically an inverse covariance or a mass matrix — is the correct instrument, and it retains every property on this page.
Guard normalisation against the zero vector
Normalising is undefined at and numerically hazardous nearby, where the direction is dominated by rounding error rather than data. Test the norm against a tolerance scaled to the problem, and define explicitly what the algorithm does when a direction is requested from a vanishing vector.
State the norm you mean
Reporting that an error is "below " is meaningless without saying which norm and whether it is absolute or relative. A relative residual is dimensionless and scale-invariant; an absolute residual is neither. Fix the convention once and record it alongside the tolerance.
Beware of dimension when interpreting magnitude
The norm of a vector of independent unit-variance samples grows like . A threshold tuned on a -dimensional problem will fire constantly at dimension . Normalise by to obtain a root-mean-square value when comparing across different vector lengths.
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 | Fixes the double-bar notation for a norm and the single-bar for absolute value and modulus, a distinction that this page relies on throughout and that is frequently blurred in software documentation. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Defines the finite exponent range that makes naive squaring unsafe, and specifies the correctly rounded sqrt and the hypot operation recommended for two-argument magnitude computation. |
BLAS Level 1 | Basic Linear Algebra Subprograms, vector operations | The reference norm routines SNRM2, DNRM2, SCNRM2 and DZNRM2 implement the scaled accumulation described here, and xSCAL performs the normalising multiplication. |
IEC 61869 / IEC 61000-4-30 | Instrument transformers and power quality measurement methods | Power-quality quantities such as total harmonic distortion and unbalance factors are defined as ratios of norms of harmonic or sequence-component vectors, which is the applied form of this page's definition. |
ISO/IEC 40314 | Mathematical Markup Language (MathML) Version 3.0 | Encodes the norm and modulus delimiters on this page as semantic markup, so the distinction between and survives into assistive technology and search indexing. |
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 |
|---|---|---|
| IEEE 754 binary64 with scaled accumulation | General numerical work where entry magnitudes are not known in advance. | The default correct choice; the scaling pass costs one extra sweep over the data but removes all overflow and underflow risk. |
| IEEE 754 binary32 | Large signal or image data where memory bandwidth dominates and only three significant digits of magnitude are required. | Halves storage and traffic, but the narrower exponent range makes unscaled squaring overflow above roughly , so scaling becomes mandatory rather than merely prudent. |
| Exact rational arithmetic on the squared norm | Symbolic verification of orthogonality or independence, where the answer must be exactly zero or exactly non-zero. | Keeps exact and decidable, but the norm itself is generally irrational, so the square root must be left in surd form or approximated at the end. |
| Fixed-point with a guard-bit budget | Embedded DSP and motor-control targets without a floating-point unit. | Deterministic timing and small silicon area, but the accumulator must carry enough guard bits for squared terms, and the square root needs a dedicated CORDIC or Newton routine. |
| Squared norm only, no square root | Nearest-neighbour search, thresholding, and any comparison of magnitudes. | Removes the most expensive operation entirely and is exact for comparison purposes, but the retained quantity has squared units and must be labelled as such to avoid misreporting. |
| Complex versus real storage | Phasor, spectral and quantum data where entries are genuinely complex. | A complex vector of size costs the same as a real vector of size for norm purposes, since ; splitting into real and imaginary arrays gives identical norms and often better vectorisation. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Operation count
A real norm requires multiplications, additions and one square root, so it is a strictly operation dominated by memory traffic rather than arithmetic. A complex norm doubles the multiplications. The scaled algorithm adds one comparison pass and one division pass, which is usually invisible against the cost of fetching the vector from memory.
The scaled algorithm in detail
Let be the largest entry modulus. Compute , which lies between and , then multiply the square root of that sum by . Since every scaled term is at most , no intermediate can overflow, and since the largest is exactly , no information is lost to underflow. A one-pass variant that rescales on the fly is what DNRM2 actually implements.
Library behaviour
numpy.linalg.norm defaults to the -norm for vectors and to the Frobenius norm for matrices — a genuine trap, since the induced -norm of a matrix is the largest singular value, not the Frobenius norm. MATLAB's norm defaults to the induced -norm for matrices instead. Always pass the order argument explicitly rather than relying on the default.Verification technique
Three cheap checks catch most errors. Confirm against the inner product computed independently; confirm for a complex such as , which will expose a missing conjugate; and confirm that a normalised vector returns a norm of to within a few units in the last place.
Accuracy of the accumulation
Summing squared terms in the obvious order accumulates rounding error of order relative to the result, where is the unit roundoff. For very long vectors, pairwise or compensated summation reduces this to order or respectively, at negligible cost. Because all terms are non-negative there is no cancellation, so the norm is one of the better-conditioned computations in numerical linear algebra.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Squaring entries instead of moduli | high | Writing for complex data, which produces a complex number that may even be zero for a non-zero vector. | Always form , or use the library complex norm routine which handles the conjugation internally. |
| Overflow or underflow in naive accumulation | high | Squaring an entry of magnitude beyond roughly in binary64, or below , before summing. | Scale by the largest modulus first, or call xNRM2 / hypot rather than coding the textbook formula. |
| Normalising the zero vector | high | Dividing by a norm of zero, or by a norm so small that the resulting direction is pure rounding noise. | Test the norm against a tolerance scaled to the data before dividing, and define the algorithm's behaviour for the degenerate case explicitly. |
| Confusing the Frobenius and induced matrix norms | medium | Applying a vector norm function to a matrix and accepting the default, which differs between libraries. | Specify the order explicitly; remember that the induced -norm is the largest singular value, while the Frobenius norm is the vector norm of the flattened entries. |
| Comparing absolute residuals across problems of different scale | medium | Using directly as a convergence test when varies by orders of magnitude between cases. | Normalise the residual by or by so the criterion is dimensionless and scale-invariant. |
| Treating the norm as linear | medium | Assuming , which holds only when the vectors are non-negative multiples of each other. | Use the triangle inequality as an inequality; when an equality is needed, expand via the inner product and keep the cross terms. |
| Mixing units within one vector | medium | Stacking quantities with different physical dimensions, so the sum of squares has no meaningful unit and the norm is dominated by whichever entry happens to be numerically largest. | Non-dimensionalise each entry, or adopt a weighted norm with a diagonal weight matrix that restores comparability. |
| Assuming a small norm implies a small relative error | low | Reading a small residual as evidence of an accurate solution in an ill-conditioned system. | Bound the solution error by the residual multiplied by the condition number; report the condition estimate alongside any residual claim. |
FAQs
Why does the definition use the modulus rather than the entry itself?
Because a complex number squared is still complex and cannot be compared with zero. Squaring the modulus gives a real non-negative contribution from every entry, so the total is a real number that is zero only for the zero vector. For real entries the modulus is the absolute value and squaring it is the same as squaring the entry, so nothing changes.
What is the relationship between the norm and the inner product?
They are two views of one object: . The inner product carries the extra information of relative orientation between two different vectors, while the norm is what remains when both arguments coincide. Because the inner product is positive definite, the square root always exists as a real number.
Is the norm of a vector always a real number even for complex vectors?
Yes, and always non-negative. Each term of the sum is a squared modulus, which is real and non-negative by construction, so the total is a non-negative real and its square root is taken in the usual real sense. A complex-valued norm would be meaningless, since norms are compared with thresholds.
Why do numerical libraries not use the textbook formula directly?
Because squaring the entries can overflow or underflow long before the true norm approaches the limits of the format. A vector whose largest entry is has a perfectly representable norm, but its square is infinite in binary64. Library routines scale by the largest modulus first, which costs one extra pass and removes the failure entirely.
Can two different vectors have the same norm?
Certainly — infinitely many do. The set of vectors with norm is a sphere, not a point. The norm captures magnitude only; all directional information is discarded, which is exactly why it is paired with the inner product when direction matters.
When should I use a weighted norm instead of the plain Euclidean one?
Whenever the entries are not interchangeable: different physical units, different measurement uncertainties, or different importance to the objective. Replacing by with a Hermitian positive-definite keeps every property on this page while restoring comparability between entries.
Does the norm satisfy the Pythagorean theorem?
It does, but only for orthogonal vectors. Expanding gives plus cross terms in ; those cross terms vanish precisely when the vectors are orthogonal, leaving the familiar identity.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section O, subsection N. 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.
- Lawson, C. L., Hanson, R. J., Kincaid, D. R. and Krogh, F. T. Basic Linear Algebra Subprograms for Fortran Usage. ACM Transactions on Mathematical Software, 1979.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
AI Suggested Questions
- Show me a binary64 vector whose true norm is finite but whose naive sum-of-squares overflows, and trace what the scaled algorithm does instead.
- Derive the triangle inequality from the Cauchy-Schwarz inequality by expanding the squared norm of a sum.
- How does the expected norm of a random vector with independent unit-variance entries grow with dimension, and what does that imply for fixed thresholds?
- Compare the 1-norm, 2-norm and infinity norm of the same vector and explain which optimisation problems each one favours.
- Why is the induced 2-norm of a matrix the largest singular value, while the Frobenius norm is the vector 2-norm of its entries?
- Construct a weighted norm from a covariance matrix and show that it still satisfies absolute homogeneity and the triangle inequality.
Related Calculators
Compute the Euclidean norm of a real or complex vector using scaled accumulation, with the squared norm reported alongside.
Unit Vector NormaliserDivide a vector by its norm to produce a unit vector, with a zero-vector guard and a residual check on the result.
Vector Distance & Similarity CalculatorEvaluate , the relative distance and the cosine similarity between two vectors of equal size.
