Closed jankoboehm closed 1 year ago
On Tue, May 30, 2023 at 09:42:16AM -0700, Janko Boehm wrote:
Radical computation for an ideal over a non-simple number field yields a segfault.
Qt, t = QQ["t"]; K, (a1,a2) = number_field([t^2 - 2, t^2 - 3], "a"); R, (x,y) = polynomial_ring(K,["x","y"]); I = ideal(R,[x^2-a1]) radical(I)
Should this give a not implemented? Yes, I'll talk to Hans. My guess is that primdec.lib is calling factor, but factor is not part of the field interface that the kernel is using. Singular should throw an error at this point, but returns a NULL pointer instead. The segfault then is reading the polynomial.
It works for simple (antic) fields as they are mapped into pure singular rings. For more general number fields (your example is just one of many that will fail this way - or, for that matter any field unknown to singular) this is hard...
Output:
[11072] signal (11.1): Segmentation fault: 11 in expression starting at REPL[9]:1 ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) nemoFieldIsZero at /Users/boehm/.julia/packages/Singular/34YOl/src/libsingular/nemo/Fields.jl:140 unknown function (ip: 0x10cd58d28) _Z6p_ReadPKcRP8spolyrecP8ip_sring at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libpolys-4.3.2.dylib (unknown line) _Z7p_mInitPKcRiP8ip_sring at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libpolys-4.3.2.dylib (unknown line) _Z6syMakeP6sleftvPKcP11sip_package at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libSingular-4.3.2.dylib (unknown line) _Z7yyparsev at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libSingular-4.3.2.dylib (unknown line) _Z10iiAllStartP8procinfoPKc13feBufferTypesi at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libSingular-4.3.2.dylib (unknown line) _Z8iiPStartP5idrecP6sleftv at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libSingular-4.3.2.dylib (unknown line) _Z11iiMake_procP5idrecP11sip_packageP6sleftv at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libSingular-4.3.2.dylib (unknown line) _Z15ii_CallLibProcMPKcPPvPiP8ip_sringRi at /Users/boehm/.julia/artifacts/fac705e45add88021e44911aa88ee814406480da/lib/libSingular-4.3.2.dylib (unknown line) _Z31call_singular_library_procedureNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEP8ip_sringN5jlcxx8ArrayRefIP11_jl_value_tLi1EEE at /Users/boehm/.julia/artifacts/ae195a5c19261d58ffa2719894db0d23ec0a3642/lib/libsingular_julia.dylib (unknown line) _ZNSt3__110__function6__funcIPFP11_jl_value_tNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEP8ip_sringN5jlcxx8ArrayRefIS3_Li1EEEENS7_ISG_EESF_EclEOS9_OSB_OSE_ at /Users/boehm/.julia/artifacts/ae195a5c19261d58ffa2719894db0d23ec0a3642/lib/libsingular_julia.dylib (unknown line) _ZN5jlcxx6detail11CallFunctorIP11_jl_value_tJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEP8ip_sringNS_8ArrayRefIS3_Li1EEEEE5applyEPKvNS_13WrappedCppPtrESI_P10jl_array_t at /Users/boehm/.julia/artifacts/ae195a5c19261d58ffa2719894db0d23ec0a3642/lib/libsingular_julia.dylib (unknown line) call_singular_library_procedure at /Users/boehm/.julia/packages/CxxWrap/aXNBY/src/CxxWrap.jl:624 [inlined] low_level_caller_rng at /Users/boehm/.julia/packages/Singular/34YOl/src/caller.jl:373 radical at /Users/boehm/.julia/packages/Singular/34YOl/src/Meta.jl:49 unknown function (ip: 0x10cd5fce6) ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) __compute_radical__ at /Users/boehm/factorbug/Oscar.jl/src/Rings/mpoly-ideals.jl:423 #234 at /Users/boehm/.julia/packages/AbstractAlgebra/Ai5oJ/src/Attributes.jl:357 [inlined] get! at ./dict.jl:468 get_attribute! at /Users/boehm/.julia/packages/AbstractAlgebra/Ai5oJ/src/Attributes.jl:230 [inlined] radical at /Users/boehm/factorbug/Oscar.jl/src/Rings/mpoly-ideals.jl:419 unknown function (ip: 0x10cd4a082) ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) do_call at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) eval_body at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) jl_interpret_toplevel_thunk at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) jl_toplevel_eval_flex at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) jl_toplevel_eval_flex at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) jl_toplevel_eval_flex at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) ijl_toplevel_eval_in at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) eval at ./boot.jl:370 [inlined] eval_user_input at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-grannysmith-C07ZM05NJYVY.0/build/default-grannysmith-C07ZM05NJYVY-0/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:153 repl_backend_loop at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-grannysmith-C07ZM05NJYVY.0/build/default-grannysmith-C07ZM05NJYVY-0/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:249 #start_repl_backend#46 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-grannysmith-C07ZM05NJYVY.0/build/default-grannysmith-C07ZM05NJYVY-0/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:234 start_repl_backend at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-grannysmith-C07ZM05NJYVY.0/build/default-grannysmith-C07ZM05NJYVY-0/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:231 ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) #run_repl#59 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-grannysmith-C07ZM05NJYVY.0/build/default-grannysmith-C07ZM05NJYVY-0/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:379 run_repl at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-grannysmith-C07ZM05NJYVY.0/build/default-grannysmith-C07ZM05NJYVY-0/julialang/julia-release-1-dot-9/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:365 jfptr_run_repl_60218.clone_1 at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/sys.dylib (unknown line) ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) #1017 at ./client.jl:421 jfptr_YY.1017_49987.clone_1 at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/sys.dylib (unknown line) ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) jl_f__call_latest at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) #invokelatest#2 at ./essentials.jl:816 [inlined] invokelatest at ./essentials.jl:813 [inlined] run_main_repl at ./client.jl:405 exec_options at ./client.jl:322 _start at ./client.jl:522 jfptr__start_30180.clone_1 at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/sys.dylib (unknown line) ijl_apply_generic at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) true_main at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) jl_repl_entrypoint at /Users/boehm/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line) Allocations: 26808077 (Pool: 26762112; Big: 45965); GC: 20 zsh: segmentation fault julia
System:
julia> Oscar.versioninfo(full=true) OSCAR version 0.12.2-DEV combining: AbstractAlgebra.jl v0.30.7 GAP.jl v0.9.6 Hecke.jl v0.18.14 Nemo.jl v0.34.4 Polymake.jl v0.9.2 Singular.jl v0.18.3 building on: Antic_jll v0.201.500+0 Arb_jll v200.2300.0+0 Calcium_jll v0.401.100+0 FLINT_jll v200.900.6+0 GAP_jll v400.1200.200+1 Singular_jll v403.201.1+0 libpolymake_julia_jll v0.9.2+0 libsingular_julia_jll v0.30.0+1 polymake_jll v400.900.0+0 See `]st -m` for a full list of dependencies. Julia Version 1.9.0 Commit 8e630552924 (2023-05-07 11:25 UTC) Platform Info: OS: macOS (x86_64-apple-darwin22.4.0) CPU: 16 × Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, skylake) Threads: 1 on 16 virtual cores Official https://julialang.org/ release
-- Reply to this email directly or view it on GitHub: https://github.com/oscar-system/Oscar.jl/issues/2435 You are receiving this because you are subscribed to this thread.
Message ID: @.***>
So for the moment we should add a check. What about going to a primitive element on the Oscar side and then into Singular and back?
On Wed, May 31, 2023 at 12:37:21AM -0700, Janko Boehm wrote:
So for the moment we should add a check. What about going to a primitive element on the Oscar side and then into Singular and back? Can be done - but the check in the singular kernel has to be done independently.
for k a number field of any type different from AnticNumberField ks, ms = absolute_simple_field(k) will get an isomorphic AnticNumberField
map_coefficients(pseudo_inv(ms), f) will map a poly over k to one over ks map_coefficients(ms, g) does the other direction. However, for an ideal (and the back direction!) the parent should also be supplied:
map_coefficients(ms, g, parent = parent(f)) or similar
-- Reply to this email directly or view it on GitHub: https://github.com/oscar-system/Oscar.jl/issues/2435#issuecomment-1569655524 You are receiving this because you commented.
Message ID: @.***>
At least the following functions have a problem here:
radical(I) is_reduced(quo(R, I)[1]) normalization(quo(R, I)[1]) is_normal(quo(R, I)[1])
primary_decomposition(I::MPolyIdeal; algorithm = :GTZ) primary_decomposition(I::MPolyIdeal; algorithm = :SY)
minimal_primes(I, algorithm = :GTZ) minimal_primes(I, algorithm = :charSets)
equidimensional_decomposition_weak(I) equidimensional_decomposition_radical(I) equidimensional_hull(I) equidimensional_hull_radical(I)
noether_normalization(quo(R, I)[1])
The function
minimal_primes(I, algorithm = :charSets)
does actually not even work here:
T, t = polynomial_ring(QQ, "t") K, a = number_field(t^2 - 2, "a"); R, (x,y) = polynomial_ring(K,["x","y"]); I = ideal(R,[x^2-a])
Not all functions on the list require factorization (square_free decomposition).
Radical computation for an ideal over a non-simple number field yields a segfault.
Should this give a not implemented?
Output:
System: