You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 => optionsminors++ {Prefix => null})
minors'(ZZ, Matrix) := opts -> (n, m) -> (
if opts.Prefix === nullthenreturnminors(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));
idealapply(rowsets ** colsets, coords -> detsubmatrix(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 |
24
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.
The text was updated successfully, but these errors were encountered:
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:Example:
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.The text was updated successfully, but these errors were encountered: