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

singular_ring not working for finite prime fields #564

Closed
thofma opened this issue Jul 15, 2021 · 6 comments
Closed

singular_ring not working for finite prime fields #564

thofma opened this issue Jul 15, 2021 · 6 comments

Comments

@thofma
Copy link
Collaborator

thofma commented Jul 15, 2021

julia> Fx, = GF(fmpz(3))["x", "y"]
(Multivariate Polynomial Ring in x, y over Galois field with characteristic 3, AbstractAlgebra.Generic.MPoly{gfp_fmpz_elem}[x, y])

julia> Oscar.singular_ring(Fx)
ERROR: pointer_from_objref cannot be used on immutable objects
Stacktrace:
  [1] error(s::String)
[...]

@tthsqe12

@tthsqe12
Copy link
Contributor

Well, you can't use n_unknown on immutables.
This is a well-known fact. :)

#singular cannot use immutable structs
mutable struct QabField <: Nemo.Field # union of cyclotomic fields
end

Unfortunately, singular offers no native analogue of gfp_fmpz_elem, so either we make gfp_fmpz_elem mutable, or make a mutable wrapper of it?

@thofma
Copy link
Collaborator Author

thofma commented Jul 15, 2021

How about not creating an n_unkown? Or is there no corresponding Singular type?

@tthsqe12
Copy link
Contributor

Unfortunately, singular offers no native analogue of gfp_fmpz_elem

@thofma thofma changed the title singula_ring not working for finite prime fields singular_ring not working for finite prime fields Jul 15, 2021
@thofma
Copy link
Collaborator Author

thofma commented Jul 15, 2021

What about the ResidueRing trick from here: #528?

@tthsqe12
Copy link
Contributor

No - then Singular doesn't know it is a field.

@tthsqe12
Copy link
Contributor

This is now fixed as:

julia> Fx, = GF(fmpz(3))["x", "y"]
(Multivariate Polynomial Ring in x, y over Galois field with characteristic 3, AbstractAlgebra.Generic.MPoly{gfp_fmpz_elem}[x, y])

julia> Oscar.singular_ring(Fx)
Singular Polynomial Ring (Coeffs(17)),(x,y),(lp(2),C)

julia> typeof(gen(ans, 1))
Singular.spoly{Singular.n_FieldElem{Singular.FieldElemWrapper{Nemo.GaloisFmpzField, gfp_fmpz_elem}}}

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

2 participants