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

  1. Distinguish diagonalization from general canonical decomposition.
  2. Compute and interpret generalized eigenvector chains.
  3. Build rational canonical form without relying on eigenvalue factorization.
  4. Verify similarity invariants rigorously.
  5. 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

  1. Exact arithmetic mode (Q, finite fields optional).
  2. Jordan chain construction workflow.
  3. Invariant-factor computation for rational form.
  4. Similarity-invariant report with consistency checks.
  5. 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

  1. Compute polynomials and algebraic invariants.
  2. If splitting field available, construct Jordan chains.
  3. Compute invariant factors for rational form.
  4. Reconstruct canonical matrix and compare invariants.
  5. 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

  1. Similarity invariants
  2. Generalized eigenvectors
  3. Invariant factors and companion matrices

5.5 Questions to Guide Your Design

  1. How do you ensure field assumptions are explicit and enforced?
  2. 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

  1. Why does minimal polynomial bound Jordan block size?
  2. When does Jordan form fail to exist over a field?
  3. Why can rational canonical form classify without eigenvalue factorization?
  4. Why is numerical Jordan computation unstable?
  5. 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

  1. Polynomial invariant engine
  2. Jordan chain construction
  3. Rational form construction
  4. 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

  1. Matrix with repeated eigenvalue but full eigenbasis.
  2. Matrix with single Jordan chain length >1.
  3. 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_i divides f_{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.