/usr/share/gap/lib/alghom.gd is in gap-libs 4r8p8-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | #############################################################################
##
#W alghom.gd GAP library Thomas Breuer
##
##
#Y Copyright (C) 1997, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
#Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
#Y Copyright (C) 2002 The GAP Group
##
## This file contains declarations of operations for algebra(-with-one)
## homomorphisms.
##
## <#GAPDoc Label="[1]{alghom}">
## Algebra homomorphisms are vector space homomorphisms that preserve the
## multiplication.
## So the default methods for vector space homomorphisms work,
## and in fact there is not much use of the fact that source and range are
## algebras, except that preimages and images are algebras (or even ideals)
## in certain cases.
## <#/GAPDoc>
##
#############################################################################
##
#O AlgebraGeneralMappingByImages( <A>, <B>, <gens>, <imgs> )
##
## <#GAPDoc Label="AlgebraGeneralMappingByImages">
## <ManSection>
## <Oper Name="AlgebraGeneralMappingByImages" Arg='A, B, gens, imgs'/>
##
## <Description>
## is a general mapping from the <M>F</M>-algebra <A>A</A> to the <M>F</M>-algebra <A>B</A>.
## This general mapping is defined by mapping the entries in the list <A>gens</A>
## (elements of <A>A</A>) to the entries in the list <A>imgs</A> (elements of <A>B</A>),
## and taking the <M>F</M>-linear and multiplicative closure.
## <P/>
## <A>gens</A> need not generate <A>A</A> as an <M>F</M>-algebra, and if the
## specification does not define a linear and multiplicative mapping then
## the result will be multivalued.
## Hence, in general it is not a mapping.
## For constructing a linear map that is not
## necessarily multiplicative, we refer to
## <Ref Func="LeftModuleHomomorphismByImages"/>.
## <Example><![CDATA[
## gap> A:= QuaternionAlgebra( Rationals );;
## gap> B:= FullMatrixAlgebra( Rationals, 2 );;
## gap> bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;
## gap> f:= AlgebraGeneralMappingByImages( A, B, bA, bB );
## [ e, i, j, k ] -> [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 1 ], [ 0, 0 ] ],
## [ [ 0, 0 ], [ 1, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] ]
## gap> Images( f, bA[1] );
## <add. coset of <algebra over Rationals, with 16 generators>>
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "AlgebraGeneralMappingByImages",
[ IsFLMLOR, IsFLMLOR, IsHomogeneousList, IsHomogeneousList ] );
#############################################################################
##
#F AlgebraHomomorphismByImages( <A>, <B>, <gens>, <imgs> )
##
## <#GAPDoc Label="AlgebraHomomorphismByImages">
## <ManSection>
## <Func Name="AlgebraHomomorphismByImages" Arg='A, B, gens, imgs'/>
##
## <Description>
## <Ref Func="AlgebraHomomorphismByImages"/> returns the algebra homomorphism with
## source <A>A</A> and range <A>B</A> that is defined by mapping the list <A>gens</A> of
## generators of <A>A</A> to the list <A>imgs</A> of images in <A>B</A>.
## <P/>
## If <A>gens</A> does not generate <A>A</A> or if the homomorphism does not exist
## (i.e., if mapping the generators describes only a multi-valued mapping)
## then <K>fail</K> is returned.
## <P/>
## One can avoid the checks by calling <Ref Oper="AlgebraHomomorphismByImagesNC"/>,
## and one can construct multi-valued mappings with
## <Ref Func="AlgebraGeneralMappingByImages"/>.
## <Example><![CDATA[
## gap> T:= EmptySCTable( 2, 0 );;
## gap> SetEntrySCTable( T, 1, 1, [1,1] ); SetEntrySCTable( T, 2, 2, [1,2] );
## gap> A:= AlgebraByStructureConstants( Rationals, T );;
## gap> m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;
## gap> m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;
## gap> B:= AlgebraByGenerators( Rationals, [ m1, m2 ] );;
## gap> bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;
## gap> f:= AlgebraHomomorphismByImages( A, B, bA, bB );
## [ v.1, v.2 ] -> [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] ]
## gap> Image( f, bA[1]+bA[2] );
## [ [ 1, 0 ], [ 0, 1 ] ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareGlobalFunction( "AlgebraHomomorphismByImages" );
#############################################################################
##
#O AlgebraHomomorphismByImagesNC( <A>, <B>, <gens>, <imgs> )
##
## <#GAPDoc Label="AlgebraHomomorphismByImagesNC">
## <ManSection>
## <Oper Name="AlgebraHomomorphismByImagesNC" Arg='A, B, gens, imgs'/>
##
## <Description>
## <Ref Oper="AlgebraHomomorphismByImagesNC"/> is the operation that is called by the
## function <Ref Func="AlgebraHomomorphismByImages"/>.
## Its methods may assume that <A>gens</A> generates <A>A</A> and that the mapping of
## <A>gens</A> to <A>imgs</A> defines an algebra homomorphism.
## Results are unpredictable if these conditions do not hold.
## <P/>
## For creating a possibly multi-valued mapping from <A>A</A> to <A>B</A> that
## respects addition, multiplication, and scalar multiplication,
## <Ref Func="AlgebraGeneralMappingByImages"/> can be used.
## <!-- see the comment in the declaration of <Ref Func="GroupHomomorphismByImagesNC"/>!-->
## <P/>
## For the definitions of the algebras <C>A</C> and <C>B</C> in the next example we refer
## to the previous example.
## <P/>
## <Example><![CDATA[
## gap> f:= AlgebraHomomorphismByImagesNC( A, B, bA, bB );
## [ v.1, v.2 ] -> [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "AlgebraHomomorphismByImagesNC",
[ IsFLMLOR, IsFLMLOR, IsHomogeneousList, IsHomogeneousList ] );
#############################################################################
##
#O AlgebraWithOneGeneralMappingByImages( <A>, <B>, <gens>, <imgs> )
##
## <#GAPDoc Label="AlgebraWithOneGeneralMappingByImages">
## <ManSection>
## <Oper Name="AlgebraWithOneGeneralMappingByImages" Arg='A, B, gens, imgs'/>
##
## <Description>
## This function is analogous to <Ref Func="AlgebraGeneralMappingByImages"/>;
## the only difference being that the identity of <A>A</A> is automatically
## mapped to the identity of <A>B</A>.
## <Example><![CDATA[
## gap> A:= QuaternionAlgebra( Rationals );;
## gap> B:= FullMatrixAlgebra( Rationals, 2 );;
## gap> bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;
## gap> f:=AlgebraWithOneGeneralMappingByImages(A,B,bA{[2,3,4]},bB{[1,2,3]});
## [ i, j, k, e ] -> [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 1 ], [ 0, 0 ] ],
## [ [ 0, 0 ], [ 1, 0 ] ], [ [ 1, 0 ], [ 0, 1 ] ] ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "AlgebraWithOneGeneralMappingByImages",
[ IsFLMLOR, IsFLMLOR, IsHomogeneousList, IsHomogeneousList ] );
#############################################################################
##
#F AlgebraWithOneHomomorphismByImages( <A>, <B>, <gens>, <imgs> )
##
## <#GAPDoc Label="AlgebraWithOneHomomorphismByImages">
## <ManSection>
## <Func Name="AlgebraWithOneHomomorphismByImages" Arg='A, B, gens, imgs'/>
##
## <Description>
## <Ref Func="AlgebraWithOneHomomorphismByImages"/> returns the
## algebra-with-one homomorphism with source <A>A</A> and range <A>B</A>
## that is defined by mapping the list <A>gens</A> of generators of <A>A</A>
## to the list <A>imgs</A> of images in <A>B</A>.
## <P/>
## The difference between an algebra homomorphism and an algebra-with-one
## homomorphism is that in the latter case,
## it is assumed that the identity of <A>A</A> is mapped to the identity of
## <A>B</A>,
## and therefore <A>gens</A> needs to generate <A>A</A> only as an
## algebra-with-one.
## <P/>
## If <A>gens</A> does not generate <A>A</A> or if the homomorphism does not
## exist
## (i.e., if mapping the generators describes only a multi-valued mapping)
## then <K>fail</K> is returned.
## <P/>
## One can avoid the checks by calling
## <Ref Func="AlgebraWithOneHomomorphismByImagesNC"/>,
## and one can construct multi-valued mappings with
## <Ref Func="AlgebraWithOneGeneralMappingByImages"/>.
## <Example><![CDATA[
## gap> m1:= NullMat( 2, 2 );; m1[1][1]:=1;;
## gap> m2:= NullMat( 2, 2 );; m2[2][2]:=1;;
## gap> A:= AlgebraByGenerators( Rationals, [m1,m2] );;
## gap> T:= EmptySCTable( 2, 0 );;
## gap> SetEntrySCTable( T, 1, 1, [1,1] );
## gap> SetEntrySCTable( T, 2, 2, [1,2] );
## gap> B:= AlgebraByStructureConstants(Rationals, T);;
## gap> bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;
## gap> f:= AlgebraWithOneHomomorphismByImages( A, B, bA{[1]}, bB{[1]} );
## [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 1, 0 ], [ 0, 1 ] ] ] -> [ v.1, v.1+v.2 ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareGlobalFunction( "AlgebraWithOneHomomorphismByImages" );
#############################################################################
##
#O AlgebraWithOneHomomorphismByImagesNC( <A>, <B>, <gens>, <imgs> )
##
## <#GAPDoc Label="AlgebraWithOneHomomorphismByImagesNC">
## <ManSection>
## <Oper Name="AlgebraWithOneHomomorphismByImagesNC" Arg='A, B, gens, imgs'/>
##
## <Description>
## <Ref Func="AlgebraWithOneHomomorphismByImagesNC"/> is the operation that
## is called by the function
## <Ref Func="AlgebraWithOneHomomorphismByImages"/>.
## Its methods may assume that <A>gens</A> generates <A>A</A> and that the
## mapping of <A>gens</A> to <A>imgs</A> defines an algebra-with-one
## homomorphism.
## Results are unpredictable if these conditions do not hold.
## <P/>
## For creating a possibly multi-valued mapping from <A>A</A> to <A>B</A>
## that respects addition, multiplication, identity, and scalar
## multiplication,
## <Ref Func="AlgebraWithOneGeneralMappingByImages"/> can be used.
## <P/>
## <!-- see the comment in the declaration of <C>GroupHomomorphismByImagesNC</C>!-->
## <Example><![CDATA[
## gap> m1:= NullMat( 2, 2 );; m1[1][1]:=1;;
## gap> m2:= NullMat( 2, 2 );; m2[2][2]:=1;;
## gap> A:= AlgebraByGenerators( Rationals, [m1,m2] );;
## gap> T:= EmptySCTable( 2, 0 );;
## gap> SetEntrySCTable( T, 1, 1, [1,1] );
## gap> SetEntrySCTable( T, 2, 2, [1,2] );
## gap> B:= AlgebraByStructureConstants( Rationals, T);;
## gap> bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;
## gap> f:= AlgebraWithOneHomomorphismByImagesNC( A, B, bA{[1]}, bB{[1]} );
## [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 1, 0 ], [ 0, 1 ] ] ] -> [ v.1, v.1+v.2 ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "AlgebraWithOneHomomorphismByImagesNC",
[ IsFLMLOR, IsFLMLOR, IsHomogeneousList, IsHomogeneousList ] );
#############################################################################
##
#O OperationAlgebraHomomorphism( <A>, <B>[, <opr>] )
#O OperationAlgebraHomomorphism( <A>, <V>[, <opr>] )
##
## <#GAPDoc Label="OperationAlgebraHomomorphism">
## <ManSection>
## <Oper Name="OperationAlgebraHomomorphism" Arg='A, B[, opr]'
## Label="action w.r.t. a basis of the module"/>
## <Oper Name="OperationAlgebraHomomorphism" Arg='A, V[, opr]'
## Label="action on a free left module"/>
##
## <Description>
## <Ref Func="OperationAlgebraHomomorphism" Label="action w.r.t. a basis of the module"/>
## returns an algebra homomorphism from the <M>F</M>-algebra <A>A</A> into
## a matrix algebra over <M>F</M> that describes the <M>F</M>-linear action
## of <A>A</A> on the basis <A>B</A> of a free left module
## respectively on the free left module <A>V</A>
## (in which case some basis of <A>V</A> is chosen),
## via the operation <A>opr</A>.
## <P/>
## The homomorphism need not be surjective.
## The default value for <A>opr</A> is <Ref Func="OnRight"/>.
## <P/>
## If <A>A</A> is an algebra-with-one then the operation homomorphism is an
## algebra-with-one homomorphism because the identity of <A>A</A> must act
## as the identity.
## <P/>
## <!-- (Of course this holds especially if <A>D</A> is in the kernel of the action.)-->
## <Example><![CDATA[
## gap> m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;
## gap> m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;
## gap> B:= AlgebraByGenerators( Rationals, [ m1, m2 ] );;
## gap> V:= FullRowSpace( Rationals, 2 );
## ( Rationals^2 )
## gap> f:=OperationAlgebraHomomorphism( B, Basis( V ), OnRight );
## <op. hom. Algebra( Rationals,
## [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ]
## ] ) -> matrices of dim. 2>
## gap> Image( f, m1 );
## [ [ 1, 0 ], [ 0, 0 ] ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "OperationAlgebraHomomorphism",
[ IsFLMLOR, IsBasis, IsFunction ] );
#############################################################################
##
#F InducedLinearAction( <basis>, <elm>, <opr> )
##
## <ManSection>
## <Func Name="InducedLinearAction" Arg='basis, elm, opr'/>
##
## <Description>
## returns the matrix that describe the linear action of the ring element
## <A>elm</A> via <A>opr</A> on the free left module with basis <A>basis</A>,
## with respect to this basis.
## <!-- (Should this replace <C>LinearOperation</C>?)-->
## </Description>
## </ManSection>
##
DeclareGlobalFunction( "InducedLinearAction" );
#############################################################################
##
#O MakePreImagesInfoOperationAlgebraHomomorphism( <ophom> )
##
## <ManSection>
## <Oper Name="MakePreImagesInfoOperationAlgebraHomomorphism" Arg='ophom'/>
##
## <Description>
## Provide the information for computing preimages, that is, set up
## the components <C>basisImage</C>, <C>preimagesBasisImage</C>.
## </Description>
## </ManSection>
##
DeclareOperation( "MakePreImagesInfoOperationAlgebraHomomorphism",
[ IsAlgebraGeneralMapping ] );
#############################################################################
##
#A IsomorphismFpAlgebra( <A> )
##
## <#GAPDoc Label="IsomorphismFpAlgebra">
## <ManSection>
## <Attr Name="IsomorphismFpAlgebra" Arg='A'/>
##
## <Description>
## isomorphism from the algebra <A>A</A> onto a finitely presented algebra.
## Currently this is only implemented for associative algebras with one.
## <Example><![CDATA[
## gap> A:= QuaternionAlgebra( Rationals );
## <algebra-with-one of dimension 4 over Rationals>
## gap> f:= IsomorphismFpAlgebra( A );
## [ e, i, j, k, e ] -> [ [(1)*x.1], [(1)*x.2], [(1)*x.3], [(1)*x.4],
## [(1)*<identity ...>] ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareAttribute( "IsomorphismFpFLMLOR", IsFLMLOR );
DeclareSynonymAttr( "IsomorphismFpAlgebra", IsomorphismFpFLMLOR );
#############################################################################
##
#A IsomorphismMatrixAlgebra( <A> )
##
## <#GAPDoc Label="IsomorphismMatrixAlgebra">
## <ManSection>
## <Attr Name="IsomorphismMatrixAlgebra" Arg='A'/>
##
## <Description>
## isomorphism from the algebra <A>A</A> onto a matrix algebra.
## Currently this is only implemented for associative algebras with one.
## <Example><![CDATA[
## gap> T:= EmptySCTable( 2, 0 );;
## gap> SetEntrySCTable( T, 1, 1, [1,1] ); SetEntrySCTable( T, 2, 2, [1,2] );
## gap> A:= AlgebraByStructureConstants( Rationals, T );;
## gap> A:= AsAlgebraWithOne( Rationals, A );;
## gap> f:=IsomorphismMatrixAlgebra( A );
## <op. hom. AlgebraWithOne( Rationals, ... ) -> matrices of dim. 2>
## gap> Image( f, BasisVectors( Basis( A ) )[1] );
## [ [ 1, 0 ], [ 0, 0 ] ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareAttribute( "IsomorphismMatrixFLMLOR", IsFLMLOR );
DeclareSynonymAttr( "IsomorphismMatrixAlgebra", IsomorphismMatrixFLMLOR );
#############################################################################
##
#A IsomorphismSCAlgebra( <B> )
#A IsomorphismSCAlgebra( <A> )
##
## <#GAPDoc Label="IsomorphismSCAlgebra">
## <ManSection>
## <Attr Name="IsomorphismSCAlgebra" Arg='B' Label="w.r.t. a given basis"/>
## <Attr Name="IsomorphismSCAlgebra" Arg='A' Label="for an algebra"/>
##
## <Description>
## For a basis <A>B</A> of an algebra <M>A</M>, say,
## <Ref Func="IsomorphismSCAlgebra" Label="w.r.t. a given basis"/> returns
## an algebra isomorphism from <M>A</M> to an algebra <M>S</M> given by
## structure constants
## (see <Ref Sect="Constructing Algebras by Structure Constants"/>),
## such that the canonical basis of <M>S</M> is the image of <A>B</A>.
## <P/>
## For an algebra <A>A</A>,
## <Ref Func="IsomorphismSCAlgebra" Label="for an algebra"/> chooses
## a basis of <A>A</A> and returns the
## <Ref Func="IsomorphismSCAlgebra" Label="w.r.t. a given basis"/>
## value for that basis.
## <P/>
## <Example><![CDATA[
## gap> IsomorphismSCAlgebra( GF(8) );
## CanonicalBasis( GF(2^3) ) -> CanonicalBasis( <algebra of dimension
## 3 over GF(2)> )
## gap> IsomorphismSCAlgebra( GF(2)^[2,2] );
## CanonicalBasis( ( GF(2)^
## [ 2, 2 ] ) ) -> CanonicalBasis( <algebra of dimension 4 over GF(2)> )
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareAttribute( "IsomorphismSCFLMLOR", IsBasis );
DeclareAttribute( "IsomorphismSCFLMLOR", IsFLMLOR );
DeclareSynonymAttr( "IsomorphismSCAlgebra", IsomorphismSCFLMLOR );
#############################################################################
##
#O RepresentativeLinearOperation( <A>, <v>, <w>, <opr> )
##
## <#GAPDoc Label="RepresentativeLinearOperation">
## <ManSection>
## <Oper Name="RepresentativeLinearOperation" Arg='A, v, w, opr'/>
##
## <Description>
## is an element of the algebra <A>A</A> that maps the vector <A>v</A>
## to the vector <A>w</A> under the linear operation described by the function
## <A>opr</A>. If no such element exists then <K>fail</K> is returned.
## <P/>
## <!-- Would it be desirable to put this under <C>RepresentativeOperation</C>?-->
## <!-- (look at the code before you agree ...)-->
## <Example><![CDATA[
## gap> m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;
## gap> m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;
## gap> B:= AlgebraByGenerators( Rationals, [ m1, m2 ] );;
## gap> RepresentativeLinearOperation( B, [1,0], [1,0], OnRight );
## [ [ 1, 0 ], [ 0, 0 ] ]
## gap> RepresentativeLinearOperation( B, [1,0], [0,1], OnRight );
## fail
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "RepresentativeLinearOperation",
[ IsFLMLOR, IsVector, IsVector, IsFunction ] );
#############################################################################
##
#E
|