Because SLP-groups exist primarily to allow the user to write efficient
code for evaluating words under a homomorphism, there are some extra
features in the homomorphism constructor which rely on the user
providing correct input.
When evaluating single words, it may not be desirable to explicitly
construct the homomorphism. The Evaluate function uses the same
evaluation mechanism as the homomorphisms and may a useful alternative.
Evaluate the word u using the elements of Q as images of the
generators of the parent of u. The sequence Q must contains at least as
many group elements as the parent of u has generators.
The second form evaluates all the words in v simultaneously, which is
usually quicker than doing individual evaluations.
When the second argument is a group G, Q is taken as the sequence of
generators of G.
An illustration of the use of
AddRedundantGenerators and the
homomorphism constructing machinery.
> G := SLPGroup(2);
> M := GeneralLinearGroup(19, 7);
> P := RandomProcess(G);
> x := Random(P);
> #x;
74
We evaluate x im M using the
Evaluate function.
> m := Evaluate(x, [M.1, M.2]);
> Order(m);
118392315154200
If we wish to evaluate several different words, we may be better off
using a homomorphism.
> Q := [x^G.1, x^G.2, x^(G.1*G.2)];
> phi := hom<G -> M | M.1, M.2>;
> time R1 := phi(Q);
Time: 0.129
We note that x has become important since it is now a common
sub-expression of several straight-line programs. We can build
a homomorphism which will store the image of x by adding x
as a redundant generator and defining the same homomorphism
from the resulting group.
> H := AddRedundantGenerators(G, [x]);
> QQ := [H | x: x in Q];
We will define psi as the unique map on H which matches phi.
> psi := hom<H -> M | phi>;
> time R2 := psi(QQ);
Time: 0.000
> R1 eq R2;
true
In fact, if we had looked at the expression lengths of the straight-line
programs involved, we would have found the following, which explains
the significant speed up:
> [#x: x in Q];
[ 75, 75, 75 ]
> [#x: x in QQ];
[ 1, 1, 2 ]
[Next][Prev] [Right] [Left] [Up] [Index] [Root]