coefficients not returning coefficients in the coefficient ring
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the `coefficients` entry point and reproduce the Macaulay2 example in the issue; also review the tangential issue #2490. Done means the returned coefficient matrix contains elements of the coefficient ring R rather than the larger polynomial ring S, without requiring the reported pointless lift.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100