Closed yirkajk closed 6 years ago
It would be useful to have an independent eigenvalue algorithm implementation to check our eigenvaue computations.
These matrices are all symmetric - that they are throwing complex eigenvalues is a mistake.
A similar numerical precision warning was given for laplacian_energy
And gutman_energy
laplacian_energy_like
has a totally different problem: It times out on almost every graph.
One thing we notice: This method calls the g.spectrum()
method. Why does every method dealing with eigenvalues not call this built-in method?
Sage uses a completely different algorithm for computing matrix eigenvalues than the algorithm implemented for graph adjacency matrices (which seems to factor the characteristic polynomial).
These algorithms can easily (and should) definitely be compared for the graphs in GT
Also with numerical precision warnings:
largest_eigenvalue_minus_avg_degree
.
And that's it for efficient invariants.
The complex values come from numerical rounding errors as is also mentioned in the user warning. We should see if the user warning originates in our code, or in Sage code. In the latter case we should report a bug with Sage.
Just summarising the invariants to be fixed and values to be checked:
max_eigenvalue
min_eigenvalue
largest_eigenvalue_minus_avg_degree
laplacian_energy
gutman_energy
wilf
I'm going to begin by considering why we don't use g.spectrum()
in all of these. Perhaps the reason is related to why laplacian_energy_like
times out so often.
Okay, I fixed the functions by passing argument=symmetric
as a parameter to eigenvalues()
, forcing it to use an algorithm just for real eigenvalues.
I will go back and recompute the values for all graphs for these functions, in case the numerical precision was a problem.
Values have been recomputed. The issue should be automatically closed when the precomputing branch is merged into master.
The numerical precision warning occurred with both
max_eigenvalue
andmin_eigenvalue
.The errors involving complex numbers only occurred with
min_eigenvalue
.So, need to resolve the errors. And, do we need to recompute the values, since they might be wrong?