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

Allow (::Singular.N_FField)(::fmpq_poly) ? #556

Open
YueRen opened this issue Feb 6, 2022 · 2 comments
Open

Allow (::Singular.N_FField)(::fmpq_poly) ? #556

YueRen opened this issue Feb 6, 2022 · 2 comments

Comments

@YueRen
Copy link
Member

YueRen commented Feb 6, 2022

Not sure whether this should be allowed, but when casting a Oscar polynomial to a Singular polynomial over the rationals, Singular does not care whether the Oscar polynomial was defined over QQ or ZZ:

Kx,(x0,x1,x2,x3,x4,x5) = PolynomialRing(QQ,6);
g = 2*x1+(2^2+1)*x2+(2^3+2)*x3+(2^4+2^2+1)*x4+(2^5+2^3+2)*x5;
S,_ = Singular.PolynomialRing(singular_ring(K),map(string,symbols(Kx)))
S(g) # works perfectly

Rx,(x0,x1,x2,x3,x4,x5) = PolynomialRing(ZZ,6);
g = 2*x1+(2^2+1)*x2+(2^3+2)*x3+(2^4+2^2+1)*x4+(2^5+2^3+2)*x5;
S(g) # works perfectly as well

In contrast, when casting a Oscar polynomial to a Singular polynomial over the rational function field, Singular complains if the Oscar polynomial was defined over a univariate polynomial ring:

K,s = RationalFunctionField(QQ,"s");
Kx,(x0,x1,x2,x3,x4,x5) = PolynomialRing(K,6);
g = s*x1+(s^2+1)*x2+(s^3+s)*x3+(s^4+s^2+1)*x4+(s^5+s^3+s)*x5;
S,_ = Singular.PolynomialRing(singular_ring(K),map(string,symbols(Kx)))
S(g) # works perfectly

R,s = PolynomialRing(QQ,"s")
Rx,(x0,x1,x2,x3,x4,x5) = PolynomialRing(R,6);
g = s*x1+(s^2+1)*x2+(s^3+s)*x3+(s^4+s^2+1)*x4+(s^5+s^3+s)*x5;
S(g) # ERROR
S(change_base_ring(K,g)) # workaround

For the sake of consistency, I think that (::Singular.N_FField)(::fmpq_poly) should be allowed. Are there any reasons why function fields should behave differently to rationals (honest question)?

@fingolfin
Copy link
Member

Most likely this is simply an oversight. PR welcome:-)

@thofma
Copy link
Collaborator

thofma commented Feb 6, 2022

We will take care of it when overhauling thesingular_ring, see also oscar-system/Oscar.jl#975 and oscar-system/Oscar.jl#976. It is a broken design, so I would not spend too much time on it.

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

3 participants