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

lapack exception (2) backward qr diff

Open maartenvd opened this issue 4 years ago • 4 comments

While random matrices work, I get lapack exceptions in trtrs when using it in my application. fpeps.zip

`using Zygote,BackwardsLinalg,fpeps

width = 4;height = 4; D = 2;d = 2;chi = 5;

peps = Array{Array{ComplexF64,5},2}(undef,width,height); for i = 1:width for j = 1:height peps[i,j] = rand(ComplexF64,D,D,D,D,d); end end

boundaries = fpeps.gen_boundaries(peps,chi); n1 = boundaries[1][1]; n2 = boundaries[1][2];

fun(a) = real(sum(sum.(fpeps.north_vomps(n1,peps[1,:],a)))) fun'(n2)`

Is there anything I should know about numerical stability problems (assuming the lapack error means that trtrs didn't converge). How can I go about debugging this further? The matrix passed to trtrs did became spectacularly quite ill-conditioned in my example... I can try to reduce this further to a smaller minimal example?

If I set the parameters to make sure that we are effectively working with 1x1 matrices then I get errors later on with zygote (I'm assuming it's unrelated to this package but I'm not sure as the stacktrace effectively says nothing).

maartenvd avatar Jan 11 '20 09:01 maartenvd