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 ishomogeneous for more types of polynomials #909

Closed
YueRen opened this issue Dec 17, 2021 · 3 comments
Closed

allow ishomogeneous for more types of polynomials #909

YueRen opened this issue Dec 17, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@YueRen
Copy link
Member

YueRen commented Dec 17, 2021

This works:

julia> K = PadicField(2,2)
Field of 2-adic numbers

julia> R, (x1,x2) = PolynomialRing(K, "x".*string.(1:2))
(Multivariate Polynomial Ring in x1, x2 over Field of 2-adic numbers, AbstractAlgebra.Generic.MPoly{padic}[x1, x2])

julia> I = ideal([x1+x2])
ideal(x1 + x2)

julia> ishomogeneous(I[1])
true

This doesn't:

julia> R, (x1,x2) = PolynomialRing(QQ, "x".*string.(1:2))
(Multivariate Polynomial Ring in x1, x2 over Rational Field, fmpq_mpoly[x1, x2])

julia> I = ideal([x1+x2])
ideal(x1 + x2)

julia> ishomogeneous(I[1])
ERROR: MethodError: no method matching ishomogeneous(::fmpq_mpoly)
Closest candidates are:
  ishomogeneous(::AbstractAlgebra.Generic.MPoly{T}) where T<:RingElement at /home/ren/oscar/AbstractAlgebra.jl/src/generic/MPoly.jl:653
  ishomogeneous(::AbstractAlgebra.Generic.UnivPoly) at /home/ren/oscar/AbstractAlgebra.jl/src/generic/UnivPoly.jl:141
  ishomogeneous(::Oscar.SubQuoElem_dec) at /home/ren/oscar/Oscar.jl/src/Modules/FreeModules-graded.jl:931
  ...
Stacktrace:
 [1] top-level scope
   @ REPL[103]:1
@YueRen YueRen added the bug Something isn't working label Dec 17, 2021
@wdecker
Copy link
Collaborator

wdecker commented Dec 17, 2021

@YueRen This is not a bug, this is a design decision which could be changed. Let us talk about this and #908 via skype, phone, gathertown ...

@wdecker
Copy link
Collaborator

wdecker commented Dec 17, 2021

julia> R, (x1,x2) = PolynomialRing(QQ, "x".*string.(1:2))
(Multivariate Polynomial Ring in x1, x2 over Rational Field, fmpq_mpoly[x1, x2])

julia> R, (x1,x2) = grade(R)
(Multivariate Polynomial Ring in x1, x2 over Rational Field graded by
x1 -> [1]
x2 -> [1], MPolyElem_dec{fmpq, fmpq_mpoly}[x1, x2])

julia> I = ideal([x1+x2])
ideal(x1 + x2)

julia> ishomogeneous(I[1])
true

@YueRen
Copy link
Member Author

YueRen commented Jan 23, 2022

I am closing the issue for now, because it is not as clear-cut as I imagined when I opened it. I don't think now is the time to discuss is (as in: there are other much more important tasks and this is just a minor issue with an easy workaround whose proper solution requires a lot of discussion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants