General Functions

Some of the functions provided by &HAPprime; are not specifically aimed at homological algebra or extending the &HAP; package. The functions in this chapter, which are used internally by &HAPprime; extend some of the standard &GAP; functions and datatypes.

Matrices

For details of the standard &GAP; vector and matrix functions, see and in the &GAP; tutorial and reference manuals. &HAPprime; provides improved versions of a couple of standard matrix operations, and two small helper functions.

<#Include Label="SumIntersectionMatDestructive_manBaseMat"> <#Include Label="SolutionMat_manBaseMat"> <#Include Label="IsSameSubspace_manBaseMat"> <#Include Label="PrintDimensionsMat_manBaseMat">

Example: matrices and vector spaces

&GAP; uses rows of a matrix to represent basis vectors for a vector space. In this example we have two matrics U and V that we suspect represent the same subspace. Using we can see that V lies in U, but shows that they are the same subspace, as is confirmed by having identical sums and intersections. gap> U := [[1,2,3],[4,5,6]];; gap> V := [[3,3,3],[5,7,9]];; gap> SolutionMat(U, V); [ [ -1, 1 ], [ 1, 1 ] ] gap> IsSameSubspace(U, V); true gap> SumIntersectionMatDestructive(U, V); [ [ [ 1, 2, 3 ], [ 0, 1, 2 ] ], [ [ 0, 1, 2 ], [ 1, 0, -1 ] ] ] gap> IsSameSubspace(last[1], last[2]); true gap> PrintDimensionsMat(V); "2x3"
Polynomials

&GAP; provides some functions for manipulating polynomials and polynomial ideals - see . The &HAPprime; packages adds further functions to decompose polynomials into terms and monomials, and some functions for tidying up polynomial ideals.

<#Include Label="TermsOfPolynomial_manPolynomial"> <#Include Label="IsMonomial_manPolynomial"> <#Include Label="UnivariateMonomialsOfMonomial_manPolynomial"> <#Include Label="IndeterminateAndExponentOfUnivariateMonomial_manPolynomial"> <#Include Label="IndeterminatesOfPolynomial_manPolynomial"> <#Include Label="ReduceIdeal_manPolynomial"> <#Include Label="ReducedPolynomialRingPresentation_manPolynomial">

Example: monomials, polynomials and ring presentations

A monomial is some product of ring indeterminates. A polynomial is a sum of monomials, where each monomial may also be multiplied by an element from the field of the polynomial. It can be useful to decompose polynomials as follows: decompose a polynomial into its individual terms (where a term is a product of a monomial and a field element). The function does this. decompose a monomial into its component univariate monomials, each of which is some (power of) a single indeterminates. This operation is performed by . decompose a univariate monomial into it the indeterminates and exponent (). In the example below, we decompose x + xy^2 + 3y^3 into its three terms, and then further decompose the xy^2 term. gap> R := PolynomialRing(Integers, 2);; gap> x := R.1;; y := R.2;; gap> poly := x + x*y^2 + 3*y^3; x_1*x_2^2+3*x_2^3+x_1 gap> terms := TermsOfPolynomial(poly); [ [ x_1, 1 ], [ x_2^3, 3 ], [ x_1*x_2^2, 1 ] ] gap> UnivariateMonomialsOfMonomial(terms[3][1]); [ x_1, x_2^2 ] gap> IndeterminateAndExponentOfUnivariateMonomial(last[2]); [ x_2, 2 ]

&HAPprime; also provides some functions to help the generation of ring presentations. In the following example we consider the polynomial ring \mathbb{Z}[w,x,y,z] an an ideal I = \langle w^2 + x, w^3 + x^3 \rangle. We first convert this ideal into reduced form (where no monomial in a polynomial is divisible by the leading term of any other polynomial). Then we calculate a reduced ring presentation for the quotient ring R/I, where we find that the indeterminate x is can be removed and a new ring S/J = \mathbb{Z}[w,y,z]/\langle w^6-w^3 \rangle is isomorphic to R/I gap> R := PolynomialRing(Integers, 4);; gap> w := R.1;; x := R.2;; gap> I := [w^2 + x, w^3 + x^3]; [ x_1^2+x_2, x_1^3+x_2^3 ] gap> ReduceIdeal(I, MonomialLexOrdering()); [ x_1^2+x_2, -x_2^3+x_1*x_2 ] gap> gap> ReducedPolynomialRingPresentation(R, I); [ Integers[x_5,x_6,x_7], [ x_5^6-x_5^3 ] ]
Singular
<#Include Label="SingularSetNormalFormIdeal_manSingular"> <#Include Label="SingularPolynomialNormalForm_manSingular"> <#Include Label="SingularGroebnerBasis_manSingular"> <#Include Label="SingularReducedGroebnerBasis_manSingular">

Groups

Small groups in &GAP; can be indexed by their small groups library number . An alternative indexing scheme, the Hall-Senior number, is used by Jon Carlson to publish his cohomology ring calculations at http://www.math.uga.edu/~lvalero/cohointro.html. To allow comparison with these results, we provide a function that converts from the &GAP; small groups library numbers to Hall-Senior number for the groups of order 8, 16, 32 and 64.

<#Include Label="HallSeniorNumber_manGroups">