From ce68bc347106e19ded19d87b5425e07f19640127 Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Wed, 13 Sep 2017 10:49:47 +0200 Subject: [PATCH] fixed a bug in `RadicalOfAlgebra` For associative algebras that are not matrix algebras, the radical is computed in an isomorphic matrix algebra. Up to now, one ran into an error if `Coefficients` returned an immutable list. (One might argue that `Coefficients` should always return a new mutable list, but this would cause the creation of many superfluous lists. Thus we solve the problem in the place where the list has to be changed.) --- lib/algebra.gi | 3 +++ tst/testinstall/algsc.tst | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/algebra.gi b/lib/algebra.gi index 69f08fef37..c17c6557ff 100644 --- a/lib/algebra.gi +++ b/lib/algebra.gi @@ -2757,6 +2757,9 @@ InstallMethod( RadicalOfAlgebra, M:=[]; for j in [1..n] do col:= Coefficients( BA, bv[i] * bv[j] ); + if not IsMutable( col ) then + col:= ShallowCopy( col ); + fi; col[n+1]:= Zero( F ); Add( M, col ); od; diff --git a/tst/testinstall/algsc.tst b/tst/testinstall/algsc.tst index 12c6292268..a3dc908a8b 100644 --- a/tst/testinstall/algsc.tst +++ b/tst/testinstall/algsc.tst @@ -675,6 +675,15 @@ gap> c:= Centre( t ); gap> c = t; true +############################################################################# +## +## Some bugfixes +## +gap> a:= Algebra( Rationals, [ [ [ 0, 0 ], [ 1, 0 ] ] ] );; +gap> sc:= Image( IsomorphismSCAlgebra( a ) );; +gap> Dimension( RadicalOfAlgebra( sc ) ); +1 + ############################################################################# gap> STOP_TEST( "algsc.tst", 1);