SumOfSquares.jl icon indicating copy to clipboard operation
SumOfSquares.jl copied to clipboard

Could not simultaneously block-diagonalize

Open jeremypparker opened this issue 1 year ago • 1 comments

On fd7336e, I am hitting an error on line 189 of wedderburn.jl

Firstly, the actual error raised is "ERROR: LoadError: UndefVarError: dx not defined" because of a minor bug on line 190, but the real underlying problem is that the simultaneous block-diagonalization fails. Unfortunately the example (attached) I have to repro this is rather resource intensive and it seems to run fine without an error at lower polynomial degree (though I have not exhaustively tested).

As with #381, I create a symmetry group with Oscar, a basis invariant under this group, a polynomial using that basis and then an SOS constraint from that polynomial.

sos_repro.jl.txt

jeremypparker avatar Oct 22 '24 11:10 jeremypparker

The issue seems to be related to almost-zero entries in the input to ordered_block_diag. I can fix the error message if I add something like this to the top of that function:

function clean!(M, tol=1e-15)
    M[abs.(M) .< tol] .= 0
end

for A in As
    clean!(A)
end

I could add a pull request for this but it feels like a hack, and I'm also not yet sure if I fully trust the results after this fix. More testing underway

jeremypparker avatar Jan 02 '25 17:01 jeremypparker