Macaulay2 / Macaulay2/M2

solve doesn't work for non-square matrix over inexact field

Open
#3,252 0 comments 0 reactions 1 assignee View on GitHub

@mikestillman is already working on this.

Since Sep 5, 2024.

Linear Algebra
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

This seems not right:

Say we have a random matrix:

i1 : A = random(RR^3, RR^3)
o1 = | .941075 .728174 .559197 |
     | .143775 .110624 .482643 |
     | .531091 .126337 .393081 |

Surely the first column is in the column span of A:

i2 : solve(A, A_{0}) -- this is fine

o2 = | 1           |
     | 8.00436e-17 |
     | 2.8623e-17  |

But somehow there's no answer if we remove the last column?

i3 : solve(A_{0,1}, A_{0}) -- why no answer?

i4 : solve(A_{0,1,0}, A_{0}) -- why no answer?

What's more bizarre, very occasionally the last line above does return an answer:

i14 : A = random(RR^3, RR^3)

o14 = | .915419 .759446 .469346 |
      | .455108 .922644 .920515 |
      | .716856 .999732 .327083 |

                 3         3
o14 : Matrix RR    <-- RR
               53        53

i18 : solve(A_{0,1}, A_{0}) -- why no answer?

i19 : solve(A_{0,1,0}, A_{0}) -- but this works?!?!

o19 = | .498589     |
      | -1.4841e-17 |
      | .501411     |

                 3         1
o19 : Matrix RR    <-- RR
               53        53

The trend is pretty much the flip of a coin:

i53 : tally apply(100, i -> (
      	A := random(RR^3, RR^3);
      	null === solve(A_{0,1}, A_{0}),
      	null === solve(A_{0,1,0}, A_{0})
      	))

o53 = Tally{(true, false) => 41}
            (true, true) => 59

This is not an issue over QQ, but seems to be even more random over CC:

i50 : tally apply(100, i -> (
      	A := random(CC^3, CC^3);
      	null === solve(A_{0,1}, A_{0}),
      	null === solve(A_{0,1,0}, A_{0})
      	))

o50 = Tally{(false, false) => 3}
            (true, false) => 85
            (true, true) => 12

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.