Opened 5 years ago

Last modified 5 years ago

#23338 closed enhancement

Clean up polynomial constructor — at Version 12

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, GitHub, GitLab) Commit: f0a314c800e0f060008a9402d1a7f2fba968920b
Dependencies: Stopgaps:

Status badges

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(), although much more likely in library code and not user code (some code in Sage gets this even wrong and was passing sparse="lex" instead of order="lex")

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

Change History (12)

comment:1 Changed 5 years ago by tscrim

  • Cc tscrim added

+1

comment:2 Changed 5 years ago by jdemeyer

  • Branch set to u/jdemeyer/clean_up_polynomial_constructor

comment:3 Changed 5 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 5 years ago by jdemeyer

  • Description modified (diff)

comment:5 Changed 5 years ago by jdemeyer

  • Description modified (diff)

comment:6 Changed 5 years ago by jdemeyer

  • Description modified (diff)

comment:7 Changed 5 years ago by jdemeyer

  • Description modified (diff)

comment:8 Changed 5 years ago by jdemeyer

  • Description modified (diff)

comment:9 Changed 5 years ago by jdemeyer

  • Description modified (diff)

comment:10 Changed 5 years ago by git

  • Commit changed from 883d50709298487518d7d0a2771045483adb0cf9 to 2f8a591a6b7151c442c9d20b53a5131eaa26e3b0

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2f8a591Clean up PolynomialRing() constructor

comment:11 Changed 5 years ago by git

  • Commit changed from 2f8a591a6b7151c442c9d20b53a5131eaa26e3b0 to f0a314c800e0f060008a9402d1a7f2fba968920b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f0a314cClean up PolynomialRing() constructor

comment:12 Changed 5 years ago by jdemeyer

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