GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
1[1X2 [33X[0;0YExtending Gauss Functionality[133X[101X234[1X2.1 [33X[0;0YThe need for extended functionality[133X[101X56[33X[0;0Y[5XGAP[105X has a lot of functionality for row echelon forms of matrices. These can7be called by [10XSemiEchelonForm[110X and similar commands. All of these work for the8[5XGAP[105X matrix type over fields. However, these algorithms are not capable of9computing a reduced row echelon form (RREF) of a matrix, there is no way to10"Gauss upwards". While this is not neccessary for things like Rank or Kernel11computations, this was one in a number of missing features important for the12development of the [5XGAP[105X package [5Xhomalg[105X by M. Barakat [Bar09].[133X1314[33X[0;0YParallel to this development I worked on [5XSCO[105X [Gör08b], a package for15creating simplicial sets and computing the cohomology of orbifolds, based on16the paper "Simplicial Cohomology of Orbifolds" by I. Moerdijk and D. A.17Pronk [MP99]. Very early on it became clear that the cohomology matrices18(with entries in ℤ or finite quotients of ℤ) would grow exponentially in19size with the cohomology degree. At one point in time, for example, a 5065120x 1133693 matrix had to be handled.[133X2122[33X[0;0YIt should be quite clear that there was a need for a sparse matrix data type23and corresponding Gaussian algorithms. After an unfruitful search for a24computer algebra system capable of this task, the [5XGauss[105X package was born -25to provide not only the missing RREF algorithms, but also support a new data26type, enabling [5XGAP[105X to handle sparse matrices of almost arbritrary size.[133X2728[33X[0;0YI am proud to tell you that, thanks to optimizing the algorithms for29matrices over GF(2), it was possible to compute the GF(2)-Rank of the matrix30mentioned above in less than 20 minutes with a memory usage of about 3 GB.[133X313233[1X2.2 [33X[0;0YThe applications of the [5XGauss[105X[101X[1X package algorithms[133X[101X3435[33X[0;0YPlease refer to [ht09] to find out more about the [5Xhomalg[105X project and its36related packages. Most of the motivation for the algorithms in the [5XGauss[105X37package can be found there. If you are interested in this project, you might38also want to check out my [5XGaussForHomalg[105X [Gör08a] package, which, just as39[5XRingsForHomalg[105X [BGKLH08] does for external Rings, serves as the connection40between [5Xhomalg[105X and [5XGauss[105X. By allowing [5Xhomalg[105X to delegate computational tasks41to [5XGauss[105X this small package extends [5Xhomalg[105X's capabilities to dense and42sparse matrices over fields and rings of the form [22Xℤ / ⟨ p^n ⟩[122X.[133X4344[33X[0;0YFor those unfamiliar with the [5Xhomalg[105X project let me explain a couple of45points. As outlined in [BR08] by D. Robertz and M. Barakat homological46computations can be reduced to three basic tasks:[133X4748[30X [33X[0;6YComputing a row basis of a module ([10XBasisOfRowModule[110X).[133X4950[30X [33X[0;6YReducing a module with a basis ([10XDecideZeroRows[110X).[133X5152[30X [33X[0;6YCompute the relations between module elements53([10XSyzygiesGeneratorsOfRows[110X).[133X5455[33X[0;0YIn addition to these tasks only relatively easy tools for matrix56manipulation are needed, ranging from addition and multiplication to finding57the zero rows in a matrix. However, to reduce the need for communication it58might be helpful to supply [5Xhomalg[105X with some more advanced procedures.[133X5960[33X[0;0YWhile the above tasks can be quite difficult when, for example, working in61noncommutative polynomial rings, in the [5XGauss[105X case they can all be done as62long as you can compute a Reduced Row Echelon Form. This is clear for63[10XBasisOfRowModule[110X, as the rows of the RREF of the matrix are already a basis64of the module. [2XEchelonMat[102X ([14X4.2-1[114X) is used to compute RREFs, based on the [5XGAP[105X65internal method [10XSemiEchelonMat[110X for Row Echelon Forms.[133X6667[33X[0;0YLets look at the second point, the basic function [10XDecideZeroRows[110X: When you68face the task of reducing a module [22XA[122X with a given basis [22XB[122X, you can compute69the RREF of the following block matrix:[133X7071┌────┬───┐72│ Id │ A │73├────┼───┤74│ 0 │ B │75└────┴───┘7677[33X[0;0YBy computing the RREF (notice how important "Gaussing upwards" is here) [22XA[122X is78reduced with [22XB[122X. However, the left side of the matrix just serves the single79purpose of tricking the Gaussian algorithms into doing what we want.80Therefore, it was a logical step to implement [2XReduceMat[102X ([14X4.2-3[114X), which does81the same thing but without needing unneccessary columns.[133X8283[33X[0;0YNote: When, much later, it became clear that it was important to compute the84transformation matrices of the reduction, [2XReduceMatTransformation[102X ([14X4.2-4[114X)85was born, similar to [2XEchelonMatTransformation[102X ([14X4.2-2[114X). This corresponds to86the [5Xhomalg[105X procedure [10XDecideZeroRowsEffectively[110X.[133X8788[33X[0;0YThe third procedure, [10XSygygiesGeneratorsOfRows[110X, is concerned with the89relations between rows of a matrix, each row representing a module element.90Over a field these relations are exactly the kernel of the matrix. One can91easily see that this can be achieved by taking a matrix[133X9293┌───┬────┐94│ A │ Id │95└───┴────┘9697[33X[0;0Yand computing its Row Echelon Form. Then the row relations are generated by98the rows to the right of the zero rows of the REF. There are two problems99with this approach: The computation diagonalizes the kernel, which might not100be wanted, and, much worse, it does not work at all for rings with zero101divisors. For example, the [22X1 × 1[122X matrix [22X[2 + 8ℤ][122X has a row relation [22X[4 + 8ℤ][122X102which would not have been found by this method.[133X103104[33X[0;0YApproaching this problem led to the method [2XEchelonMatTransformation[102X ([14X4.2-2[114X),105which additionally computes the transformation matrix [22XT[122X, such that RREF [22X= T106⋅ M[122X. Similar to [10XSemiEchelonMatTransformation[110X, [22XT[122X is split up into the rows107needed to create the basis vectors of the RREF, and the relations that led108to zero rows. Focussing on the computations over fields, it was an easy step109to write [2XKernelMat[102X ([14X4.2-5[114X), which terminates after the REF and returns the110kernel generators.[133X111112[33X[0;0YThe syzygy computation over [22Xℤ / ⟨ p^n ⟩[122X was solved by carefully keeping113track of basis vectors with a zero-divising head. If, for [22Xv =114(0,...,0,h,*,...,*), h ≠ 0,[122X there exists [22Xg ≠ 0[122X such that [22Xg ⋅ h = 0[122X, the115vector [22Xg ⋅ v[122X is regarded as an additional row vector which has to be reduced116and can be reduced with. After some more work this allowed for the117implementation of [2XKernelMat[102X ([14X4.2-5[114X) for matrices over [22Xℤ / ⟨ p^n ⟩[122X.[133X118119[33X[0;0YThis concludes the explanation of the so-called basic tasks [5XGauss[105X has to120handle when called by [5Xhomalg[105X to do matrix calculations. Here is a tabular121overview of the current capabilities of [5XGauss[105X ([22Xp[122X is a prime, [22Xn ∈ ℕ[122X):[133X122123┌───────────────────┬────── ─────────── ────── ────── ─────────── ─┐124│ Matrix Type: │ Dense c Dense c Sparse c Sparse c Sparse c125├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤126│ Base Ring: │ Field c [22Xℤ / ⟨ p^n ⟩[122X c Field c GF(2) c [22Xℤ / ⟨ p^n ⟩[122X c127├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤128├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤129│ RankMat │ [5XGAP[105X c n.a. c + c ++ c n.a. c130├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤131│ EchelonMat │ + c - c + c ++ c + c132├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤133│ EchelonMatTransf. │ + c - c + c ++ c + c134├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤135│ ReduceMat │ + c - c + c ++ c + c136├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤137│ ReduceMatTransf. │ + c - c + c ++ c + c138├───────────────────┼────── ─────────── ────── ────── ─────────── ─┤139│ KernelMat │ + c - c + c ++ c + c140└───────────────────┴────── ─────────── ────── ────── ─────────── ─┘141142[33X[0;0YAs you can see, the development of hermite algorithms was not continued for143dense matrices. There are two reasons for that: [5XGAP[105X already has very good144algorithms for ℤ, and for small matrices the disadvantage of computing over145ℤ, potentially leading to coefficient explosion, is marginal.[133X146147148149