I would like to make some modifications to the library to test out an idea.
Most things I've been able to figure out by looking at other sections of the code, but I am having trouble understanding how the monomial ordering works when dealing with syzygy components.
In idLiftStd it makes a new ring to allow calculating syzygies and/or tracing how the computed ideal relates to the initial ideal.
For example my ring initially looks like (printed using "rWrite(currRing, TRUE)" )
Code:
// coefficients: QQ
// number of vars : 54
// block 1 : ordering dp
// : names w0100 w0101 w0102 w0110 w0111 w0112 w0120 w0121 w0122 w0200 w0201 w0202 w0210 w0211 w0212 w0220 w0221 w0222 w0300 w0301 w0302 w0310 w0311 w0312 w0320 w0321 w0322 w1200 w1201 w1202 w1210 w1211 w1212 w1220 w1221 w1222 w1300 w1301 w1302 w1310 w1311 w1312 w1320 w1321 w1322 w2300 w2301 w2302 w2310 w2311 w2312 w2320 w2321 w2322
// block 2 : ordering C
Then before calling idPrepare the ring is changed to:
Code:
// coefficients: QQ
// number of vars : 54
// block 1 : ordering s syz_comp: 1
// block 2 : ordering dp
// : names w0100 w0101 w0102 w0110 w0111 w0112 w0120 w0121 w0122 w0200 w0201 w0202 w0210 w0211 w0212 w0220 w0221 w0222 w0300 w0301 w0302 w0310 w0311 w0312 w0320 w0321 w0322 w1200 w1201 w1202 w1210 w1211 w1212 w1220 w1221 w1222 w1300 w1301 w1302 w1310 w1311 w1312 w1320 w1321 w1322 w2300 w2301 w2302 w2310 w2311 w2312 w2320 w2321 w2322
// block 3 : ordering C
This change appears to make the monomial ordering first group by component if the component is 1, then order by dp.
For example I see a polynomial ordered like this:
Code:
w0312*w1322*w2322*gen(1)+w0302*w1302*w2300*gen(55)-w0312*w1302*w2300*gen(28)-w0302*w1322*w2300*gen(37)+w0312*w1322*w2300*gen(10)+w0302*w1300*w2302*gen(55)-w0312*w1300*w2302*gen(28)+w0300*w1302*w2302*gen(55)+w0302*w1302*w2302*gen(53)-w0310*w1302*w2302*gen(28)-w0312*w1302*w2302*gen(26)-w0302*w1320*w2302*gen(37)+w0312*w1320*w2302*gen(10)-w0300*w1322*w2302*gen(37)-w0302*w1322*w2302*gen(35)+w0310*w1322*w2302*gen(10)+w0312*w1322*w2302*gen(8)-w0302*w1302*w2320*gen(49)+w0312*w1302*w2320*gen(22)+w0302*w1322*w2320*gen(31)-w0312*w1322*w2320*gen(4)-w0302*w1300*w2322*gen(49)+w0312*w1300*w2322*gen(22)-w0300*w1302*w2322*gen(49)-w0302*w1302*w2322*gen(47)+w0310*w1302*w2322*gen(22)+w0312*w1302*w2322*gen(20)+w0302*w1320*w2322*gen(31)-w0312*w1320*w2322*gen(4)+w0300*w1322*w2322*gen(31)+w0302*w1322*w2322*gen(29)-w0310*w1322*w2322*gen(4)-w0312*w1322*w2322*gen(2)
To test my understanding (and make the output a bit nicer to read), I tried to change this to order by all syzygy components first, then order by dp between terms with the same syzygy component.
So in the example above, this would place the multiple terms with gen(4) next to each other in the ordering.
Based on how the new ring is setup in the code, as a quick manual test I tried inserting the following right before the call to idGroebner in idPrepare:
Code:
rSetSyzComp(82, currRing);
rChangeCurrRing(currRing); // updates some globals
The ring does show a change:
Code:
// coefficients: QQ
// number of vars : 54
// block 1 : ordering s syz_comp: 82
// block 2 : ordering dp
// : names w0100 w0101 w0102 w0110 w0111 w0112 w0120 w0121 w0122 w0200 w0201 w0202 w0210 w0211 w0212 w0220 w0221 w0222 w0300 w0301 w0302 w0310 w0311 w0312 w0320 w0321 w0322 w1200 w1201 w1202 w1210 w1211 w1212 w1220 w1221 w1222 w1300 w1301 w1302 w1310 w1311 w1312 w1320 w1321 w1322 w2300 w2301 w2302 w2310 w2311 w2312 w2320 w2321 w2322
// block 3 : ordering C
However, the polynomials created during the groebner calculation still have the same monomial ordering as before.
I am clearly misunderstanding something.
How do I specify the ring to order by all syzygy components first, then dp for comparing between monomials with the same component?
I am also confused about intention regarding the syz_comp parameter being different in various objects during a groebner calculation (the ring reports syz_comp = 1, while the slimgb algorithm has syz_comp = 82, and various function have syz_comp parameters which are sometimes 1 and sometimes 82). So likely there are multiple meanings being given to "syz_comp" that depend on context. So any clarification would be appreciated.
(I've already been able to greatly speed up some large liftstd calculations, but my changes are quite hacky at the moment, so I'm trying to get a better understanding of how to do things as the code design intended.)