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

coefficients not returning coefficients in the coefficient ring #3155

Open
pzinn opened this issue Mar 15, 2024 · 2 comments
Open

coefficients not returning coefficients in the coefficient ring #3155

pzinn opened this issue Mar 15, 2024 · 2 comments

Comments

@pzinn
Copy link
Collaborator

pzinn commented Mar 15, 2024

I recently got reminded of an issue that's been bothering me for years:
why does coefficients return the coefficients of a polynomial not as elements of the coefficient ring, but rather of the ring itself? this makes no sense to me. Maybe at some point promote didn't work well and so it was more convenient this way?
Example borrowed from the doc:

i1 : R=QQ[a,b,c,d,e,f]

o1 = R

o1 : PolynomialRing

i2 : S=R[x,y]

o2 = S

o2 : PolynomialRing

i3 : F=a*x^2+b*x*y+c*y^2

        2              2
o3 = a*x  + b*x*y + c*y

o3 : S

i4 : (M,C)=coefficients F

o4 = (| x2 xy y2 |, {2, 0} | a |)
                    {2, 0} | b |
                    {2, 0} | c |

o4 : Sequence

i5 : C -- should be in R but is instead in S, forcing pointless "lift"

o5 = {2, 0} | a |
     {2, 0} | b |
     {2, 0} | c |

             3      1
o5 : Matrix S  <-- S

tangentially related: #2490

@pzinn
Copy link
Collaborator Author

pzinn commented Mar 15, 2024

This issue is particularly bad with AssociativeAlgebras:

i1 : needsPackage"AssociativeAlgebras"

o1 = AssociativeAlgebras

o1 : Package

i2 : R=QQ<|x|>

o2 = R

o2 : FreeAlgebra

i3 : (last coefficients(1/3*x))_(0,0)

     1
o3 = -
     3

o3 : R

i4 : denominator oo
stdio:4:11:(3): error: no method found for applying denominator to:
                   1
     argument   :  - (of class R)
                   3

@pzinn
Copy link
Collaborator Author

pzinn commented Mar 20, 2024

In constrast, leadCoefficient does give the coefficient in the coefficient ring, as should be.

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

1 participant