Macaulay2 / Macaulay2/M2

matrix of exponents instead of monomials from basis

Open
#3,459 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there a fast (i.e. implemented in the engine) routine for the following? (or its transpose)
```m2
exponentMatrix = B -> transpose matrix apply(numcols B, c -> first exponents B_(0,c))

-- example:
i17 : exponentMatrix basis(3, kk[x,y,z])

o17 = | 3 2 2 1 1 1 0 0 0 0 |
| 0 1 0 2 1 0 3 2 1 0 |
| 0 0 1 0 1 2 0 1 2 3 |

3 10
o17 : Matrix ZZ <-- ZZ
```
The one liner above obviously works, but when `B` is a matrix of basis monomials with tens thousands of columns, it gets quite slow (e.g. the basis itself takes a couple of seconds but computing the exponent matrix takes a minute!!)

cc: @mikestillman

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.

Research direction

Start by locating the engine implementation behind basis and monomial exponent extraction. Compare the existing one-line matrix operation with the requested routine or its transpose, using the issue's example as a correctness check. Done means an implemented routine produces the same exponent matrix and avoids the reported slowdown on bases with tens of thousands of columns.

Written by the indexing model from the issue text.

Assessment

Domain
performance, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.