Spectral Decomposition Calculator
Analyze symmetric matrices with confidence and precision. See eigenvalues, orthonormal eigenvectors, and projectors together instantly. Plot results, compare components, and export polished study reports.
Purpose: This calculator finds eigenvalues, orthonormal eigenvectors, projector matrices, diagonal matrix Λ, and the reconstruction A = QΛQT = Σ λiPi for real symmetric 2×2 and 3×3 matrices.
Result panels appear below this header and above the form after submission, exactly as requested.
Calculator Form
Enter a real symmetric matrix only. The tool supports 2×2 and 3×3 matrices and sorts eigenvalues in your selected order.
Formula Used
Here, Q contains orthonormal eigenvectors as columns, and Λ is a diagonal matrix of eigenvalues.
This is the spectral decomposition form. Each term uses one eigenvalue and one projector matrix.
Every projector isolates the component of a vector along one eigendirection.
- Eigenvalues satisfy the characteristic equation det(A - λI) = 0.
- This calculator uses Jacobi rotations internally, which are reliable for small real symmetric matrices.
- The orthogonality check QTQ ≈ I confirms that the eigenvectors are normalized and mutually perpendicular.
- The reconstruction error is the Frobenius norm of A - Σ λiPi. Smaller values indicate a correct decomposition.
How to Use This Calculator
- Select the matrix size, either 2×2 or 3×3.
- Enter a real symmetric matrix. Match off-diagonal pairs carefully.
- Choose your preferred decimal precision and eigenvalue order.
- Click Calculate Spectral Decomposition.
- Review the eigenvalues, eigenvectors, diagonal matrix, projectors, and reconstruction error.
- Use the CSV and PDF buttons to save the results for reports, assignments, or revision.
Example Data Table
| Example | Matrix | Type | What to Expect |
|---|---|---|---|
| Example 1 | [[2, 1], [1, 2]] | 2 × 2 symmetric | Two real eigenvalues, orthogonal eigenvectors, exact reconstruction. |
| Example 2 | [[4, 1, 1], [1, 3, 0], [1, 0, 2]] | 3 × 3 symmetric | Three real eigenvalues and three rank-one projector matrices. |
| Example 3 | [[5, 2, 0], [2, 5, 0], [0, 0, 3]] | 3 × 3 symmetric | Repeated eigenvalues may appear, but reconstruction still works. |
Frequently Asked Questions
1) What is spectral decomposition?
Spectral decomposition writes a symmetric matrix as a sum of eigenvalue-weighted projector matrices. It also appears as A = QΛQᵀ, where Q holds orthonormal eigenvectors and Λ stores eigenvalues.
2) Why does this calculator require a symmetric matrix?
A real symmetric matrix guarantees real eigenvalues and orthonormal eigenvectors. That property makes the decomposition stable, interpretable, and suitable for QΛQᵀ with projector matrices built from normalized eigenvectors.
3) What does the projector matrix represent?
A projector matrix extracts the part of any vector aligned with one eigendirection. It is formed as P = vvᵀ when v is a unit eigenvector.
4) What does the orthogonality check QᵀQ show?
It should be close to the identity matrix. That means the eigenvectors are unit length and perpendicular to one another, which is essential for a correct spectral decomposition.
5) Can repeated eigenvalues still work?
Yes. A symmetric matrix can have repeated eigenvalues. The eigenspace may contain multiple valid orthonormal bases, but the decomposition and matrix reconstruction remain correct.
6) What does reconstruction error mean?
It measures how closely the sum of spectral terms rebuilds the original matrix. Very small values usually come from floating-point rounding, not from a failed decomposition.
7) What does the Plotly graph display?
The graph plots the computed eigenvalues. It helps you compare spectral components quickly and see which directions carry the largest magnitude in the decomposition.
8) Can I save the results for classwork or reports?
Yes. Use the CSV export for spreadsheet work and the PDF export for a clean printable summary of the matrix, eigenvalues, eigenvectors, and projector matrices.