Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minors with prescribed rows or columns #1705

Open
mahrud opened this issue Dec 17, 2020 · 0 comments
Open

Minors with prescribed rows or columns #1705

mahrud opened this issue Dec 17, 2020 · 0 comments

Comments

@mahrud
Copy link
Member

mahrud commented Dec 17, 2020

Is there an easy way to compute the ideal of minors that include a specific set of rows or columns? I tried to think of a way to do this incrementally; e.g. exclude those rows and columns, find the minors, then add in one row or column and update the minors. Perhaps there's a smart way to do this, but I couldn't think of it, so I wrote this piece of code that I think should become a part of the minors command if there isn't a better way to do it:

minors' = method(Options => options minors ++ {Prefix => null})
minors'(ZZ, Matrix) := opts -> (n, m) -> (
    if opts.Prefix === null then return minors(n, m, opts);
    -- rows and columns to force in the minors
    -- TODO: implement general type checking, e.g. instance({2:{ZZ}}, opts.Prefix)
    (rows, cols) := (set opts.Prefix#0, set opts.Prefix#1);
    rowsets := apply(subsets(set(0..numrows m - 1) - rows, n - #rows), r -> toList(r + rows));
    colsets := apply(subsets(set(0..numcols m - 1) - cols, n - #cols), c -> toList(c + cols));
    ideal apply(rowsets ** colsets, coords -> det submatrix(m, coords#0, coords#1)))

Example:

i2 : R = QQ[a..z];

i3 : m = genericMatrix(R, 2, 4)

o3 = | a c e g |
     | b d f h |

             2       4
o3 : Matrix R  <--- R

i4 : minors'(2, m, Prefix => {{}, {0}})

o4 = ideal (- b*c + a*d, - b*e + a*f, - b*g + a*h)

It doesn't take advantage of the engine's rawMinors routine, but still might be useful. It is likely also implemented by others, which is why I'm asking here to see if there is a better implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant