|
1 | 1 | @attributes mutable struct PBWAlgRing{T, S} <: NCRing |
2 | 2 | sring::Singular.PluralRing{S} |
3 | 3 | relations::Singular.smatrix{Singular.spoly{S}} |
4 | | - coeff_ring |
5 | | - poly_ring |
| 4 | + coeff_ring::Ring |
| 5 | + poly_ring::MPolyRing{T} |
6 | 6 | opposite::PBWAlgRing{T, S} |
7 | 7 |
|
8 | 8 | function PBWAlgRing{T, S}(sring, relations, coeff_ring, poly_ring) where {T, S} |
@@ -62,11 +62,11 @@ parent(a::PBWAlgElem) = a.parent |
62 | 62 |
|
63 | 63 | symbols(a::PBWAlgRing) = symbols(a.sring) |
64 | 64 |
|
65 | | -coefficient_ring(a::PBWAlgRing) = a.coeff_ring |
| 65 | +coefficient_ring(a::PBWAlgRing{T}) where T = a.coeff_ring::parent_type(T) |
66 | 66 |
|
67 | 67 | coefficient_ring(a::PBWAlgElem) = coefficient_ring(parent(a)) |
68 | 68 |
|
69 | | -base_ring(a::PBWAlgRing) = a.poly_ring |
| 69 | +base_ring(a::PBWAlgRing{T}) where T = a.poly_ring::mpoly_ring_type(T) |
70 | 70 |
|
71 | 71 | function Base.deepcopy_internal(a::PBWAlgElem, dict::IdDict) |
72 | 72 | return PBWAlgElem(parent(a), deepcopy_internal(a.sdata, dict)) |
@@ -343,7 +343,7 @@ function (R::PBWAlgRing)(cs::AbstractVector, es::AbstractVector{Vector{Int}}) |
343 | 343 | end |
344 | 344 |
|
345 | 345 | function (R::PBWAlgRing)(a::MPolyRingElem) |
346 | | - @assert parent(a) == R.poly_ring |
| 346 | + @assert parent(a) == base_ring(R) |
347 | 347 | z = build_ctx(R) |
348 | 348 | for (c, e) in zip(AbstractAlgebra.coefficients(a), AbstractAlgebra.exponent_vectors(a)) |
349 | 349 | push_term!(z, c, e) |
@@ -537,7 +537,7 @@ function _opposite(a::PBWAlgRing{T, S}) where {T, S} |
537 | 537 | for i in 1:n-1, j in i+1:n |
538 | 538 | bsrel[i,j] = _unsafe_coerce(bspolyring, a.relations[n+1-j,n+1-i], true) |
539 | 539 | end |
540 | | - b = PBWAlgRing{T, S}(bsring, bsrel, a.coeff_ring, polynomial_ring(a.coeff_ring, revs; cached = false)[1]) |
| 540 | + b = PBWAlgRing{T, S}(bsring, bsrel, coefficient_ring(a), polynomial_ring(coefficient_ring(a), revs; cached = false)[1]) |
541 | 541 | a.opposite = b |
542 | 542 | b.opposite = a |
543 | 543 | end |
@@ -1154,7 +1154,7 @@ function _left_eliminate_via_given_ordering(I::Singular.sideal{<:Singular.splura |
1154 | 1154 | end |
1155 | 1155 |
|
1156 | 1156 | function _left_eliminate(R::PBWAlgRing, I::Singular.sideal, sigma, sigmaC, ordering) |
1157 | | - r = R.poly_ring |
| 1157 | + r = base_ring(R) |
1158 | 1158 | if !isnothing(ordering) |
1159 | 1159 | @assert is_elimination_ordering(ordering, sigmaC) |
1160 | 1160 | @assert is_admissible_ordering(R, ordering) |
@@ -1217,7 +1217,7 @@ function eliminate(I::PBWAlgIdeal{D, T, S}, sigmaC::Vector{Int}; ordering = noth |
1217 | 1217 | sigmaop = reverse!(n + 1 .- sigma) |
1218 | 1218 | sigmaCop = reverse!(n + 1 .- sigmaC) |
1219 | 1219 | orderingop = isnothing(ordering) ? ordering : |
1220 | | - opposite_ordering(Rop.poly_ring, ordering) |
| 1220 | + opposite_ordering(base_ring(Rop), ordering) |
1221 | 1221 | zop = _left_eliminate(Rop, get_sopdata(I), sigmaop, sigmaCop, orderingop) |
1222 | 1222 | z = _opmap(R, zop, Rop) |
1223 | 1223 | return PBWAlgIdeal{D, T, S}(R, z, zop) |
|
0 commit comments