diff --git a/precomputed_reps_spectral_gap.jl b/precomputed_reps_spectral_gap.jl index c0696e3..a666bc6 100644 --- a/precomputed_reps_spectral_gap.jl +++ b/precomputed_reps_spectral_gap.jl @@ -68,16 +68,6 @@ function load_principal_repr(i, q = 109; CC = AcbField(PRECISION)) return a, b end -function safe_eigvals(m::acb_mat) - evs = eigvals(m) - all(isfinite.(evs)) && return evs - CC = base_ring(m) - X = matrix(CC, rand(CC, size(m))) - evs = eigvals(X * m * inv(X)) - all(isfinite.(evs)) && return evs - throw(ArgumentError("Could not compute eigenvalues")) -end - if !isinteractive() for i = 0:27 diff --git a/src/nemo_utils.jl b/src/nemo_utils.jl index 182707b..bf26abe 100644 --- a/src/nemo_utils.jl +++ b/src/nemo_utils.jl @@ -163,3 +163,14 @@ function _count_multiplicites(evs) rev = true, ) end + +function safe_eigvals(m::acb_mat) + evs = eigvals(m) + all(isfinite.(evs)) && return evs + CC = base_ring(m) + X = matrix(CC, rand(CC, size(m))) + evs = eigvals(X * m * inv(X)) + return evs + all(isfinite.(evs)) && return evs + throw(ArgumentError("Could not compute eigenvalues")) +end