The trace test fails for witness sets where the linear subspace L is a LinearSubspace{Float64}:
julia> L = LinearSubspace([1.0 0.0], [2.0]);
julia> W = witness_set([x^2+y^2-1], L)
Witness set for dimension 1 of degree 2
julia> trace_test(W)
ERROR: InexactError: Float64(2.7923774848451757 + 0.04248034231480903im)
Stacktrace:
[1] Real
@ ./complex.jl:44 [inlined]
[2] convert
@ ./number.jl:7 [inlined]
[3] setindex!
@ ./array.jl:985 [inlined]
[4] macro expansion
@ ./broadcast.jl:995 [inlined]
[5] macro expansion
@ ./simdloop.jl:77 [inlined]
[6] copyto!
@ ./broadcast.jl:994 [inlined]
[7] copyto!
@ ./broadcast.jl:947 [inlined]
[8] materialize!
@ ./broadcast.jl:905 [inlined]
[9] materialize!
@ ./broadcast.jl:902 [inlined]
[10] translate!(L::LinearSubspace{Float64}, δb::Vector{ComplexF64}, ::Coordinates{:Extrinsic})
@ HomotopyContinuation ~/.julia/packages/HomotopyContinuation/s3sko/src/linear_subspaces.jl:686
[11] translate (repeats 2 times)
@ ~/.julia/packages/HomotopyContinuation/s3sko/src/linear_subspaces.jl:682 [inlined]
[12] trace_test(W₀::WitnessSet{MixedSystem{…}, LinearSubspace{…}, PathResult}; options::@Kwargs{})
@ HomotopyContinuation ~/.julia/packages/HomotopyContinuation/s3sko/src/witness_set.jl:597
[13] trace_test(W₀::WitnessSet{MixedSystem{(0xa6d77f86f464958b, 1)}, LinearSubspace{Float64}, PathResult})
@ HomotopyContinuation ~/.julia/packages/HomotopyContinuation/s3sko/src/witness_set.jl:582
[14] top-level scope
@ REPL[194]:1
Some type information was truncated. Use `show(err)` to see complete types.
The problem seems to arise when trace_test runs translate and attempts to shift the vector L.extrensic.b (which is of type Vector{Float64}) by vector δb (which is of type Vector{ComplexF64}) here:
|
function translate!(L::LinearSubspace, δb, ::Coordinates{:Extrinsic} = Extrinsic) |
|
ext = extrinsic(L) |
|
ext.b .+= δb |
|
int = intrinsic(L) |
|
LA.mul!(int.b, ext.A', δb, true, true) |
|
stiefel_coordinates_intrinsic!(int.Y, int.A, int.b) |
|
L |
|
end |
The trace test fails for witness sets where the linear subspace
Lis aLinearSubspace{Float64}:The problem seems to arise when
trace_testrunstranslateand attempts to shift the vectorL.extrensic.b(which is of type Vector{Float64}) by vectorδb(which is of type Vector{ComplexF64}) here:HomotopyContinuation.jl/src/linear_subspaces.jl
Lines 684 to 691 in 9ef422d