Skip to content

Commit

Permalink
Fix Jordan normal form (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt authored Nov 9, 2023
1 parent dd1b63c commit 829741c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Misc/jordan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function closure_with_pol(v::MatElem{T}, M::MatElem{T}) where T <: FieldElem
E = rref(v)[2]
w = v*M
res = Hecke.cleanvect(E, w)
v = deepcopy(v) # the output should not "share" entries with the input
while !iszero(res)
v = vcat(v, w)
E = vcat(E, res)
Expand Down
6 changes: 6 additions & 0 deletions test/Misc/jordan_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
@test CF == C
@test TM * C * inv(TM) == CF

# Issue #1279
K, _ = number_field(x^2 - 2)
M = matrix(K, [ 0 1 1; 1//2 0 0 ; 1//2 0 0 ])
J, S = jordan_normal_form(M)
@test J == S*M*inv(S)
@test Set([ J[1, 1], J[2, 2], J[3, 3] ]) == Set([ K(), K(1), K(-1) ])
end

@testset "Spectrum and eigenspaces" begin
Expand Down

0 comments on commit 829741c

Please sign in to comment.