Skip to content

Commit 6ff7f7a

Browse files
committed
Towards lattices
1 parent 829741c commit 6ff7f7a

File tree

23 files changed

+942
-165
lines changed

23 files changed

+942
-165
lines changed

src/AlgAss/AbsAlgAss.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,8 @@ end
14731473

14741474
# Given epimorphism h : A -> B, transport the refined wedderburn decomposition
14751475
# of A to B
1476-
function _transport_refined_wedderburn_decomposition_forward(h::AbsAlgAssMor)
1476+
function _transport_refined_wedderburn_decomposition_forward(h::AbsAlgAssMor; is_anti::Bool = false)
1477+
# is_anti = h is anti-morphism
14771478
A = domain(h)
14781479
B = codomain(h)
14791480

@@ -1510,7 +1511,15 @@ function _transport_refined_wedderburn_decomposition_forward(h::AbsAlgAssMor)
15101511
CtoBc = hom(C, Bc, M, inv(M))
15111512
if isdefined(C, :isomorphic_full_matrix_algebra)
15121513
CM, CtoCM = C.isomorphic_full_matrix_algebra
1514+
#bmat = basis_matrix([CM(transpose(matrix(x)), check = false) for x in basis(CM)])
1515+
#ff = hom(CM, CM, bmat, inv(bmat))
15131516
f = AbsAlgAssMorGen(Bc, CM, inv(CtoBc).mat * CtoCM.M, CtoCM.Minv * CtoBc.mat)
1517+
if is_anti
1518+
BB = matrix([coefficients(CM(transpose(matrix(f(b))), check = false)) for b in basis(Bc)])
1519+
BBinv = matrix([coefficients(preimage(CtoCM, CM(transpose(matrix(b)), check = false))) for b in _absolute_basis(CM)])
1520+
#BBinv = inv(BB)
1521+
f = AbsAlgAssMorGen(Bc, CM, BB, BBinv)
1522+
end
15141523
Bc.isomorphic_full_matrix_algebra = CM, f
15151524
end
15161525
end

src/AlgAss/AlgGrp.jl

Lines changed: 132 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,21 @@ end
126126
#
127127
################################################################################
128128

129+
function show(io::IO, ::MIME"text/plain", A::AlgGrp)
130+
io = pretty(io)
131+
println(io, "Group algebra")
132+
print(io, Indent())
133+
println(io, "of ", Lowercase(), group(A))
134+
print(io, "over ", Lowercase(), base_ring(A))
135+
print(io, Dedent())
136+
end
137+
129138
function show(io::IO, A::AlgGrp)
130-
compact = get(io, :compact, false)
131-
if compact
139+
if get(io, :supercompact, false)
132140
print(io, "Group algebra of dimension ", dim(A), " over ", base_ring(A))
133141
else
134-
print(io, "Group algebra of group\n", group(A), "\nover\n", base_ring(A))
142+
print(io, "Group algebra of group of order ", order(group(A)), " over ")
143+
print(IOContext(io, :supercompact => true), base_ring(A))
135144
end
136145
end
137146

@@ -491,121 +500,121 @@ end
491500

492501
automorphism_map(f::NfToAlgGrpMor) = f.mG
493502

