Thanks for reopening. I get the same number: your session on master 92979cf7b gives 1.3402904179514637e-26. Without domain : complex the same session gives 3.1271276229227505, and that is what a user gets by default. Your session also shows something I missed. My patch binds domain: complex inside matrixexp, and then bfloat(rectform(matrixexp(m))) is right at the default domain: real. But as soon as the result is simplified again under domain: real, it is wrong again (patched, domain: real, xxx as...
Thanks for c5762fdc4. spectral_rep now succeeds on the 3x3 matrix, but the matrix exponential that comes out of it is wrong, and nothing signals an error. Checked on master 92979cf7b against a truncated power series: load(linearalgebra)$ seriesexp(a, k) := block([s : ident(3), t : ident(3)], for j : 1 thru k do (t : (t . a)/j, s : s + t), s)$ mnorm(a) := lmax(map(abs, flatten(args(float(rectform(a))))))$ m : %i*matrix([1,2,3],[3,2,0],[1,2,1])$ mnorm(matrixexp(m) - seriesexp(m, 80)); => 3.127... (it...
Patch attached, file: 0001-draw-run-the-generated-vtk-script-with-python3.patch
file: 0002-matrixexp-matrixfun-work-in-DOMAIN-COMPLEX.patch
file: 0001-spectral_rep-project-with-a-generic-eigenvalue-when-.patch
Cause found, patch attached. Two independent defects, both in share/linearalgebra. 1. The residue division is not exact over the eigenvalues. spectral_rep builds each projector as a residue of the resolvent at one eigenvalue, so rational-residue divides the characteristic polynomial by (z - zi) with zi already substituted. Once zi is a cubic irrationality that division stops being exact: the projectors come out wrong by O(1) and check-spectral-rep rejects them, which is the reported error. For a...