Macaulay2 / Macaulay2/M2

bad behavior (bug): substitute using a matrix of values

Open
#113 6 comments 0 reactions 0 assignees View on GitHub
Core
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

substituting using a matrix (not Options, not a ring map) can still give the wrong/unexpected answer. Here are two situations (one over QQ, the other over CC_53).

It should be easy to fix this, Dan, as the "Options" version was changed to produce these correct values recently.

```
R = QQ[x]
m = matrix{{1/2 * x}}
sub(m, {x=>1_ZZ}) -- is correct behavior
sub(m, matrix{{1}}) -- just wrong. Should give behavior on previous line
f = map(ZZ, R, {1}) -- REALLY: should give an error: cannot construct ring map from R --> ZZ.
f m -- wrong behavior currently. But if f cannot be constructed, this will not be a problem
g = map(QQ[y], R, {1}) -- this one works now, and is the behavior we want
g m

R = CC[x]
m = matrix{{ii * x}}
sub(m, {x=>1_ZZ}) -- is correct behavior
sub(m, matrix{{1}}) -- just wrong. Should give behavior on previous line
f = map(RR_53, R, {1}) -- REALLY: should give an error.
f m -- crashes in linalg branch, gives 0 in 1.6. Both are wrong...!
g = map(CC_53[y], R, {1}) -- this one works now, and is the behavior we want
g m
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the two matrix-substitution examples over QQ and CC_53, comparing substitution with the working Options and ring-map cases. Trace the substitution and ring-map behavior involved in those examples; done means matrix substitution matches the scalar substitution and invalid maps produce errors rather than incorrect values or crashes.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.