Project 9: Jordan and Rational Canonical Form Explorer
Build an exact-arithmetic explorer that classifies matrices by similarity using Jordan and rational canonical forms, with invariant verification.
Quick Reference
| Attribute | Value |
|---|---|
| Difficulty | Expert (Level 4) |
| Time Estimate | 2-3 weeks |
| Language | Python (alternatives: Julia, SageMath) |
| Prerequisites | Eigen theory, minimal polynomials, similarity |
| Key Topics | Jordan chains, invariant factors, canonical classification |
1. Learning Objectives
- Distinguish diagonalization from general canonical decomposition.
- Compute and interpret generalized eigenvector chains.
- Build rational canonical form without relying on eigenvalue factorization.
- Verify similarity invariants rigorously.
- Explain why canonical-form computation is primarily symbolic/exact.
2. Theoretical Foundation
2.1 Core Concepts
- Similarity classes and invariants.
- Jordan blocks and generalized eigenspaces.
- Minimal polynomial constraints on block sizes.
- Rational canonical form via invariant factors.
2.2 Why This Matters
Canonical forms provide operator-level identity beyond matrix appearance. They are essential for control theory, symbolic systems, and advanced understanding of non-diagonalizable behavior.
2.3 Historical Context / Background
Jordan form emerged from 19th century linear substitutions. Rational canonical form unified classification over arbitrary fields by module-theoretic machinery.
2.4 Common Misconceptions
- Distinct eigenvalues are required for useful structure.
- Jordan form is numerically robust for floating-point matrices.
- Rational form is just “Jordan with different notation”.
3. Project Specification
3.1 What You Will Build
A command-line analyzer that takes exact matrices and emits:
- Characteristic and minimal polynomial
- Jordan block structure (when field splits)
- Rational canonical blocks
- Invariant verification report
3.2 Functional Requirements
- Exact arithmetic mode (
Q, finite fields optional). - Jordan chain construction workflow.
- Invariant-factor computation for rational form.
- Similarity-invariant report with consistency checks.
- Input/output format for batch experiments.
3.3 Non-Functional Requirements
- Correctness: Invariants must match reconstructed canonical matrix.
- Transparency: Every block decision should be explainable.
- Determinism: Repeatable output ordering and block presentation.
3.4 Example Usage / Output
$ python canonical_forms.py --matrix fixtures/defective_5x5.json --field Q
[INFO] charpoly=(x-3)^5
[INFO] minpoly=(x-3)^3
[INFO] Jordan block sizes=[3,2]
[INFO] Rational blocks=[companion((x-3)^3), companion((x-3)^2)]
[PASS] invariants verified against original matrix
3.5 Real World Outcome
You finish with a canonical-form engine that can be used in advanced coursework, symbolic analysis pipelines, and debugging of defective spectral behavior in model systems.
4. Solution Architecture
4.1 High-Level Design
Input Matrix -> Polynomial Module -> Jordan Chain Builder -> Rational Builder -> Invariant Verifier -> Reporter
4.2 Key Components
| Component | Responsibility | Key Decisions |
|---|---|---|
| Polynomial Module | char/min polynomial ops | exact arithmetic only |
| Jordan Builder | generalized eigenspace chains | chain ordering rules |
| Rational Builder | invariant-factor pipeline | divisibility constraints |
| Verifier | invariant cross-checks | independent recomputation |
| Reporter | canonical form summaries | stable textual format |
4.3 Data Structures
CanonicalResult:
field
charpoly
minpoly
jordan_blocks[]
rational_blocks[]
invariants{}
4.4 Algorithm Overview
- Compute polynomials and algebraic invariants.
- If splitting field available, construct Jordan chains.
- Compute invariant factors for rational form.
- Reconstruct canonical matrix and compare invariants.
- Emit diagnostics and explanations.
5. Implementation Guide
5.1 Development Environment Setup
Install symbolic algebra stack
Enable exact-rational arithmetic backend
Load canonical fixture suite
5.2 Project Structure
P09/
polynomials/
jordan/
rational/
verify/
fixtures/
reports/
5.3 The Core Question You’re Answering
“How do we classify a linear operator independent of basis representation?”
5.4 Concepts You Must Understand First
- Similarity invariants
- Generalized eigenvectors
- Invariant factors and companion matrices
5.5 Questions to Guide Your Design
- How do you ensure field assumptions are explicit and enforced?
- Which invariants do you recompute independently for confidence?
5.6 Thinking Exercise
Pick a defective 3x3 matrix and hand-derive possible Jordan structure from minimal polynomial before coding.
5.7 The Interview Questions They’ll Ask
- Why does minimal polynomial bound Jordan block size?
- When does Jordan form fail to exist over a field?
- Why can rational canonical form classify without eigenvalue factorization?
- Why is numerical Jordan computation unstable?
- Which invariants survive similarity?
5.8 Hints in Layers
- Hint 1: Solve small exact examples first.
- Hint 2: Validate char/min polynomial relation before block assembly.
- Hint 3: Keep Jordan and rational builders independent.
- Hint 4: Add round-trip checks from canonical back to invariants.
5.9 Books That Will Help
| Topic | Book | Chapter |
|---|---|---|
| Jordan theory | Horn & Johnson | Canonical forms |
| Rational form | Abstract algebra notes | Module decomposition |
| Symbolic implementation | Sage docs | Linear algebra exact mode |
5.10 Implementation Phases
- Polynomial invariant engine
- Jordan chain construction
- Rational form construction
- Verification/reporting
5.11 Key Implementation Decisions
- Prefer exact arithmetic over floating point.
- Treat ordering and normalization of blocks as deterministic policy.
6. Testing Strategy
6.1 Test Categories
- Diagonalizable examples
- Defective examples
- Field-dependent examples
6.2 Critical Test Cases
- Matrix with repeated eigenvalue but full eigenbasis.
- Matrix with single Jordan chain length >1.
- Matrix requiring rational form over non-splitting field.
6.3 Test Data
- Hand-constructed fixtures with known canonical outputs.
7. Common Pitfalls & Debugging
- Symptom: Jordan blocks inconsistent with minimal polynomial.
- Why: Chain-length inference bug.
- Fix: Recompute kernel dimensions of
(A-lambda I)^k. - Quick test: Compare staircase dimensions.
- Symptom: Rational blocks violate divisibility order.
- Why: Invariant factor sorting bug.
- Fix: Enforce divisibility post-check.
- Quick test: Verify
f_idividesf_{i+1}for all i.
8. Extensions & Challenges
- Add finite-field mode for coding-theory examples.
- Add Schur-form comparison to explain numerical alternatives.
- Visualize generalized eigenspace lattice.
9. Real-World Connections
- Control-system modal analysis for defective systems.
- Symbolic linear recurrences and state-transition analysis.
- Educational tooling for advanced algebra courses.
10. Resources
11. Self-Assessment Checklist
- I can explain similarity invariants without examples.
- My tool outputs consistent Jordan/rational reports.
- I can justify every block-size decision.
- I can explain when Jordan is theoretical vs computational.
12. Submission / Completion Criteria
- Canonical-form CLI with fixture coverage.
- Verification report proving invariants are preserved.
- One write-up comparing Jordan and rational workflows.
This guide expands Project 9 from LINEAR_ALGEBRA_LEARNING_PROJECTS.md.