Skip to content

Commit 9f15bb6

Browse files
Merge branch 'macaulay' of github.com:MercedesHaiech/sage into macaulay
2 parents 6684885 + aeb01d6 commit 9f15bb6

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

src/sage/rings/polynomial/multi_polynomial_sequence.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ def macaulay_matrix(self, degree,
870870
the rows of the Macaulay matrix correspond to all possible products
871871
between a polynomial from the sequence and monomials of the polynomial
872872
ring up to degree ``degree``;
873-
when ``True``, all polynomials in the sequence must be homogeneous.
873+
when ``True``, all polynomials in the sequence must be homogeneous, and
874874
the rows of the Macaulay matrix then represent all possible products
875875
between a polynomial in the sequence and a monomial of the polynomial
876876
ring such that the resulting product is homogeneous of degree
@@ -900,18 +900,18 @@ def macaulay_matrix(self, degree,
900900
sequence are included
901901
902902
- ``reverse_column_order`` -- boolean (default: ``False``);
903-
when ``False``, by default the order for the columns is the same
903+
when ``False``, by default, the order of the columns is the same
904904
as the order of the polynomial ring;
905-
when ``True``, the order of the rows is the reverse of the order
906-
of the monomial of the polynomial ring
905+
when ``True``, the order of the columns is the reverse of the order
906+
of the polynomial ring
907907
908908
- ``row_order`` -- str (default: ``None``);
909-
determines the ordering of the columns in the matrix;
909+
determines the ordering of the rows in the matrix;
910910
when ``None`` (or ``"POT"``), a **position over term** (POT) order is used:
911-
columns are first ordered by the index of the corresponding polynomial
911+
rows are first ordered by the index of the corresponding polynomial
912912
in the sequence, and then by the (multiplicative) monomials;
913-
when set to ``"TOP"``, the columns follow a **term over position**
914-
(TOP) order: columns are firt ordered by the (multiplicative) monomials
913+
when set to ``"TOP"``, the rows follow a **term over position**
914+
(TOP) order: rows are first ordered by the (multiplicative) monomials
915915
and then by the index of the corresponding polynomial
916916
in the sequence
917917
@@ -1014,6 +1014,17 @@ def macaulay_matrix(self, degree,
10141014
...
10151015
ValueError: the variables must be in the polynomial ring
10161016
1017+
sage: Sequence([y*z + z^2 - 1,x*y - z^2 - x ]).macaulay_matrix(1, row_order="increasing")
1018+
Traceback (most recent call last):
1019+
...
1020+
ValueError: the argument of ``row_order`` must be ``None``, "TOP" or "POT"
1021+
1022+
sage: R.<x,y,z> = PolynomialRing(GF(7),order='degrevlex(2),neglex(1)')
1023+
sage: Sequence([y*z + z^2 - 1,x*y - z^2 - x ]).macaulay_matrix(1, variables=[x,z])
1024+
Traceback (most recent call last):
1025+
...
1026+
ValueError: impossible to use the original term order (most likely because it was a block order). Please specify the term order for the subring
1027+
10171028
REFERENCES:
10181029
10191030
[Mac1902]_, Chapter 1 of [Mac1916]_
@@ -1032,7 +1043,7 @@ def macaulay_matrix(self, degree,
10321043
if not (self[i].is_homogeneous()):
10331044
raise ValueError('all the polynomials of the sequence must be homogeneous')
10341045
if not (row_order is None or row_order == "TOP" or row_order == "POT"):
1035-
raise ValueError('the argument of ``row_order`` must be ``None``, "TOP" or "POT" ')
1046+
raise ValueError('the argument of ``row_order`` must be ``None``, "TOP" or "POT"')
10361047

10371048
# handle subset of variables
10381049
S = self.ring()
@@ -1112,7 +1123,7 @@ def macaulay_matrix(self, degree,
11121123
R_monomials_useful.sort()
11131124
for mon in R_monomials_useful:
11141125
row_indices += [(mon, i) for i in range(m)
1115-
if mon.degree() <= target_degree - self[i].degree() + 1]
1126+
if mon.degree() + self[i].degree() <= target_degree]
11161127

11171128
# compute sorted list of monomials that index the columns
11181129
if remove_zero:

0 commit comments

Comments
 (0)