Skip to content

efficiency problem with polynomials (SymbolicRing vs PolynomialRing) #8158

Open
@zimmermann6

Description

@zimmermann6

Consider the following example:

sage: var('a,b,c')
(a, b, c)
sage: time d=expand((a+b+c+1)^100)
CPU times: user 2.45 s, sys: 0.07 s, total: 2.52 s
Wall time: 2.53 s

I thought it would be more efficient to use PolynomialRing(),
but it is not:

sage: P.<a,b,c> = PolynomialRing(QQ)
sage: time d=(a+b+c+1)^100
CPU times: user 10.28 s, sys: 0.07 s, total: 10.35 s
Wall time: 12.59 s

However if one wants to factor d, then PolynomialRing is faster
(SymbolicRing seems to loop forever):

sage: time e = d.factor()
CPU times: user 28.87 s, sys: 0.36 s, total: 29.23 s
Wall time: 34.20 s

Component: performance

Issue created by migration from https://trac.sagemath.org/ticket/8158

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions