GAP:SA

Function type
The function takes two arguments, both of which are positive integers, and outputs a boolean variable (true/false).

Behavior
The goal is to take inputs $$n$$ and $$q$$, with $$n$$ a positive integer and $$q$$ a prime power, and output the special affine group $$SA(n,q)$$.

Code
The current version works only when the prime power is itself a prime number.

SA := function(n,q) local A,B,C; if (q = 2 and n = 2) then return SymmetricGroup(4); fi; if IsPrime(q) then A := ElementaryAbelianGroup(q^n); B := AutomorphismGroup(A); C := DerivedSubgroup(B); return SemidirectProduct(C,A); else if IsPrimePower(q) then Print("Method not yet available for prime powers other than primes\n"); fi; fi; end;;