Opened 2 years ago

Last modified 2 years ago

#23338 closed enhancement

Clean up polynomial constructor — at Version 9

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.0
Component: algebra Keywords:
Cc: tscrim Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: N/A Work issues:
Branch: u/jdemeyer/clean_up_polynomial_constructor (Commits) Commit: 883d50709298487518d7d0a2771045483adb0cf9
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

This ticket cleans up the PolynomialRing() function in many ways. Mainly:

  1. Use normalize_names() as much as possible to deal with variable names.
  1. Fix indentation in docstring.
  1. Pass arguments like sparse and implementation as **kwds to the single-variate or multi-variate polynomial constructor.
  1. Make the code easier to understand.
  1. Allow PolynomialRing(..., implementation="singular") which forces Singular. This allows simplifying some code in src/sage/algebras/free_algebra.py which currently needs to jump through hoops to get a MPolynomialRing_libsingular.
  1. Check more error conditions, for example currently we have
    sage: PolynomialRing(QQ, name="x", names="y")
    Univariate Polynomial Ring in y over Rational Field
    
  1. Change some arguments of PolynomialRing() to keyword-only arguments. This does break some existing uses of PolynomialRing() (some even wrong: some Singular code was passing sparse="lex" instead or order="lex")

Apart from items 6 and 7, no existing functionality is changed.

Change History (9)

comment:1 Changed 2 years ago by tscrim

  • Cc tscrim added

+1

comment:2 Changed 2 years ago by jdemeyer

  • Branch set to u/jdemeyer/clean_up_polynomial_constructor

comment:3 Changed 2 years ago by jdemeyer

  • Commit set to 883d50709298487518d7d0a2771045483adb0cf9

First version, not finished or tested yet. But feel free to comment...


New commits:

883d507Clean up PolynomialRing() constructor

comment:4 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:5 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:6 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:7 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:8 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:9 Changed 2 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.