Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flint integers bug? #57

Closed
heiderich opened this issue Jul 31, 2018 · 7 comments
Closed

Flint integers bug? #57

heiderich opened this issue Jul 31, 2018 · 7 comments

Comments

@heiderich
Copy link
Contributor

Is this a bug?

$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.4 (2018-07-09 19:09 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-pc-linux-gnu

julia> using Cxx

julia> using Singular

Welcome to AbstractAlgebra version 0.0.9

AbstractAlgebra comes with absolutely no warranty whatsoever


Welcome to Nemo version 0.8.5

Nemo comes with absolutely no warranty whatsoever


julia> K = Nemo.ZZ
Integer Ring

julia> R,(x,y) = Singular.PolynomialRing(K, ["x","y"])
(Singular Polynomial Ring (Coeffs(18)),(x,y),(dp(2),C), Singular.spoly{Singular.n_unknown{Nemo.fmpz}}[x, y])

julia> I = [-x^4+2*x^2+y^4-y^2, -4*x^3*y-4*x*y^3+6*x*y]
2-element Array{Singular.spoly{Singular.n_unknown{Nemo.fmpz}},1}:
 -x^4+y^4+2*x^2-y^2    
 -4*x^3*y-4*x*y^3+6*x*y

julia> IAsIdeal = Ideal(R, I)
Singular Ideal over Singular Polynomial Ring (Coeffs(18)),(x,y),(dp(2),C) with generators (-x^4+y^4+2*x^2-y^2, -4*x^3*y-4*x*y^3+6*x*y)

julia> std(IAsIdeal)
ERROR: KeyError: key 0x00000000007fa7b0 not found
Stacktrace:
 [1] getindex at ./dict.jl:474 [inlined]
 [2] number_pop!(::Dict{UInt64,Singular.libSingular.live_cache}, ::Ptr{Void}) at /home/florian/.julia/v0.6/Singular/src/libsingular/coeffs.jl:230
 [3] fmpzExtGcd(::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:snumber},(false, false, false)},(false, false, false)}, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:snumber},(false, false, false)},(false, false, false)}, ::Ptr{Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:snumber},(false, false, false)},(false, false, false)}}, ::Ptr{Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:snumber},(false, false, false)},(false, false, false)}}, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:n_Procs_s},(false, false, false)},(false, false, false)}) at /home/florian/.julia/v0.6/Singular/src/libsingular/flint/fmpz.jl:175
 [4] #id_Std#2(::Bool, ::Function, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:sip_sideal},(false, false, false)},(false, false, false)}, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:ip_sring},(false, false, false)},(false, false, false)}) at /home/florian/.julia/v0.6/Singular/src/libsingular/ideals.jl:131
 [5] (::Singular.libSingular.#kw##id_Std)(::Array{Any,1}, ::Singular.libSingular.#id_Std, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:sip_sideal},(false, false, false)},(false, false, false)}, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{:ip_sring},(false, false, false)},(false, false, false)}) at ./<missing>:0
 [6] #std#23(::Bool, ::Function, ::Singular.sideal{Singular.spoly{Singular.n_unknown{Nemo.fmpz}}}) at /home/florian/.julia/v0.6/Singular/src/ideal/ideal.jl:330
 [7] std(::Singular.sideal{Singular.spoly{Singular.n_unknown{Nemo.fmpz}}}) at /home/florian/.julia/v0.6/Singular/src/ideal/ideal.jl:329

@wbhart
Copy link
Contributor

wbhart commented Jul 31, 2018 via email

@hannes14
Copy link
Member

Singular.n_unknown currently only supports fields - this maybe part of the problem

@wbhart
Copy link
Contributor

wbhart commented Jul 31, 2018 via email

@rfourquet
Copy link
Contributor

This seems to be fixed?

@wbhart
Copy link
Contributor

wbhart commented Oct 13, 2020

I don't recall. Does it seem to give the right answer now? I do recall explaining how to fix it. And Andreas wrote something.

@rfourquet
Copy link
Contributor

I didn't check if this gives the right answer, but at least it doesn't error:

julia> using Singular

julia> import Nemo

julia> K = Nemo.ZZ
Integer Ring

julia> R,(x,y) = Singular.PolynomialRing(K, ["x","y"])
(Singular Polynomial Ring (Coeffs(17)),(x,y),(dp(2),C), spoly{Singular.n_unknown{Nemo.fmpz}}[x, y])

julia> I = [-x^4+2*x^2+y^4-y^2, -4*x^3*y-4*x*y^3+6*x*y]
2-element Vector{spoly{Singular.n_unknown{Nemo.fmpz}}}:
 -x^4 + y^4 + 2*x^2 - y^2
 -4*x^3*y - 4*x*y^3 + 6*x*y

julia> IAsIdeal = Ideal(R, I)
Singular Ideal over Singular Polynomial Ring (Coeffs(17)),(x,y),(dp(2),C) with generators (-x^4+y^4+2*x^2-y^2, -4*x^3*y-4*x*y^3+6*x*y)

julia> std(IAsIdeal)
Singular Ideal over Singular Polynomial Ring (Coeffs(17)),(x,y),(dp(2),C) with generators (6*x*y, 2*x^3*y+2*x*y^3, x^4-y^4-2*x^2+y^2, 12*y^5-12*y^3, 2*x^2*y^3-4*y^5-2*x^2*y+4*y^3)

@wbhart
Copy link
Contributor

wbhart commented Oct 13, 2020

Then we close the ticket.

@wbhart wbhart closed this as completed Oct 13, 2020
fingolfin pushed a commit to fingolfin/Singular.jl that referenced this issue Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants