i1 : S = QQ[a, b, c, d]; 
i2 : I = monomialIdeal(a^2, a*b, b^3, a*c)

                     2        3
o2 = monomialIdeal (a , a*b, b , a*c)

o2 : MonomialIdeal of S
i3 : J = monomialIdeal{a^2, a*b, b^2}

                     2        2
o3 = monomialIdeal (a , a*b, b )

o3 : MonomialIdeal of S
i4 : monomialIdeal(a^2+a*b, a*b+3, b^2+d)

                     2        2
o4 = monomialIdeal (a , a*b, b )

o4 : MonomialIdeal of S
i5 : K = ideal(a^2, b^2, a*b+b*c)

             2   2
o5 = ideal (a , b , a*b + b*c)

o5 : Ideal of S
i6 : monomialIdeal K

                     2        2     2
o6 = monomialIdeal (a , a*b, b , b*c )

o6 : MonomialIdeal of S
i7 : monomialIdeal gens K

                     2        2
o7 = monomialIdeal (a , a*b, b )

o7 : MonomialIdeal of S
i8 : isMonomialIdeal K

o8 = false
i9 : isMonomialIdeal ideal(a^5, b^2*c, d^11)

o9 = true
i10 : I+J

                      2        2
o10 = monomialIdeal (a , a*b, b , a*c)

