From 3827650fec4c3525d702d140fb9a30cd2c9959e2 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 19 Feb 2019 15:04:47 +0100 Subject: [PATCH 1/2] use a Julia iterator in `MinimalDegreeHard` --- JuliaExperimental/julia/loewy.jl | 126 +++++++++++++++++++------------ 1 file changed, 79 insertions(+), 47 deletions(-) diff --git a/JuliaExperimental/julia/loewy.jl b/JuliaExperimental/julia/loewy.jl index fc9c8394..420f42e3 100644 --- a/JuliaExperimental/julia/loewy.jl +++ b/JuliaExperimental/julia/loewy.jl @@ -350,48 +350,75 @@ function DivisorsInt( n::Int ) return sort( divs( 1, 1 ) ) end; - -raw""" -> V( m, n, s ) -> Enumerate the set `V(m,n,s)` of all vectors of length `n` +""" +> VectorIterator( m, n, s ) +> Iterate over all vectors of length `n` > with entries in the set { 0, 1, 2, ... `m` } -> and coefficient sum `s`, -> such that a largest entry is in the first position. -> -> \[ -> V(m,n,s) = \bigcup_{0 \leq a \leq \min\{ m, s \}} -> \{ [a,v]; v \in V(m,n-1,s-a) \} -> \] -""" -# replace this by an iterator, we just want to run over the elements! -function Vinner( m::Int, n::Int, s::Int ) - local result, a - - if s == 0 - return [ zeros( Int, n ) ] - elseif n == 0 || m*n < s - return [] - end - - result = [] - for a in 0:min( m, s ) - append!( result, map( v -> append!( [ a ], v ), - Vinner( m, n-1, s-a ) ) ) - end - return result -end; +> and coefficient sum `s`. +> The vectors are enumerated in lexicographical order. +> (The functions change the vectors in place, +> just collecting the results makes no sense.) +""" +mutable struct VectorIterator + m::Int + n::Int + s::Int +end -function V( m::Int, n::Int, s::Int ) - local result, a +# Auxiliary function for the iterator: +# Distribute `s` to the first `n` positions in the array `v` +# such that as many initial entries are `m`. +function VectorIterator_ResetPrefix( v::Array{Int,1}, m::Int, n::Int, s::Int ) + local rest::Int, i::Int, j::Int - result = [] - for a in 1:m - append!( result, map( v -> append!( [ a ], v ), - Vinner( a, n-1, s-a ) ) ) + rest = s + i = 1 + while m < rest + v[i] = m + rest = rest - m + i = i + 1 end - return result -end; + v[i] = rest + for j in (i+1):n + v[j] = 0 + end + + return v +end +# Initialize the iterator. +function Base.iterate( vi::VectorIterator ) + local next::Array{Int,1} + + if vi.s > vi.m * vi.n + # The iterator is empty. + return + end + next = VectorIterator_ResetPrefix( zeros( Int, vi.n ), vi.m, vi.n, vi.s ) + return ( next, next ) +end + +# Define the iteration step. +# Note that `state` is changed in place. +function Base.iterate( vi::VectorIterator, state::Array{Int,1} ) + local sum::Int, i::Int + + # Find the first position with a nonzero value + # such that the value on the right is smaller than m. + sum = -1 + for i in 1:(vi.n-1) + sum = sum + state[i] + if state[i] != 0 && state[ i+1 ] < vi.m + state[i] = state[i] - 1 + state[i+1] = state[i+1] + 1 + VectorIterator_ResetPrefix( state, vi.m, i, sum ) + return ( state, state ) + end + end + + # There is no such position, we are done. + return +end """ MinimalDegreeCheap( q::Int, n::Int, e ) @@ -471,19 +498,21 @@ end; function MinimalDegreeHard( q::Int, n::Int, e::T ) where {T<:Integer} local powers, m, v - powers = map( i -> powermod( q, i, e ), 0:(n-1) ) + powers = map( i -> powermod( q, i, e ), 1:(n-1) ) m = 3 while true - for v in V( m, n, m ) - if mod( sum( v .* powers ), e ) == 0 + for a in 1:m + for v in VectorIterator( a, n-1, m-a ) + if mod( a + sum( v .* powers ), e ) == 0 # is there no dot( v, powers ) anymore in Julia 1.0?? # ('.*' needs same length of its operands) - if ! haskey( MinimalDegreeCache, e ) - MinimalDegreeCache[e] = Dict() + if ! haskey( MinimalDegreeCache, e ) + MinimalDegreeCache[e] = Dict() + end + MinimalDegreeCache[e][q] = m + return m end - MinimalDegreeCache[e][q] = m - return m end end m = m + 1 @@ -718,9 +747,12 @@ function test_this_module() ok = false end - # V( m, n, s ) - if LoewyStructure.V( 3, 3, 4 ) != - [ [ 2, 0, 2 ], [ 2, 1, 1 ], [ 2, 2, 0 ], [ 3, 0, 1 ], [ 3, 1, 0 ] ] + # VectorIterator( m, n, s ) + n = 0 + for i in VectorIterator( 2, 5, 7 ) + n = n + 1 + end + if n != 30 ok = false end From d9420222fe3a2119a30cc61a1c67fc4cb728123a Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 19 Feb 2019 17:58:06 +0100 Subject: [PATCH 2/2] some tests are shorter now and the longer version is available in a separate test file --- JuliaExperimental/tst/loewy.tst | 488 +------------------------- JuliaExperimental/tst/loewy_ext.tst | 523 ++++++++++++++++++++++++++++ 2 files changed, 536 insertions(+), 475 deletions(-) create mode 100644 JuliaExperimental/tst/loewy_ext.tst diff --git a/JuliaExperimental/tst/loewy.tst b/JuliaExperimental/tst/loewy.tst index e24be4d4..f134e822 100644 --- a/JuliaExperimental/tst/loewy.tst +++ b/JuliaExperimental/tst/loewy.tst @@ -24,9 +24,15 @@ gap> a:= SingerAlgebra( 5, 2, 4 );; GeneratorsOfAlgebraWithOne( a ); gap> a:= SingerAlgebra( 5, 2, 4 );; Centre( a ); A(5,2,4) +## Auxiliary function: +## Test only one generator from each cyclic group of prime residues. +gap> SmallestPrimeResidueGenerators:= e -> Filtered( PrimeResidues( e ), +> q -> ForAll( PrimeResidues( OrderMod( q, e ) ), +> i -> PowerModInt( q, i, e ) >= q ) );; + ## Test the minimal degree computation (in Julia). -gap> for e in [ 2 .. 30 ] do -> for q in PrimeResidues( e ) do +gap> for e in [ 2 .. 15 ] do +> for q in SmallestPrimeResidueGenerators( e ) do > if q = 1 then > q:= e+1; > fi; @@ -46,15 +52,12 @@ gap> for e in [ 2 .. 30 ] do [ 3, 4, 2 ] [ 6, 5, 5 ] [ 2, 5, 2 ] -[ 3, 5, 2 ] [ 4, 5, 2 ] [ 7, 6, 6 ] [ 5, 6, 2 ] [ 8, 7, 7 ] [ 2, 7, 3 ] [ 3, 7, 2 ] -[ 4, 7, 3 ] -[ 5, 7, 2 ] [ 6, 7, 2 ] [ 9, 8, 8 ] [ 3, 8, 4 ] @@ -63,22 +66,13 @@ gap> for e in [ 2 .. 30 ] do [ 10, 9, 9 ] [ 2, 9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5, 29, 2 ] -[ 6, 29, 2 ] -[ 7, 29, 4 ] -[ 8, 29, 2 ] -[ 9, 29, 2 ] -[ 10, 29, 2 ] -[ 11, 29, 2 ] -[ 12, 29, 2 ] -[ 13, 29, 2 ] -[ 14, 29, 2 ] -[ 15, 29, 2 ] -[ 16, 29, 4 ] -[ 17, 29, 2 ] -[ 18, 29, 2 ] -[ 19, 29, 2 ] -[ 20, 29, 4 ] -[ 21, 29, 2 ] -[ 22, 29, 2 ] -[ 23, 29, 4 ] -[ 24, 29, 4 ] -[ 25, 29, 4 ] -[ 26, 29, 2 ] -[ 27, 29, 2 ] -[ 28, 29, 2 ] -[ 31, 30, 30 ] -[ 7, 30, 6 ] -[ 11, 30, 10 ] -[ 13, 30, 6 ] -[ 17, 30, 4 ] -[ 19, 30, 6 ] -[ 23, 30, 4 ] -[ 29, 30, 2 ] ## Test the Loewy length computations in Julia. -gap> for e in [ 2 .. 30 ] do -> for q in PrimeResidues( e ) do +gap> for e in [ 2 .. 15 ] do +> for q in SmallestPrimeResidueGenerators( e ) do > if q = 1 then > q:= e+1; > fi; @@ -341,15 +119,12 @@ gap> for e in [ 2 .. 30 ] do [ 3, 4, 3 ] [ 6, 5, 2 ] [ 2, 5, 3 ] -[ 3, 5, 5 ] [ 4, 5, 4 ] [ 7, 6, 2 ] [ 5, 6, 5 ] [ 8, 7, 2 ] [ 2, 7, 2 ] [ 3, 7, 7 ] -[ 4, 7, 4 ] -[ 5, 7, 13 ] [ 6, 7, 6 ] [ 9, 8, 2 ] [ 3, 8, 2 ] @@ -358,19 +133,13 @@ gap> for e in [ 2 .. 30 ] do [ 10, 9, 2 ] [ 2, 9, 4 ] [ 4, 9, 4 ] -[ 5, 9, 13 ] -[ 7, 9, 7 ] [ 8, 9, 8 ] [ 11, 10, 2 ] [ 3, 10, 5 ] -[ 7, 10, 13 ] [ 9, 10, 9 ] [ 12, 11, 2 ] [ 2, 11, 6 ] [ 3, 11, 4 ] -[ 4, 11, 6 ] -[ 5, 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, 24, 2 ] -[ 5, 24, 2 ] -[ 7, 24, 3 ] -[ 11, 24, 6 ] -[ 13, 24, 3 ] -[ 17, 24, 5 ] -[ 19, 24, 7 ] -[ 23, 24, 23 ] -[ 26, 25, 2 ] -[ 6, 25, 6 ] -[ 7, 25, 13 ] -[ 11, 25, 11 ] -[ 18, 25, 35 ] -[ 24, 25, 24 ] -[ 27, 26, 2 ] -[ 3, 26, 2 ] -[ 5, 26, 9 ] -[ 9, 26, 5 ] -[ 21, 26, 41 ] -[ 25, 26, 25 ] -[ 28, 27, 2 ] -[ 2, 27, 10 ] -[ 4, 27, 10 ] -[ 8, 27, 22 ] -[ 10, 27, 4 ] -[ 19, 27, 7 ] -[ 26, 27, 26 ] -[ 29, 28, 2 ] -[ 3, 28, 7 ] -[ 5, 28, 7 ] -[ 9, 28, 7 ] -[ 13, 28, 7 ] -[ 15, 28, 3 ] -[ 25, 28, 19 ] -[ 27, 28, 27 ] -[ 30, 29, 2 ] -[ 12, 29, 23 ] -[ 17, 29, 33 ] -[ 28, 29, 28 ] -[ 31, 30, 2 ] -[ 7, 30, 5 ] -[ 11, 30, 3 ] -[ 13, 30, 9 ] -[ 17, 30, 17 ] -[ 19, 30, 7 ] -[ 23, 30, 23 ] -[ 29, 30, 29 ] ## Test 'DimensionsLoewyFactors'. -gap> for e in [ 2 .. 30 ] do -> for q in PrimeResidues( e ) do +gap> for e in [ 2 .. 15 ] do +> for q in SmallestPrimeResidueGenerators( e ) do > if q = 1 then > q:= e+1; > fi; @@ -514,15 +183,12 @@ gap> for e in [ 2 .. 30 ] do [ 3, 4, [ 1, 1, 1 ] ] [ 6, 5, [ 1, 1 ] ] [ 2, 5, [ 1, 2, 1 ] ] -[ 3, 5, [ 1, 6, 7, 2, 1 ] ] [ 4, 5, [ 1, 1, 1, 1 ] ] [ 7, 6, [ 1, 1 ] ] [ 5, 6, [ 1, 1, 1, 1, 1 ] ] [ 8, 7, [ 1, 1 ] ] [ 2, 7, [ 1, 1 ] ] [ 3, 7, [ 1, 17, 38, 31, 14, 3, 1 ] ] -[ 4, 7, [ 1, 7, 1, 1 ] ] -[ 5, 7, [ 1, 35, 146, 312, 451, 470, 387, 242, 125, 46, 14, 3, 1 ] ] [ 6, 7, [ 1, 1, 1, 1, 1, 1 ] ] [ 9, 8, [ 1, 1 ] ] [ 3, 8, [ 1, 1 ] ] @@ -531,19 +197,13 @@ gap> for e in [ 2 .. 30 ] do [ 10, 9, [ 1, 1 ] ] [ 2, 9, [ 1, 3, 3, 1 ] ] [ 4, 9, [ 1, 3, 3, 1 ] ] -[ 5, 9, [ 1, 33, 126, 252, 351, 360, 291, 180, 93, 34, 12, 3, 1 ] ] -[ 7, 9, [ 1, 6, 9, 10, 9, 3, 1 ] ] [ 8, 9, [ 1, 1, 1, 1, 1, 1, 1, 1 ] ] [ 11, 10, [ 1, 1 ] ] [ 3, 10, [ 1, 2, 3, 2, 1 ] ] -[ 7, 10, [ 1, 10, 27, 40, 41, 38, 35, 22, 13, 8, 3, 2, 1 ] ] [ 9, 10, [ 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] [ 12, 11, [ 1, 1 ] ] [ 2, 11, [ 1, 27, 40, 20, 5, 1 ] ] [ 3, 11, [ 1, 11, 10, 1 ] ] -[ 4, 11, [ 1, 21, 40, 26, 5, 1 ] ] -[ 5, 11, [ 1, 26, 75, 96, 65, 21, 1 ] ] -[ 9, 11, [ 1, 46, 175, 401, 680, 911, 981, 865, 656, 395, 186, 61, 10, 1 ] ] [ 10, 11, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] [ 13, 12, [ 1, 1 ] ] [ 5, 12, [ 1, 1, 1 ] ] @@ -554,143 +214,21 @@ gap> for e in [ 2 .. 30 ] do [ 3, 13, [ 1, 1, 1 ] ] [ 4, 13, [ 1, 23, 56, 84, 74, 44, 22, 8, 3, 1 ] ] [ 5, 13, [ 1, 6, 11, 12, 9, 4, 3, 2, 1 ] ] -[ 8, 13, [ 1, 10, 27, 40, 45, 50, 43, 36, 27, 18, 9, 4, 3, 2, 1 ] ] -[ 9, 13, [ 1, 10, 19, 10, 7, 7, 1, 1, 1 ] ] [ 12, 13, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] [ 15, 14, [ 1, 1 ] ] [ 3, 14, [ 1, 11, 18, 13, 6, 3, 1 ] ] -[ 5, 14, [ 1, 29, 102, 186, 227, 222, 169, 98, 51, 22, 6, 3, 1 ] ] [ 9, 14, [ 1, 7, 15, 16, 10, 3, 1 ] ] -[ 11, 14, [ 1, 7, 18, 22, 25, 15, 7, 1 ] ] [ 13, 14, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] [ 16, 15, [ 1, 1 ] ] [ 2, 15, [ 1, 1 ] ] [ 4, 15, [ 1, 1 ] ] [ 7, 15, [ 1, 10, 28, 38, 39, 24, 16, 4, 1 ] ] -[ 8, 15, [ 1, 55, 81, 89, 31, 15, 1, 1 ] ] [ 11, 15, [ 1, 2, 3, 2, 1 ] ] -[ 13, 15, [ 1, 22, 60, 108, 155, 200, 234, 250, 243, 210, 162, 116, 79, 44, - 16, 4, 1 ] ] [ 14, 15, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 17, 16, [ 1, 1 ] ] -[ 3, 16, [ 1, 4, 1 ] ] -[ 5, 16, [ 1, 8, 22, 8, 1 ] ] -[ 7, 16, [ 1, 1, 1, 1 ] ] -[ 9, 16, [ 1, 4, 1 ] ] -[ 11, 16, [ 1, 36, 113, 172, 193, 176, 131, 64, 25, 4, 1 ] ] -[ 13, 16, [ 1, 24, 76, 144, 221, 288, 336, 308, 225, 112, 42, 8, 1 ] ] -[ 15, 16, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 18, 17, [ 1, 1 ] ] -[ 2, 17, [ 1, 4, 6, 4, 1 ] ] -[ 4, 17, [ 1, 2, 3, 4, 3, 2, 1 ] ] -[ 13, 17, [ 1, 14, 39, 76, 109, 126, 139, 148, 157, 150, 139, 128, 117, 92, - 71, 54, 41, 28, 19, 14, 9, 4, 3, 2, 1 ] ] -[ 16, 17, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 19, 18, [ 1, 1 ] ] -[ 5, 18, [ 1, 33, 90, 142, 177, 168, 127, 72, 33, 16, 6, 3, 1 ] ] -[ 7, 18, [ 1, 9, 9, 1 ] ] -[ 13, 18, [ 1, 12, 27, 43, 30, 9, 1 ] ] -[ 17, 18, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 20, 19, [ 1, 1 ] ] -[ 7, 19, [ 1, 7, 7, 1, 1, 1, 1 ] ] -[ 11, 19, [ 1, 10, 19, 13, 10, 7, 7, 1, 1, 1, 1 ] ] -[ 18, 19, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 21, 20, [ 1, 1 ] ] -[ 3, 20, [ 1, 3, 1 ] ] -[ 7, 20, [ 1, 27, 41, 35, 13, 3, 1 ] ] -[ 9, 20, [ 1, 1, 1, 1, 1 ] ] -[ 11, 20, [ 1, 5, 1 ] ] -[ 13, 20, [ 1, 19, 53, 107, 177, 235, 273, 255, 177, 91, 33, 7, 1 ] ] -[ 17, 20, [ 1, 19, 65, 139, 229, 339, 465, 563, 613, 591, 489, 339, 193, 91, - 33, 7, 1 ] ] -[ 19, 20, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 22, 21, [ 1, 1 ] ] -[ 2, 21, [ 1, 2, 1 ] ] -[ 4, 21, [ 1, 1, 1, 1 ] ] -[ 5, 21, [ 1, 29, 74, 120, 157, 140, 99, 62, 35, 16, 8, 3, 1 ] ] -[ 8, 21, [ 1, 2, 1 ] ] -[ 13, 21, [ 1, 3, 3, 1, 1 ] ] -[ 16, 21, [ 1, 13, 25, 37, 25, 22, 19, 19, 10, 7, 7, 7, 1, 1, 1, 1 ] ] -[ 20, 21, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 23, 22, [ 1, 1 ] ] -[ 3, 22, [ 1, 10, 1 ] ] -[ 5, 22, [ 1, 40, 56, 40, 5, 1 ] ] -[ 9, 22, [ 1, 95, 321, 535, 595, 521, 370, 181, 60, 5, 1 ] ] -[ 21, 22, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ] ] -[ 24, 23, [ 1, 1 ] ] -[ 2, 23, [ 1, 44, 44, 1 ] ] -[ 3, 23, [ 1, 407, 2002, 2894, 1826, 517, 55, 1 ] ] -[ 22, 23, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - ] ] -[ 25, 24, [ 1, 1 ] ] -[ 5, 24, [ 1, 1 ] ] -[ 7, 24, [ 1, 1, 1 ] ] -[ 11, 24, [ 1, 1, 1, 1, 1, 1 ] ] -[ 13, 24, [ 1, 6, 1 ] ] -[ 17, 24, [ 1, 3, 5, 3, 1 ] ] -[ 19, 24, [ 1, 2, 3, 4, 3, 2, 1 ] ] -[ 23, 24, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1 ] ] -[ 26, 25, [ 1, 1 ] ] -[ 6, 25, [ 1, 25, 130, 130, 25, 1 ] ] -[ 7, 25, [ 1, 6, 11, 16, 17, 14, 11, 6, 5, 4, 3, 2, 1 ] ] -[ 11, 25, [ 1, 45, 215, 675, 1405, 1761, 1410, 705, 200, 25, 1 ] ] -[ 18, 25, [ 1, 14, 43, 84, 129, 170, 199, 228, 249, 262, 267, 276, 273, 270, - 263, 240, 217, 194, 169, 144, 119, 94, 73, 56, 47, 38, 29, 20, 11, 6, - 5, 4, 3, 2, 1 ] ] -[ 24, 25, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 ] ] -[ 27, 26, [ 1, 1 ] ] -[ 3, 26, [ 1, 1 ] ] -[ 5, 26, [ 1, 2, 3, 4, 5, 4, 3, 2, 1 ] ] -[ 9, 26, [ 1, 19, 7, 1, 1 ] ] -[ 21, 26, [ 1, 18, 51, 100, 165, 226, 267, 304, 337, 366, 395, 404, 409, 410, - 411, 412, 393, 370, 347, 324, 301, 260, 223, 190, 161, 136, 111, 90, - 73, 60, 47, 34, 25, 20, 15, 10, 5, 4, 3, 2, 1 ] ] -[ 25, 26, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1 ] ] -[ 28, 27, [ 1, 1 ] ] -[ 2, 27, [ 1, 423, 1998, 3252, 2556, 1116, 300, 54, 9, 1 ] ] -[ 4, 27, [ 1, 144, 765, 1569, 2511, 2961, 1452, 288, 18, 1 ] ] -[ 8, 27, [ 1, 57, 198, 424, 681, 915, 1090, 1206, 1212, 1102, 924, 696, 484, - 306, 180, 112, 63, 33, 16, 6, 3, 1 ] ] -[ 10, 27, [ 1, 18, 18, 1 ] ] -[ 19, 27, [ 1, 21, 60, 91, 63, 18, 1 ] ] -[ 26, 27, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1 ] ] -[ 29, 28, [ 1, 1 ] ] -[ 3, 28, [ 1, 3, 6, 7, 6, 3, 1 ] ] -[ 5, 28, [ 1, 30, 123, 251, 135, 18, 1 ] ] -[ 9, 28, [ 1, 3, 6, 7, 6, 3, 1 ] ] -[ 13, 28, [ 1, 1, 1, 1, 1, 1, 1 ] ] -[ 15, 28, [ 1, 7, 1 ] ] -[ 25, 28, [ 1, 9, 18, 25, 33, 39, 46, 51, 57, 58, 54, 48, 43, 33, 21, 13, 6, - 3, 1 ] ] -[ 27, 28, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 ] ] -[ 30, 29, [ 1, 1 ] ] -[ 12, 29, [ 1, 10, 27, 44, 57, 66, 67, 68, 65, 66, 59, 48, 39, 30, 21, 16, - 11, 6, 5, 4, 3, 2, 1 ] ] -[ 17, 29, [ 1, 14, 39, 76, 109, 134, 155, 172, 189, 194, 199, 196, 193, 186, - 175, 156, 141, 120, 99, 82, 65, 48, 39, 30, 21, 16, 11, 6, 5, 4, 3, 2, - 1 ] ] -[ 28, 29, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1 ] ] -[ 31, 30, [ 1, 1 ] ] -[ 7, 30, [ 1, 16, 47, 16, 1 ] ] -[ 11, 30, [ 1, 3, 1 ] ] -[ 13, 30, [ 1, 32, 87, 210, 293, 222, 91, 16, 1 ] ] -[ 17, 30, [ 1, 43, 165, 307, 433, 435, 435, 317, 257, 155, 115, 57, 41, 15, - 7, 1, 1 ] ] -[ 19, 30, [ 1, 3, 3, 3, 1, 1, 1 ] ] -[ 23, 30, [ 1, 43, 193, 427, 729, 915, 1109, 1087, 1107, 901, 805, 571, 475, - 317, 257, 155, 115, 57, 41, 15, 7, 1, 1 ] ] -[ 29, 30, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1 ] ] ## Test 'LoewyStructureInfo'. gap> for e in [ 2 .. 30 ] do -> for q in PrimeResidues( e ) do +> for q in SmallestPrimeResidueGenerators( e ) do > if q = 1 then > q:= e+1; > fi; diff --git a/JuliaExperimental/tst/loewy_ext.tst b/JuliaExperimental/tst/loewy_ext.tst new file mode 100644 index 00000000..2ad81b18 --- /dev/null +++ b/JuliaExperimental/tst/loewy_ext.tst @@ -0,0 +1,523 @@ +############################################################################# +## +#W loewy_ext.tst GAP 4 package JuliaExperimental Thomas Breuer +## +gap> START_TEST( "loewy_ext.tst" ); + +## Test the general functionality of Singer algebras (not Julia related). +gap> a:= SingerAlgebra( 5, 2, 4 );; ParametersOfSingerAlgebra( a ); +[ 5, 2, 4 ] +gap> a:= SingerAlgebra( 5, 2, 4 );; CanonicalBasis( a ); +CanonicalBasis( A(5,2,4) ) +gap> a:= SingerAlgebra( 5, 2, 4 );; Zero( Random( a ) ); +0*b0 +gap> a:= SingerAlgebra( 5, 2, 4 );; Representative( a ); +b0 +gap> a:= SingerAlgebra( 5, 2, 4 );; One( a ); +b0 +gap> a:= SingerAlgebra( 5, 2, 4 );; Zero( a ); +0*b0 +gap> a:= SingerAlgebra( 5, 2, 4 );; GeneratorsOfAlgebra( a ); +[ b0, b1, b2, b3, b4, b5, b6 ] +gap> a:= SingerAlgebra( 5, 2, 4 );; GeneratorsOfAlgebraWithOne( a ); +[ b0, b1, b2, b3, b4, b5, b6 ] +gap> a:= SingerAlgebra( 5, 2, 4 );; Centre( a ); +A(5,2,4) + +## Auxiliary function: +## Test only one generator from each cyclic group of prime residues. +gap> SmallestPrimeResidueGenerators:= e -> Filtered( PrimeResidues( e ), +> q -> ForAll( PrimeResidues( OrderMod( q, e ) ), +> i -> PowerModInt( q, i, e ) >= q ) );; + +## Test the minimal degree computation (in Julia). +gap> for e in [ 2 .. 30 ] do +> for q in SmallestPrimeResidueGenerators( e ) do +> if q = 1 then +> q:= e+1; +> fi; +> n:= OrderMod( q, e ); +> a:= SingerAlgebra( q, n, e ); +> m:= MinimalDegreeOfSingerAlgebra( a ); +> if m <> MinimalDegreeOfSingerAlgebra( q, e ) then +> Error( "bad result for ", [ q, e ], "\n" ); +> fi; +>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3, 20, 4 ] +[ 9, 20, 4 ] +[ 11, 20, 10 ] +[ 13, 20, 4 ] +[ 19, 20, 2 ] +[ 22, 21, 21 ] +[ 2, 21, 3 ] +[ 4, 21, 3 ] +[ 5, 21, 2 ] +[ 8, 21, 7 ] +[ 10, 21, 3 ] +[ 13, 21, 6 ] +[ 20, 21, 2 ] +[ 23, 22, 22 ] +[ 3, 22, 4 ] +[ 7, 22, 2 ] +[ 21, 22, 2 ] +[ 24, 23, 23 ] +[ 2, 23, 3 ] +[ 5, 23, 2 ] +[ 22, 23, 2 ] +[ 25, 24, 24 ] +[ 5, 24, 8 ] +[ 7, 24, 6 ] +[ 11, 24, 4 ] +[ 13, 24, 12 ] +[ 17, 24, 8 ] +[ 19, 24, 6 ] +[ 23, 24, 2 ] +[ 26, 25, 25 ] +[ 2, 25, 2 ] +[ 4, 25, 2 ] +[ 6, 25, 5 ] +[ 7, 25, 2 ] +[ 24, 25, 2 ] +[ 27, 26, 26 ] +[ 3, 26, 6 ] +[ 5, 26, 2 ] +[ 7, 26, 2 ] +[ 17, 26, 2 ] +[ 25, 26, 2 ] +[ 28, 27, 27 ] +[ 2, 27, 2 ] +[ 4, 27, 3 ] +[ 8, 27, 2 ] +[ 10, 27, 9 ] +[ 26, 27, 2 ] +[ 29, 28, 28 ] +[ 3, 28, 2 ] +[ 5, 28, 4 ] +[ 9, 28, 4 ] +[ 11, 28, 4 ] +[ 13, 28, 4 ] +[ 15, 28, 14 ] +[ 27, 28, 2 ] +[ 30, 29, 29 ] +[ 2, 29, 2 ] +[ 4, 29, 2 ] +[ 7, 29, 4 ] +[ 12, 29, 2 ] +[ 28, 29, 2 ] +[ 31, 30, 30 ] +[ 7, 30, 6 ] +[ 11, 30, 10 ] +[ 17, 30, 4 ] +[ 19, 30, 6 ] +[ 29, 30, 2 ] + +## Test the Loewy length computations in Julia. +gap> for e in [ 2 .. 30 ] do +> for q in SmallestPrimeResidueGenerators( e ) do +> if q = 1 then +> q:= e+1; +> fi; +> n:= OrderMod( q, e ); +> a:= SingerAlgebra( q, n, e ); +> if Dimension( a ) < 10000 then +> l:= LoewyLength( a ); +> if l <> LoewyLength( q, n, e ) then +> Error( "bad result for ", [ q, n, e ], "\n" ); +> fi; +> Print( [ q, e, l ], "\n" ); +> fi; +> od; +> od; +[ 3, 2, 2 ] +[ 4, 3, 2 ] +[ 2, 3, 2 ] +[ 5, 4, 2 ] +[ 3, 4, 3 ] +[ 6, 5, 2 ] +[ 2, 5, 3 ] +[ 4, 5, 4 ] +[ 7, 6, 2 ] +[ 5, 6, 5 ] +[ 8, 7, 2 ] +[ 2, 7, 2 ] +[ 3, 7, 7 ] +[ 6, 7, 6 ] +[ 9, 8, 2 ] +[ 3, 8, 2 ] +[ 5, 8, 3 ] +[ 7, 8, 7 ] +[ 10, 9, 2 ] +[ 2, 9, 4 ] +[ 4, 9, 4 ] +[ 8, 9, 8 ] +[ 11, 10, 2 ] +[ 3, 10, 5 ] +[ 9, 10, 9 ] +[ 12, 11, 2 ] +[ 2, 11, 6 ] +[ 3, 11, 4 ] +[ 10, 11, 10 ] +[ 13, 12, 2 ] +[ 5, 12, 3 ] +[ 7, 12, 3 ] +[ 11, 12, 11 ] +[ 14, 13, 2 ] +[ 2, 13, 7 ] +[ 3, 13, 3 ] +[ 4, 13, 10 ] +[ 5, 13, 9 ] +[ 12, 13, 12 ] +[ 15, 14, 2 ] +[ 3, 14, 7 ] +[ 9, 14, 7 ] +[ 13, 14, 13 ] +[ 16, 15, 2 ] +[ 2, 15, 2 ] +[ 4, 15, 2 ] +[ 7, 15, 9 ] +[ 11, 15, 5 ] +[ 14, 15, 14 ] +[ 17, 16, 2 ] +[ 3, 16, 3 ] +[ 5, 16, 5 ] +[ 7, 16, 4 ] +[ 9, 16, 3 ] +[ 15, 16, 15 ] +[ 18, 17, 2 ] +[ 2, 17, 5 ] +[ 4, 17, 7 ] +[ 16, 17, 16 ] +[ 19, 18, 2 ] +[ 5, 18, 13 ] +[ 7, 18, 4 ] +[ 17, 18, 17 ] +[ 20, 19, 2 ] +[ 7, 19, 7 ] +[ 18, 19, 18 ] +[ 21, 20, 2 ] +[ 3, 20, 3 ] +[ 9, 20, 5 ] +[ 11, 20, 3 ] +[ 13, 20, 13 ] +[ 19, 20, 19 ] +[ 22, 21, 2 ] +[ 2, 21, 3 ] +[ 4, 21, 4 ] +[ 5, 21, 13 ] +[ 8, 21, 3 ] +[ 13, 21, 5 ] +[ 20, 21, 20 ] +[ 23, 22, 2 ] +[ 3, 22, 3 ] +[ 21, 22, 21 ] +[ 24, 23, 2 ] +[ 2, 23, 4 ] +[ 22, 23, 22 ] +[ 25, 24, 2 ] +[ 5, 24, 2 ] +[ 7, 24, 3 ] +[ 11, 24, 6 ] +[ 13, 24, 3 ] +[ 17, 24, 5 ] +[ 19, 24, 7 ] +[ 23, 24, 23 ] +[ 26, 25, 2 ] +[ 6, 25, 6 ] +[ 7, 25, 13 ] +[ 24, 25, 24 ] +[ 27, 26, 2 ] +[ 3, 26, 2 ] +[ 5, 26, 9 ] +[ 25, 26, 25 ] +[ 28, 27, 2 ] +[ 2, 27, 10 ] +[ 4, 27, 10 ] +[ 8, 27, 22 ] +[ 10, 27, 4 ] +[ 26, 27, 26 ] +[ 29, 28, 2 ] +[ 3, 28, 7 ] +[ 5, 28, 7 ] +[ 9, 28, 7 ] +[ 13, 28, 7 ] +[ 15, 28, 3 ] +[ 27, 28, 27 ] +[ 30, 29, 2 ] +[ 12, 29, 23 ] +[ 28, 29, 28 ] +[ 31, 30, 2 ] +[ 7, 30, 5 ] +[ 11, 30, 3 ] +[ 17, 30, 17 ] +[ 19, 30, 7 ] +[ 29, 30, 29 ] + +## Test 'DimensionsLoewyFactors'. +gap> for e in [ 2 .. 30 ] do +> for q in SmallestPrimeResidueGenerators( e ) do +> if q = 1 then +> q:= e+1; +> fi; +> n:= OrderMod( q, e ); +> a:= SingerAlgebra( q, n, e ); +> if Dimension( a ) < 10000 then +> v:= DimensionsLoewyFactors( a ); +> Print( [ q, e,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 30, 29, [ 1, 1 ] ] +[ 12, 29, [ 1, 10, 27, 44, 57, 66, 67, 68, 65, 66, 59, 48, 39, 30, 21, 16, + 11, 6, 5, 4, 3, 2, 1 ] ] +[ 28, 29, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1 ] ] +[ 31, 30, [ 1, 1 ] ] +[ 7, 30, [ 1, 16, 47, 16, 1 ] ] +[ 11, 30, [ 1, 3, 1 ] ] +[ 17, 30, [ 1, 43, 165, 307, 433, 435, 435, 317, 257, 155, 115, 57, 41, 15, + 7, 1, 1 ] ] +[ 19, 30, [ 1, 3, 3, 3, 1, 1, 1 ] ] +[ 29, 30, [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 ] ] + +## Test 'LoewyStructureInfo'. +gap> for e in [ 2 .. 30 ] do +> for q in SmallestPrimeResidueGenerators( e ) do +> if q = 1 then +> q:= e+1; +> fi; +> n:= OrderMod( q, e ); +> a:= SingerAlgebra( q, n, e ); +> if Dimension( a ) < 10000 then +> LoewyStructureInfo( a ); +> fi; +> od; +> od; + +## Test large e. +gap> q:= 17;; n:= 19;; e:= ( q^n - 1 ) / 2; +119536217842575662423576 +gap> IsSmallIntRep( e ); +false +gap> a:= SingerAlgebra( q, n, e );; +gap> Dimension( a ); +3 +gap> data:= LoewyStructureInfo( a );; +gap> keys:= Julia.Base.keys( data );; +gap> keys:= Julia.Base.collect( keys );; +gap> Set( JuliaToGAP( IsList, keys, true ) ); +[ "chain", "inputs", "layers", "ll", "m", "monomials" ] + +## Test some error messages. +gap> SingerAlgebra( 2, 2, 0 ); +Error, , , must be positive integers +gap> SingerAlgebra( 1, 2, 3 ); +Error, must be an integer > 1 +gap> SingerAlgebra( 7, 2, 5 ); +Error, must divide ^ - 1 +gap> MinimalDegreeOfSingerAlgebra( 1, 2 ); +Error, must be an integer > 1 +gap> LoewyLength( 1, 2, 3 ); +Error, must be an integer > 1 + +## Test the Julia part. +gap> Julia.LoewyStructure.test_this_module(); +true + +## +gap> STOP_TEST( "loewy_ext.tst" ); +