Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/Tables/A1/SL2.1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using ..GenericCharacterTables.Oscar
R = universal_polynomial_ring(QQ; cached=false)
q0 = gen(R, "q0")
q = q0^2
S, E = generic_cyclotomic_ring(R; congruence=ZZ.((1, 2)))
S, E = generic_cyclotomic_ring(R; congruence=ZZ.((1, 2)), power=2)
i, k, _... = gens(
R, ["i", "k", "i1", "k1", "i2", "k2", "i3", "k3", "it1", "kt1", "it2", "kt2"]
)
Expand Down
4 changes: 3 additions & 1 deletion src/CharTable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ function show(io::IO, ::MIME"text/plain", t::Table)
println(io, "of order ", order(t))
c = congruence(t)
if c !== nothing
S = t.ring
q = gen(base_ring(S), 1)^S.power
println(
io,
"restricted to ",
gen(base_ring(t.ring), 1),
q,
" congruent to ",
c[1],
" modulo ",
Expand Down
19 changes: 17 additions & 2 deletions src/GenericCyclotomics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ function (R::GenericCycloRing)(f::Dict{UPolyFrac,UPoly}; simplify::Bool=true) #

# congruence preparation
substitutes = get_substitutes!(R)
power = R.power

# reduce numerators modulo denominators
L = NTuple{4,UPoly}[]
Expand All @@ -412,7 +413,17 @@ function (R::GenericCycloRing)(f::Dict{UPolyFrac,UPoly}; simplify::Bool=true) #
# example be `(q+1)//2` and `q` congruent to `1`
# modulo `2`. Then `substitutes[1]` is `2*q+1`
# and `gp=(2*q+2)//2=q+1` which simplifies to `0`.
gp = evaluate(g, [1], [substitutes[1]])
#
# `power` is used in cases where the first parameter
# represents a root of order `power`. In this case the
# polynomials need to be deflated before the evaluation
# and the inflated back again.
if isone(power)
gp = evaluate(g, [1], [substitutes[1]])
else
gd = deflate(numerator(g), [power])//deflate(denominator(g), [power])
gp = evaluate(gd, [1], [substitutes[1]])
end
end
a, r = divrem(numerator(gp), denominator(gp))
push!(L, (c, denominator(gp), r, a))
Expand Down Expand Up @@ -447,6 +458,9 @@ function (R::GenericCycloRing)(f::Dict{UPolyFrac,UPoly}; simplify::Bool=true) #
gp = g
else
gp = evaluate(g, [1], [substitutes[2]])
if !isone(power)
gp = inflate(numerator(gp), [power])//inflate(denominator(gp), [power])
end
end
if haskey(fp, gp)
fp[gp] += cp * c
Expand Down Expand Up @@ -480,9 +494,10 @@ function generic_cyclotomic_ring(
R::UPolyRing,
symbol::Symbol=:E;
congruence::Union{Tuple{ZZRingElem,ZZRingElem},Nothing}=nothing,
power::Int64=1,
cached::Bool=true,
)
S = GenericCycloRing(R, symbol, congruence)
S = GenericCycloRing(R, symbol, congruence, power)
E = GenericCycloRingGen(S)
length(gens(R)) < 1 && error("At least one free variable is needed")
return (S, E)
Expand Down
4 changes: 3 additions & 1 deletion src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ mutable struct GenericCycloRing <: Ring
base_ring::UPolyRing
symbol::Symbol
congruence::Union{Tuple{ZZRingElem,ZZRingElem},Nothing}
power::Int64
substitute::UPoly
substitute_inv::UPoly
function GenericCycloRing(
R::UPolyRing,
symbol::Symbol,
congruence::Union{Tuple{ZZRingElem,ZZRingElem},Nothing},
power::Int64
)
return new(R, symbol, congruence)
return new(R, symbol, congruence, power)
end
end

Expand Down
Loading