Conditioning and Stability
Conditioning measures how sensitive a mathematical problem is to small changes in its input. Stability measures whether a numerical algorithm introduces more error than the problem itself forces.
These are different questions. Error Estimates explains how these diagnostics enter an explicit uncertainty budget.
| Question | Concept |
|---|---|
| Does the exact answer change a lot when the input changes slightly? | conditioning |
| Does the algorithm behave like the exact solution of a nearby problem? | stability |
| Is the computed answer close to the exact answer for the original data? | forward accuracy |
| Does the computed answer satisfy the original equations nearly? | residual |
A poor result can come from an ill-conditioned problem, an unstable algorithm, an insufficient discretization, or a coding mistake. The purpose of this page is to separate those possibilities.
Why Quantum Mechanics Needs It
Section titled “Why Quantum Mechanics Needs It”Quantum calculations routinely ask for quantities that are sensitive:
- small energy splittings between nearly degenerate states;
- eigenvectors inside a nearly degenerate eigenspace;
- wavefunctions expanded in a nearly linearly dependent basis;
- tunneling amplitudes that are exponentially small;
- scattering phase shifts near resonances;
- long-time time evolution;
- expectation values obtained from subtracting large terms;
- inverse or reconstruction problems from incomplete data.
In such cases, “the code ran” and “the residual is small” are not enough. One must ask whether the problem is well conditioned at the requested accuracy and whether the algorithm is stable for that problem class.
Conditioning as Sensitivity
Section titled “Conditioning as Sensitivity”Let a problem be represented abstractly as a map
where is the input data and is the exact answer. A condition number estimates how much the answer can change when the input is perturbed.
For a scalar differentiable function with , a relative condition number is
It means that a small relative perturbation in can produce, to first order,
Large means the problem itself is sensitive. No algorithm can recover more information than the data determine.
Matrix Condition Numbers
Section titled “Matrix Condition Numbers”For a linear system
the condition number of an invertible matrix is
In the Euclidean norm, this can be written using singular values:
If is small, the matrix is close to singular. Then small perturbations in or can cause large changes in .
A typical first-order warning is
when the perturbation is only in and the bound is interpreted in the appropriate norm and small-perturbation regime.
This is why Singular Value Decomposition is more than a linear-algebra ornament: singular values diagnose near-null directions and loss of numerical information.
Quantum Linear Algebra owns how intrinsic and access-induced block conditioning enter QLSP success, error, and resource claims; this page retains general problem sensitivity, residuals, forward and backward error, and classical stability.
Forward Error, Backward Error, and Residuals
Section titled “Forward Error, Backward Error, and Residuals”The forward error compares the computed answer with the exact answer :
The backward error asks how much the input data would need to change to make exact:
An algorithm is backward stable when the required perturbation is comparable to the unavoidable rounding scale:
up to moderate constants and problem-size factors.
For an equation such as , the residual is
A small residual says that nearly satisfies the equation. But if is ill conditioned, a small residual may still correspond to a large forward error because
Residuals are essential diagnostics, but they should be interpreted together with conditioning.
Stable Algorithms Do Not Fix Ill Conditioning
Section titled “Stable Algorithms Do Not Fix Ill Conditioning”A backward stable algorithm gives an answer that is exact for a nearby problem. That is usually the right standard. But if the original problem is ill conditioned, the nearby problem may have a noticeably different answer.
Thus stability and conditioning combine schematically as
For a problem with condition number , double-precision rounding at the scale can become a scale forward error even with a stable algorithm. This may be excellent or unacceptable depending on the physical question.
Eigenvalue Sensitivity
Section titled “Eigenvalue Sensitivity”Hermitian eigenvalue problems are much better behaved than general non-Hermitian eigenvalue problems. If
with and Hermitian, the eigenvalues shift by at most the perturbation size in spectral norm:
after matching the ordered eigenvalues.
Eigenvectors are more sensitive. If an eigenvalue is separated from the rest of the spectrum by a gap , then the angle between the exact and perturbed eigendirections is controlled roughly by
When is small, individual eigenvectors can rotate strongly under tiny perturbations. The physically meaningful object may be the whole nearly degenerate subspace, not a particular basis vector inside it.
This distinction is central in Matrix Diagonalization: eigenvalue residuals, orthogonality, symmetry labels, and subspace comparisons are all part of validation.
Nonorthogonal Bases and Overlap Matrices
Section titled “Nonorthogonal Bases and Overlap Matrices”Many variational and computational methods use a nonorthogonal basis . The overlap matrix is
The generalized eigenvalue problem has the form
If the basis functions are nearly linearly dependent, then has very small singular values and is ill conditioned. The generalized eigenvalue problem may amplify roundoff, produce spurious states, or make coefficients enormous while the represented wavefunction remains moderate.
The fix is not merely to ask for more digits in the printed output. One may need to remove near-dependent basis vectors, orthogonalize carefully, use SVD thresholds, rescale the basis, or reformulate the problem.
Small Splittings and Physical Claims
Section titled “Small Splittings and Physical Claims”Suppose a calculation reports
If is much smaller than the absolute uncertainty in and , then the splitting has not been resolved. This is common in tunneling, weak symmetry breaking, fine structure, avoided crossings, and finite-size effects.
Useful checks include:
- compare with eigenpair residuals and estimated discretization error;
- vary basis size, grid size, and precision;
- check whether a symmetry predicts exact degeneracy;
- compare with an asymptotic or exactly solvable limit;
- track the subspace rather than individual eigenvectors near a crossing.
A small number is a physical result only after it survives these checks.
Stability in Time Evolution
Section titled “Stability in Time Evolution”For exact closed-system quantum mechanics, time evolution is unitary:
A numerical time-stepping method should be judged partly by whether it respects or accurately approximates this structure. An algorithm can be locally accurate for short times but drift in norm or energy over long times.
Stability questions include:
- Does the method preserve norm for a time-independent Hermitian Hamiltonian?
- Does reducing the time step improve the answer at the expected rate?
- Does the error grow linearly, diffusively, or exponentially with time?
- Is the evolution problem stiff because the Hamiltonian has widely separated scales?
For long-time dynamics, qualitative stability may matter as much as a small one-step error.
Choosing Tolerances
Section titled “Choosing Tolerances”A tolerance should be tied to a scale. The statement
is incomplete unless the scale of , , and is known. A relative residual such as
is often more meaningful because it compares the residual with the size of the terms being balanced.
Tolerances should also respect the problem’s conditioning. Asking for relative accuracy from a problem with condition number in double precision may be unrealistic without extended precision or a reformulation.
Practical Checklist
Section titled “Practical Checklist”For a numerical quantum calculation, ask:
- What is the mathematical problem map from data to answer?
- Which input perturbations are physically or numerically plausible?
- What residual was checked, and in what norm?
- Is the condition number or spectral gap known or estimated?
- Does the algorithm have a backward-stability guarantee for this problem class?
- Are small physical conclusions larger than estimated numerical uncertainty?
- Is the result stable under basis, grid, time-step, and precision changes?
When the answer changes under harmless numerical choices, treat that as a diagnostic signal rather than a nuisance.
Common Mistakes
Section titled “Common Mistakes”- Calling an algorithm unstable when the problem is simply ill conditioned.
- Calling a problem well solved because the residual is small, without checking conditioning.
- Trusting individual eigenvectors inside a nearly degenerate subspace.
- Reporting tiny energy splittings without an absolute error estimate.
- Using a nonorthogonal basis without checking the overlap matrix.
- Choosing tolerances with no scale or units.
- Assuming double precision is enough because the final answer prints many digits.
- Ignoring symmetry constraints that could distinguish numerical noise from real effects.
Cross-Links
Section titled “Cross-Links”- Floating-Point Arithmetic
- Error Estimates
- Discretization
- Matrix Diagonalization
- Time-Stepping Methods
- Norms and Metrics
- Matrices as Linear Maps
- Singular Value Decomposition
- Hermitian Operators
- Small Parameters and Error Estimates
References
Section titled “References”- N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd ed., SIAM, 2002.
- G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed., Johns Hopkins University Press, 2013.
- L. N. Trefethen and D. Bau, Numerical Linear Algebra, SIAM, 1997.
- J. H. Wilkinson, The Algebraic Eigenvalue Problem, Oxford University Press, 1965.
- J. M. Thijssen, Computational Physics, 2nd ed., Cambridge University Press, 2007.
Exercises
Section titled “Exercises”- Let for . Compute the relative condition number.
Solution
We have
Thus
The condition number becomes large near , where the function is very sensitive to input perturbations.
- A backward stable algorithm is applied to a problem with condition number in double precision. Estimate the possible scale of forward relative error from rounding alone.
Solution
Double precision has unit roundoff around . A rough estimate is
The exact constant depends on the problem and algorithm, but the estimate shows that backward stability does not guarantee sixteen accurate digits when the problem is ill conditioned.
- Why can eigenvectors be unreliable near degeneracy even when eigenvalues are accurate?
Solution
Hermitian eigenvalues have good absolute perturbation bounds, but eigenvector directions depend on spectral gaps. If the gap to nearby eigenvalues is small, a perturbation of size can rotate the eigenvector by an angle controlled roughly by . Near degeneracy, the individual basis vectors inside the eigenspace are not stable; the subspace is the better object to compare.
- Let with . If a computed solution has residual , what is the corresponding error ?
Solution
Since
the error is
A small residual component can produce a large error if is tiny. This is the residual-versus-conditioning lesson in its simplest form.
- In a nonorthogonal variational basis, why is a small singular value of the overlap matrix a warning sign?
Solution
A small singular value means that some nonzero coefficient vector produces a very small represented vector. The basis is nearly linearly dependent. In the generalized eigenvalue problem , this near-null direction can amplify roundoff and produce unstable coefficients or spurious eigenvalues. One should consider orthogonalization, SVD truncation, rescaling, or basis repair.