Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
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
Project: cocalc-sagemath-dev-slelievre
Views: 418346/****************************************************************************1**2*A extend_automorphisms.c ANUPQ source Eamonn O'Brien3**4*Y Copyright 1995-2001, Lehrstuhl D fuer Mathematik, RWTH Aachen, Germany5*Y Copyright 1995-2001, School of Mathematical Sciences, ANU, Australia6**7*/89#include "pq_defs.h"10#include "pcp_vars.h"11#include "pq_functions.h"1213static int nmr_of_bytes;1415static void extend_automorphism(int **auts, struct pcp_vars *pcp);1617/* for each automorphism, compute its action on each of the generators */1819void extend_automorphisms(int ***auts, int nmr_of_auts, struct pcp_vars *pcp)20{21register int alpha;22nmr_of_bytes = pcp->lastg * sizeof(int);2324if (is_space_exhausted(7 * pcp->lastg + 4, pcp))25return;2627for (alpha = 1; alpha <= nmr_of_auts; ++alpha)28extend_automorphism(auts[alpha], pcp);29}3031/* extend the automorphism whose action on the defining generators32of the group is described by the supplied 2-dimensional matrix,33auts, to act on all of the generators of the group */3435static void extend_automorphism(int **auts, struct pcp_vars *pcp)36{37register int *y = y_address;3839register int generator;40register int lastg = pcp->lastg;41register int structure = pcp->structure;4243int cp1 = pcp->submlg - lastg - 2;44int cp2 = cp1 - lastg;45int result = cp2 - lastg;46int start = y[pcp->clend + 1] + 1;47register int value;48int u, v;4950#include "access.h"5152/* update submlg because of possible call to power */53pcp->submlg -= (3 * lastg + 2);5455/* for each generator, compute its image under the action of auts */56for (generator = start; generator <= lastg; ++generator) {5758/* examine the definition of generator */59value = y[structure + generator];60u = PART2(value);61v = PART3(value);6263if (v == 0)64extend_power(cp1, cp2, u, auts, pcp);65else66extend_commutator(cp1, cp2, u, v, auts, pcp);6768/* solve the appropriate equation, storing the image69of generator under the action of alpha at result */70solve_equation(cp1, cp2, result, pcp);7172/* now copy the result to auts */73memcpy(auts[generator] + 1, y + result + 1, nmr_of_bytes);74}7576/* reset value of submlg */77pcp->submlg += (3 * lastg + 2);78}7980/* given generator t of the p-multiplicator, whose definition is81u^p; hence, we have the equation8283u^p = W * t8485where W is a word (possibly trivial) in the generators of the group;86find the image of t under alpha by setting up (W)alpha at cp1,87((u)alpha)^p at cp2, and then call solve_equation */8889void extend_power(int cp1, int cp2, int u, int **auts, struct pcp_vars *pcp)90{91register int *y = y_address;9293register int i;94register int lastg = pcp->lastg;9596/* set up the image of u under alpha at cp2 and zero vector at cp1 */97for (i = 1; i <= lastg; ++i) {98y[cp2 + i] = auts[u][i];99y[cp1 + i] = 0;100}101102/* raise the image of u under alpha to its pth power */103power(pcp->p, cp2, pcp);104105/* set up image of W under alpha at cp1 */106if (y[pcp->ppower + u] < 0)107collect_image_of_string(-y[pcp->ppower + u], cp1, auts, pcp);108}109110/* given generator t of the p-multiplicator, whose definition is111[u, v]; hence, we have the equation112113[u, v] = W * t, or equivalently, u * v = v * u * W * t114115where W is a word (possibly trivial) in the generators of the group;116find the image of t under alpha by setting up117(v)alpha * (u)alpha * (W)alpha at cp1, (u)alpha * (v)alpha at cp2118and then call solve_equation */119120void extend_commutator(121int cp1, int cp2, int u, int v, int **auts, struct pcp_vars *pcp)122{123register int *y = y_address;124125int pointer;126127/* set up image under alpha of u at cp2 and image of v at cp1 */128memcpy(y + cp2 + 1, auts[u] + 1, nmr_of_bytes);129memcpy(y + cp1 + 1, auts[v] + 1, nmr_of_bytes);130131/* collect image of v under alpha at cp2 */132collect_image_of_generator(cp2, auts[v], pcp);133134/* collect image of u under alpha at cp1 */135collect_image_of_generator(cp1, auts[u], pcp);136137/* collect image of W under alpha at cp1 */138pointer = y[pcp->ppcomm + u];139if (y[pointer + v] < 0)140collect_image_of_string(-y[pointer + v], cp1, auts, pcp);141}142143/* collect the image of a generator under the action of144an automorphism and store the result at cp */145146void collect_image_of_generator(int cp, int *auts, struct pcp_vars *pcp)147{148register int *y = y_address;149150register int lused = pcp->lused;151register int lastg = pcp->lastg;152register int length = 0;153register int i;154int exp;155156#include "access.h"157158for (i = 1; i <= lastg; ++i) {159if ((exp = auts[i]) != 0)160y[lused + 1 + (++length)] = PACK2(exp, i);161}162163y[lused + 1] = length;164collect(-lused, cp, pcp);165}166167/* collect image of supplied string under the action of168supplied automorphism, auts, and store the result at cp */169170void171collect_image_of_string(int string, int cp, int **auts, struct pcp_vars *pcp)172{173register int *y = y_address;174175register int i;176int generator, exp;177int length = y[string + 1] - 1; /* last element of string178is in p-multiplicator */179#include "access.h"180181/* collect the string generator by generator */182for (i = 1; i <= length; ++i) {183generator = FIELD2(y[string + 1 + i]);184exp = FIELD1(y[string + 1 + i]);185while (exp > 0) {186collect_image_of_generator(cp, auts[generator], pcp);187--exp;188}189}190}191192193