Macaulay2 / Macaulay2/M2

gfanInterface: Another issue with gfanConvertToNewRing

Open
#3,601 5 comments 0 reactions 0 assignees View on GitHub
Interfaces
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

While fighting with #3600 I discovered a more exotic bug, unrelated to NCAlgebra, but probably coming from the same method. To produce a minimal example I copied some code from MultigradedImplicitization.m2 (@bkholler):

```
needsPackage "gfanInterface"

maxGrading = method(Options => {ReturnTargetGrading => false});
maxGrading RingMap := Matrix => opts -> F -> (
dom := source F;
codom := target F;
elimRing := dom ** codom;
X := vars dom;
n := numgens dom;
elimIdeal := ideal(sub(X, elimRing) - sub(F(X), elimRing));
linealitySpace(gfanHomogeneitySpace(elimIdeal))
)

R1 = QQ[x1]
R2 = QQ[s1,s2]
maxGrading(map(R1,R2,{x1,x1^2})) -- works fine once
maxGrading(map(R1,R2,{x1,x1^2})) -- error
```
Here, the error message is
```
error: no method found for applying promote to:
argument 1 : x1 (of class QQ {x1, x2, x3})
argument 2 : R1
```
The problem seems to be the variable name "x1", which is also used inside gfanConvertToNewRing. ~~Interestingly, calling gfanHomogeneitySpace directly, e.g. does not produce any errors.~~ It does, too.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the minimal Macaulay2 example in the issue and compare the first and second calls to maxGrading, then trace gfanHomogeneitySpace and gfanConvertToNewRing around the promote error. Done means the repeated example runs successfully, including when the ring variable is named x1.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.