CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
/****************************************************************************
2
**
3
*A extend_automorphisms.c ANUPQ source Eamonn O'Brien
4
**
5
*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany
6
*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia
7
**
8
*/
9
10
#include "pq_defs.h"
11
#include "pcp_vars.h"
12
#include "pq_functions.h"
13
14
static int nmr_of_bytes;
15
16
static void extend_automorphism(int **auts, struct pcp_vars *pcp);
17
18
/* for each automorphism, compute its action on each of the generators */
19
20
void extend_automorphisms(int ***auts, int nmr_of_auts, struct pcp_vars *pcp)
21
{
22
register int alpha;
23
nmr_of_bytes = pcp->lastg * sizeof(int);
24
25
if (is_space_exhausted(7 * pcp->lastg + 4, pcp))
26
return;
27
28
for (alpha = 1; alpha <= nmr_of_auts; ++alpha)
29
extend_automorphism(auts[alpha], pcp);
30
}
31
32
/* extend the automorphism whose action on the defining generators
33
of the group is described by the supplied 2-dimensional matrix,
34
auts, to act on all of the generators of the group */
35
36
static void extend_automorphism(int **auts, struct pcp_vars *pcp)
37
{
38
register int *y = y_address;
39
40
register int generator;
41
register int lastg = pcp->lastg;
42
register int structure = pcp->structure;
43
44
int cp1 = pcp->submlg - lastg - 2;
45
int cp2 = cp1 - lastg;
46
int result = cp2 - lastg;
47
int start = y[pcp->clend + 1] + 1;
48
register int value;
49
int u, v;
50
51
#include "access.h"
52
53
/* update submlg because of possible call to power */
54
pcp->submlg -= (3 * lastg + 2);
55
56
/* for each generator, compute its image under the action of auts */
57
for (generator = start; generator <= lastg; ++generator) {
58
59
/* examine the definition of generator */
60
value = y[structure + generator];
61
u = PART2(value);
62
v = PART3(value);
63
64
if (v == 0)
65
extend_power(cp1, cp2, u, auts, pcp);
66
else
67
extend_commutator(cp1, cp2, u, v, auts, pcp);
68
69
/* solve the appropriate equation, storing the image
70
of generator under the action of alpha at result */
71
solve_equation(cp1, cp2, result, pcp);
72
73
/* now copy the result to auts */
74
memcpy(auts[generator] + 1, y + result + 1, nmr_of_bytes);
75
}
76
77
/* reset value of submlg */
78
pcp->submlg += (3 * lastg + 2);
79
}
80
81
/* given generator t of the p-multiplicator, whose definition is
82
u^p; hence, we have the equation
83
84
u^p = W * t
85
86
where W is a word (possibly trivial) in the generators of the group;
87
find the image of t under alpha by setting up (W)alpha at cp1,
88
((u)alpha)^p at cp2, and then call solve_equation */
89
90
void extend_power(int cp1, int cp2, int u, int **auts, struct pcp_vars *pcp)
91
{
92
register int *y = y_address;
93
94
register int i;
95
register int lastg = pcp->lastg;
96
97
/* set up the image of u under alpha at cp2 and zero vector at cp1 */
98
for (i = 1; i <= lastg; ++i) {
99
y[cp2 + i] = auts[u][i];
100
y[cp1 + i] = 0;
101
}
102
103
/* raise the image of u under alpha to its pth power */
104
power(pcp->p, cp2, pcp);
105
106
/* set up image of W under alpha at cp1 */
107
if (y[pcp->ppower + u] < 0)
108
collect_image_of_string(-y[pcp->ppower + u], cp1, auts, pcp);
109
}
110
111
/* given generator t of the p-multiplicator, whose definition is
112
[u, v]; hence, we have the equation
113
114
[u, v] = W * t, or equivalently, u * v = v * u * W * t
115
116
where W is a word (possibly trivial) in the generators of the group;
117
find the image of t under alpha by setting up
118
(v)alpha * (u)alpha * (W)alpha at cp1, (u)alpha * (v)alpha at cp2
119
and then call solve_equation */
120
121
void extend_commutator(
122
int cp1, int cp2, int u, int v, int **auts, struct pcp_vars *pcp)
123
{
124
register int *y = y_address;
125
126
int pointer;
127
128
/* set up image under alpha of u at cp2 and image of v at cp1 */
129
memcpy(y + cp2 + 1, auts[u] + 1, nmr_of_bytes);
130
memcpy(y + cp1 + 1, auts[v] + 1, nmr_of_bytes);
131
132
/* collect image of v under alpha at cp2 */
133
collect_image_of_generator(cp2, auts[v], pcp);
134
135
/* collect image of u under alpha at cp1 */
136
collect_image_of_generator(cp1, auts[u], pcp);
137
138
/* collect image of W under alpha at cp1 */
139
pointer = y[pcp->ppcomm + u];
140
if (y[pointer + v] < 0)
141
collect_image_of_string(-y[pointer + v], cp1, auts, pcp);
142
}
143
144
/* collect the image of a generator under the action of
145
an automorphism and store the result at cp */
146
147
void collect_image_of_generator(int cp, int *auts, struct pcp_vars *pcp)
148
{
149
register int *y = y_address;
150
151
register int lused = pcp->lused;
152
register int lastg = pcp->lastg;
153
register int length = 0;
154
register int i;
155
int exp;
156
157
#include "access.h"
158
159
for (i = 1; i <= lastg; ++i) {
160
if ((exp = auts[i]) != 0)
161
y[lused + 1 + (++length)] = PACK2(exp, i);
162
}
163
164
y[lused + 1] = length;
165
collect(-lused, cp, pcp);
166
}
167
168
/* collect image of supplied string under the action of
169
supplied automorphism, auts, and store the result at cp */
170
171
void
172
collect_image_of_string(int string, int cp, int **auts, struct pcp_vars *pcp)
173
{
174
register int *y = y_address;
175
176
register int i;
177
int generator, exp;
178
int length = y[string + 1] - 1; /* last element of string
179
is in p-multiplicator */
180
#include "access.h"
181
182
/* collect the string generator by generator */
183
for (i = 1; i <= length; ++i) {
184
generator = FIELD2(y[string + 1 + i]);
185
exp = FIELD1(y[string + 1 + i]);
186
while (exp > 0) {
187
collect_image_of_generator(cp, auts[generator], pcp);
188
--exp;
189
}
190
}
191
}
192
193