494-
function galois_module(K::AnticNumberField, aut::Map = automorphism_group(K)[2]; normal_basis_generator = normal_basis(K))
495-
G = domain(aut)
496-
A = FlintQQ[G]
497-
return _galois_module(K, A, aut, normal_basis_generator = normal_basis_generator)
498-
end
499-
500-
function _galois_module(K::AnticNumberField, A, aut::Map = automorphism_group(K)[2]; normal_basis_generator = normal_basis(K))
501-
G = domain(aut)
502-
alpha = normal_basis_generator
503-
504-
basis_alpha = Vector{elem_type(K)}(undef, dim(A))
505-
for (i, g) in enumerate(G)
506-
f = aut(g)
507-
basis_alpha[A.group_to_base[g]] = f(alpha)
508-
end
509-
510-
M = zero_matrix(base_field(K), degree(K), degree(K))
511-
for i = 1:degree(K)
512-
a = basis_alpha[i]
513-
for j = 1:degree(K)
514-
M[i, j] = coeff(a, j - 1)
515-
end
516-
end
517-
518-
invM = inv(M)
519-
520-
z = NfToAlgGrpMor{QQFieldElem, GrpGen, GrpGenElem}()
521-
z.K = K
522-
z.mG = aut
523-
z.A = A
524-
z.M = M
525-
z.Minv = invM
526-
527-
return A, z
528-
end
529-
530-
function galois_module(K::AnticNumberField, A::AlgGrp; normal_basis_generator = normal_basis(K))
531-
G = group(A)
532-
Au, mAu = automorphism_group(K)
533-
fl, f = is_isomorphic_with_map(G, Au)
534-
@assert fl
535-
aut = Vector{NfToNfMor}(undef, order(G))
536-
for g in G
537-
aut[g[]] = mAu(f(g))
538-
end
539-
h = GrpGenToNfMorSet(G, aut, K)
540-
541-
return _galois_module(K, A, h, normal_basis_generator = normal_basis(K))
542-
end
543-
544-
domain(f::NfToAlgGrpMor) = f.K
545-
546-
codomain(f::NfToAlgGrpMor) = f.A
547-
548-
function image(f::NfToAlgGrpMor, x::nf_elem)
549-
K = domain(f)
550-
@assert parent(x) === K
551-
A = codomain(f)
552-
553-
t = zero_matrix(base_field(K), 1, degree(K))
554-
for i = 1:degree(K)
555-
t[1, i] = coeff(x, i - 1)
556-
end
557-
y = t*f.Minv
558-
return A([ y[1, i] for i = 1:degree(K) ])
559-
end
560-
561-
function preimage(f::NfToAlgGrpMor, x::AlgGrpElem)
562-
K = domain(f)
563-
t = matrix(base_field(K), 1, degree(K), coefficients(x))
564-
y = t*f.M
565-
v = QQFieldElem[ y[1, i] for i = 1:degree(K) ]
566-
return K(v)
567-
end
568-
569-
# Returns the group algebra Q[G] where G = Gal(K/Q) and a Q-linear map from K
570-
# to Q[G] and one from Q[G] to K
571-
function _galois_module(K::AnticNumberField, to_automorphisms::Map = automorphism_group(K)[2]; normal_basis_generator = normal_basis(K))
572-
G = domain(to_automorphisms)
573-
A = FlintQQ[G]
574-
alpha = normal_basis_generator
575-
576-
basis_alpha = Vector{elem_type(K)}(undef, dim(A))
577-
for (i, g) in enumerate(G)
578-
f = to_automorphisms(g)
579-
basis_alpha[A.group_to_base[g]] = f(alpha)
580-
end
581-
582-
M = zero_matrix(base_field(K), degree(K), degree(K))
583-
for i = 1:degree(K)
584-
a = basis_alpha[i]
585-
for j = 1:degree(K)
586-
M[i, j] = coeff(a, j - 1)
587-
end
588-
end
589-
590-
invM = inv(M)
591-
592-
function KtoA(x::nf_elem)
593-
t = zero_matrix(base_field(K), 1, degree(K))
594-
for i = 1:degree(K)
595-
t[1, i] = coeff(x, i - 1)
596-
end
597-
y = t*invM
598-
return A([ y[1, i] for i = 1:degree(K) ])
599-
end
600-
601-
function AtoK(x::AlgGrpElem)
602-
t = matrix(base_field(K), 1, degree(K), coefficients(x))
603-
y = t*M
604-
return K(parent(K.pol)([ y[1, i] for i = 1:degree(K) ]))
605-
end
606-
607-
return A, KtoA, AtoK
608-
end
503+
#function galois_module(K::AnticNumberField, aut::Map = automorphism_group(K)[2]; normal_basis_generator = normal_basis(K))
504+
# G = domain(aut)
505+
# A = FlintQQ[G]
506+
# return _galois_module(K, A, aut, normal_basis_generator = normal_basis_generator)
507+
#end
508+
#
509+
#function _galois_module(K::AnticNumberField, A, aut::Map = automorphism_group(K)[2]; normal_basis_generator = normal_basis(K))
510+
# G = domain(aut)
511+
# alpha = normal_basis_generator
512+
#
513+
# basis_alpha = Vector{elem_type(K)}(undef, dim(A))
514+
# for (i, g) in enumerate(G)
515+
# f = aut(g)
516+
# basis_alpha[A.group_to_base[g]] = f(alpha)
517+
# end
518+
#
519+
# M = zero_matrix(base_field(K), degree(K), degree(K))
520+
# for i = 1:degree(K)
521+
# a = basis_alpha[i]
522+
# for j = 1:degree(K)
523+
# M[i, j] = coeff(a, j - 1)
524+
# end
525+
# end
526+
#
527+
# invM = inv(M)
528+
#
529+
# z = NfToAlgGrpMor{QQFieldElem, GrpGen, GrpGenElem}()
530+
# z.K = K
531+
# z.mG = aut
532+
# z.A = A
533+
# z.M = M
534+
# z.Minv = invM
535+
#
536+
# return A, z
537+
#end
538+
#
539+
#function galois_module(K::AnticNumberField, A::AlgGrp; normal_basis_generator = normal_basis(K))
540+
# G = group(A)
541+
# Au, mAu = automorphism_group(K)
542+
# fl, f = is_isomorphic_with_map(G, Au)
543+
# @assert fl
544+
# aut = Vector{NfToNfMor}(undef, order(G))
545+
# for g in G
546+
# aut[g[]] = mAu(f(g))
547+
# end
548+
# h = GrpGenToNfMorSet(G, aut, K)
549+
#
550+
# return _galois_module(K, A, h, normal_basis_generator = normal_basis(K))
551+
#end
552+
#
553+
#domain(f::NfToAlgGrpMor) = f.K
554+
#
555+
#codomain(f::NfToAlgGrpMor) = f.A
556+
#
557+
#function image(f::NfToAlgGrpMor, x::nf_elem)
558+
# K = domain(f)
559+
# @assert parent(x) === K
560+
# A = codomain(f)
561+
#
562+
# t = zero_matrix(base_field(K), 1, degree(K))
563+
# for i = 1:degree(K)
564+
# t[1, i] = coeff(x, i - 1)
565+
# end
566+
# y = t*f.Minv
567+
# return A([ y[1, i] for i = 1:degree(K) ])
568+
#end
569+
#
570+
#function preimage(f::NfToAlgGrpMor, x::AlgGrpElem)
571+
# K = domain(f)
572+
# t = matrix(base_field(K), 1, degree(K), coefficients(x))
573+
# y = t*f.M
574+
# v = QQFieldElem[ y[1, i] for i = 1:degree(K) ]
575+
# return K(v)
576+
#end
577+
#
578+
## Returns the group algebra Q[G] where G = Gal(K/Q) and a Q-linear map from K
579+
## to Q[G] and one from Q[G] to K
580+
#function _galois_module(K::AnticNumberField, to_automorphisms::Map = automorphism_group(K)[2]; normal_basis_generator = normal_basis(K))
581+
# G = domain(to_automorphisms)
582+
# A = FlintQQ[G]
583+
# alpha = normal_basis_generator
584+
#
585+
# basis_alpha = Vector{elem_type(K)}(undef, dim(A))
586+
# for (i, g) in enumerate(G)
587+
# f = to_automorphisms(g)
588+
# basis_alpha[A.group_to_base[g]] = f(alpha)
589+
# end
590+
#
591+
# M = zero_matrix(base_field(K), degree(K), degree(K))
592+
# for i = 1:degree(K)
593+
# a = basis_alpha[i]
594+
# for j = 1:degree(K)
595+
# M[i, j] = coeff(a, j - 1)
596+
# end
597+
# end
598+
#
599+
# invM = inv(M)
600+
#
601+
# function KtoA(x::nf_elem)
602+
# t = zero_matrix(base_field(K), 1, degree(K))
603+
# for i = 1:degree(K)
604+
# t[1, i] = coeff(x, i - 1)
605+
# end
606+
# y = t*invM
607+
# return A([ y[1, i] for i = 1:degree(K) ])
608+
# end
609+
#
610+
# function AtoK(x::AlgGrpElem)
611+
# t = matrix(base_field(K), 1, degree(K), coefficients(x))
612+
# y = t*M
613+
# return K(parent(K.pol)([ y[1, i] for i = 1:degree(K) ]))
614+
# end
615+
#
616+
# return A, KtoA, AtoK
617+
#end
609618

