Skip to content

Commit 0bd7c89

Browse files
bkhollerd-torrance
authored andcommitted
fixed tests in trimBasisInDegree
1 parent 8258356 commit 0bd7c89

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

M2/Macaulay2/packages/MultigradedImplicitization.m2

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ R = QQ[x_1..x_(numcols A)];
112112
S = QQ[t_1..t_(numrows A)];
113113
F = map(S, R, apply(numcols(A), i -> S_(flatten entries A_i)));
114114
dom = newRing(R, Degrees => A);
115-
B = basis(2, source F) | basis(3, source F);
115+
use R;
116+
B = basis(1, source F) | basis(2, source F) | basis(3, source F);
116117
lats = unique apply(flatten entries B, i -> degree(sub(i, dom)));
117-
basisHash = hashTable apply(lats, deg -> {deg, basis(deg, dom)});
118-
assert(trimBasisInDegree({2,1,0,1,1}, dom, {x_2*x_4-x_1*x_5, x_3*x_4-x_1*x_6, x_3*x_5-x_2*x_6}, basisHash) == matrix {{x_2*x_3*x_4}});
118+
basisHash = hashTable apply(lats, deg -> {deg, sub(basis(deg, dom), R)});
119+
G = {x_2*x_4-x_1*x_5, x_3*x_4-x_1*x_6, x_3*x_5-x_2*x_6}
120+
assert(trimBasisInDegree({2,1,0,1,1}, dom, G, basisHash) == matrix {{x_2*x_3*x_4}});
119121
///
120122

121123

@@ -480,12 +482,13 @@ Description
480482
Example
481483
A = matrix {{1,1,1,0,0,0,0,0,0}, {0,0,0,1,1,1,0,0,0}, {0,0,0,0,0,0,1,1,1}, {1,0,0,1,0,0,1,0,0}, {0,1,0,0,1,0,0,1,0}};
482484
R = QQ[x_1..x_(numcols A)];
485+
dom = newRing(R, Degrees => A);
486+
use R;
483487
S = QQ[t_1..t_(numrows A)];
484488
F = map(S, R, apply(numcols(A), i -> S_(flatten entries A_i)));
485-
dom = newRing(R, Degrees => A);
486-
B = basis(2, source F) | basis(3, source F);
489+
B = basis(1, source F) | basis(2, source F) | basis(3, source F);
487490
lats = unique apply(flatten entries B, i -> degree(sub(i, dom)));
488-
basisHash = hashTable apply(lats, deg -> {deg, basis(deg, dom)});
491+
basisHash = hashTable apply(lats, deg -> {deg, sub(basis(deg, dom), R)});
489492
trimBasisInDegree({2,1,0,1,1}, dom, {x_2*x_4-x_1*x_5, x_3*x_4-x_1*x_6, x_3*x_5-x_2*x_6}, basisHash)
490493
Text
491494
Observe that after trimming we get a smaller monomial basis for this homogeneous component. The full monomial basis is

0 commit comments

Comments
 (0)