Skip to content

Commit

Permalink
Add characteristic for multivariate quotient rings over fields (#4241)
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt authored Oct 24, 2024
1 parent 5c30f3a commit eaa8972
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Rings/MPolyQuo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ oscar_origin_ring(Q::MPolyQuoRing) = base_ring(Q)

default_ordering(Q::MPolyQuoRing) = default_ordering(base_ring(Q))

# Only for fields for now because of things like char(ZZ[x, y]/<2>) = 2
function characteristic(Q::MPolyQuoRing{<:MPolyRingElem{T}}) where {T <: FieldElement}
if is_zero(one(Q))
return 1
end
return characteristic(coefficient_ring(Q))
end

##############################################################################
#
# Quotient ring elements
Expand Down
6 changes: 6 additions & 0 deletions test/Rings/MPolyQuo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@

B,q = quo(R, x^3+y,y^2; ordering=lex(R))
@test A.I == B.I

@test characteristic(quo(R, ideal(x))[1]) == 0
@test characteristic(quo(R, ideal(R, 1))[1]) == 1

S, (s, t) = GF(5)[:s, :t]
@test characteristic(quo(S, ideal([s, t]))[1]) == 5
end

@testset "MpolyQuo.manipulation" begin
Expand Down

0 comments on commit eaa8972

Please sign in to comment.