Skip to content

Commit 6ea611b

Browse files
authored
Fix SL2.1 (#281)
1 parent 4d4dcc0 commit 6ea611b

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

data/Tables/A1/SL2.1.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using ..GenericCharacterTables.Oscar
55
R = universal_polynomial_ring(QQ; cached=false)
66
q0 = gen(R, "q0")
77
q = q0^2
8-
S, E = generic_cyclotomic_ring(R; congruence=ZZ.((1, 2)))
8+
S, E = generic_cyclotomic_ring(R; congruence=ZZ.((1, 2)), power=2)
99
i, k, _... = gens(
1010
R, ["i", "k", "i1", "k1", "i2", "k2", "i3", "k3", "it1", "kt1", "it2", "kt2"]
1111
)

src/CharTable.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,12 @@ function show(io::IO, ::MIME"text/plain", t::Table)
278278
println(io, "of order ", order(t))
279279
c = congruence(t)
280280
if c !== nothing
281+
S = t.ring
282+
q = gen(base_ring(S), 1)^S.power
281283
println(
282284
io,
283285
"restricted to ",
284-
gen(base_ring(t.ring), 1),
286+
q,
285287
" congruent to ",
286288
c[1],
287289
" modulo ",

src/GenericCyclotomics.jl

+17-2
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ function (R::GenericCycloRing)(f::Dict{UPolyFrac,UPoly}; simplify::Bool=true) #
397397

398398
# congruence preparation
399399
substitutes = get_substitutes!(R)
400+
power = R.power
400401

401402
# reduce numerators modulo denominators
402403
L = NTuple{4,UPoly}[]
@@ -412,7 +413,17 @@ function (R::GenericCycloRing)(f::Dict{UPolyFrac,UPoly}; simplify::Bool=true) #
412413
# example be `(q+1)//2` and `q` congruent to `1`
413414
# modulo `2`. Then `substitutes[1]` is `2*q+1`
414415
# and `gp=(2*q+2)//2=q+1` which simplifies to `0`.
415-
gp = evaluate(g, [1], [substitutes[1]])
416+
#
417+
# `power` is used in cases where the first parameter
418+
# represents a root of order `power`. In this case the
419+
# polynomials need to be deflated before the evaluation
420+
# and the inflated back again.
421+
if isone(power)
422+
gp = evaluate(g, [1], [substitutes[1]])
423+
else
424+
gd = deflate(numerator(g), [power])//deflate(denominator(g), [power])
425+
gp = evaluate(gd, [1], [substitutes[1]])
426+
end
416427
end
417428
a, r = divrem(numerator(gp), denominator(gp))
418429
push!(L, (c, denominator(gp), r, a))
@@ -447,6 +458,9 @@ function (R::GenericCycloRing)(f::Dict{UPolyFrac,UPoly}; simplify::Bool=true) #
447458
gp = g
448459
else
449460
gp = evaluate(g, [1], [substitutes[2]])
461+
if !isone(power)
462+
gp = inflate(numerator(gp), [power])//inflate(denominator(gp), [power])
463+
end
450464
end
451465
if haskey(fp, gp)
452466
fp[gp] += cp * c
@@ -480,9 +494,10 @@ function generic_cyclotomic_ring(
480494
R::UPolyRing,
481495
symbol::Symbol=:E;
482496
congruence::Union{Tuple{ZZRingElem,ZZRingElem},Nothing}=nothing,
497+
power::Int64=1,
483498
cached::Bool=true,
484499
)
485-
S = GenericCycloRing(R, symbol, congruence)
500+
S = GenericCycloRing(R, symbol, congruence, power)
486501
E = GenericCycloRingGen(S)
487502
length(gens(R)) < 1 && error("At least one free variable is needed")
488503
return (S, E)

src/Types.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ mutable struct GenericCycloRing <: Ring
2323
base_ring::UPolyRing
2424
symbol::Symbol
2525
congruence::Union{Tuple{ZZRingElem,ZZRingElem},Nothing}
26+
power::Int64
2627
substitute::UPoly
2728
substitute_inv::UPoly
2829
function GenericCycloRing(
2930
R::UPolyRing,
3031
symbol::Symbol,
3132
congruence::Union{Tuple{ZZRingElem,ZZRingElem},Nothing},
33+
power::Int64
3234
)
33-
return new(R, symbol, congruence)
35+
return new(R, symbol, congruence, power)
3436
end
3537
end
3638

0 commit comments

Comments
 (0)