-
-
Notifications
You must be signed in to change notification settings - Fork 652
Open
Description
Problem Description
Currently (23 Jan 2024), polynomial rings have some support with weighted polynomial rings, while lacking others. For example,
sage: R.<X, Y, Z> = PolynomialRing(K, 3, order=TermOrder("wdegrevlex", [1, 3, 1]))
sage: f = X + Y
sage: f.degree() # correct
3
sage: f.is_homogeneous() # wrong
True
sage: f.homogenize(Z) # wrong
False
Proposed Solution
This should probably grow into a TODO list / feature tracker thing.
TODO:
- Simpler API to access term order related attributes, and to modify them. - (1)
- Simpler monomial ordering names. - (2)
- Fix
.homogenize
and.is_homogeneous
. - Fix weird
TermOrder
bug? - (3)
(1): Currently, we can modify the weight of the term order by R.term_order()._weights = (1, 7, 1)
, but that's not really intuitive. This should be a method.
(2): Currently, "degrevlex" and "wdegrevlex" are separate monomial orderings, the latter being the weighted version of the first. Perhaps they should be unified.
(3): Start a new session of Sage and type the following:
sage: R = PolynomialRing(Qp(7), 1, order=TermOrder("degrevlex"), names="X")
....: print(R.term_order(), R.gen(0).degree())
....: R.term_order()._weights = (5,)
....: print(R.term_order(), R.gen(0).degree())
....: R = PolynomialRing(Qp(7), 1, order=TermOrder("degrevlex"), names="X")
....: print(R.term_order(), R.gen(0).degree()) # persists
Degree reverse lexicographic term order, 1
Degree reverse lexicographic term order with weights (5,) 5
Degree reverse lexicographic term order with weights (5,) 5
Fixed: the two calls return the same object in memory and hence share the same attributes.
mantepse and GiacomoPope