o10 : MonomialIdeal of S
i11 : fvector = I -> (
           R := (ring I)/I;
           d := dim R;
           N := poincare R;
           t := first gens ring N;
           while 0 == substitute(N, t => 1) do N = N // (1-t);
           h := apply(reverse toList(0..d), i -> N_(t^i));
           f := j -> sum(0..j+1, i -> binomial(d-i, j+1-i)*h#(d-i));
           apply(toList(0..d-1), j -> f(j)));
i12 : S = QQ[x_1 .. x_6];
i13 : octahedron = monomialIdeal(x_1*x_2, x_3*x_4, x_5*x_6)

o13 = monomialIdeal (x x , x x , x x )
                      1 2   3 4   5 6

o13 : MonomialIdeal of S
i14 : fvector octahedron

o14 = {6, 12, 8}

o14 : List
i15 : simplicial2sphere = v -> ( 
           S := QQ[x_1..x_v]; 
           if v === 4 then monomialIdeal product gens S 
           else ( 
                L := {};
                scan(1..v-4, i -> L = L | apply(v-i-3, 
                          j -> x_i*x_(i+j+4))); 
                scan(2..v-3, i -> L = L | {x_i*x_(i+1)*x_(i+2)}); 
                monomialIdeal L));
i16 : apply({4,5,6,7,8}, j -> fvector simplicial2sphere(j))

o16 = {{4, 6, 4}, {5, 9, 6}, {6, 12, 8}, {7, 15, 10}, {8, 18, 12}}

o16 : List
i17 : supp = r -> select(gens ring r, e -> r % e == 0);
i18 : monomialDecompose = method();
i19 : monomialDecompose List := L -> (
           P := select(L, I -> all(first entries gens I, 
                     r -> #supp(r) < 2) === false);
           if #P > 0 then (
                I := first P;
                m := first select(first entries gens I, 
                     r -> #supp(r) > 1);
                E := first exponents m;
                i := position(E, e -> e =!= 0);
                r1 := product apply(E_{0..i}, (gens ring I)_{0..i}, 
                     (j, r) -> r^j);
                r2 := m // r1;
                monomialDecompose(delete(I, L) | {I+monomialIdeal(r1),
                          I+monomialIdeal(r2)}))
           else L);
i20 : monomialDecompose MonomialIdeal := I -> monomialDecompose {I};
i21 : S = QQ[a,b,c,d];
i22 : I = monomialIdeal(a^3*b, a^3*c, a*b^3, b^3*c, a*c^3, b*c^3)

                      3      3   3    3      3     3
o22 = monomialIdeal (a b, a*b , a c, b c, a*c , b*c )

o22 : MonomialIdeal of S
i23 : P = monomialDecompose I;
i24 : scan(P, J -> << endl << J << endl);

monomialIdeal (b, c)

monomialIdeal (a, c)

                3   3   3
monomialIdeal (a , b , c )

monomialIdeal (a, b)

                3      3
monomialIdeal (a , b, c )

monomialIdeal (a, b)

                   3   3
monomialIdeal (a, b , c )
i25 : I == intersect(P)

o25 = true
i26 : code(dual, MonomialIdeal, List)

o26 = -- ../../../m2/monideal.m2:260-278
      dual(MonomialIdeal, List) := (I,a) -> ( -- Alexander dual
           R := ring I;
           X := gens R;
           aI := lcmOfGens I;
           if aI =!= a then (
                if #aI =!= #a 
                then error (
                     "expected list of length ",
                     toString (#aI));
                scan(a, aI, 
                     (b,c) -> (
                          if b<c then
                          error "exponent vector not large enough"
                          ));
                ); 
           S := R/(I + monomialIdeal apply(#X, i -> X#i^(a#i+1)));
           monomialIdeal contract(
                lift(syz transpose vars S, R), 
                product(#X, i -> X#i^(a#i))))
i27 : code(primaryDecomposition, MonomialIdeal)

o27 = -- ../../../m2/monideal.m2:286-295
      primaryDecomposition MonomialIdeal := (I) -> (
           R := ring I;
           aI := lcmOfGens I;
           M := first entries gens dual I;
           L := unique apply(#M, i -> first exponents M_i);
           apply(L, i -> monomialIdeal apply(#i, j -> ( 
                          if i#j === 0 then 0_R 
                          else R_j^(aI#j+1-i#j)
                          )))
           )
i28 : L = primaryDecomposition I;
i29 : scan(L, J -> << endl << J << endl);

                3   3   3
monomialIdeal (a , b , c )

monomialIdeal (b, c)

monomialIdeal (a, b)

monomialIdeal (a, c)
i30 : I == intersect L

o30 = true
i31 : treeIdeal = n -> (
           S = QQ[vars(0..n-1)];
           L := delete({}, subsets gens S);
           monomialIdeal apply(L, F -> (product F)^(n - #F +1)));
i32 : apply(2..6, i -> #primaryDecomposition treeIdeal i)

o32 = (2, 6, 24, 120, 720)

o32 : Sequence
i33 : minorsIdeal = (m,n,k) -> (
           S := QQ[x_1..x_(m*n), MonomialOrder => Lex];
           I := minors(k, matrix table(m, n, (i,j) -> x_(i*n+n-j)));
           forceGB gens I;
           I);
i34 : apply(2..8, i -> time codim monomialIdeal minorsIdeal(i,2*i,2))
     -- used 0.02 seconds
     -- used 0.05 seconds
     -- used 0.1 seconds
     -- used 0.36 seconds
     -- used 1.41 seconds
     -- used 5.94 seconds
     -- used 25.51 seconds

o34 = (3, 10, 21, 36, 55, 78, 105)

o34 : Sequence
i35 : erase symbol x;
i36 : stdPairs = I -> (
           S := ring I;
           X := gens S;
           std := {};
           J := I;
           while J != S do (
                w1 := 1_S;
                F := X;
                K := J;
                while K != 0 do (
                     g1 := (ideal mingens ideal K)_0;
                     x := first supp g1;
                     w1 = w1 * g1 // x;
                     F = delete(x, F);
                     K = K : monomialIdeal(g1 // x);
                     L := select(first entries gens K, 
                          r -> not member(x, supp r));
                     if #L > 0 then K = monomialIdeal L
                     else K = monomialIdeal 0_S;);
                w2 := w1;
                scan(X, r -> if not member(r, supp w1) or member(r, F)
                     then w2 = substitute(w2, {r => 1}));
                P := monomialIdeal select(X, r -> not member(r, F));
                if (I:(I:P) == P) and (all(std, p -> 
                          (w2 % (first p) != 0) or not
                          isSubset(supp(w2 // first p) | F, last p)))
                then std = std | {{w2, F}};
                J = J + monomialIdeal(w1););
           std);
i37 : S = QQ[x,y,z];
i38 : I = monomialIdeal(x*y^3*z, x*y^2*z^2, y^3*z^2, y^2*z^3);

o38 : MonomialIdeal of S
i39 : scan(time stdPairs I, P -> << endl << P << endl);
     -- used 0.66 seconds

{y, {x, z}}

{1, {x, z}}

  2 2
{y z , {}}

{z, {y}}

  2
{y z, {x}}

{1, {x, y}}
i40 : code(standardPairs, MonomialIdeal, List)

o40 = -- ../../../m2/monideal.m2:318-341
      standardPairs(MonomialIdeal, List) := (I,D) -> (
           R := ring I;
           X := gens R;
           S := {};
           k := coefficientRing R;
           scan(D, L -> ( 
                     Y := X;
                     m := vars R;
                     Lset := set L;
                     Y = select(Y, r -> not Lset#?r);
                     m = substitute(m, apply(L, r -> r => 1));
                     -- using monoid to create ring to avoid 
                     -- changing global ring.
                     A := k (monoid [Y]);
                     phi := map(A, R, substitute(m, A));
                     J := ideal mingens ideal phi gens I;
                     Jsat := saturate(J, ideal vars A);
                     if Jsat != J then (
                          B := flatten entries super basis (
                               trim (Jsat / J));
                          psi := map(R, A, matrix{Y});
                          S = join(S, apply(B, b -> {psi(b), L}));
                          )));
           S)
i41 : time standardPairs I;
     -- used 0.83 seconds
i42 : permutohedronIdeal = n -> (
           S := QQ[X_1..X_n];
           monomialIdeal terms det matrix table(n ,gens S, 
                (i,r) -> r^(i+1)));
i43 : L = apply({2,3,4,5}, j -> standardPairs(permutohedronIdeal(j)));
i44 : apply(L, i -> #i)

o44 = {3, 10, 53, 446}

o44 : List
i45 : erase symbol x; erase symbol z;
i47 : toBinomial = (b, S) -> (
           pos := 1_S;
           neg := 1_S;
           scan(#b, i -> if b_i > 0 then pos = pos*S_i^(b_i)
                         else if b_i < 0 then neg = neg*S_i^(-b_i));
           pos - neg);
i48 : toricIdeal = (A, omega) -> (
           n := rank source A;
           S = QQ[x_1..x_n, Weights => omega, MonomialSize => 16];
           B := transpose matrix syz A;
           J := ideal apply(entries B, b -> toBinomial(b, S));
           scan(gens S, r -> J = saturate(J, r));
           J);
i49 : IP = (A, omega, beta) -> (
           std := standardPairs monomialIdeal toricIdeal(A, omega);
           n := rank source A;
           alpha := {};
           Q := first select(1, std, P -> (
                F := apply(last P, r -> index r);
                gamma := transpose matrix exponents first P;
                K := transpose syz (submatrix(A,F) | (A*gamma-beta));
                X := select(entries K, k -> abs last(k) === 1);
                scan(X, k -> if all(k, j -> j>=0) or all(k, j -> j<=0)
                     then alpha = apply(n, j -> if member(j, F) 
                          then last(k)*k_(position(F, i -> i === j))
                          else 0));
                #alpha > 0));
           if #Q > 0 then (matrix {alpha})+(matrix exponents first Q)
           else 0);
i50 : A = matrix{{1,1,1,1,1},{1,2,4,5,6}}

o50 = | 1 1 1 1 1 |
      | 1 2 4 5 6 |

               2        5
o50 : Matrix ZZ  <--- ZZ
i51 : w1 = {1,1,1,1,1};
i52 : w2 = {2,3,5,7,11};
i53 : b1 = transpose matrix{{3,9}}

o53 = | 3 |
      | 9 |

               2        1
o53 : Matrix ZZ  <--- ZZ
i54 : b2 = transpose matrix{{5,16}}

o54 = | 5  |
      | 16 |

               2        1
o54 : Matrix ZZ  <--- ZZ
i55 : IP(A, w1, b1)

o55 = | 1 1 0 0 1 |

               1        5
o55 : Matrix ZZ  <--- ZZ
i56 : IP(A, w2, b1)

o56 = | 1 0 2 0 0 |

               1        5
o56 : Matrix ZZ  <--- ZZ
i57 : IP(A, w1, b2)

o57 = | 2 1 0 0 2 |

               1        5
o57 : Matrix ZZ  <--- ZZ
i58 : IP(A, w2, b2)

o58 = | 2 0 1 2 0 |

               1        5
o58 : Matrix ZZ  <--- ZZ
i59 : S = QQ[a,b,c,d];
i60 : isBorel monomialIdeal(a^2, a*b, b^2)

o60 = true
i61 : isBorel monomialIdeal(a^2, b^2)

o61 = false
i62 : borel monomialIdeal(b*c)

                      2        2
o62 = monomialIdeal (a , a*b, b , a*c, b*c)

o62 : MonomialIdeal of S
i63 : borel monomialIdeal(a,c^3)

                         3   2      2   3
o63 = monomialIdeal (a, b , b c, b*c , c )

o63 : MonomialIdeal of S
i64 : gin = method();
i65 : gin Ideal := I -> (
           S := ring I;
           StoS := map(S, S, random(S^{0}, S^{numgens S:-1}));
           monomialIdeal StoS I);
i66 : gin MonomialIdeal := I -> gin ideal I;
i67 : genericForms = (p,q) -> ideal(random(p,S), random(q,S));
i68 : gin genericForms(2,2)

                      2        3
o68 = monomialIdeal (a , a*b, b )

o68 : MonomialIdeal of S
i69 : gin genericForms(2,3)

                      2     2   4
o69 = monomialIdeal (a , a*b , b )

o69 : MonomialIdeal of S
i70 : J = ideal(a^2, a*b+b^2, a*c)

              2         2
o70 = ideal (a , a*b + b , a*c)

o70 : Ideal of S
i71 : ginJ = gin J

                      2        2     2
o71 = monomialIdeal (a , a*b, b , a*c )

o71 : MonomialIdeal of S
i72 : inJ = monomialIdeal J

                      2        3        2
o72 = monomialIdeal (a , a*b, b , a*c, b c)

o72 : MonomialIdeal of S
i73 : isBorel inJ and isBorel ginJ

o73 = true
i74 : S = QQ[a,b,c,d, MonomialOrder => Lex];
i75 : gin genericForms(2,2)

                      2        4     2
o75 = monomialIdeal (a , a*b, b , a*c )

o75 : MonomialIdeal of S
i76 : gin genericForms(2,3)

                      2     2   6       2     6         2       4
o76 = monomialIdeal (a , a*b , b , a*b*c , a*c , a*b*c*d , a*b*d )

o76 : MonomialIdeal of S
i77 : projection = I -> (
           S := ring I;
           n := numgens S;
           X := gens S;
           monomialIdeal mingens substitute(ideal I, 
                {X#(n-2) => 1, X#(n-1) => 1}));
i78 : polarization = I -> (
           n := numgens ring I;
           u := apply(numgens I, i -> first exponents I_i);
           I.lcm = max \ transpose u;
           Z := flatten apply(n, i -> apply(I.lcm#i, j -> z_{i,j}));
           R := QQ(monoid[Z]);
           Z = gens R;
           p := apply(n, i -> sum((I.lcm)_{0..i-1}));
           monomialIdeal apply(u, e -> product apply(n, i -> 
                     product(toList(0..e#i-1), j -> Z#(p#i+j)))));
i79 : distraction = I -> (
           S := ring I;
           n := numgens S;
           X := gens S;
           J := polarization I;
           W := flatten apply(n, i -> flatten apply(I.lcm#i, 
                     j -> X#i));
           section := map(S, ring J, apply(W, r -> r - 
                     random(500)*X#(n-2) - random(500)*X#(n-1)));     
           section ideal J);
i80 : S = QQ[x_0 .. x_4, MonomialOrder => GLex];
i81 : I = monomialIdeal(x_0^2, x_0*x_1^2*x_3, x_1^3*x_4)

                      2     2     3
o81 = monomialIdeal (x , x x x , x x )
                      0   0 1 3   1 4

o81 : MonomialIdeal of S
i82 : projection I

                      2     2   3
o82 = monomialIdeal (x , x x , x )
                      0   0 1   1

o82 : MonomialIdeal of S
i83 : polarization I

o83 = monomialIdeal (z      z      , z      z      z      z      , z      z      z      z      )
                      {0, 0} {0, 1}   {0, 0} {1, 0} {1, 1} {3, 0}   {1, 0} {1, 1} {1, 2} {4, 0}

o83 : MonomialIdeal of QQ [z      , z      , z      , z      , z      , z      , z      ]
                            {0, 0}   {0, 1}   {1, 0}   {1, 1}   {1, 2}   {3, 0}   {4, 0}
i84 : distraction I

              2                             2                     2          2          2                2                              2             3              2                  2              3         2 2          2             2 2              3               2                   2              3             4               3                 2 2                 3              4       3         3           2 2          2              2 2              3              2                   2              3             4              3                 2 2                 3              4
o84 = ideal (x  - 398x x  - 584x x  + 36001x  + 92816x x  + 47239x , - 322x x x  - 83x x x  + 152950x x x  + 335987x x x x  + 76443x x x  - 1789032x x  - 67481906x x x  - 85381113x x x  - 17555164x x  + 83398x x  + 178311x x x  + 40421x x  - 39614050x x  - 161507283x x x  - 183424406x x x  - 37227741x x  + 463359288x  + 18349072238x x  + 54977396489x x  + 46127389507x x  + 8549364868x , - 85x x  - 109x x  + 82790x x  + 193801x x x  + 112379x x  - 20619385x x  - 87638609x x x  - 105066042x x x  - 34097162x x  + 235657740x  + 9182360681x x  + 22304716259x x  + 15977318038x x  + 2535980920x )
              0       0 3       0 4         3         3 4         4        0 1 3      0 1 4          0 1 3          0 1 3 4         0 1 4           0 3            0 3 4            0 3 4            0 4         1 3          1 3 4         1 4            1 3             1 3 4             1 3 4            1 4             3               3 4               3 4               3 4              4       1 3       1 4         1 3          1 3 4          1 4            1 3            1 3 4             1 3 4            1 4             3              3 4               3 4               3 4              4

o84 : Ideal of S
i85 : m =  matrix table({0,1,2}, {0,1,2}, (i,j) -> (gens S)#(i+j))

o85 = | x_0 x_1 x_2 |
      | x_1 x_2 x_3 |
      | x_2 x_3 x_4 |

              3       3
o85 : Matrix S  <--- S
i86 : rationalQuartic = minors(2, m);

o86 : Ideal of S
i87 : H = hilbertPolynomial(S/rationalQuartic);
i88 : hilbertPolynomial(S/rationalQuartic, Projective => false)

o88 = 4$i + 1

o88 : QQ [$i]
i89 : L = {monomialIdeal(x_0^2, x_0*x_1, x_0*x_2, x_1^2, x_1*x_2, x_2^2), monomialIdeal(x_0^2, x_0*x_1, x_0*x_2, x_0*x_3, x_1^2, x_1*x_2, x_2^3), monomialIdeal(x_0, x_1^2, x_1*x_2^2, x_1*x_2*x_3, x_2^3), monomialIdeal(x_0, x_1^2, x_1*x_2, x_2^4, x_2^3*x_3), monomialIdeal(x_0, x_1, x_2^5, x_2^4*x_3^3), monomialIdeal(x_0, x_1^2, x_1*x_2, x_1*x_3, x_2^5, x_2^4*x_3^2), monomialIdeal(x_0^2, x_0*x_1, x_0*x_2, x_0*x_3, x_1^2, x_1*x_2, x_1*x_3, x_2^5, x_2^4*x_3), monomialIdeal(x_0, x_1^2, x_1*x_2, x_1*x_3^2, x_2^5, x_2^4*x_3), monomialIdeal(x_0^2, x_0*x_1, x_0*x_2, x_0*x_3, x_1^2, x_1*x_2, x_1*x_3^2, x_2^4), monomialIdeal(x_0, x_1^2, x_1*x_2^2, x_1*x_2*x_3, x_1*x_3^2, x_2^4), monomialIdeal(x_0, x_1^2, x_1*x_2, x_1*x_3^3, x_2^4), monomialIdeal(x_0, x_1, x_2^6, x_2^5*x_3, x_2^4*x_3^2)};
i90 : scan(#L, i -> << endl << i+1 << " : " << L#i << endl);

                    2         2               2
1 : monomialIdeal (x , x x , x , x x , x x , x )
                    0   0 1   1   0 2   1 2   2

                    2         2               3
2 : monomialIdeal (x , x x , x , x x , x x , x , x x )
                    0   0 1   1   0 2   1 2   2   0 3

                        2     2   3
3 : monomialIdeal (x , x , x x , x , x x x )
                    0   1   1 2   2   1 2 3

                        2         4   3
4 : monomialIdeal (x , x , x x , x , x x )
                    0   1   1 2   2   2 3

                            5   4 3
5 : monomialIdeal (x , x , x , x x )
                    0   1   2   2 3

                        2         5         4 2
6 : monomialIdeal (x , x , x x , x , x x , x x )
                    0   1   1 2   2   1 3   2 3

                    2         2               5               4
7 : monomialIdeal (x , x x , x , x x , x x , x , x x , x x , x x )
                    0   0 1   1   0 2   1 2   2   0 3   1 3   2 3

                        2         5   4       2
8 : monomialIdeal (x , x , x x , x , x x , x x )
                    0   1   1 2   2   2 3   1 3

                    2         2               4           2
9 : monomialIdeal (x , x x , x , x x , x x , x , x x , x x )
                    0   0 1   1   0 2   1 2   2   0 3   1 3

                         2     2   4             2
10 : monomialIdeal (x , x , x x , x , x x x , x x )
                     0   1   1 2   2   1 2 3   1 3

                         2         4     3
11 : monomialIdeal (x , x , x x , x , x x )
                     0   1   1 2   2   1 3

                             6   5     4 2
12 : monomialIdeal (x , x , x , x x , x x )
                     0   1   2   2 3   2 3
i91 : all(L, I -> isBorel I and hilbertPolynomial(S/I) == H)

o91 = true
i92 : class1 = projection L#0

                      2         2               2
o92 = monomialIdeal (x , x x , x , x x , x x , x )
                      0   0 1   1   0 2   1 2   2

o92 : MonomialIdeal of S
i93 : class2 = projection L#1

                          2         3
o93 = monomialIdeal (x , x , x x , x )
                      0   1   1 2   2

o93 : MonomialIdeal of S
i94 : class3 = projection L#4

                              4
o94 = monomialIdeal (x , x , x )
                      0   1   2

o94 : MonomialIdeal of S
i95 : all(1..3, i -> projection L#i == class2)

o95 = true
i96 : all(4..11, i -> projection L#i == class3)

o96 = true
i97 : all(L, I -> I == monomialIdeal distraction I)

o97 = true
i98 : all(0..3, i -> projection gin distraction L#i == class3)

o98 = true
i99 : hasChainProperty = I -> (
           L := ass I;
           radI := radical I;
           all(L, P -> radI : (radI : P) == P or (
                     gensP := first entries gens P;
                     all(gensP, r -> (
                               Q := monomialIdeal delete(r, gensP);
                               I : (I : Q) == Q)))));
i100 : A = matrix{{1,1,1,1,1,1,1}, {2,0,0,0,1,0,0}, {0,2,0,0,0,1,0}, {2,2,0,2,1,1,1}}

o100 = | 1 1 1 1 1 1 1 |
       | 2 0 0 0 1 0 0 |
       | 0 2 0 0 0 1 0 |
       | 2 2 0 2 1 1 1 |

                4        7
o100 : Matrix ZZ  <--- ZZ
i101 : IA = toricIdeal(A, {1,1,1,1,1,1,1})

                      2          2          2
o101 = ideal (x x  - x , x x  - x , x x  - x )
               3 4    7   2 3    6   1 3    5

o101 : Ideal of S
i102 : inIA = monomialIdeal IA

                                           2     2     2
o102 = monomialIdeal (x x , x x , x x , x x , x x , x x )
                       1 3   2 3   3 4   2 5   4 5   4 6

o102 : MonomialIdeal of S
i103 : hasChainProperty inIA

o103 = true
i104 : StoS = map(S, S, {x_1, x_2, x_3, x_3 - x_4, x_5, x_6, x_7});

o104 : RingMap S <--- S
i105 : J = StoS IA

               2           2          2          2
o105 = ideal (x  - x x  - x , x x  - x , x x  - x )
               3    3 4    7   2 3    6   1 3    5

o105 : Ideal of S
i106 : inJ = monomialIdeal J

                                   2     2     2       2     2       2       2
o106 = monomialIdeal (x x , x x , x , x x , x x , x x x , x x , x x x , x x x )
                       1 3   2 3   3   2 5   3 5   1 4 5   3 6   1 4 6   2 4 6

o106 : MonomialIdeal of S
i107 : hasChainProperty inJ

o107 = false
i108 : A = matrix{{2,0,0,1,0,0,2,1,1,3,2,2,2,3,3,3},
                  {0,2,0,0,1,0,1,2,1,2,3,2,3,2,3,3},
                  {0,0,2,0,0,1,1,1,2,2,2,3,3,3,2,3}};

                3        16
o108 : Matrix ZZ  <--- ZZ
i109 : D = A^{0}+A^{1}+A^{2} || A

o109 = | 2 2 2 1 1 1 4 4 4 7 7 7 8 8 8 9 |
       | 2 0 0 1 0 0 2 1 1 3 2 2 2 3 3 3 |
       | 0 2 0 0 1 0 1 2 1 2 3 2 3 2 3 3 |
       | 0 0 2 0 0 1 1 1 2 2 2 3 3 3 2 3 |

                4        16
o109 : Matrix ZZ  <--- ZZ
i110 : D = entries transpose D;
i111 : S = QQ[vars(0..15), Degrees => D, MonomialSize => 16];
i112 : I = monomialIdeal(d*j, d*k, d*l, d*m, d*n, d*o, d*p, e*j, e*k,
           e*l, e*m, e*n, e*o, e*p, f*j, f*k, f*l, f*m, f*n, f*o, f*p,
           g*j, g*k, g*l, g*m, g*n, g*o, g*p, h*j, h*k, h*l, h*m, h*n,
           h*o, h*p, i*j, i*k, i*l, i*m, i*n, i*o, i*p, g^2, g*h, g*i,
           h^2, h*i, i^2, j^2, j*k, j*l, j*m, j*n, j*o, j*p, k^2, k*l,
           k*m, k*n, k*o, k*p, l^2, l*m, l*n, l*o, l*p, m^2, m*n, m*o,
           m*p, n^2, n*o, n*p, o^2, o*p, p^2, d^2, e^2, f^2, d*h, e*i,
           f*g, f*d*i, d*e*g, e*f*h, c*d*g, a*e*h, b*f*i, c*e*g, 
           a*f*h, b*d*i, c*d*e, a*e*f, b*f*d, c*b*d, a*c*e, b*a*f, 
           c*b*g, a*c*h, b*a*i);

o112 : MonomialIdeal of S
i113 : apply(D, d -> rank source basis(d, (S^1)/ ideal I))

o113 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}

o113 : List
i114 : hasChainProperty I

o114 = false
i115 : 