Let $G,H$ be two Groups. How to check with GAP whether they are isomorphic or not?
For example, GAP has IsNilpotentGroup to check whether the group $G$ is nilpotent. Is there a similar function named like AreIsomorphicGroups to check whether $G$ and $H$ are isomorphic or not?
There are two aspects here: how to search such information in GAP, and how to actually check the isomorphism of two groups.
First, the OP was quite close to guessing the name of the function, since most of the documented GAP functions follow these naming conventions. Functions that return
trueorfalseusually have the name of the formIsSomething(even in the cases whenAreSomethingcould make sense). So one could expect that GAP has something named likeIsIsomorph....Making such a guess, one could now use the help system to find all help entries starting with
IsIsom. To do this, enter?IsIsomin GAP (one could also try??IsIsomto find all entries containing a substringIsIsom). This will produce a list of entries, and those which are relevant areand
(this also demonstrates a very useful feature of the help system - searching in the manuals of packages even when they are not loaded).
Now in more details about the actual isomorphism check. If one would open the documentation of SONATA's
IsIsomorphicGroup, that would lead to the GAP functionIsomorphismGroupswhich constructs and returns the actual isomorphism, if it is possible, or returnsfailif the groups are non-isomorphic (see here). For example:One could inspect the source code of this function entering
to see that before attempting to construct the isomorphism it does some checks of necessary conditions and will immediately return
failif e.g. the groups have different orders or different number of conjugacy classes. Also, for groups of the order that allows identification of the group in the GAP Small Groups Library (seeIdGrouphere) it checks that both groups have the same ID and returns fail if not.This may be useful if one is only interested whether two groups are isomorphic, but not interested in the actual homomorphism: in this case
GandHare isomorphic if and only ifIdGroup(G)=IdGroup(H). In the example above, we have:Identification using
IdGroupis possible for all orders in the library except for the orders $512$ and $1536$ and except for the orders $p^5$, $p^6$ and $p^7$ above $2000$ (see here). Also note that ANUPQ package has an undocumented functionIdStandardPresented512Groupwhich provides identification for groups of order 512.This approach is used by the SONATA package which provides a function
IsIsomorphicGroup(see here) which returnstrueorfalsedependently on whether the two groups are isomorphic or not:To inspect the code of
IsIsomorphicGroup, first callLoadPackage("sonata");and then enterThen one could also see that this checks some necessary conditions before doing actual work in the generic method which just checks that
IsomorphismGroups( G, H ) <> fail. These necessary conditions could work fast for small groups but not work very efficiently for very large ones (e.g. comparing the number of elements of each order), so this should be used with care.In case of a $p$-group, the ANUPQ package (requires compilation, not available in the GAP distribution for Windows) provides the function
IsIsomorphicPGroup(see here) which is applicable only to groups of prime power order and may be more efficient in this case. See more details about the algorithm it uses here.For very large groups, checking whether they are isomorphic or not may be quite time-consuming. One could try to calculate some other invariants to try to show that they are different, and/or try to find better representation of the group (e.g. convert a group given by generators and relators to a permutation group) so that GAP will operate with it faster. In case of any challenging examples, I suggest to post them in separate questions.