610619
const _reps = [(i=24,j=12,n=5,dims=(1,1,2,3,3),
611620
reps=Vector{Vector{Rational{BigInt}}}[[[1],[1],[1],[1]],
@@ -928,13 +937,13 @@ function _absolute_basis(A)
928937
n = degree(K)
929938
B = Vector{elem_type(A)}()
930939
bK = basis(K)
931-
for i in 1:n
932-
for j in 1:m
940+
for i in 1:m
941+
for j in 1:n
933942
v = Vector{elem_type(K)}(undef, m)
934943
for k in 1:m
935-
v[i] = zero(K)
944+
v[k] = zero(K)
936945
end
937-
v[j] = bK[j]
946+
v[i] = bK[j]
938947
push!(B, A(v))
939948
end
940949
end
@@ -1107,7 +1116,7 @@ function is_almost_maximally_ramified(K::AnticNumberField, p::ZZRingElem)
11071116
return true
11081117
end
11091118

1110-
function hom(KG::AlgGrp, KH::AlgGrp, m::GrpGenToGrpGenMor)
1119+
function hom(KG::AlgGrp, KH::AlgGrp, m::Map)
11111120
@assert base_ring(KG) === base_ring(KH)
11121121
K = base_ring(KG)
11131122
M = zero_matrix(K, dim(KG), dim(KH))

src/AlgAss/AlgMat.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,22 @@ function multiplication_table(A::AlgMat; copy::Bool = true)
221221
end
222222
end
223223

224+
function denominator_of_multiplication_table(A::AlgMat)
225+
get_attribute!(A, :denominator_of_multiplication_table) do
226+
den = one(ZZ)
227+
mt = multiplication_table(A)
228+
d = degree(A)
229+
for i in 1:d
230+
for j in 1:d
231+
for k in 1:d
232+
den = lcm!(den, den, denominator(mt[i, j, k]))
233+
end
234+
end
235+
end
236+
return den
237+
end::ZZRingElem
238+
end
239+
224240
################################################################################
225241
#
226242
# Construction

src/AlgAss/AlgMatElem.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ end
7979

8080
function +(a::AlgMatElem{T, S, V}, b::AlgMatElem{T, S, V}) where {T, S, V}
8181
parent(a) != parent(b) && error("Parents don't match.")
82-
c = parent(a)(matrix(a, copy = false) + matrix(b, copy = false))
82+
c = parent(a)(matrix(a, copy = false) + matrix(b, copy = false), check = false)
8383
if a.has_coeffs && b.has_coeffs
8484
c.coeffs = [ coefficients(a, copy = false)[i] + coefficients(b, copy = false)[i] for i = 1:dim(parent(a)) ]
8585
c.has_coeffs = true
@@ -157,25 +157,25 @@ function *(a::AlgMatElem, b::T) where {T <: RingElem}
157157
if parent(b) == base_ring(A)
158158
b = coefficient_ring(A)(b)
159159
end
160-
return A(matrix(a, copy = false)*b)::elem_type(A)
160+
return A(matrix(a, copy = false)*b, check = false)::elem_type(A)
161161
end
162162

163163
function *(b::T, a::AlgMatElem) where {T <: RingElem}
164164
A = parent(a)
165165
if parent(b) == base_ring(A)
166166
b = coefficient_ring(A)(b)
167167
end
168-
return A(b*matrix(a, copy = false))::elem_type(A)
168+
return A(b*matrix(a, copy = false), check = false)::elem_type(A)
169169
end
170170

171171
function *(a::AlgMatElem{S, T, U}, b::U) where { S, T, U <: MatElem }
172172
A = parent(a)
173-
return A(matrix(a, copy = false)*b)
173+
return A(matrix(a, copy = false)*b, check = false)
174174
end
175175

176176
function *(b::U, a::AlgMatElem{S, T, U}) where { S, T, U <: MatElem }
177177
A = parent(a)
178-
return A(b*matrix(a, copy = false))
178+
return A(b*matrix(a, copy = false), check = false)
179179
end
180180

181181
################################################################################
@@ -224,7 +224,7 @@ end
224224

225225
function (A::AlgMat)()
226226
n = degree(A)
227-
return A(zero_matrix(coefficient_ring(A), n, n))
227+
return A(zero_matrix(coefficient_ring(A), n, n), check = false)
228228
end
229229

230230
function (A::AlgMat{T, S})(M::S; check::Bool = true) where {T, S}
@@ -262,7 +262,7 @@ function (A::AlgMat{T, S})(v::Vector{T}; copy::Bool = true) where { T, S }
262262
#M = add!(M, M, matrix(basis(A)[i], copy = false)*v[i])
263263
M += matrix(B[i], copy = false)*R(v[i])
264264
end
265-
a = A(M)
265+
a = A(M; check = false)
266266
if copy
267267
a.coeffs = Base.copy(v)
268268
else

0 commit comments

Comments
 (0)