[GAP Forum] complex product of two groups

Burkhard Höfling burkhard at hoefling.name
Wed Apr 18 14:41:18 BST 2012


> HK:=[];
> for h in H do
>   for k in K do
>      if h*k not in HK then
>         Add(HK,h*k);
>      fi;
>   od;
> od;

To avoid checking for duplicates, you could use

HK := [];
for h in H do
	for k in RightTransversal (K, Intersection (H, K)) do
		Add (HK, h*k);
	od;
od;

But do you really want HK as a list? You might be better off representing it as a list of riight cosets of H (or left cosets of K).

Cheers

Burkhard.




More information about the Forum mailing list