Skip to content

Caching for universal polynomial rings #1989

@SoongNoonien

Description

@SoongNoonien

While looking into #1979 I noticed that caching for universal polynomial rings is implemented in a weird way, which is incompatible with the ideas I have for #1979. I'm not sure if there even is a sensible way to implement caching in this case. As far as I understand, currently the caching for universal polynomial rings doesn't depend on the variables. So if I create a universal polynomial ring and add some variables to it and then create a new one, the new one will have the same variables as the old one. I my opinion this even contradicts the docstring of universal_polynomial_ring:

Given a base ring R, return an object representing
the universal polynomial ring $S = R[\ldots]$ with no variables in it initially

This is now caching looks in action:

julia> R=universal_polynomial_ring(QQ)
Universal Polynomial Ring over Rationals

julia> x=gen(R,:x)
x

julia> gens(R)
1-element Vector{AbstractAlgebra.Generic.UnivPoly{Rational{BigInt}}}:
 x

julia> S=universal_polynomial_ring(QQ)
Universal Polynomial Ring over Rationals

julia> gens(S)
1-element Vector{AbstractAlgebra.Generic.UnivPoly{Rational{BigInt}}}:
 x

julia> gen(S,:y)
y

julia> gens(R)
2-element Vector{AbstractAlgebra.Generic.UnivPoly{Rational{BigInt}}}:
 x
 y

Is there a use case for caching for universal polynomial rings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions