This file is indexed.

/usr/share/gap/doc/ref/chap62.html is in gap-doc 4r6p5-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
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (ref) - Chapter 62: Algebras</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap62"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chap19.html">19</a>  <a href="chap20.html">20</a>  <a href="chap21.html">21</a>  <a href="chap22.html">22</a>  <a href="chap23.html">23</a>  <a href="chap24.html">24</a>  <a href="chap25.html">25</a>  <a href="chap26.html">26</a>  <a href="chap27.html">27</a>  <a href="chap28.html">28</a>  <a href="chap29.html">29</a>  <a href="chap30.html">30</a>  <a href="chap31.html">31</a>  <a href="chap32.html">32</a>  <a href="chap33.html">33</a>  <a href="chap34.html">34</a>  <a href="chap35.html">35</a>  <a href="chap36.html">36</a>  <a href="chap37.html">37</a>  <a href="chap38.html">38</a>  <a href="chap39.html">39</a>  <a href="chap40.html">40</a>  <a href="chap41.html">41</a>  <a href="chap42.html">42</a>  <a href="chap43.html">43</a>  <a href="chap44.html">44</a>  <a href="chap45.html">45</a>  <a href="chap46.html">46</a>  <a href="chap47.html">47</a>  <a href="chap48.html">48</a>  <a href="chap49.html">49</a>  <a href="chap50.html">50</a>  <a href="chap51.html">51</a>  <a href="chap52.html">52</a>  <a href="chap53.html">53</a>  <a href="chap54.html">54</a>  <a href="chap55.html">55</a>  <a href="chap56.html">56</a>  <a href="chap57.html">57</a>  <a href="chap58.html">58</a>  <a href="chap59.html">59</a>  <a href="chap60.html">60</a>  <a href="chap61.html">61</a>  <a href="chap62.html">62</a>  <a href="chap63.html">63</a>  <a href="chap64.html">64</a>  <a href="chap65.html">65</a>  <a href="chap66.html">66</a>  <a href="chap67.html">67</a>  <a href="chap68.html">68</a>  <a href="chap69.html">69</a>  <a href="chap70.html">70</a>  <a href="chap71.html">71</a>  <a href="chap72.html">72</a>  <a href="chap73.html">73</a>  <a href="chap74.html">74</a>  <a href="chap75.html">75</a>  <a href="chap76.html">76</a>  <a href="chap77.html">77</a>  <a href="chap78.html">78</a>  <a href="chap79.html">79</a>  <a href="chap80.html">80</a>  <a href="chap81.html">81</a>  <a href="chap82.html">82</a>  <a href="chap83.html">83</a>  <a href="chap84.html">84</a>  <a href="chap85.html">85</a>  <a href="chap86.html">86</a>  <a href="chap87.html">87</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap61.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap63.html">[Next Chapter]</a>&nbsp;  </div>

<p id="mathjaxlink" class="pcenter"><a href="chap62_mj.html">[MathJax on]</a></p>
<p><a id="X7DDBF6F47A2E021C" name="X7DDBF6F47A2E021C"></a></p>
<div class="ChapSects"><a href="chap62.html#X7DDBF6F47A2E021C">62 <span class="Heading">Algebras</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X830EDB5F85645FFB">62.1 <span class="Heading">InfoAlgebra (Info Class)</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8665F459841AAD53">62.1-1 InfoAlgebra</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X8686DEBA85D3F3B6">62.2 <span class="Heading">Constructing Algebras by Generators</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7B213851791A594B">62.2-1 Algebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X80FE16EA84EE56CD">62.2-2 AlgebraWithOne</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X7A7B00127DC9DD40">62.3 <span class="Heading">Constructing Algebras as Free Algebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X83484C917D8F7A1A">62.3-1 FreeAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7FBD04B07B85623D">62.3-2 FreeAlgebraWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X87835FFE79D2E068">62.3-3 FreeAssociativeAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X845A777584A7D711">62.3-4 FreeAssociativeAlgebraWithOne</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X7E8F45547CC07CE5">62.4 <span class="Heading">Constructing Algebras by Structure Constants</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7CC58DFD816E6B65">62.4-1 AlgebraByStructureConstants</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X804ADF0280F67CDC">62.4-2 StructureConstantsTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7F1203A1793411DF">62.4-3 EmptySCTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X817BD086876EC1C4">62.4-4 SetEntrySCTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7F333822780B6731">62.4-5 GapInputSCTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7C23ED85814C0371">62.4-6 TestJacobi</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X78B633CE7A5B9F9A">62.4-7 IdentityFromSCTable</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7F2A71608602635D">62.4-8 QuotientFromSCTable</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X79B7C3078112E7E1">62.5 <span class="Heading">Some Special Algebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X83DF4BCC7CE494FC">62.5-1 QuaternionAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7B807702782F56FF">62.5-2 ComplexificationQuat</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X78C88A38853A8443">62.5-3 OctaveAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7D88E42B7DE087B0">62.5-4 FullMatrixAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X78B8BA77869DAA13">62.5-5 NullAlgebra</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X7DF5989886BE611E">62.6 <span class="Heading">Subalgebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8396643D7A49EEAD">62.6-1 Subalgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7C6B08657BD836C3">62.6-2 SubalgebraNC</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X83ECF489846F00B0">62.6-3 SubalgebraWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7A11B177868E76AA">62.6-4 SubalgebraWithOneNC</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7FDD953A84CFC3D2">62.6-5 TrivialSubalgebra</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X83629803819C4A6F">62.7 <span class="Heading">Ideals</span></a>
</span>
</div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X7DC95D6982C9D7B0">62.8 <span class="Heading">Categories and Properties of Algebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7FEDFAA383AB20D2">62.8-1 IsFLMLOR</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X85C1E13A877DF2C8">62.8-2 IsFLMLORWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X801ED693808F6C84">62.8-3 IsAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X80B21AC27DE6D068">62.8-4 IsAlgebraWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X839BAC687B4E1A1D">62.8-5 IsLieAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X877DF13387831A6A">62.8-6 IsSimpleAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7C5AECE87D79D075">62.8-7 IsFiniteDimensional</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X82B3A9077D0CB453">62.8-8 IsQuaternion</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X7E9273E47CF38CF1">62.9 <span class="Heading">Attributes and Operations for Algebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X83B055F37EBF2438">62.9-1 GeneratorsOfAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7FA408307A5A420E">62.9-2 GeneratorsOfAlgebraWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7D309FD37D94B196">62.9-3 ProductSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X875CD2B37EE9A8A2">62.9-4 PowerSubalgebraSeries</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X788F4E6184E5C863">62.9-5 AdjointBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X800A410B8536E6DD">62.9-6 IndicesOfAdjointBasis</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7BA35CB28062D407">62.9-7 AsAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X878323367D0B68EB">62.9-8 AsAlgebraWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7A922D26805AFF99">62.9-9 AsSubalgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7B964BC37A975E48">62.9-10 AsSubalgebraWithOne</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7C280DAC7F840B60">62.9-11 MutableBasisOfClosureUnderAction</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7BA1739D7F8B3A2B">62.9-12 MutableBasisOfNonassociativeAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8467B687823371F9">62.9-13 MutableBasisOfIdealInNonassociativeAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7C591B7C7DEA7EEB">62.9-14 DirectSumOfAlgebras</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7D0EB1437D3D9495">62.9-15 FullMatrixAlgebraCentralizer</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X850C29907A509533">62.9-16 RadicalOfAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X82571785846CF05C">62.9-17 CentralIdempotentsOfAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7CFB230582C26DAA">62.9-18 DirectSumDecomposition</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X85C58364833E014C">62.9-19 LeviMalcevDecomposition</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7DCA2568870A2D34">62.9-20 Grading</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X7E94B857847F95C1">62.10 <span class="Heading">Homomorphisms of Algebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X83CE798C7D39E368">62.10-1 AlgebraGeneralMappingByImages</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7A7F97ED8608C882">62.10-2 AlgebraHomomorphismByImages</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8326D1BD79725462">62.10-3 AlgebraHomomorphismByImagesNC</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8057E55B864567AD">62.10-4 AlgebraWithOneGeneralMappingByImages</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X866F32B5846E5857">62.10-5 AlgebraWithOneHomomorphismByImages</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X80BF4D6A7FDC959A">62.10-6 AlgebraWithOneHomomorphismByImagesNC</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8712E5C1861CC32C">62.10-7 NaturalHomomorphismByIdeal</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8705A9C68102FEA3">62.10-8 OperationAlgebraHomomorphism</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7B249E8E86D895F0">62.10-9 NiceAlgebraMonomorphism</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X79D770777D873F80">62.10-10 IsomorphismFpAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7FB760F9813B0789">62.10-11 IsomorphismMatrixAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7F8D3DF2863EC50D">62.10-12 IsomorphismSCAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7F34244B81979696">62.10-13 RepresentativeLinearOperation</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap62.html#X818DE6C57D1A4B33">62.11 <span class="Heading">Representations of Algebras</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8055B87F7ADBD66B">62.11-1 LeftAlgebraModuleByGenerators</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8026B99B7955A355">62.11-2 RightAlgebraModuleByGenerators</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7F28A47E876427E0">62.11-3 BiAlgebraModuleByGenerators</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X852524F581613359">62.11-4 LeftAlgebraModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8222F2B67D753036">62.11-5 RightAlgebraModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X84517770868DDA02">62.11-6 BiAlgebraModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X79AAB50D83A14A43">62.11-7 GeneratorsOfAlgebraModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X82B708BD84F3DAB1">62.11-8 IsAlgebraModuleElement</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X80E786467F9163F9">62.11-9 IsLeftAlgebraModuleElement</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X863756787E2B6E75">62.11-10 IsRightAlgebraModuleElement</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X85654EF07F708AC3">62.11-11 LeftActingAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X826298B37E1B1520">62.11-12 RightActingAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8308408D86CFC3C9">62.11-13 ActingAlgebra</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7C325A507EC9BA18">62.11-14 IsBasisOfAlgebraModuleElementSpace</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X789863037B0E35D2">62.11-15 MatrixOfAction</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8742A7D27F26AFAB">62.11-16 SubAlgebraModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X86E0515987192F0E">62.11-17 LeftModuleByHomomorphismToMatAlg</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7EE41297867E41A8">62.11-18 RightModuleByHomomorphismToMatAlg</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X8729F0A678A4A09C">62.11-19 AdjointModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X84813BCD80BDF3C4">62.11-20 FaithfulModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7E16630185CE2C10">62.11-21 ModuleByRestriction</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7885AAC87FDCF649">62.11-22 NaturalHomomorphismBySubAlgebraModule</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X85D0F3758551DADC">62.11-23 DirectSumOfAlgebraModules</a></span>
<span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap62.html#X7D7A6486803B15CE">62.11-24 TranslatorSubalgebra</a></span>
</div></div>
</div>

<h3>62 <span class="Heading">Algebras</span></h3>

<p>An algebra is a vector space equipped with a bilinear map (multiplication). This chapter describes the functions in <strong class="pkg">GAP</strong> that deal with general algebras and associative algebras.</p>

<p>Algebras in <strong class="pkg">GAP</strong> are vector spaces in a natural way. So all the functionality for vector spaces (see Chapter <a href="chap61.html#X7DAD6700787EC845"><span class="RefLink">61</span></a>) is also applicable to algebras.</p>

<p><a id="X830EDB5F85645FFB" name="X830EDB5F85645FFB"></a></p>

<h4>62.1 <span class="Heading">InfoAlgebra (Info Class)</span></h4>

<p><a id="X8665F459841AAD53" name="X8665F459841AAD53"></a></p>

<h5>62.1-1 InfoAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; InfoAlgebra</code></td><td class="tdright">( info class )</td></tr></table></div>
<p>is the info class for the functions dealing with algebras (see <a href="chap7.html#X7A9C902479CB6F7C"><span class="RefLink">7.4</span></a>).</p>

<p><a id="X8686DEBA85D3F3B6" name="X8686DEBA85D3F3B6"></a></p>

<h4>62.2 <span class="Heading">Constructing Algebras by Generators</span></h4>

<p><a id="X7B213851791A594B" name="X7B213851791A594B"></a></p>

<h5>62.2-1 Algebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Algebra</code>( <var class="Arg">F</var>, <var class="Arg">gens</var>[, <var class="Arg">zero</var>][, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="code">Algebra( <var class="Arg">F</var>, <var class="Arg">gens</var> )</code> is the algebra over the division ring <var class="Arg">F</var>, generated by the vectors in the list <var class="Arg">gens</var>.</p>

<p>If there are three arguments, a division ring <var class="Arg">F</var> and a list <var class="Arg">gens</var> and an element <var class="Arg">zero</var>, then <code class="code">Algebra( <var class="Arg">F</var>, <var class="Arg">gens</var>, <var class="Arg">zero</var> )</code> is the <var class="Arg">F</var>-algebra generated by <var class="Arg">gens</var>, with zero element <var class="Arg">zero</var>.</p>

<p>If the last argument is the string <code class="code">"basis"</code> then the vectors in <var class="Arg">gens</var> are known to form a basis of the algebra (as an <var class="Arg">F</var>-vector space).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m ] );</span>
&lt;algebra over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
2
</pre></div>

<p><a id="X80FE16EA84EE56CD" name="X80FE16EA84EE56CD"></a></p>

<h5>62.2-2 AlgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraWithOne</code>( <var class="Arg">F</var>, <var class="Arg">gens</var>[, <var class="Arg">zero</var>][, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="code">AlgebraWithOne( <var class="Arg">F</var>, <var class="Arg">gens</var> )</code> is the algebra-with-one over the division ring <var class="Arg">F</var>, generated by the vectors in the list <var class="Arg">gens</var>.</p>

<p>If there are three arguments, a division ring <var class="Arg">F</var> and a list <var class="Arg">gens</var> and an element <var class="Arg">zero</var>, then <code class="code">AlgebraWithOne( <var class="Arg">F</var>, <var class="Arg">gens</var>, <var class="Arg">zero</var> )</code> is the <var class="Arg">F</var>-algebra-with-one generated by <var class="Arg">gens</var>, with zero element <var class="Arg">zero</var>.</p>

<p>If the last argument is the string <code class="code">"basis"</code> then the vectors in <var class="Arg">gens</var> are known to form a basis of the algebra (as an <var class="Arg">F</var>-vector space).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraWithOne( Rationals, [ m ] );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
3
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One(A);</span>
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
</pre></div>

<p><a id="X7A7B00127DC9DD40" name="X7A7B00127DC9DD40"></a></p>

<h4>62.3 <span class="Heading">Constructing Algebras as Free Algebras</span></h4>

<p><a id="X83484C917D8F7A1A" name="X83484C917D8F7A1A"></a></p>

<h5>62.3-1 FreeAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">rank</var>[, <var class="Arg">name</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">name1</var>, <var class="Arg">name2</var>, <var class="Arg">...</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a free (nonassociative) algebra of rank <var class="Arg">rank</var> over the division ring <var class="Arg">R</var>. Here <var class="Arg">name</var>, and <var class="Arg">name1</var>, <var class="Arg">name2</var>, ... are optional strings that can be used to provide names for the generators.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FreeAlgebra( Rationals, "a", "b" );</span>
&lt;algebra over Rationals, with 2 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:= GeneratorsOfAlgebra( A );</span>
[ (1)*a, (1)*b ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">(g[1]*g[2])*((g[2]*g[1])*g[1]);</span>
(1)*((a*b)*((b*a)*a))
</pre></div>

<p><a id="X7FBD04B07B85623D" name="X7FBD04B07B85623D"></a></p>

<h5>62.3-2 FreeAlgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAlgebraWithOne</code>( <var class="Arg">R</var>, <var class="Arg">rank</var>[, <var class="Arg">name</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAlgebraWithOne</code>( <var class="Arg">R</var>, <var class="Arg">name1</var>, <var class="Arg">name2</var>, <var class="Arg">...</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a free (nonassociative) algebra-with-one of rank <var class="Arg">rank</var> over the division ring <var class="Arg">R</var>. Here <var class="Arg">name</var>, and <var class="Arg">name1</var>, <var class="Arg">name2</var>, ... are optional strings that can be used to provide names for the generators.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FreeAlgebraWithOne( Rationals, 4, "q" );</span>
&lt;algebra-with-one over Rationals, with 4 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfAlgebra( A );</span>
[ (1)*&lt;identity ...&gt;, (1)*q.1, (1)*q.2, (1)*q.3, (1)*q.4 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One( A );</span>
(1)*&lt;identity ...&gt;
</pre></div>

<p><a id="X87835FFE79D2E068" name="X87835FFE79D2E068"></a></p>

<h5>62.3-3 FreeAssociativeAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAssociativeAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">rank</var>[, <var class="Arg">name</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAssociativeAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">name1</var>, <var class="Arg">name2</var>, <var class="Arg">...</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a free associative algebra of rank <var class="Arg">rank</var> over the division ring <var class="Arg">R</var>. Here <var class="Arg">name</var>, and <var class="Arg">name1</var>, <var class="Arg">name2</var>, ... are optional strings that can be used to provide names for the generators.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FreeAssociativeAlgebra( GF( 5 ), 4, "a" );</span>
&lt;algebra over GF(5), with 4 generators&gt;
</pre></div>

<p><a id="X845A777584A7D711" name="X845A777584A7D711"></a></p>

<h5>62.3-4 FreeAssociativeAlgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAssociativeAlgebraWithOne</code>( <var class="Arg">R</var>, <var class="Arg">rank</var>[, <var class="Arg">name</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FreeAssociativeAlgebraWithOne</code>( <var class="Arg">R</var>, <var class="Arg">name1</var>, <var class="Arg">name2</var>, <var class="Arg">...</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a free associative algebra-with-one of rank <var class="Arg">rank</var> over the division ring <var class="Arg">R</var>. Here <var class="Arg">name</var>, and <var class="Arg">name1</var>, <var class="Arg">name2</var>, ... are optional strings that can be used to provide names for the generators.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FreeAssociativeAlgebraWithOne( Rationals, "a", "b", "c" );</span>
&lt;algebra-with-one over Rationals, with 3 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfAlgebra( A );</span>
[ (1)*&lt;identity ...&gt;, (1)*a, (1)*b, (1)*c ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">One( A );</span>
(1)*&lt;identity ...&gt;
</pre></div>

<p><a id="X7E8F45547CC07CE5" name="X7E8F45547CC07CE5"></a></p>

<h4>62.4 <span class="Heading">Constructing Algebras by Structure Constants</span></h4>

<p>For an introduction into structure constants and how they are handled by <strong class="pkg">GAP</strong>, we refer to Section <a href="../../doc/tut/chap6.html#X7DDBF6F47A2E021C"><span class="RefLink">Tutorial: Algebras</span></a> of the user's tutorial.</p>

<p><a id="X7CC58DFD816E6B65" name="X7CC58DFD816E6B65"></a></p>

<h5>62.4-1 AlgebraByStructureConstants</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraByStructureConstants</code>( <var class="Arg">R</var>, <var class="Arg">sctable</var>[, <var class="Arg">nameinfo</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>returns a free left module <span class="SimpleMath">A</span> over the division ring <var class="Arg">R</var>, with multiplication defined by the structure constants table <var class="Arg">sctable</var>. The optional argument <var class="Arg">nameinfo</var> can be used to prescribe names for the elements of the canonical basis of <span class="SimpleMath">A</span>; it can be either a string <var class="Arg">name</var> (then <var class="Arg">name</var><code class="code">1</code>, <var class="Arg">name</var><code class="code">2</code> etc. are chosen) or a list of strings which are then chosen. The vectors of the canonical basis of <span class="SimpleMath">A</span> correspond to the vectors of the basis given by <var class="Arg">sctable</var>.</p>

<p>It is <em>not</em> checked whether the coefficients in <var class="Arg">sctable</var> are really elements in <var class="Arg">R</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [ 1/2, 1, 2/3, 2 ] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( Rationals, T );</span>
&lt;algebra of dimension 2 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b:= BasisVectors( Basis( A ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b[1]^2;</span>
(1/2)*v.1+(2/3)*v.2
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b[1]*b[2];</span>
0*v.1
</pre></div>

<p><a id="X804ADF0280F67CDC" name="X804ADF0280F67CDC"></a></p>

<h5>62.4-2 StructureConstantsTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; StructureConstantsTable</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Let <var class="Arg">B</var> be a basis of a free left module <span class="SimpleMath">R</span>, say, that is also a ring. In this case <code class="func">StructureConstantsTable</code> returns a structure constants table <span class="SimpleMath">T</span> in sparse representation, as used for structure constants algebras (see Section <a href="../../doc/tut/chap6.html#X7DDBF6F47A2E021C"><span class="RefLink">Tutorial: Algebras</span></a> of the <strong class="pkg">GAP</strong> User's Tutorial).</p>

<p>If <var class="Arg">B</var> has length <span class="SimpleMath">n</span> then <span class="SimpleMath">T</span> is a list of length <span class="SimpleMath">n+2</span>. The first <span class="SimpleMath">n</span> entries of <span class="SimpleMath">T</span> are lists of length <span class="SimpleMath">n</span>. <span class="SimpleMath">T[ n+1 ]</span> is one of <span class="SimpleMath">1</span>, <span class="SimpleMath">-1</span>, or <span class="SimpleMath">0</span>; in the case of <span class="SimpleMath">1</span> the table is known to be symmetric, in the case of <span class="SimpleMath">-1</span> it is known to be antisymmetric, and <span class="SimpleMath">0</span> occurs in all other cases. <span class="SimpleMath">T[ n+2 ]</span> is the zero element of the coefficient domain.</p>

<p>The coefficients w.r.t. <var class="Arg">B</var> of the product of the <span class="SimpleMath">i</span>-th and <span class="SimpleMath">j</span>-th basis vector of <var class="Arg">B</var> are stored in <span class="SimpleMath">T[i][j]</span> as a list of length <span class="SimpleMath">2</span>; its first entry is the list of positions of nonzero coefficients, the second entry is the list of these coefficients themselves.</p>

<p>The multiplication in an algebra <span class="SimpleMath">A</span> with vector space basis <var class="Arg">B</var> with basis vectors <span class="SimpleMath">[ v_1, ..., v_n ]</span> is determined by the so-called structure matrices <span class="SimpleMath">M_k = [ m_ijk ]_ij</span>, <span class="SimpleMath">1 ≤ k ≤ n</span>. The <span class="SimpleMath">M_k</span> are defined by <span class="SimpleMath">v_i v_j = ∑_k m_ijk v_k</span>. Let <span class="SimpleMath">a = [ a_1, ..., a_n ]</span> and <span class="SimpleMath">b = [ b_1, ..., b_n ]</span>. Then</p>

<p class="pcenter">( ∑_i a_i v_i ) ( ∑_j b_j v_j ) = ∑_{i,j} a_i b_j ( v_i v_j ) = ∑_k ( ∑_j ( ∑_i a_i m_ijk ) b_j ) v_k = ∑_k ( a M_k b^tr ) v_k.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">StructureConstantsTable( Basis( A ) );</span>
[ [ [ [ 1 ], [ 1 ] ], [ [ 2 ], [ 1 ] ], [ [ 3 ], [ 1 ] ], 
      [ [ 4 ], [ 1 ] ] ], 
  [ [ [ 2 ], [ 1 ] ], [ [ 1 ], [ -1 ] ], [ [ 4 ], [ 1 ] ], 
      [ [ 3 ], [ -1 ] ] ], 
  [ [ [ 3 ], [ 1 ] ], [ [ 4 ], [ -1 ] ], [ [ 1 ], [ -1 ] ], 
      [ [ 2 ], [ 1 ] ] ], 
  [ [ [ 4 ], [ 1 ] ], [ [ 3 ], [ 1 ] ], [ [ 2 ], [ -1 ] ], 
      [ [ 1 ], [ -1 ] ] ], 0, 0 ]
</pre></div>

<p><a id="X7F1203A1793411DF" name="X7F1203A1793411DF"></a></p>

<h5>62.4-3 EmptySCTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; EmptySCTable</code>( <var class="Arg">dim</var>, <var class="Arg">zero</var>[, <var class="Arg">flag</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">EmptySCTable</code> returns a structure constants table for an algebra of dimension <var class="Arg">dim</var>, describing trivial multiplication. <var class="Arg">zero</var> must be the zero of the coefficients domain. If the multiplication is known to be (anti)commutative then this can be indicated by the optional third argument <var class="Arg">flag</var>, which must be one of the strings <code class="code">"symmetric"</code>, <code class="code">"antisymmetric"</code>.</p>

<p>For filling up the structure constants table, see <code class="func">SetEntrySCTable</code> (<a href="chap62.html#X817BD086876EC1C4"><span class="RefLink">62.4-4</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">EmptySCTable( 2, Zero( GF(5) ), "antisymmetric" );</span>
[ [ [ [  ], [  ] ], [ [  ], [  ] ] ], 
  [ [ [  ], [  ] ], [ [  ], [  ] ] ], -1, 0*Z(5) ]
</pre></div>

<p><a id="X817BD086876EC1C4" name="X817BD086876EC1C4"></a></p>

<h5>62.4-4 SetEntrySCTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SetEntrySCTable</code>( <var class="Arg">T</var>, <var class="Arg">i</var>, <var class="Arg">j</var>, <var class="Arg">list</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>sets the entry of the structure constants table <var class="Arg">T</var> that describes the product of the <var class="Arg">i</var>-th basis element with the <var class="Arg">j</var>-th basis element to the value given by the list <var class="Arg">list</var>.</p>

<p>If <var class="Arg">T</var> is known to be antisymmetric or symmetric then also the value <code class="code"><var class="Arg">T</var>[<var class="Arg">j</var>][<var class="Arg">i</var>]</code> is set.</p>

<p><var class="Arg">list</var> must be of the form <span class="SimpleMath">[ c_ij^{k_1}, k_1, c_ij^{k_2}, k_2, ... ]</span>.</p>

<p>The entries at the odd positions of <var class="Arg">list</var> must be compatible with the zero element stored in <var class="Arg">T</var>. For convenience, these entries may also be rational numbers that are automatically replaced by the corresponding elements in the appropriate prime field in finite characteristic if necessary.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [ 1/2, 1, 2/3, 2 ] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T;</span>
[ [ [ [ 1, 2 ], [ 1/2, 2/3 ] ], [ [  ], [  ] ] ], 
  [ [ [  ], [  ] ], [ [  ], [  ] ] ], 0, 0 ]
</pre></div>

<p><a id="X7F333822780B6731" name="X7F333822780B6731"></a></p>

<h5>62.4-5 GapInputSCTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GapInputSCTable</code>( <var class="Arg">T</var>, <var class="Arg">varname</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a string that describes the structure constants table <var class="Arg">T</var> in terms of <code class="func">EmptySCTable</code> (<a href="chap62.html#X7F1203A1793411DF"><span class="RefLink">62.4-3</span></a>) and <code class="func">SetEntrySCTable</code> (<a href="chap62.html#X817BD086876EC1C4"><span class="RefLink">62.4-4</span></a>). The assignments are made to the variable <var class="Arg">varname</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [ 1, 2 ] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 1, [ 1, 2 ] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GapInputSCTable( T, "T" );</span>
"T:= EmptySCTable( 2, 0 );\nSetEntrySCTable( T, 1, 2, [1,2] );\nSetEnt\
rySCTable( T, 2, 1, [1,2] );\n"
</pre></div>

<p><a id="X7C23ED85814C0371" name="X7C23ED85814C0371"></a></p>

<h5>62.4-6 TestJacobi</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TestJacobi</code>( <var class="Arg">T</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>tests whether the structure constants table <var class="Arg">T</var> satisfies the Jacobi identity <span class="SimpleMath">v_i * (v_j * v_k) + v_j * (v_k * v_i) + v_k * (v_i * v_j) = 0</span> for all basis vectors <span class="SimpleMath">v_i</span> of the underlying algebra, where <span class="SimpleMath">i ≤ j ≤ k</span>. (Thus antisymmetry is assumed.)</p>

<p>The function returns <code class="keyw">true</code> if the Jacobi identity is satisfied, and a failing triple <span class="SimpleMath">[ i, j, k ]</span> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0, "antisymmetric" );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [ 1, 2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">TestJacobi( T );</span>
true
</pre></div>

<p><a id="X78B633CE7A5B9F9A" name="X78B633CE7A5B9F9A"></a></p>

<h5>62.4-7 IdentityFromSCTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IdentityFromSCTable</code>( <var class="Arg">T</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Let <var class="Arg">T</var> be a structure constants table of an algebra <span class="SimpleMath">A</span> of dimension <span class="SimpleMath">n</span>. <code class="code">IdentityFromSCTable( <var class="Arg">T</var> )</code> is either <code class="keyw">fail</code> or the vector of length <span class="SimpleMath">n</span> that contains the coefficients of the multiplicative identity of <span class="SimpleMath">A</span> with respect to the basis that belongs to <var class="Arg">T</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [ 1, 1 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [ 1, 2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 1, [ 1, 2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IdentityFromSCTable( T );</span>
[ 1, 0 ]
</pre></div>

<p><a id="X7F2A71608602635D" name="X7F2A71608602635D"></a></p>

<h5>62.4-8 QuotientFromSCTable</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; QuotientFromSCTable</code>( <var class="Arg">T</var>, <var class="Arg">num</var>, <var class="Arg">den</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Let <var class="Arg">T</var> be a structure constants table of an algebra <span class="SimpleMath">A</span> of dimension <span class="SimpleMath">n</span>. <code class="code">QuotientFromSCTable( <var class="Arg">T</var> )</code> is either <code class="keyw">fail</code> or the vector of length <span class="SimpleMath">n</span> that contains the coefficients of the quotient of <var class="Arg">num</var> and <var class="Arg">den</var> with respect to the basis that belongs to <var class="Arg">T</var>.</p>

<p>We solve the equation system <var class="Arg">num</var><span class="SimpleMath">= x *</span> <var class="Arg">den</var>. If no solution exists, <code class="keyw">fail</code> is returned.</p>

<p>In terms of the basis <span class="SimpleMath">B</span> with vectors <span class="SimpleMath">b_1, ..., b_n</span> this means for <span class="SimpleMath"><var class="Arg">num</var> = ∑_{i = 1}^n a_i b_i</span>, <span class="SimpleMath"><var class="Arg">den</var> = ∑_{i = 1}^n c_i b_i</span>, <span class="SimpleMath">x = ∑_{i = 1}^n x_i b_i</span> that <span class="SimpleMath">a_k = ∑_{i,j} c_i x_j c_ijk</span> for all <span class="SimpleMath">k</span>. Here <span class="SimpleMath">c_ijk</span> denotes the structure constants with respect to <span class="SimpleMath">B</span>. This means that (as a vector) <span class="SimpleMath">a = x M</span> with <span class="SimpleMath">M_jk = ∑_{i = 1}^n c_ijk c_i</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [ 1, 1 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 1, [ 1, 2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [ 1, 2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">QuotientFromSCTable( T, [0,1], [1,0] );</span>
[ 0, 1 ]
</pre></div>

<p><a id="X79B7C3078112E7E1" name="X79B7C3078112E7E1"></a></p>

<h4>62.5 <span class="Heading">Some Special Algebras</span></h4>

<p><a id="X83DF4BCC7CE494FC" name="X83DF4BCC7CE494FC"></a></p>

<h5>62.5-1 QuaternionAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; QuaternionAlgebra</code>( <var class="Arg">F</var>[, <var class="Arg">a</var>, <var class="Arg">b</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a quaternion algebra over <var class="Arg">F</var>, with parameters <var class="Arg">a</var> and <var class="Arg">b</var>.</p>

<p>Let <var class="Arg">F</var> be a field or a list of field elements, let <span class="SimpleMath">F</span> be the field generated by <var class="Arg">F</var>, and let <var class="Arg">a</var> and <var class="Arg">b</var> two elements in <span class="SimpleMath">F</span>. <code class="func">QuaternionAlgebra</code> returns a quaternion algebra over <span class="SimpleMath">F</span>, with parameters <var class="Arg">a</var> and <var class="Arg">b</var>, i.e., a four-dimensional associative <span class="SimpleMath">F</span>-algebra with basis <span class="SimpleMath">(e,i,j,k)</span> and multiplication defined by <span class="SimpleMath">e e = e</span>, <span class="SimpleMath">e i = i e = i</span>, <span class="SimpleMath">e j = j e = j</span>, <span class="SimpleMath">e k = k e = k</span>, <span class="SimpleMath">i i = <var class="Arg">a</var> e</span>, <span class="SimpleMath">i j = - j i = k</span>, <span class="SimpleMath">i k = - k i = <var class="Arg">a</var> j</span>, <span class="SimpleMath">j j = <var class="Arg">b</var> e</span>, <span class="SimpleMath">j k = - k j = <var class="Arg">b</var> i</span>, <span class="SimpleMath">k k = - <var class="Arg">a</var> <var class="Arg">b</var> e</span>. The default value for both <var class="Arg">a</var> and <var class="Arg">b</var> is <span class="SimpleMath">-1 ∈ F</span>.</p>

<p>The <code class="func">GeneratorsOfAlgebra</code> (<a href="chap62.html#X83B055F37EBF2438"><span class="RefLink">62.9-1</span></a>) and <code class="func">CanonicalBasis</code> (<a href="chap61.html#X7C8EBFF5805F8C51"><span class="RefLink">61.5-3</span></a>) value of an algebra constructed with <code class="func">QuaternionAlgebra</code> is the list <span class="SimpleMath">[ e, i, j, k ]</span>.</p>

<p>Two quaternion algebras with the same parameters <var class="Arg">a</var>, <var class="Arg">b</var> lie in the same family, so it makes sense to consider their intersection or to ask whether they are contained in each other. (This is due to the fact that the results of <code class="func">QuaternionAlgebra</code> are cached, in the global variable <code class="code">QuaternionAlgebraData</code>.)</p>

<p>The embedding of the field <code class="func">GaussianRationals</code> (<a href="chap60.html#X82F53C65802FF551"><span class="RefLink">60.1-3</span></a>) into a quaternion algebra <span class="SimpleMath">A</span> over <code class="func">Rationals</code> (<a href="chap17.html#X7B6029D18570C08A"><span class="RefLink">17.1-1</span></a>) is not uniquely determined. One can specify one embedding as a vector space homomorphism that maps <code class="code">1</code> to the first algebra generator of <span class="SimpleMath">A</span>, and <code class="code">E(4)</code> to one of the others.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">QuaternionAlgebra( Rationals );</span>
&lt;algebra-with-one of dimension 4 over Rationals&gt;
</pre></div>

<p><a id="X7B807702782F56FF" name="X7B807702782F56FF"></a></p>

<h5>62.5-2 ComplexificationQuat</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ComplexificationQuat</code>( <var class="Arg">vector</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ComplexificationQuat</code>( <var class="Arg">matrix</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Let <span class="SimpleMath">A = e F ⊕ i F ⊕ j F ⊕ k F</span> be a quaternion algebra over the field <span class="SimpleMath">F</span> of cyclotomics, with basis <span class="SimpleMath">(e,i,j,k)</span>.</p>

<p>If <span class="SimpleMath">v = v_1 + v_2 j</span> is a row vector over <span class="SimpleMath">A</span> with <span class="SimpleMath">v_1 = e w_1 + i w_2</span> and <span class="SimpleMath">v_2 = e w_3 + i w_4</span> then <code class="func">ComplexificationQuat</code> called with argument <span class="SimpleMath">v</span> returns the concatenation of <span class="SimpleMath">w_1 +</span><code class="code">E(4)</code><span class="SimpleMath">w_2</span> and <span class="SimpleMath">w_3 +</span><code class="code">E(4)</code><span class="SimpleMath">w_4</span>.</p>

<p>If <span class="SimpleMath">M = M_1 + M_2 j</span> is a matrix over <span class="SimpleMath">A</span> with <span class="SimpleMath">M_1 = e N_1 + i N_2</span> and <span class="SimpleMath">M_2 = e N_3 + i N_4</span> then <code class="func">ComplexificationQuat</code> called with argument <span class="SimpleMath">M</span> returns the block matrix <span class="SimpleMath">A</span> over <span class="SimpleMath">e F ⊕ i F</span> such that <span class="SimpleMath">A(1,1) = N_1 +</span><code class="code">E(4)</code><span class="SimpleMath">N_2</span>, <span class="SimpleMath">A(2,2) = N_1 -</span><code class="code">E(4)</code><span class="SimpleMath">N_2</span>, <span class="SimpleMath">A(1,2) = N_3 +</span><code class="code">E(4)</code><span class="SimpleMath">N_4</span>, and <span class="SimpleMath">A(2,1) = - N_3 +</span><code class="code">E(4)</code><span class="SimpleMath">N_4</span>.</p>

<p>Then <code class="code">ComplexificationQuat(<var class="Arg">v</var>) * ComplexificationQuat(<var class="Arg">M</var>)= ComplexificationQuat(<var class="Arg">v</var> * <var class="Arg">M</var>)</code>, since</p>

<p class="pcenter">v M = v_1 M_1 + v_2 j M_1 + v_1 M_2 j + v_2 j M_2 j = ( v_1 M_1 - v_2 overline{M_2} ) + ( v_1 M_2 + v_2 overline{M_1} ) j.</p>

<p><a id="X78C88A38853A8443" name="X78C88A38853A8443"></a></p>

<h5>62.5-3 OctaveAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; OctaveAlgebra</code>( <var class="Arg">F</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The algebra of octonions over <var class="Arg">F</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">OctaveAlgebra( Rationals );</span>
&lt;algebra of dimension 8 over Rationals&gt;
</pre></div>

<p><a id="X7D88E42B7DE087B0" name="X7D88E42B7DE087B0"></a></p>

<h5>62.5-4 FullMatrixAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FullMatrixAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MatrixAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MatAlgebra</code>( <var class="Arg">R</var>, <var class="Arg">n</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is the full matrix algebra of <span class="SimpleMath"><var class="Arg">n</var> × <var class="Arg">n</var></span> matrices over the ring <var class="Arg">R</var>, for a nonnegative integer <var class="Arg">n</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:=FullMatrixAlgebra( Rationals, 20 );</span>
( Rationals^[ 20, 20 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
400
</pre></div>

<p><a id="X78B8BA77869DAA13" name="X78B8BA77869DAA13"></a></p>

<h5>62.5-5 NullAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NullAlgebra</code>( <var class="Arg">R</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>The zero-dimensional algebra over <var class="Arg">R</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= NullAlgebra( Rationals );</span>
&lt;algebra over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( A );</span>
0
</pre></div>

<p><a id="X7DF5989886BE611E" name="X7DF5989886BE611E"></a></p>

<h4>62.6 <span class="Heading">Subalgebras</span></h4>

<p><a id="X8396643D7A49EEAD" name="X8396643D7A49EEAD"></a></p>

<h5>62.6-1 Subalgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Subalgebra</code>( <var class="Arg">A</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>is the <span class="SimpleMath">F</span>-algebra generated by <var class="Arg">gens</var>, with parent algebra <var class="Arg">A</var>, where <span class="SimpleMath">F</span> is the left acting domain of <var class="Arg">A</var>.</p>

<p><em>Note</em> that being a subalgebra of <var class="Arg">A</var> means to be an algebra, to be contained in <var class="Arg">A</var>, <em>and</em> to have the same left acting domain as <var class="Arg">A</var>.</p>

<p>An optional argument <code class="code">"basis"</code> may be added if it is known that the generators already form a basis of the algebra. Then it is <em>not</em> checked whether <var class="Arg">gens</var> really are linearly independent and whether all elements in <var class="Arg">gens</var> lie in <var class="Arg">A</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m ] );</span>
&lt;algebra over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Subalgebra( A, [ m^2 ] );</span>
&lt;algebra over Rationals, with 1 generators&gt;
</pre></div>

<p><a id="X7C6B08657BD836C3" name="X7C6B08657BD836C3"></a></p>

<h5>62.6-2 SubalgebraNC</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubalgebraNC</code>( <var class="Arg">A</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">SubalgebraNC</code> does the same as <code class="func">Subalgebra</code> (<a href="chap62.html#X8396643D7A49EEAD"><span class="RefLink">62.6-1</span></a>), except that it does not check whether all elements in <var class="Arg">gens</var> lie in <var class="Arg">A</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= RandomMat( 3, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m ] );</span>
&lt;algebra over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SubalgebraNC( A, [ IdentityMat( 3, 3 ) ], "basis" );</span>
&lt;algebra of dimension 1 over Rationals&gt;
</pre></div>

<p><a id="X83ECF489846F00B0" name="X83ECF489846F00B0"></a></p>

<h5>62.6-3 SubalgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubalgebraWithOne</code>( <var class="Arg">A</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>is the algebra-with-one generated by <var class="Arg">gens</var>, with parent algebra <var class="Arg">A</var>.</p>

<p>The optional third argument, the string <code class="code">"basis"</code>, may be added if it is known that the elements from <var class="Arg">gens</var> are linearly independent. Then it is <em>not</em> checked whether <var class="Arg">gens</var> really are linearly independent and whether all elements in <var class="Arg">gens</var> lie in <var class="Arg">A</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraWithOne( Rationals, [ m ] );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B1:= SubalgebraWithOne( A, [ m ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B2:= Subalgebra( A, [ m ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( B1 );</span>
3
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( B2 );</span>
2
</pre></div>

<p><a id="X7A11B177868E76AA" name="X7A11B177868E76AA"></a></p>

<h5>62.6-4 SubalgebraWithOneNC</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubalgebraWithOneNC</code>( <var class="Arg">A</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">SubalgebraWithOneNC</code> does the same as <code class="func">SubalgebraWithOne</code> (<a href="chap62.html#X83ECF489846F00B0"><span class="RefLink">62.6-3</span></a>), except that it does not check whether all elements in <var class="Arg">gens</var> lie in <var class="Arg">A</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= RandomMat( 3, 3 );; A:= Algebra( Rationals, [ m ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SubalgebraWithOneNC( A, [ m ] );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
</pre></div>

<p><a id="X7FDD953A84CFC3D2" name="X7FDD953A84CFC3D2"></a></p>

<h5>62.6-5 TrivialSubalgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TrivialSubalgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>The zero dimensional subalgebra of the algebra <var class="Arg">A</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= TrivialSubalgebra( A );</span>
&lt;algebra over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( B );</span>
0
</pre></div>

<p><a id="X83629803819C4A6F" name="X83629803819C4A6F"></a></p>

<h4>62.7 <span class="Heading">Ideals</span></h4>

<p>For constructing and working with ideals in algebras the same functions are available as for ideals in rings. So for the precise description of these functions we refer to Chapter <a href="chap56.html#X81897F6082CACB59"><span class="RefLink">56</span></a>. Here we give examples demonstrating the use of ideals in algebras. For an introduction into the construction of quotient algebras we refer to Chapter <a href="../../doc/tut/chap6.html#X7DDBF6F47A2E021C"><span class="RefLink">Tutorial: Algebras</span></a> of the user's tutorial.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 2, 3 ], [ 0, 0, 4 ], [ 0, 0, 0] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraWithOne( Rationals, [ m ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">I:= Ideal( A, [ m ] );  # the two-sided ideal of `A' generated by `m'</span>
&lt;two-sided ideal in &lt;algebra-with-one of dimension 3 over Rationals&gt;, 
  (1 generators)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( I );</span>
2
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfIdeal( I );</span>
[ [ [ 0, 2, 3 ], [ 0, 0, 4 ], [ 0, 0, 0 ] ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( Basis( I ) );</span>
[ [ [ 0, 1, 3/2 ], [ 0, 0, 2 ], [ 0, 0, 0 ] ], 
  [ [ 0, 0, 1 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 4 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= NullMat( 4, 4 );; m[1][4]:=1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">I:= LeftIdeal( A, [ m ] );</span>
&lt;left ideal in ( Rationals^[ 4, 4 ] ), (1 generators)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( I );</span>
4
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfLeftIdeal( I );</span>
[ [ [ 0, 0, 0, 1 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ], [ 0, 0, 0, 0 ] ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">mats:= [ [[1,0],[0,0]], [[0,1],[0,0]], [[0,0],[0,1]] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, mats );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput"># Form the two-sided ideal for which `mats[2]' is known to be</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput"># the unique basis element.</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">I:= Ideal( A, [ mats[2] ], "basis" );</span>
&lt;two-sided ideal in &lt;algebra of dimension 3 over Rationals&gt;, 
  (dimension 1)&gt;
</pre></div>

<p><a id="X7DC95D6982C9D7B0" name="X7DC95D6982C9D7B0"></a></p>

<h4>62.8 <span class="Heading">Categories and Properties of Algebras</span></h4>

<p><a id="X7FEDFAA383AB20D2" name="X7FEDFAA383AB20D2"></a></p>

<h5>62.8-1 IsFLMLOR</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFLMLOR</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>A FLMLOR ("free left module left operator ring") in <strong class="pkg">GAP</strong> is a ring that is also a free left module.</p>

<p>Note that this means that being a FLMLOR is not a property a ring can get, since a ring is usually not represented as an external left set.</p>

<p>Examples are magma rings (e.g. over the integers) or algebras.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFLMLOR ( A );</span>
true
</pre></div>

<p><a id="X85C1E13A877DF2C8" name="X85C1E13A877DF2C8"></a></p>

<h5>62.8-2 IsFLMLORWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFLMLORWithOne</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>A FLMLOR-with-one in <strong class="pkg">GAP</strong> is a ring-with-one that is also a free left module.</p>

<p>Note that this means that being a FLMLOR-with-one is not a property a ring-with-one can get, since a ring-with-one is usually not represented as an external left set.</p>

<p>Examples are magma rings-with-one or algebras-with-one (but also over the integers).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFLMLORWithOne ( A );</span>
true
</pre></div>

<p><a id="X801ED693808F6C84" name="X801ED693808F6C84"></a></p>

<h5>62.8-3 IsAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAlgebra</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>An algebra in <strong class="pkg">GAP</strong> is a ring that is also a left vector space. Note that this means that being an algebra is not a property a ring can get, since a ring is usually not represented as an external left set.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= MatAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsAlgebra( A );</span>
true
</pre></div>

<p><a id="X80B21AC27DE6D068" name="X80B21AC27DE6D068"></a></p>

<h5>62.8-4 IsAlgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAlgebraWithOne</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>An algebra-with-one in <strong class="pkg">GAP</strong> is a ring-with-one that is also a left vector space. Note that this means that being an algebra-with-one is not a property a ring-with-one can get, since a ring-with-one is usually not represented as an external left set.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= MatAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsAlgebraWithOne( A );</span>
true
</pre></div>

<p><a id="X839BAC687B4E1A1D" name="X839BAC687B4E1A1D"></a></p>

<h5>62.8-5 IsLieAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLieAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>An algebra <var class="Arg">A</var> is called Lie algebra if <span class="SimpleMath">a * a = 0</span> for all <span class="SimpleMath">a</span> in <var class="Arg">A</var> and <span class="SimpleMath">( a * ( b * c ) ) + ( b * ( c * a ) ) + ( c * ( a * b ) ) = 0</span> for all <span class="SimpleMath">a, b, c ∈</span><var class="Arg">A</var> (Jacobi identity).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixLieAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsLieAlgebra( A );</span>
true
</pre></div>

<p><a id="X877DF13387831A6A" name="X877DF13387831A6A"></a></p>

<h5>62.8-6 IsSimpleAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsSimpleAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( property )</td></tr></table></div>
<p>is <code class="keyw">true</code> if the algebra <var class="Arg">A</var> is simple, and <code class="keyw">false</code> otherwise. This function is only implemented for the cases where <var class="Arg">A</var> is an associative or a Lie algebra. And for Lie algebras it is only implemented for the case where the ground field is of characteristic zero.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixLieAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsSimpleAlgebra( A );</span>
false
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= MatAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsSimpleAlgebra( A );</span>
true
</pre></div>

<p><a id="X7C5AECE87D79D075" name="X7C5AECE87D79D075"></a></p>

<h5>62.8-7 IsFiniteDimensional</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFiniteDimensional</code>( <var class="Arg">matalg</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>returns <code class="keyw">true</code> (always) for a matrix algebra <var class="Arg">matalg</var>, since matrix algebras are always finite dimensional.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= MatAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFiniteDimensional( A );</span>
true
</pre></div>

<p><a id="X82B3A9077D0CB453" name="X82B3A9077D0CB453"></a></p>

<h5>62.8-8 IsQuaternion</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsQuaternion</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsQuaternionCollection</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsQuaternionCollColl</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p><code class="func">IsQuaternion</code> is the category of elements in an algebra constructed by <code class="func">QuaternionAlgebra</code> (<a href="chap62.html#X83DF4BCC7CE494FC"><span class="RefLink">62.5-1</span></a>). A collection of quaternions lies in the category <code class="func">IsQuaternionCollection</code>. Finally, a collection of quaternion collections (e.g., a matrix of quaternions) lies in the category <code class="func">IsQuaternionCollColl</code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b:= BasisVectors( Basis( A ) );</span>
[ e, i, j, k ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsQuaternion( b[1] );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsQuaternionCollColl( [ [ b[1], b[2] ], [ b[3], b[4] ] ] );</span>
true
</pre></div>

<p><a id="X7E9273E47CF38CF1" name="X7E9273E47CF38CF1"></a></p>

<h4>62.9 <span class="Heading">Attributes and Operations for Algebras</span></h4>

<p><a id="X83B055F37EBF2438" name="X83B055F37EBF2438"></a></p>

<h5>62.9-1 GeneratorsOfAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>returns a list of elements that generate <var class="Arg">A</var> as an algebra.</p>

<p>For a free algebra, each generator can also be accessed using the <code class="code">.</code> operator (see <code class="func">GeneratorsOfDomain</code> (<a href="chap31.html#X7E353DD1838AB223"><span class="RefLink">31.9-2</span></a>)).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraWithOne( Rationals, [ m ] );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfAlgebra( A );</span>
[ [ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ], 
  [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ] ]
</pre></div>

<p><a id="X7FA408307A5A420E" name="X7FA408307A5A420E"></a></p>

<h5>62.9-2 GeneratorsOfAlgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfAlgebraWithOne</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>returns a list of elements of <var class="Arg">A</var> that generate <var class="Arg">A</var> as an algebra with one.</p>

<p>For a free algebra with one, each generator can also be accessed using the <code class="code">.</code> operator (see <code class="func">GeneratorsOfDomain</code> (<a href="chap31.html#X7E353DD1838AB223"><span class="RefLink">31.9-2</span></a>)).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraWithOne( Rationals, [ m ] );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfAlgebraWithOne( A );</span>
[ [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ] ]
</pre></div>

<p><a id="X7D309FD37D94B196" name="X7D309FD37D94B196"></a></p>

<h5>62.9-3 ProductSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ProductSpace</code>( <var class="Arg">U</var>, <var class="Arg">V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>is the vector space <span class="SimpleMath">⟨ u * v ; u ∈ U, v ∈ V ⟩</span>, where <span class="SimpleMath">U</span> and <span class="SimpleMath">V</span> are subspaces of the same algebra.</p>

<p>If <span class="SimpleMath"><var class="Arg">U</var> = <var class="Arg">V</var></span> is known to be an algebra then the product space is also an algebra, moreover it is an ideal in <var class="Arg">U</var>. If <var class="Arg">U</var> and <var class="Arg">V</var> are known to be ideals in an algebra <span class="SimpleMath">A</span> then the product space is known to be an algebra and an ideal in <span class="SimpleMath">A</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b:= BasisVectors( Basis( A ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Subalgebra( A, [ b[4] ] );</span>
&lt;algebra over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ProductSpace( A, B );</span>
&lt;vector space of dimension 4 over Rationals&gt;
</pre></div>

<p><a id="X875CD2B37EE9A8A2" name="X875CD2B37EE9A8A2"></a></p>

<h5>62.9-4 PowerSubalgebraSeries</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PowerSubalgebraSeries</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>returns a list of subalgebras of <var class="Arg">A</var>, the first term of which is <var class="Arg">A</var>; and every next term is the product space of the previous term with itself.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );</span>
&lt;algebra-with-one of dimension 4 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PowerSubalgebraSeries( A );</span>
[ &lt;algebra-with-one of dimension 4 over Rationals&gt; ]
</pre></div>

<p><a id="X788F4E6184E5C863" name="X788F4E6184E5C863"></a></p>

<h5>62.9-5 AdjointBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AdjointBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>The <em>adjoint map</em> <span class="SimpleMath">ad(x)</span> of an element <span class="SimpleMath">x</span> in an <span class="SimpleMath">F</span>-algebra <span class="SimpleMath">A</span>, say, is the left multiplication by <span class="SimpleMath">x</span>. This map is <span class="SimpleMath">F</span>-linear and thus, w.r.t. the given basis <var class="Arg">B</var><span class="SimpleMath">= (x_1, x_2, ..., x_n)</span> of <span class="SimpleMath">A</span>, <span class="SimpleMath">ad(x)</span> can be represented by a matrix over <span class="SimpleMath">F</span>. Let <span class="SimpleMath">V</span> denote the <span class="SimpleMath">F</span>-vector space of the matrices corresponding to <span class="SimpleMath">ad(x)</span>, for <span class="SimpleMath">x ∈ A</span>. Then <code class="func">AdjointBasis</code> returns the basis of <span class="SimpleMath">V</span> that consists of the matrices for <span class="SimpleMath">ad(x_1), ..., ad(x_n)</span>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AdjointBasis( Basis( A ) );</span>
Basis( &lt;vector space over Rationals, with 4 generators&gt;, 
[ [ [ 1, 0, 0, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 0, 0, 1 ] ], 
  [ [ 0, -1, 0, 0 ], [ 1, 0, 0, 0 ], [ 0, 0, 0, -1 ], [ 0, 0, 1, 0 ] ]
    , 
  [ [ 0, 0, -1, 0 ], [ 0, 0, 0, 1 ], [ 1, 0, 0, 0 ], [ 0, -1, 0, 0 ] ]
    , 
  [ [ 0, 0, 0, -1 ], [ 0, 0, -1, 0 ], [ 0, 1, 0, 0 ], [ 1, 0, 0, 0 ] 
     ] ] )
</pre></div>

<p><a id="X800A410B8536E6DD" name="X800A410B8536E6DD"></a></p>

<h5>62.9-6 IndicesOfAdjointBasis</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IndicesOfAdjointBasis</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Let <var class="Arg">A</var> be an algebra and let <var class="Arg">B</var> be the basis that is output by <code class="code">AdjointBasis( Basis( <var class="Arg">A</var> ) )</code>. This function returns a list of indices. If <span class="SimpleMath">i</span> is an index belonging to this list, then <span class="SimpleMath">ad x_i</span> is a basis vector of the matrix space spanned by <span class="SimpleMath">ad A</span>, where <span class="SimpleMath">x_i</span> is the <span class="SimpleMath">i</span>-th basis vector of the basis <var class="Arg">B</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= FullMatrixLieAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AdjointBasis( Basis( L ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IndicesOfAdjointBasis( B );</span>
[ 1, 2, 3, 4, 5, 6, 7, 8 ]
</pre></div>

<p><a id="X7BA35CB28062D407" name="X7BA35CB28062D407"></a></p>

<h5>62.9-7 AsAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsAlgebra</code>( <var class="Arg">F</var>, <var class="Arg">A</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns the algebra over <var class="Arg">F</var> generated by <var class="Arg">A</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ IdentityMat( 2 ) ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsAlgebra( Rationals, V );</span>
&lt;algebra of dimension 1 over Rationals&gt;
</pre></div>

<p><a id="X878323367D0B68EB" name="X878323367D0B68EB"></a></p>

<h5>62.9-8 AsAlgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsAlgebraWithOne</code>( <var class="Arg">F</var>, <var class="Arg">A</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>If the algebra <var class="Arg">A</var> has an identity, then it can be viewed as an algebra with one over <var class="Arg">F</var>. This function returns this algebra with one.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ IdentityMat( 2 ) ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AsAlgebra( Rationals, V );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AsAlgebraWithOne( Rationals, A );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
</pre></div>

<p><a id="X7A922D26805AFF99" name="X7A922D26805AFF99"></a></p>

<h5>62.9-9 AsSubalgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsSubalgebra</code>( <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>If all elements of the algebra <var class="Arg">B</var> happen to be contained in the algebra <var class="Arg">A</var>, then <var class="Arg">B</var> can be viewed as a subalgebra of <var class="Arg">A</var>. This function returns this subalgebra.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ IdentityMat( 2 ) ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AsAlgebra( Rationals, V );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BA:= AsSubalgebra( A, B );</span>
&lt;algebra of dimension 1 over Rationals&gt;
</pre></div>

<p><a id="X7B964BC37A975E48" name="X7B964BC37A975E48"></a></p>

<h5>62.9-10 AsSubalgebraWithOne</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AsSubalgebraWithOne</code>( <var class="Arg">A</var>, <var class="Arg">B</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>If <var class="Arg">B</var> is an algebra with one, all elements of which happen to be contained in the algebra with one <var class="Arg">A</var>, then <var class="Arg">B</var> can be viewed as a subalgebra with one of <var class="Arg">A</var>. This function returns this subalgebra with one.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= VectorSpace( Rationals, [ IdentityMat( 2 ) ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AsAlgebra( Rationals, V );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:= AsAlgebraWithOne( Rationals, B );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">AC:= AsSubalgebraWithOne( A, C );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
</pre></div>

<p><a id="X7C280DAC7F840B60" name="X7C280DAC7F840B60"></a></p>

<h5>62.9-11 MutableBasisOfClosureUnderAction</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MutableBasisOfClosureUnderAction</code>( <var class="Arg">F</var>, <var class="Arg">Agens</var>, <var class="Arg">from</var>, <var class="Arg">init</var>, <var class="Arg">opr</var>, <var class="Arg">zero</var>, <var class="Arg">maxdim</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Let <var class="Arg">F</var> be a ring, <var class="Arg">Agens</var> a list of generators for an <var class="Arg">F</var>-algebra <span class="SimpleMath">A</span>, and <var class="Arg">from</var> one of <code class="code">"left"</code>, <code class="code">"right"</code>, <code class="code">"both"</code>; this means that elements of <span class="SimpleMath">A</span> act via multiplication from the respective side(s). <var class="Arg">init</var> must be a list of initial generating vectors, and <var class="Arg">opr</var> the operation (a function of two arguments).</p>

<p><code class="func">MutableBasisOfClosureUnderAction</code> returns a mutable basis of the <var class="Arg">F</var>-free left module generated by the vectors in <var class="Arg">init</var> and their images under the action of <var class="Arg">Agens</var> from the respective side(s).</p>

<p><var class="Arg">zero</var> is the zero element of the desired module. <var class="Arg">maxdim</var> is an upper bound for the dimension of the closure; if no such upper bound is known then the value of <var class="Arg">maxdim</var> must be <code class="func">infinity</code> (<a href="chap18.html#X8511B8DF83324C27"><span class="RefLink">18.2-1</span></a>).</p>

<p><code class="func">MutableBasisOfClosureUnderAction</code> can be used to compute a basis of an <em>associative</em> algebra generated by the elements in <var class="Arg">Agens</var>. In this case <var class="Arg">from</var> may be <code class="code">"left"</code> or <code class="code">"right"</code>, <var class="Arg">opr</var> is the multiplication <code class="code">*</code>, and <var class="Arg">init</var> is a list containing either the identity of the algebra or a list of algebra generators. (Note that if the algebra has an identity then it is in general not sufficient to take algebra-with-one generators as <var class="Arg">init</var>, whereas of course <var class="Arg">Agens</var> need not contain the identity.)</p>

<p>(Note that bases of <em>not</em> necessarily associative algebras can be computed using <code class="func">MutableBasisOfNonassociativeAlgebra</code> (<a href="chap62.html#X7BA1739D7F8B3A2B"><span class="RefLink">62.9-12</span></a>).)</p>

<p>Other applications of <code class="func">MutableBasisOfClosureUnderAction</code> are the computations of bases for (left/ right/ two-sided) ideals <span class="SimpleMath">I</span> in an <em>associative</em> algebra <span class="SimpleMath">A</span> from ideal generators of <span class="SimpleMath">I</span>; in these cases <var class="Arg">Agens</var> is a list of algebra generators of <span class="SimpleMath">A</span>, <var class="Arg">from</var> denotes the appropriate side(s), <var class="Arg">init</var> is a list of ideal generators of <span class="SimpleMath">I</span>, and <var class="Arg">opr</var> is again <code class="code">*</code>.</p>

<p>(Note that bases of ideals in <em>not</em> necessarily associative algebras can be computed using <code class="func">MutableBasisOfIdealInNonassociativeAlgebra</code> (<a href="chap62.html#X8467B687823371F9"><span class="RefLink">62.9-13</span></a>).)</p>

<p>Finally, bases of right <span class="SimpleMath">A</span>-modules also can be computed using <code class="func">MutableBasisOfClosureUnderAction</code>. The only difference to the ideal case is that <var class="Arg">init</var> is now a list of right module generators, and <var class="Arg">opr</var> is the operation of the module.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:= GeneratorsOfAlgebra( A );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= MutableBasisOfClosureUnderAction( Rationals, </span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">                               g, "left", [ g[1] ], \*, Zero(A), 4 );</span>
&lt;mutable basis over Rationals, 4 vectors&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( B );</span>
[ e, i, j, k ]
</pre></div>

<p><a id="X7BA1739D7F8B3A2B" name="X7BA1739D7F8B3A2B"></a></p>

<h5>62.9-12 MutableBasisOfNonassociativeAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MutableBasisOfNonassociativeAlgebra</code>( <var class="Arg">F</var>, <var class="Arg">Agens</var>, <var class="Arg">zero</var>, <var class="Arg">maxdim</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a mutable basis of the (not necessarily associative) <var class="Arg">F</var>-algebra that is generated by <var class="Arg">Agens</var>, has zero element <var class="Arg">zero</var>, and has dimension at most <var class="Arg">maxdim</var>. If no finite bound for the dimension is known then <code class="func">infinity</code> (<a href="chap18.html#X8511B8DF83324C27"><span class="RefLink">18.2-1</span></a>) must be the value of <var class="Arg">maxdim</var>.</p>

<p>The difference to <code class="func">MutableBasisOfClosureUnderAction</code> (<a href="chap62.html#X7C280DAC7F840B60"><span class="RefLink">62.9-11</span></a>) is that in general it is not sufficient to multiply just with algebra generators. (For special cases of nonassociative algebras, especially for Lie algebras, multiplying with algebra generators suffices.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= FullMatrixLieAlgebra( Rationals, 4 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= Random( L );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= Random( L );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MutableBasisOfNonassociativeAlgebra( Rationals, [ m1, m2 ], </span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">Zero( L ), 16 );</span>
&lt;mutable basis over Rationals, 16 vectors&gt;
</pre></div>

<p><a id="X8467B687823371F9" name="X8467B687823371F9"></a></p>

<h5>62.9-13 MutableBasisOfIdealInNonassociativeAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MutableBasisOfIdealInNonassociativeAlgebra</code>( <var class="Arg">F</var>, <var class="Arg">Vgens</var>, <var class="Arg">Igens</var>, <var class="Arg">zero</var>, <var class="Arg">from</var>, <var class="Arg">maxdim</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>is a mutable basis of the ideal generated by <var class="Arg">Igens</var> under the action of the (not necessarily associative) <var class="Arg">F</var>-algebra with vector space generators <var class="Arg">Vgens</var>. The zero element of the ideal is <var class="Arg">zero</var>, <var class="Arg">from</var> is one of <code class="code">"left"</code>, <code class="code">"right"</code>, <code class="code">"both"</code> (with the same meaning as in <code class="func">MutableBasisOfClosureUnderAction</code> (<a href="chap62.html#X7C280DAC7F840B60"><span class="RefLink">62.9-11</span></a>)), and <var class="Arg">maxdim</var> is a known upper bound on the dimension of the ideal; if no finite bound for the dimension is known then <code class="func">infinity</code> (<a href="chap18.html#X8511B8DF83324C27"><span class="RefLink">18.2-1</span></a>) must be the value of <var class="Arg">maxdim</var>.</p>

<p>The difference to <code class="func">MutableBasisOfClosureUnderAction</code> (<a href="chap62.html#X7C280DAC7F840B60"><span class="RefLink">62.9-11</span></a>) is that in general it is not sufficient to multiply just with algebra generators. (For special cases of nonassociative algebras, especially for Lie algebras, multiplying with algebra generators suffices.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">mats:= [  [[ 1, 0 ], [ 0, -1 ]], [[0,1],[0,0]] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, mats );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">basA:= BasisVectors( Basis( A ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= MutableBasisOfIdealInNonassociativeAlgebra( Rationals, basA,</span>
<span class="GAPprompt">&gt;</span> <span class="GAPinput">[ mats[2] ], 0*mats[1], "both", infinity );</span>
&lt;mutable basis over Rationals, 1 vectors&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( B );</span>
[ [ [ 0, 1 ], [ 0, 0 ] ] ]
</pre></div>

<p><a id="X7C591B7C7DEA7EEB" name="X7C591B7C7DEA7EEB"></a></p>

<h5>62.9-14 DirectSumOfAlgebras</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DirectSumOfAlgebras</code>( <var class="Arg">A1</var>, <var class="Arg">A2</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DirectSumOfAlgebras</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>is the direct sum of the two algebras <var class="Arg">A1</var> and <var class="Arg">A2</var> respectively of the algebras in the list <var class="Arg">list</var>.</p>

<p>If all involved algebras are associative algebras then the result is also known to be associative. If all involved algebras are Lie algebras then the result is also known to be a Lie algebra.</p>

<p>All involved algebras must have the same left acting domain.</p>

<p>The default case is that the result is a structure constants algebra. If all involved algebras are matrix algebras, and either both are Lie algebras or both are associative then the result is again a matrix algebra of the appropriate type.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DirectSumOfAlgebras( [A, A, A] );</span>
&lt;algebra of dimension 12 over Rationals&gt;
</pre></div>

<p><a id="X7D0EB1437D3D9495" name="X7D0EB1437D3D9495"></a></p>

<h5>62.9-15 FullMatrixAlgebraCentralizer</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FullMatrixAlgebraCentralizer</code>( <var class="Arg">F</var>, <var class="Arg">lst</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Let <var class="Arg">lst</var> be a nonempty list of square matrices of the same dimension <span class="SimpleMath">n</span>, say, with entries in the field <var class="Arg">F</var>. <code class="func">FullMatrixAlgebraCentralizer</code> returns the (pointwise) centralizer of all matrices in <var class="Arg">lst</var>, inside the full matrix algebra of <span class="SimpleMath">n × n</span> matrices over <var class="Arg">F</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b:= Basis( A );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">mats:= List( BasisVectors( b ), x -&gt; AdjointMatrix( b, x ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FullMatrixAlgebraCentralizer( Rationals, mats );</span>
&lt;algebra-with-one of dimension 4 over Rationals&gt;
</pre></div>

<p><a id="X850C29907A509533" name="X850C29907A509533"></a></p>

<h5>62.9-16 RadicalOfAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RadicalOfAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>is the maximal nilpotent ideal of <var class="Arg">A</var>, where <var class="Arg">A</var> is an associative algebra.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 0, 1, 2 ], [ 0, 0, 3 ], [ 0, 0, 0 ] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraWithOneByGenerators( Rationals, [ m ] );</span>
&lt;algebra-with-one over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RadicalOfAlgebra( A );</span>
&lt;algebra of dimension 2 over Rationals&gt;
</pre></div>

<p><a id="X82571785846CF05C" name="X82571785846CF05C"></a></p>

<h5>62.9-17 CentralIdempotentsOfAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CentralIdempotentsOfAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For an associative algebra <var class="Arg">A</var>, this function returns a list of central primitive idempotents such that their sum is the identity element of <var class="Arg">A</var>. Therefore <var class="Arg">A</var> is required to have an identity.</p>

<p>(This is a synonym of <code class="code">CentralIdempotentsOfSemiring</code>.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= DirectSumOfAlgebras( [A, A, A] );</span>
&lt;algebra of dimension 12 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CentralIdempotentsOfAlgebra( B );</span>
[ v.9, v.5, v.1 ]
</pre></div>

<p><a id="X7CFB230582C26DAA" name="X7CFB230582C26DAA"></a></p>

<h5>62.9-18 DirectSumDecomposition</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DirectSumDecomposition</code>( <var class="Arg">L</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>This function calculates a list of ideals of the algebra <var class="Arg">L</var> such that <var class="Arg">L</var> is equal to their direct sum. Currently this is only implemented for semisimple associative algebras, and for Lie algebras (semisimple or not).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:= SymmetricGroup( 4 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= GroupRing( Rationals, G );</span>
&lt;algebra-with-one over Rationals, with 2 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">dd:= DirectSumDecomposition( A );</span>
[ &lt;two-sided ideal in 
      &lt;algebra-with-one of dimension 24 over Rationals&gt;, 
      (1 generators)&gt;, 
  &lt;two-sided ideal in 
      &lt;algebra-with-one of dimension 24 over Rationals&gt;, 
      (1 generators)&gt;, 
  &lt;two-sided ideal in 
      &lt;algebra-with-one of dimension 24 over Rationals&gt;, 
      (1 generators)&gt;, 
  &lt;two-sided ideal in 
      &lt;algebra-with-one of dimension 24 over Rationals&gt;, 
      (1 generators)&gt;, 
  &lt;two-sided ideal in 
      &lt;algebra-with-one of dimension 24 over Rationals&gt;, 
      (1 generators)&gt; ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List( dd, Dimension );</span>
[ 1, 1, 4, 9, 9 ]
</pre></div>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= FullMatrixLieAlgebra( Rationals, 5 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">DirectSumDecomposition( L );</span>
[ &lt;two-sided ideal in 
      &lt;two-sided ideal in &lt;Lie algebra of dimension 25 over Rationals&gt;
            , (dimension 1)&gt;, (dimension 1)&gt;, 
  &lt;two-sided ideal in 
      &lt;two-sided ideal in &lt;Lie algebra of dimension 25 over Rationals&gt;
            , (dimension 24)&gt;, (dimension 24)&gt; ]
</pre></div>

<p><a id="X85C58364833E014C" name="X85C58364833E014C"></a></p>

<h5>62.9-19 LeviMalcevDecomposition</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeviMalcevDecomposition</code>( <var class="Arg">L</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>A Levi-Malcev subalgebra of the algebra <var class="Arg">L</var> is a semisimple subalgebra complementary to the radical of <var class="Arg">L</var>. This function returns a list with two components. The first component is a Levi-Malcev subalgebra, the second the radical. This function is implemented for associative and Lie algebras.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m:= [ [ 1, 2, 0 ], [ 0, 1, 3 ], [ 0, 0, 1] ];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeviMalcevDecomposition( A );</span>
[ &lt;algebra of dimension 1 over Rationals&gt;, 
  &lt;algebra of dimension 2 over Rationals&gt; ]
</pre></div>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= FullMatrixLieAlgebra( Rationals, 5 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeviMalcevDecomposition( L );</span>
[ &lt;Lie algebra of dimension 24 over Rationals&gt;, 
  &lt;two-sided ideal in &lt;Lie algebra of dimension 25 over Rationals&gt;, 
      (dimension 1)&gt; ]
</pre></div>

<p><a id="X7DCA2568870A2D34" name="X7DCA2568870A2D34"></a></p>

<h5>62.9-20 Grading</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; Grading</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Let <span class="SimpleMath">G</span> be an Abelian group and <span class="SimpleMath">A</span> an algebra. Then <span class="SimpleMath">A</span> is said to be graded over <span class="SimpleMath">G</span> if for every <span class="SimpleMath">g ∈ G</span> there is a subspace <span class="SimpleMath">A_g</span> of <span class="SimpleMath">A</span> such that <span class="SimpleMath">A_g ⋅ A_h ⊂ A_{g+h}</span> for <span class="SimpleMath">g, h ∈ G</span>. In <strong class="pkg">GAP</strong> 4 a <em>grading</em> of an algebra is a record containing the following components.</p>


<dl>
<dt><strong class="Mark"><code class="code">source</code></strong></dt>
<dd><p>the Abelian group over which the algebra is graded.</p>

</dd>
<dt><strong class="Mark"><code class="code">hom_components</code></strong></dt>
<dd><p>a function assigning to each element from the source a subspace of the algebra.</p>

</dd>
<dt><strong class="Mark"><code class="code">min_degree</code></strong></dt>
<dd><p>in the case where the algebra is graded over the integers this is the minimum number for which <code class="code">hom_components</code> returns a nonzero subspace.</p>

</dd>
<dt><strong class="Mark"><code class="code">max_degree</code></strong></dt>
<dd><p>is analogous to <code class="code">min_degree</code>.</p>

</dd>
</dl>
<p>We note that there are no methods to compute a grading of an arbitrary algebra; however some algebras get a natural grading when they are constructed (see <code class="func">JenningsLieAlgebra</code> (<a href="chap64.html#X8692ADD581359CA1"><span class="RefLink">64.8-4</span></a>), <code class="func">NilpotentQuotientOfFpLieAlgebra</code> (<a href="chap64.html#X79FD70C487EA9438"><span class="RefLink">64.11-2</span></a>)).</p>

<p>We note also that these components may be not enough to handle the grading efficiently, and another record component may be needed. For instance in a Lie algebra <span class="SimpleMath">L</span> constructed by <code class="func">JenningsLieAlgebra</code> (<a href="chap64.html#X8692ADD581359CA1"><span class="RefLink">64.8-4</span></a>), the length of the of the range <code class="code">[ Grading(L)!.min_degree .. Grading(L)!.max_degree ]</code> may be non-polynomial in the dimension of <span class="SimpleMath">L</span>. To handle efficiently this situation, an optional component can be used:</p>


<dl>
<dt><strong class="Mark"><code class="code">non_zero_hom_components</code></strong></dt>
<dd><p>the subset of <code class="code">source</code> for which <code class="code">hom_components</code> returns a nonzero subspace.</p>

</dd>
</dl>

<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">G:= SmallGroup(3^6, 100 );</span>
&lt;pc group of size 729 with 6 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= JenningsLieAlgebra( G );</span>
&lt;Lie algebra of dimension 6 over GF(3)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g:= Grading( L );</span>
rec( hom_components := function( d ) ... end, max_degree := 9, 
  min_degree := 1, source := Integers )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g.hom_components( 3 );</span>
&lt;vector space over GF(3), with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">g.hom_components( 14 );</span>
&lt;vector space over GF(3), with 0 generators&gt;
</pre></div>

<p><a id="X7E94B857847F95C1" name="X7E94B857847F95C1"></a></p>

<h4>62.10 <span class="Heading">Homomorphisms of Algebras</span></h4>

<p>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.</p>

<p><a id="X83CE798C7D39E368" name="X83CE798C7D39E368"></a></p>

<h5>62.10-1 AlgebraGeneralMappingByImages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraGeneralMappingByImages</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>is a general mapping from the <span class="SimpleMath">F</span>-algebra <var class="Arg">A</var> to the <span class="SimpleMath">F</span>-algebra <var class="Arg">B</var>. This general mapping is defined by mapping the entries in the list <var class="Arg">gens</var> (elements of <var class="Arg">A</var>) to the entries in the list <var class="Arg">imgs</var> (elements of <var class="Arg">B</var>), and taking the <span class="SimpleMath">F</span>-linear and multiplicative closure.</p>

<p><var class="Arg">gens</var> need not generate <var class="Arg">A</var> as an <span class="SimpleMath">F</span>-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 <code class="func">LeftModuleHomomorphismByImages</code> (<a href="chap61.html#X85F5293983E47B5A"><span class="RefLink">61.10-2</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= FullMatrixAlgebra( Rationals, 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= AlgebraGeneralMappingByImages( A, B, bA, bB );</span>
[ e, i, j, k ] -&gt; [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 1 ], [ 0, 0 ] ], 
  [ [ 0, 0 ], [ 1, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Images( f, bA[1] );</span>
&lt;add. coset of &lt;algebra over Rationals, with 16 generators&gt;&gt;
</pre></div>

<p><a id="X7A7F97ED8608C882" name="X7A7F97ED8608C882"></a></p>

<h5>62.10-2 AlgebraHomomorphismByImages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraHomomorphismByImages</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">AlgebraHomomorphismByImages</code> returns the algebra homomorphism with source <var class="Arg">A</var> and range <var class="Arg">B</var> that is defined by mapping the list <var class="Arg">gens</var> of generators of <var class="Arg">A</var> to the list <var class="Arg">imgs</var> of images in <var class="Arg">B</var>.</p>

<p>If <var class="Arg">gens</var> does not generate <var class="Arg">A</var> or if the homomorphism does not exist (i.e., if mapping the generators describes only a multi-valued mapping) then <code class="keyw">fail</code> is returned.</p>

<p>One can avoid the checks by calling <code class="func">AlgebraHomomorphismByImagesNC</code> (<a href="chap62.html#X8326D1BD79725462"><span class="RefLink">62.10-3</span></a>), and one can construct multi-valued mappings with <code class="func">AlgebraGeneralMappingByImages</code> (<a href="chap62.html#X83CE798C7D39E368"><span class="RefLink">62.10-1</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [1,1] ); SetEntrySCTable( T, 2, 2, [1,2] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( Rationals, T );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AlgebraByGenerators( Rationals, [ m1, m2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= AlgebraHomomorphismByImages( A, B, bA, bB );</span>
[ v.1, v.2 ] -&gt; [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Image( f, bA[1]+bA[2] );</span>
[ [ 1, 0 ], [ 0, 1 ] ]
</pre></div>

<p><a id="X8326D1BD79725462" name="X8326D1BD79725462"></a></p>

<h5>62.10-3 AlgebraHomomorphismByImagesNC</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraHomomorphismByImagesNC</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><code class="func">AlgebraHomomorphismByImagesNC</code> is the operation that is called by the function <code class="func">AlgebraHomomorphismByImages</code> (<a href="chap62.html#X7A7F97ED8608C882"><span class="RefLink">62.10-2</span></a>). Its methods may assume that <var class="Arg">gens</var> generates <var class="Arg">A</var> and that the mapping of <var class="Arg">gens</var> to <var class="Arg">imgs</var> defines an algebra homomorphism. Results are unpredictable if these conditions do not hold.</p>

<p>For creating a possibly multi-valued mapping from <var class="Arg">A</var> to <var class="Arg">B</var> that respects addition, multiplication, and scalar multiplication, <code class="func">AlgebraGeneralMappingByImages</code> (<a href="chap62.html#X83CE798C7D39E368"><span class="RefLink">62.10-1</span></a>) can be used.</p>

<p>For the definitions of the algebras <code class="code">A</code> and <code class="code">B</code> in the next example we refer to the previous example.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= AlgebraHomomorphismByImagesNC( A, B, bA, bB );</span>
[ v.1, v.2 ] -&gt; [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] ]
</pre></div>

<p><a id="X8057E55B864567AD" name="X8057E55B864567AD"></a></p>

<h5>62.10-4 AlgebraWithOneGeneralMappingByImages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraWithOneGeneralMappingByImages</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>This function is analogous to <code class="func">AlgebraGeneralMappingByImages</code> (<a href="chap62.html#X83CE798C7D39E368"><span class="RefLink">62.10-1</span></a>); the only difference being that the identity of <var class="Arg">A</var> is automatically mapped to the identity of <var class="Arg">B</var>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= FullMatrixAlgebra( Rationals, 2 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=AlgebraWithOneGeneralMappingByImages(A,B,bA{[2,3,4]},bB{[1,2,3]});</span>
[ i, j, k, e ] -&gt; [ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 1 ], [ 0, 0 ] ], 
  [ [ 0, 0 ], [ 1, 0 ] ], [ [ 1, 0 ], [ 0, 1 ] ] ]
</pre></div>

<p><a id="X866F32B5846E5857" name="X866F32B5846E5857"></a></p>

<h5>62.10-5 AlgebraWithOneHomomorphismByImages</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraWithOneHomomorphismByImages</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">AlgebraWithOneHomomorphismByImages</code> returns the algebra-with-one homomorphism with source <var class="Arg">A</var> and range <var class="Arg">B</var> that is defined by mapping the list <var class="Arg">gens</var> of generators of <var class="Arg">A</var> to the list <var class="Arg">imgs</var> of images in <var class="Arg">B</var>.</p>

<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 <var class="Arg">A</var> is mapped to the identity of <var class="Arg">B</var>, and therefore <var class="Arg">gens</var> needs to generate <var class="Arg">A</var> only as an algebra-with-one.</p>

<p>If <var class="Arg">gens</var> does not generate <var class="Arg">A</var> or if the homomorphism does not exist (i.e., if mapping the generators describes only a multi-valued mapping) then <code class="keyw">fail</code> is returned.</p>

<p>One can avoid the checks by calling <code class="func">AlgebraWithOneHomomorphismByImagesNC</code> (<a href="chap62.html#X80BF4D6A7FDC959A"><span class="RefLink">62.10-6</span></a>), and one can construct multi-valued mappings with <code class="func">AlgebraWithOneGeneralMappingByImages</code> (<a href="chap62.html#X8057E55B864567AD"><span class="RefLink">62.10-4</span></a>).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:=1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:=1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByGenerators( Rationals, [m1,m2] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [1,1] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 2, [1,2] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AlgebraByStructureConstants(Rationals, T);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= AlgebraWithOneHomomorphismByImages( A, B, bA{[1]}, bB{[1]} );</span>
[ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 1, 0 ], [ 0, 1 ] ] ] -&gt; [ v.1, v.1+v.2 ]
</pre></div>

<p><a id="X80BF4D6A7FDC959A" name="X80BF4D6A7FDC959A"></a></p>

<h5>62.10-6 AlgebraWithOneHomomorphismByImagesNC</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AlgebraWithOneHomomorphismByImagesNC</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">gens</var>, <var class="Arg">imgs</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p><code class="func">AlgebraWithOneHomomorphismByImagesNC</code> is the operation that is called by the function <code class="func">AlgebraWithOneHomomorphismByImages</code> (<a href="chap62.html#X866F32B5846E5857"><span class="RefLink">62.10-5</span></a>). Its methods may assume that <var class="Arg">gens</var> generates <var class="Arg">A</var> and that the mapping of <var class="Arg">gens</var> to <var class="Arg">imgs</var> defines an algebra-with-one homomorphism. Results are unpredictable if these conditions do not hold.</p>

<p>For creating a possibly multi-valued mapping from <var class="Arg">A</var> to <var class="Arg">B</var> that respects addition, multiplication, identity, and scalar multiplication, <code class="func">AlgebraWithOneGeneralMappingByImages</code> (<a href="chap62.html#X8057E55B864567AD"><span class="RefLink">62.10-4</span></a>) can be used.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:=1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:=1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByGenerators( Rationals, [m1,m2] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [1,1] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 2, [1,2] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AlgebraByStructureConstants( Rationals, T);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bA:= BasisVectors( Basis( A ) );; bB:= BasisVectors( Basis( B ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= AlgebraWithOneHomomorphismByImagesNC( A, B, bA{[1]}, bB{[1]} );</span>
[ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 1, 0 ], [ 0, 1 ] ] ] -&gt; [ v.1, v.1+v.2 ]
</pre></div>

<p><a id="X8712E5C1861CC32C" name="X8712E5C1861CC32C"></a></p>

<h5>62.10-7 NaturalHomomorphismByIdeal</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NaturalHomomorphismByIdeal</code>( <var class="Arg">A</var>, <var class="Arg">I</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>For an algebra <var class="Arg">A</var> and an ideal <var class="Arg">I</var> in <var class="Arg">A</var>, the return value of <code class="func">NaturalHomomorphismByIdeal</code> (<a href="chap56.html#X83D53D98809EC461"><span class="RefLink">56.8-4</span></a>) is a homomorphism of algebras, in particular the range of this mapping is also an algebra.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= FullMatrixLieAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:= LieCentre( L );</span>
&lt;two-sided ideal in &lt;Lie algebra of dimension 9 over Rationals&gt;, 
  (dimension 1)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">hom:= NaturalHomomorphismByIdeal( L, C );</span>
&lt;linear mapping by matrix, &lt;Lie algebra of dimension 
9 over Rationals&gt; -&gt; &lt;Lie algebra of dimension 8 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ImagesSource( hom );</span>
&lt;Lie algebra of dimension 8 over Rationals&gt;
</pre></div>

<p><a id="X8705A9C68102FEA3" name="X8705A9C68102FEA3"></a></p>

<h5>62.10-8 OperationAlgebraHomomorphism</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; OperationAlgebraHomomorphism</code>( <var class="Arg">A</var>, <var class="Arg">B</var>[, <var class="Arg">opr</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; OperationAlgebraHomomorphism</code>( <var class="Arg">A</var>, <var class="Arg">V</var>[, <var class="Arg">opr</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p><code class="func">OperationAlgebraHomomorphism</code> returns an algebra homomorphism from the <span class="SimpleMath">F</span>-algebra <var class="Arg">A</var> into a matrix algebra over <span class="SimpleMath">F</span> that describes the <span class="SimpleMath">F</span>-linear action of <var class="Arg">A</var> on the basis <var class="Arg">B</var> of a free left module respectively on the free left module <var class="Arg">V</var> (in which case some basis of <var class="Arg">V</var> is chosen), via the operation <var class="Arg">opr</var>.</p>

<p>The homomorphism need not be surjective. The default value for <var class="Arg">opr</var> is <code class="func">OnRight</code> (<a href="chap41.html#X7960924D84B5B18F"><span class="RefLink">41.2-2</span></a>).</p>

<p>If <var class="Arg">A</var> is an algebra-with-one then the operation homomorphism is an algebra-with-one homomorphism because the identity of <var class="Arg">A</var> must act as the identity.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AlgebraByGenerators( Rationals, [ m1, m2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= FullRowSpace( Rationals, 2 );</span>
( Rationals^2 )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=OperationAlgebraHomomorphism( B, Basis( V ), OnRight );</span>
&lt;op. hom. Algebra( Rationals, 
[ [ [ 1, 0 ], [ 0, 0 ] ], [ [ 0, 0 ], [ 0, 1 ] ] 
 ] ) -&gt; matrices of dim. 2&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Image( f, m1 );</span>
[ [ 1, 0 ], [ 0, 0 ] ]
</pre></div>

<p><a id="X7B249E8E86D895F0" name="X7B249E8E86D895F0"></a></p>

<h5>62.10-9 NiceAlgebraMonomorphism</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NiceAlgebraMonomorphism</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>If <var class="Arg">A</var> is an associative algebra with one, returns an isomorphism from <var class="Arg">A</var> onto a matrix algebra (see <code class="func">IsomorphismMatrixAlgebra</code> (<a href="chap62.html#X7FB760F9813B0789"><span class="RefLink">62.10-11</span></a>) for an example). If <var class="Arg">A</var> is a finitely presented Lie algebra, returns an isomorphism from <var class="Arg">A</var> onto a Lie algebra defined by a structure constants table (see <a href="chap64.html#X7B8C71E07F50B286"><span class="RefLink">64.11</span></a> for an example).</p>

<p><a id="X79D770777D873F80" name="X79D770777D873F80"></a></p>

<h5>62.10-10 IsomorphismFpAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsomorphismFpAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>isomorphism from the algebra <var class="Arg">A</var> onto a finitely presented algebra. Currently this is only implemented for associative algebras with one.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= QuaternionAlgebra( Rationals );</span>
&lt;algebra-with-one of dimension 4 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= IsomorphismFpAlgebra( A );</span>
[ e, i, j, k, e ] -&gt; [ [(1)*x.1], [(1)*x.2], [(1)*x.3], [(1)*x.4], 
  [(1)*&lt;identity ...&gt;] ]
</pre></div>

<p><a id="X7FB760F9813B0789" name="X7FB760F9813B0789"></a></p>

<h5>62.10-11 IsomorphismMatrixAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsomorphismMatrixAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>isomorphism from the algebra <var class="Arg">A</var> onto a matrix algebra. Currently this is only implemented for associative algebras with one.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [1,1] ); SetEntrySCTable( T, 2, 2, [1,2] );</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( Rationals, T );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AsAlgebraWithOne( Rationals, A );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=IsomorphismMatrixAlgebra( A );</span>
&lt;op. hom. AlgebraWithOne( Rationals, ... ) -&gt; matrices of dim. 2&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Image( f, BasisVectors( Basis( A ) )[1] );</span>
[ [ 1, 0 ], [ 0, 0 ] ]
</pre></div>

<p><a id="X7F8D3DF2863EC50D" name="X7F8D3DF2863EC50D"></a></p>

<h5>62.10-12 IsomorphismSCAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsomorphismSCAlgebra</code>( <var class="Arg">B</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsomorphismSCAlgebra</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>For a basis <var class="Arg">B</var> of an algebra <span class="SimpleMath">A</span>, say, <code class="func">IsomorphismSCAlgebra</code> returns an algebra isomorphism from <span class="SimpleMath">A</span> to an algebra <span class="SimpleMath">S</span> given by structure constants (see <a href="chap62.html#X7E8F45547CC07CE5"><span class="RefLink">62.4</span></a>), such that the canonical basis of <span class="SimpleMath">S</span> is the image of <var class="Arg">B</var>.</p>

<p>For an algebra <var class="Arg">A</var>, <code class="func">IsomorphismSCAlgebra</code> chooses a basis of <var class="Arg">A</var> and returns the <code class="func">IsomorphismSCAlgebra</code> value for that basis.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsomorphismSCAlgebra( GF(8) );</span>
CanonicalBasis( GF(2^3) ) -&gt; CanonicalBasis( &lt;algebra of dimension 
3 over GF(2)&gt; )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsomorphismSCAlgebra( GF(2)^[2,2] );</span>
CanonicalBasis( ( GF(2)^
[ 2, 2 ] ) ) -&gt; CanonicalBasis( &lt;algebra of dimension 4 over GF(2)&gt; )
</pre></div>

<p><a id="X7F34244B81979696" name="X7F34244B81979696"></a></p>

<h5>62.10-13 RepresentativeLinearOperation</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RepresentativeLinearOperation</code>( <var class="Arg">A</var>, <var class="Arg">v</var>, <var class="Arg">w</var>, <var class="Arg">opr</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>is an element of the algebra <var class="Arg">A</var> that maps the vector <var class="Arg">v</var> to the vector <var class="Arg">w</var> under the linear operation described by the function <var class="Arg">opr</var>. If no such element exists then <code class="keyw">fail</code> is returned.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= AlgebraByGenerators( Rationals, [ m1, m2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RepresentativeLinearOperation( B, [1,0], [1,0], OnRight );</span>
[ [ 1, 0 ], [ 0, 0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RepresentativeLinearOperation( B, [1,0], [0,1], OnRight );</span>
fail
</pre></div>

<p><a id="X818DE6C57D1A4B33" name="X818DE6C57D1A4B33"></a></p>

<h4>62.11 <span class="Heading">Representations of Algebras</span></h4>

<p>An algebra module is a vector space together with an action of an algebra. So a module over an algebra is constructed by giving generators of a vector space, and a function for calculating the action of algebra elements on elements of the vector space. When creating an algebra module, the generators of the vector space are wrapped up and given the category <code class="code">IsLeftAlgebraModuleElement</code> or <code class="code">IsRightModuleElement</code> if the algebra acts from the left, or right respectively. (So in the case of a bi-module the elements get both categories.) Most linear algebra computations are delegated to the original vector space.</p>

<p>The transition between the original vector space and the corresponding algebra module is handled by <code class="code">ExtRepOfObj</code> and <code class="code">ObjByExtRep</code>. For an element <code class="code">v</code> of the algebra module, <code class="code">ExtRepOfObj( v )</code> returns the underlying element of the original vector space. Furthermore, if <code class="code">vec</code> is an element of the original vector space, and <code class="code">fam</code> the elements family of the corresponding algebra module, then <code class="code">ObjByExtRep( fam, vec )</code> returns the corresponding element of the algebra module. Below is an example of this.</p>

<p>The action of the algebra on elements of the algebra module is constructed by using the operator <code class="code">^</code>. If <code class="code">x</code> is an element of an algebra <code class="code">A</code>, and <code class="code">v</code> an element of a left <code class="code">A</code>-module, then <code class="code">x^v</code> calculates the result of the action of <code class="code">x</code> on <code class="code">v</code>. Similarly, if <code class="code">v</code> is an element of a right <code class="code">A</code>-module, then <code class="code">v^x</code> calculates the action of <code class="code">x</code> on <code class="code">v</code>.</p>

<p><a id="X8055B87F7ADBD66B" name="X8055B87F7ADBD66B"></a></p>

<h5>62.11-1 LeftAlgebraModuleByGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftAlgebraModuleByGenerators</code>( <var class="Arg">A</var>, <var class="Arg">op</var>, <var class="Arg">gens</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Constructs the left algebra module over <var class="Arg">A</var> generated by the list of vectors <var class="Arg">gens</var>. The action of <var class="Arg">A</var> is described by the function <var class="Arg">op</var>. This must be a function of two arguments; the first argument is the algebra element, and the second argument is a vector; it outputs the result of applying the algebra element to the vector.</p>

<p><a id="X8026B99B7955A355" name="X8026B99B7955A355"></a></p>

<h5>62.11-2 RightAlgebraModuleByGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RightAlgebraModuleByGenerators</code>( <var class="Arg">A</var>, <var class="Arg">op</var>, <var class="Arg">gens</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Constructs the right algebra module over <var class="Arg">A</var> generated by the list of vectors <var class="Arg">gens</var>. The action of <var class="Arg">A</var> is described by the function <var class="Arg">op</var>. This must be a function of two arguments; the first argument is a vector, and the second argument is the algebra element; it outputs the result of applying the algebra element to the vector.</p>

<p><a id="X7F28A47E876427E0" name="X7F28A47E876427E0"></a></p>

<h5>62.11-3 BiAlgebraModuleByGenerators</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; BiAlgebraModuleByGenerators</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">opl</var>, <var class="Arg">opr</var>, <var class="Arg">gens</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Constructs the algebra bi-module over <var class="Arg">A</var> and <var class="Arg">B</var> generated by the list of vectors <var class="Arg">gens</var>. The left action of <var class="Arg">A</var> is described by the function <var class="Arg">opl</var>, and the right action of <var class="Arg">B</var> by the function <var class="Arg">opr</var>. <var class="Arg">opl</var> must be a function of two arguments; the first argument is the algebra element, and the second argument is a vector; it outputs the result of applying the algebra element on the left to the vector. <var class="Arg">opr</var> must be a function of two arguments; the first argument is a vector, and the second argument is the algebra element; it outputs the result of applying the algebra element on the right to the vector.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];</span>
( Rationals^[ 3, 3 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );</span>
&lt;left-module over ( Rationals^[ 3, 3 ] )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= RightAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );</span>
&lt;right-module over ( Rationals^[ 3, 3 ] )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= BiAlgebraModuleByGenerators( A, A, \*, \*, [ [ 1, 0, 0 ] ] );</span>
&lt;bi-module over ( Rationals^[ 3, 3 ] ) (left) and ( Rationals^
[ 3, 3 ] ) (right)&gt;
</pre></div>

<p>In the above examples, the modules <code class="code">V</code>, <code class="code">W</code>, and <code class="code">M</code> are <span class="SimpleMath">3</span>-dimensional vector spaces over the rationals. The algebra <code class="code">A</code> acts from the left on <code class="code">V</code>, from the right on <code class="code">W</code>, and from the left and from the right on <code class="code">M</code>.</p>

<p><a id="X852524F581613359" name="X852524F581613359"></a></p>

<h5>62.11-4 LeftAlgebraModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftAlgebraModule</code>( <var class="Arg">A</var>, <var class="Arg">op</var>, <var class="Arg">V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Constructs the left algebra module over <var class="Arg">A</var> with underlying space <var class="Arg">V</var>. The action of <var class="Arg">A</var> is described by the function <var class="Arg">op</var>. This must be a function of two arguments; the first argument is the algebra element, and the second argument is a vector from <var class="Arg">V</var>; it outputs the result of applying the algebra element to the vector.</p>

<p><a id="X8222F2B67D753036" name="X8222F2B67D753036"></a></p>

<h5>62.11-5 RightAlgebraModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RightAlgebraModule</code>( <var class="Arg">A</var>, <var class="Arg">op</var>, <var class="Arg">V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Constructs the right algebra module over <var class="Arg">A</var> with underlying space <var class="Arg">V</var>. The action of <var class="Arg">A</var> is described by the function <var class="Arg">op</var>. This must be a function of two arguments; the first argument is a vector, from <var class="Arg">V</var> and the second argument is the algebra element; it outputs the result of applying the algebra element to the vector.</p>

<p><a id="X84517770868DDA02" name="X84517770868DDA02"></a></p>

<h5>62.11-6 BiAlgebraModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; BiAlgebraModule</code>( <var class="Arg">A</var>, <var class="Arg">B</var>, <var class="Arg">opl</var>, <var class="Arg">opr</var>, <var class="Arg">V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Constructs the algebra bi-module over <var class="Arg">A</var> and <var class="Arg">B</var> with underlying space <var class="Arg">V</var>. The left action of <var class="Arg">A</var> is described by the function <var class="Arg">opl</var>, and the right action of <var class="Arg">B</var> by the function <var class="Arg">opr</var>. <var class="Arg">opl</var> must be a function of two arguments; the first argument is the algebra element, and the second argument is a vector from <var class="Arg">V</var>; it outputs the result of applying the algebra element on the left to the vector. <var class="Arg">opr</var> must be a function of two arguments; the first argument is a vector from <var class="Arg">V</var>, and the second argument is the algebra element; it outputs the result of applying the algebra element on the right to the vector.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^3;</span>
( Rationals^3 )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^3;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= BiAlgebraModule( A, A, \*, \*, V );</span>
&lt;bi-module over ( Rationals^[ 3, 3 ] ) (left) and ( Rationals^
[ 3, 3 ] ) (right)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( M );</span>
3
</pre></div>

<p><a id="X79AAB50D83A14A43" name="X79AAB50D83A14A43"></a></p>

<h5>62.11-7 GeneratorsOfAlgebraModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; GeneratorsOfAlgebraModule</code>( <var class="Arg">M</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>A list of elements of <var class="Arg">M</var> that generate <var class="Arg">M</var> as an algebra module.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">GeneratorsOfAlgebraModule( V );</span>
[ [ 1, 0, 0 ] ]
</pre></div>

<p><a id="X82B708BD84F3DAB1" name="X82B708BD84F3DAB1"></a></p>

<h5>62.11-8 IsAlgebraModuleElement</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAlgebraModuleElement</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAlgebraModuleElementCollection</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsAlgebraModuleElementFamily</code>( <var class="Arg">fam</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>Category of algebra module elements. If an object has <code class="code">IsAlgebraModuleElementCollection</code>, then it is an algebra module. If a family has <code class="code">IsAlgebraModuleElementFamily</code>, then it is a family of algebra module elements (every algebra module has its own elements family).</p>

<p><a id="X80E786467F9163F9" name="X80E786467F9163F9"></a></p>

<h5>62.11-9 IsLeftAlgebraModuleElement</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLeftAlgebraModuleElement</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsLeftAlgebraModuleElementCollection</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>Category of left algebra module elements. If an object has <code class="code">IsLeftAlgebraModuleElementCollection</code>, then it is a left-algebra module.</p>

<p><a id="X863756787E2B6E75" name="X863756787E2B6E75"></a></p>

<h5>62.11-10 IsRightAlgebraModuleElement</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRightAlgebraModuleElement</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsRightAlgebraModuleElementCollection</code>( <var class="Arg">obj</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>Category of right algebra module elements. If an object has <code class="code">IsRightAlgebraModuleElementCollection</code>, then it is a right-algebra module.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];</span>
( Rationals^[ 3, 3 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= BiAlgebraModuleByGenerators( A, A, \*, \*, [ [ 1, 0, 0 ] ] );</span>
&lt;bi-module over ( Rationals^[ 3, 3 ] ) (left) and ( Rationals^
[ 3, 3 ] ) (right)&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vv:= BasisVectors( Basis( M ) );</span>
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsLeftAlgebraModuleElement( vv[1] );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsRightAlgebraModuleElement( vv[1] );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vv[1] = [ 1, 0, 0 ];</span>
false
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ExtRepOfObj( vv[1] ) = [ 1, 0, 0 ];</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ObjByExtRep( ElementsFamily( FamilyObj( M ) ), [ 1, 0, 0 ] ) in M;</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">xx:= BasisVectors( Basis( A ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">xx[4]^vv[1];  # left action</span>
[ 0, 1, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vv[1]^xx[2];  # right action</span>
[ 0, 1, 0 ]
</pre></div>

<p><a id="X85654EF07F708AC3" name="X85654EF07F708AC3"></a></p>

<h5>62.11-11 LeftActingAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftActingAlgebra</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Here <var class="Arg">V</var> is a left-algebra module; this function returns the algebra that acts from the left on <var class="Arg">V</var>.</p>

<p><a id="X826298B37E1B1520" name="X826298B37E1B1520"></a></p>

<h5>62.11-12 RightActingAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RightActingAlgebra</code>( <var class="Arg">V</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Here <var class="Arg">V</var> is a right-algebra module; this function returns the algebra that acts from the right on <var class="Arg">V</var>.</p>

<p><a id="X8308408D86CFC3C9" name="X8308408D86CFC3C9"></a></p>

<h5>62.11-13 ActingAlgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ActingAlgebra</code>( <var class="Arg">V</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">V</var> is an algebra module; this function returns the algebra that acts on <var class="Arg">V</var> (this is the same as <code class="code">LeftActingAlgebra( <var class="Arg">V</var> )</code> if <var class="Arg">V</var> is a left module, and <code class="code">RightActingAlgebra( <var class="Arg">V</var> )</code> if <var class="Arg">V</var> is a right module; it will signal an error if <var class="Arg">V</var> is a bi-module).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= BiAlgebraModuleByGenerators( A, A, \*, \*, [ [ 1, 0, 0 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LeftActingAlgebra( M );</span>
( Rationals^[ 3, 3 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RightActingAlgebra( M );</span>
( Rationals^[ 3, 3 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= RightAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">ActingAlgebra( V );</span>
( Rationals^[ 3, 3 ] )
</pre></div>

<p><a id="X7C325A507EC9BA18" name="X7C325A507EC9BA18"></a></p>

<h5>62.11-14 IsBasisOfAlgebraModuleElementSpace</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsBasisOfAlgebraModuleElementSpace</code>( <var class="Arg">B</var> )</td><td class="tdright">( category )</td></tr></table></div>
<p>If a basis <var class="Arg">B</var> lies in the category <code class="code">IsBasisOfAlgebraModuleElementSpace</code>, then <var class="Arg">B</var> is a basis of a subspace of an algebra module. This means that <var class="Arg">B</var> has the record field <code class="code"><var class="Arg">B</var>!.delegateBasis</code> set. This last object is a basis of the corresponding subspace of the vector space underlying the algebra module (i.e., the vector space spanned by all <code class="code">ExtRepOfObj( v )</code> for <code class="code">v</code> in the algebra module).</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= BiAlgebraModuleByGenerators( A, A, \*, \*, [ [ 1, 0, 0 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Basis( M );</span>
Basis( &lt;3-dimensional bi-module over ( Rationals^
[ 3, 3 ] ) (left) and ( Rationals^[ 3, 3 ] ) (right)&gt;, 
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsBasisOfAlgebraModuleElementSpace( B );</span>
true
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B!.delegateBasis;</span>
SemiEchelonBasis( &lt;vector space of dimension 3 over Rationals&gt;, 
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ] )
</pre></div>

<p><a id="X789863037B0E35D2" name="X789863037B0E35D2"></a></p>

<h5>62.11-15 MatrixOfAction</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MatrixOfAction</code>( <var class="Arg">B</var>, <var class="Arg">x</var>[, <var class="Arg">side</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">B</var> is a basis of an algebra module and <var class="Arg">x</var> is an element of the algebra that acts on this module. This function returns the matrix of the action of <var class="Arg">x</var> with respect to <var class="Arg">B</var>. If <var class="Arg">x</var> acts from the left, then the coefficients of the images of the basis elements of <var class="Arg">B</var> (under the action of <var class="Arg">x</var>) are the columns of the output. If <var class="Arg">x</var> acts from the right, then they are the rows of the output.</p>

<p>If the module is a bi-module, then the third parameter <var class="Arg">side</var> must be specified. This is the string <code class="code">"left"</code>, or <code class="code">"right"</code> depending whether <var class="Arg">x</var> acts from the left or the right.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:= Basis(A)[3];</span>
[ [ 0, 0, 1 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">MatrixOfAction( Basis( M ), x );</span>
[ [ 0, 0, 1 ], [ 0, 0, 0 ], [ 0, 0, 0 ] ]
</pre></div>

<p><a id="X8742A7D27F26AFAB" name="X8742A7D27F26AFAB"></a></p>

<h5>62.11-16 SubAlgebraModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; SubAlgebraModule</code>( <var class="Arg">M</var>, <var class="Arg">gens</var>[, <var class="Arg">"basis"</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>is the sub-module of the algebra module <var class="Arg">M</var>, generated by the vectors in <var class="Arg">gens</var>. If as an optional argument the string <code class="code">basis</code> is added, then it is assumed that the vectors in <var class="Arg">gens</var> form a basis of the submodule.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m1, m2 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0 ], [ 0, 1 ] ] );</span>
&lt;left-module over &lt;algebra over Rationals, with 2 generators&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bb:= BasisVectors( Basis( M ) );</span>
[ [ 1, 0 ], [ 0, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= SubAlgebraModule( M, [ bb[1] ] );</span>
&lt;left-module over &lt;algebra over Rationals, with 2 generators&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( V );</span>
1
</pre></div>

<p><a id="X86E0515987192F0E" name="X86E0515987192F0E"></a></p>

<h5>62.11-17 LeftModuleByHomomorphismToMatAlg</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LeftModuleByHomomorphismToMatAlg</code>( <var class="Arg">A</var>, <var class="Arg">hom</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">A</var> is an algebra and <var class="Arg">hom</var> a homomorphism from <var class="Arg">A</var> into a matrix algebra. This function returns the left <var class="Arg">A</var>-module defined by the homomorphism <var class="Arg">hom</var>.</p>

<p><a id="X7EE41297867E41A8" name="X7EE41297867E41A8"></a></p>

<h5>62.11-18 RightModuleByHomomorphismToMatAlg</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; RightModuleByHomomorphismToMatAlg</code>( <var class="Arg">A</var>, <var class="Arg">hom</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">A</var> is an algebra and <var class="Arg">hom</var> a homomorphism from <var class="Arg">A</var> into a matrix algebra. This function returns the right <var class="Arg">A</var>-module defined by the homomorphism <var class="Arg">hom</var>.</p>

<p>First we produce a structure constants algebra with basis elements <span class="SimpleMath">x</span>, <span class="SimpleMath">y</span>, <span class="SimpleMath">z</span> such that <span class="SimpleMath">x^2 = x</span>, <span class="SimpleMath">y^2 = y</span>, <span class="SimpleMath">xz = z</span>, <span class="SimpleMath">zy = z</span> and all other products are zero.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 3, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 1, [ 1, 1 ]);</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 2, 2, [ 1, 2 ]);</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 3, [ 1, 3 ]);</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 3, 2, [ 1, 3 ]);</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( Rationals, T );</span>
&lt;algebra of dimension 3 over Rationals&gt;
</pre></div>

<p>Now we construct an isomorphic matrix algebra.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m3:= NullMat( 2, 2 );; m3[1][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Algebra( Rationals, [ m1, m2, m3 ] );</span>
&lt;algebra over Rationals, with 3 generators&gt;
</pre></div>

<p>Finally we construct the homomorphism and the corresponding right module.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= AlgebraHomomorphismByImages( A, B, Basis(A), [ m1, m2, m3 ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">RightModuleByHomomorphismToMatAlg( A, f );</span>
&lt;right-module over &lt;algebra of dimension 3 over Rationals&gt;&gt;
</pre></div>

<p><a id="X8729F0A678A4A09C" name="X8729F0A678A4A09C"></a></p>

<h5>62.11-19 AdjointModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; AdjointModule</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>returns the <var class="Arg">A</var>-module defined by the left action of <var class="Arg">A</var> on itself.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m1:= NullMat( 2, 2 );; m1[1][1]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m2:= NullMat( 2, 2 );; m2[2][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">m3:= NullMat( 2, 2 );; m3[1][2]:= 1;;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Algebra( Rationals, [ m1, m2, m3 ] );</span>
&lt;algebra over Rationals, with 3 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= AdjointModule( A );</span>
&lt;3-dimensional left-module over &lt;algebra of dimension 
3 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">v:= Basis( V )[3];</span>
[ [ 0, 1 ], [ 0, 0 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= SubAlgebraModule( V, [ v ] );</span>
&lt;left-module over &lt;algebra of dimension 3 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Dimension( W );</span>
1
</pre></div>

<p><a id="X84813BCD80BDF3C4" name="X84813BCD80BDF3C4"></a></p>

<h5>62.11-20 FaithfulModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FaithfulModule</code>( <var class="Arg">A</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>returns a faithful finite-dimensional left-module over the algebra <var class="Arg">A</var>. This is only implemented for associative algebras, and for Lie algebras of characteristic <span class="SimpleMath">0</span>. (It may also work for certain Lie algebras of characteristic <span class="SimpleMath">p &gt; 0</span>.)</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 2, 0 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= AlgebraByStructureConstants( Rationals, T );</span>
&lt;algebra of dimension 2 over Rationals&gt;
</pre></div>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= EmptySCTable( 3, 0, "antisymmetric" );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetEntrySCTable( T, 1, 2, [ 1, 3 ]);</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= LieAlgebraByStructureConstants( Rationals, T );</span>
&lt;Lie algebra of dimension 3 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= FaithfulModule( L );</span>
&lt;left-module over &lt;Lie algebra of dimension 3 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vv:= BasisVectors( Basis( V ) );</span>
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">x:= Basis( L )[3];</span>
v.3
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">List( vv, v -&gt; x^v );</span>
[ [ 0, 0, 0 ], [ 1, 0, 0 ], [ 0, 0, 0 ] ]
</pre></div>

<p><code class="code">A</code> is a <span class="SimpleMath">2</span>-dimensional algebra where all products are zero.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= FaithfulModule( A );</span>
&lt;left-module over &lt;algebra of dimension 2 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">vv:= BasisVectors( Basis( V ) );</span>
[ [ 1, 0, 0 ], [ 0, 1, 0 ], [ 0, 0, 1 ] ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">xx:= BasisVectors( Basis( A ) );</span>
[ v.1, v.2 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">xx[1]^vv[3];</span>
[ 1, 0, 0 ]
</pre></div>

<p><a id="X7E16630185CE2C10" name="X7E16630185CE2C10"></a></p>

<h5>62.11-21 ModuleByRestriction</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ModuleByRestriction</code>( <var class="Arg">V</var>, <var class="Arg">sub1</var>[, <var class="Arg">sub2</var>] )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">V</var> is an algebra module and <var class="Arg">sub1</var> is a subalgebra of the acting algebra of <var class="Arg">V</var>. This function returns the module that is the restriction of <var class="Arg">V</var> to <var class="Arg">sub1</var>. So it has the same underlying vector space as <var class="Arg">V</var>, but the acting algebra is <var class="Arg">sub</var>. If two subalgebras <var class="Arg">sub1</var>, <var class="Arg">sub2</var> are given then <var class="Arg">V</var> is assumed to be a bi-module, and <var class="Arg">sub1</var> a subalgebra of the algebra acting on the left, and <var class="Arg">sub2</var> a subalgebra of the algebra acting on the right.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= LeftAlgebraModuleByGenerators( A, \*, [ [ 1, 0, 0 ] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= Subalgebra( A, [ Basis(A)[1] ] );</span>
&lt;algebra over Rationals, with 1 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= ModuleByRestriction( V, B );</span>
&lt;left-module over &lt;algebra over Rationals, with 1 generators&gt;&gt;
</pre></div>

<p><a id="X7885AAC87FDCF649" name="X7885AAC87FDCF649"></a></p>

<h5>62.11-22 NaturalHomomorphismBySubAlgebraModule</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NaturalHomomorphismBySubAlgebraModule</code>( <var class="Arg">V</var>, <var class="Arg">W</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">V</var> must be a sub-algebra module of <var class="Arg">V</var>. This function returns the projection from <var class="Arg">V</var> onto <code class="code"><var class="Arg">V</var>/<var class="Arg">W</var></code>. It is a linear map, that is also a module homomorphism. As usual images can be formed with <code class="code">Image( f, v )</code> and pre-images with <code class="code">PreImagesRepresentative( f, u )</code>.</p>

<p>The quotient module can also be formed by entering <code class="code"><var class="Arg">V</var>/<var class="Arg">W</var></code>.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= Rationals^[3,3];;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">B:= DirectSumOfAlgebras( A, A );</span>
&lt;algebra over Rationals, with 6 generators&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:= StructureConstantsTable( Basis( B ) );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">C:= AlgebraByStructureConstants( Rationals, T );</span>
&lt;algebra of dimension 18 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= AdjointModule( C );</span>
&lt;left-module over &lt;algebra of dimension 18 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= SubAlgebraModule( V, [ Basis(V)[1] ] );</span>
&lt;left-module over &lt;algebra of dimension 18 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:= NaturalHomomorphismBySubAlgebraModule( V, W );</span>
&lt;linear mapping by matrix, &lt;
18-dimensional left-module over &lt;algebra of dimension 
18 over Rationals&gt;&gt; -&gt; &lt;
9-dimensional left-module over &lt;algebra of dimension 
18 over Rationals&gt;&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">quo:= ImagesSource( f );  # i.e., the quotient module</span>
&lt;9-dimensional left-module over &lt;algebra of dimension 
18 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">v:= Basis( quo )[1];</span>
[ 1, 0, 0, 0, 0, 0, 0, 0, 0 ]
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PreImagesRepresentative( f, v );</span>
v.4
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Basis( C )[4]^v;</span>
[ 1, 0, 0, 0, 0, 0, 0, 0, 0 ]
</pre></div>

<p><a id="X85D0F3758551DADC" name="X85D0F3758551DADC"></a></p>

<h5>62.11-23 DirectSumOfAlgebraModules</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DirectSumOfAlgebraModules</code>( <var class="Arg">list</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; DirectSumOfAlgebraModules</code>( <var class="Arg">V</var>, <var class="Arg">W</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">list</var> must be a list of algebra modules. This function returns the direct sum of the elements in the list (as an algebra module). The modules must be defined over the same algebras.</p>

<p>In the second form is short for <code class="code">DirectSumOfAlgebraModules( [ <var class="Arg">V</var>, <var class="Arg">W</var> ] )</code></p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 3 );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= BiAlgebraModuleByGenerators( A, A, \*, \*, [ [1,0,0] ] );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= DirectSumOfAlgebraModules( V, V );</span>
&lt;6-dimensional left-module over ( Rationals^[ 3, 3 ] )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">BasisVectors( Basis( W ) );</span>
[ ( [ 1, 0, 0 ] )(+)( [ 0, 0, 0 ] ), ( [ 0, 1, 0 ] )(+)( [ 0, 0, 0 ] )
    , ( [ 0, 0, 1 ] )(+)( [ 0, 0, 0 ] ), 
  ( [ 0, 0, 0 ] )(+)( [ 1, 0, 0 ] ), ( [ 0, 0, 0 ] )(+)( [ 0, 1, 0 ] )
    , ( [ 0, 0, 0 ] )(+)( [ 0, 0, 1 ] ) ]
</pre></div>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">L:= SimpleLieAlgebra( "C", 3, Rationals );;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= HighestWeightModule( L, [ 1, 1, 0 ] );</span>
&lt;64-dimensional left-module over &lt;Lie algebra of dimension 
21 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= HighestWeightModule( L, [ 0, 0, 2 ] );</span>
&lt;84-dimensional left-module over &lt;Lie algebra of dimension 
21 over Rationals&gt;&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">U:= DirectSumOfAlgebraModules( V, W );</span>
&lt;148-dimensional left-module over &lt;Lie algebra of dimension 
21 over Rationals&gt;&gt;
</pre></div>

<p><a id="X7D7A6486803B15CE" name="X7D7A6486803B15CE"></a></p>

<h5>62.11-24 TranslatorSubalgebra</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; TranslatorSubalgebra</code>( <var class="Arg">M</var>, <var class="Arg">U</var>, <var class="Arg">W</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Here <var class="Arg">M</var> is an algebra module, and <var class="Arg">U</var> and <var class="Arg">W</var> are two subspaces of <var class="Arg">M</var>. Let <var class="Arg">A</var> be the algebra acting on <var class="Arg">M</var>. This function returns the subspace of elements of <var class="Arg">A</var> that map <var class="Arg">U</var> into <var class="Arg">W</var>. If <var class="Arg">W</var> is a sub-algebra-module (i.e., closed under the action of <var class="Arg">A</var>), then this space is a subalgebra of <var class="Arg">A</var>.</p>

<p>This function works for left, or right modules over a finite-dimensional algebra. We stress that it is not checked whether <var class="Arg">U</var> and <var class="Arg">W</var> are indeed subspaces of <var class="Arg">M</var>. If this is not the case nothing is guaranteed about the behaviour of the function.</p>


<div class="example"><pre>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">A:= FullMatrixAlgebra( Rationals, 3 );</span>
( Rationals^[ 3, 3 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">V:= Rationals^[3,2];</span>
( Rationals^[ 3, 2 ] )
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">M:= LeftAlgebraModule( A, \*, V );</span>
&lt;left-module over ( Rationals^[ 3, 3 ] )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">bm:= Basis(M);;</span>
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">U:= SubAlgebraModule( M, [ bm[1] ] );   </span>
&lt;left-module over ( Rationals^[ 3, 3 ] )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">TranslatorSubalgebra( M, U, M );</span>
&lt;algebra of dimension 9 over Rationals&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">W:= SubAlgebraModule( M, [ bm[4] ] );</span>
&lt;left-module over ( Rationals^[ 3, 3 ] )&gt;
<span class="GAPprompt">gap&gt;</span> <span class="GAPinput">T:=TranslatorSubalgebra( M, U, W );</span>
&lt;algebra of dimension 0 over Rationals&gt;
</pre></div>


<div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp;  <a href="chap0.html#contents">[Contents]</a>&nbsp;  &nbsp;<a href="chap61.html">[Previous Chapter]</a>&nbsp;  &nbsp;<a href="chap63.html">[Next Chapter]</a>&nbsp;  </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chap12.html">12</a>  <a href="chap13.html">13</a>  <a href="chap14.html">14</a>  <a href="chap15.html">15</a>  <a href="chap16.html">16</a>  <a href="chap17.html">17</a>  <a href="chap18.html">18</a>  <a href="chap19.html">19</a>  <a href="chap20.html">20</a>  <a href="chap21.html">21</a>  <a href="chap22.html">22</a>  <a href="chap23.html">23</a>  <a href="chap24.html">24</a>  <a href="chap25.html">25</a>  <a href="chap26.html">26</a>  <a href="chap27.html">27</a>  <a href="chap28.html">28</a>  <a href="chap29.html">29</a>  <a href="chap30.html">30</a>  <a href="chap31.html">31</a>  <a href="chap32.html">32</a>  <a href="chap33.html">33</a>  <a href="chap34.html">34</a>  <a href="chap35.html">35</a>  <a href="chap36.html">36</a>  <a href="chap37.html">37</a>  <a href="chap38.html">38</a>  <a href="chap39.html">39</a>  <a href="chap40.html">40</a>  <a href="chap41.html">41</a>  <a href="chap42.html">42</a>  <a href="chap43.html">43</a>  <a href="chap44.html">44</a>  <a href="chap45.html">45</a>  <a href="chap46.html">46</a>  <a href="chap47.html">47</a>  <a href="chap48.html">48</a>  <a href="chap49.html">49</a>  <a href="chap50.html">50</a>  <a href="chap51.html">51</a>  <a href="chap52.html">52</a>  <a href="chap53.html">53</a>  <a href="chap54.html">54</a>  <a href="chap55.html">55</a>  <a href="chap56.html">56</a>  <a href="chap57.html">57</a>  <a href="chap58.html">58</a>  <a href="chap59.html">59</a>  <a href="chap60.html">60</a>  <a href="chap61.html">61</a>  <a href="chap62.html">62</a>  <a href="chap63.html">63</a>  <a href="chap64.html">64</a>  <a href="chap65.html">65</a>  <a href="chap66.html">66</a>  <a href="chap67.html">67</a>  <a href="chap68.html">68</a>  <a href="chap69.html">69</a>  <a href="chap70.html">70</a>  <a href="chap71.html">71</a>  <a href="chap72.html">72</a>  <a href="chap73.html">73</a>  <a href="chap74.html">74</a>  <a href="chap75.html">75</a>  <a href="chap76.html">76</a>  <a href="chap77.html">77</a>  <a href="chap78.html">78</a>  <a href="chap79.html">79</a>  <a href="chap80.html">80</a>  <a href="chap81.html">81</a>  <a href="chap82.html">82</a>  <a href="chap83.html">83</a>  <a href="chap84.html">84</a>  <a href="chap85.html">85</a>  <a href="chap86.html">86</a>  <a href="chap87.html">87</a>  <a href="chapBib.html">Bib</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>