Skip to content

Native Julia package for symbolic matrix diagonalization (small matrices or with extensive symmetries)

License

Notifications You must be signed in to change notification settings

volkerkarle/SymbolicDiagonalization.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SymbolicDiagonalization.jl

SymbolicDiagonalization.jl Logo

Documentation CI Documentation Build codecov License: GPL v3

Symbolic eigenvalue computation for structured matrices

The Problem

The Abel-Ruffini theorem proves no closed-form solution exists for polynomials of degree 5+. This means general symbolic 5×5+ matrices cannot be diagonalized. However, many matrices have exploitable structure.

The Solution

This package automatically detects matrix structure and returns closed-form symbolic eigenvalues:

using Symbolics, SymbolicDiagonalization, LinearAlgebra

# 1024×1024 nested Kronecker product - degree 1024 polynomial!
# But structure reduces it to 10 quadratic problems
@variables a1 b1 c1  a2 b2 c2  a3 b3 c3  a4 b4 c4  a5 b5 c5  a6 b6 c6  a7 b7 c7  a8 b8 c8  a9 b9 c9  a10 b10 c10

matrices = [[a1 b1; b1 c1], [a2 b2; b2 c2], [a3 b3; b3 c3], [a4 b4; b4 c4], [a5 b5; b5 c5],
            [a6 b6; b6 c6], [a7 b7; b7 c7], [a8 b8; b8 c8], [a9 b9; b9 c9], [a10 b10; b10 c10]]
K = reduce(kron, matrices)  # 1024×1024 with 30 symbolic parameters

eigvals(K)  # 1024 symbolic eigenvalues in ~33 seconds

Supported Patterns

Pattern Size Method
Any matrix ≤4×4 Quadratic/Cardano/Ferrari formulas
Block-diagonal Any Recursive decomposition
Circulant Any DFT diagonalization
Kronecker A⊗B Any λ(A)·λ(B) factorization
Nested Kronecker Any Recursive factorization
Symmetric Toeplitz tridiagonal Any Chebyshev formula
Hadamard 2ⁿ ±√(2ⁿ)
DFT Any Fourth roots of n
Permutation Any Cycle decomposition
SO(2), SO(3), SO(4) 2,3,4 Rotation angle extraction
SU(2), SU(3) 2,3 Lie algebra structure
Cartan type Aₙ Any Root system formula
Path/Cycle Laplacian Any Trigonometric formula

Quick Start

using Symbolics, SymbolicDiagonalization, LinearAlgebra

@variables a b c d

Block-diagonal (recursive decomposition):

M = [a b 0 0; b a 0 0; 0 0 c d; 0 0 d c]
eigvals(M)  # [a+b, a-b, c+d, c-d]

Circulant (DFT formula works for any n):

C = [a b c; c a b; b c a]
eigvals(C)  # Closed-form for any size

Kronecker product:

A = [a 0; 0 b]
B = [c 0; 0 d]
eigvals(kron(A, B))  # [ac, ad, bc, bd]

Rotation matrices:

@variables θ φ
eigvals(kron(SO2_rotation(θ), SO2_rotation(φ)))  # e^{i(±θ±φ)}

Installation

using Pkg
Pkg.add("SymbolicDiagonalization")

Documentation

Full documentation

License

GPL v3 - see LICENSE.

About

Native Julia package for symbolic matrix diagonalization (small matrices or with extensive symmetries)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages