Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

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

563580 views
1
#include"typedef.h"
2
#include"longtools.h"
3
#include"matrix.h"
4
#include"base.h"
5
6
extern int INFO_LEVEL;
7
/**************************************************************************
8
@
9
@ -------------------------------------------------------------------------
10
@ FILE: conjugate.c
11
@ -------------------------------------------------------------------------
12
@
13
***************************************************************************/
14
15
/***********************************************************************
16
@
17
@ -------------------------------------------------------------------------
18
@
19
@ matrix_TYP *conjugated(bravais_TYP *G,bravais_TYP *H,
20
@ matrix_TYP **N,int Nanz,bahn **strong)
21
@ Suppose the matrices in G->gen, H->gen generate finite matrix groups, and N
22
@ generates a matrix group with the condition that the orbit of N
23
@ on the conjugated of G under N is finite. Then the algorithm decides
24
@ whether G is conjugated to a supergroup of H, and if so gives an element
25
@ conjugating G over H, i.e H<= X * G * X^-1 for the result of this function.
26
@ Declaration of variables:
27
@ G: matrices generating G,
28
@ H:
29
@ N:
30
@ strong: a set of base/strong generators for G returned by
31
@ strong_generators
32
@
33
@ Sideefects: None of the variables given nor global variables should
34
@ be affected.
35
@
36
@ -------------------------------------------------------------------------
37
@
38
***********************************************************************/
39
matrix_TYP *conjugated(bravais_TYP *G,bravais_TYP *H,
40
matrix_TYP **N,int Nanz,bahn **strong)
41
{
42
43
matrix_TYP **orbit, /* represents the orbit of G under N by the
44
conjugating element */
45
*test_subgroup,
46
*tmp,
47
*tmp2,
48
*tmp3,
49
*tmp4,
50
*erg = NULL;
51
52
int found=1, /* number of conjugated subgroups found so far */
53
dealt=0, /* number of those dealt with */
54
i,
55
j,
56
k,
57
flag;
58
59
if (INFO_LEVEL & 4){
60
fprintf(stderr,"entering conjugated\n");
61
}
62
63
64
/* let's see whether H is not already a Subgroup of G */
65
flag = TRUE;
66
k = 0;
67
while ((k<H->gen_no) && flag){
68
if (!is_element(H->gen[k],G,strong,NULL)){
69
flag = FALSE;
70
}
71
k++;
72
}
73
/* if it was, leave instantly */
74
if (flag){
75
erg = init_mat(G->gen[0]->cols,G->gen[0]->cols,"1");
76
return(erg);
77
}
78
79
orbit = (matrix_TYP **) malloc(1*sizeof(matrix_TYP *));
80
orbit[0] = init_mat(G->gen[0]->cols,G->gen[0]->cols,"1");
81
82
/* start the obit calculation */
83
while ((dealt<found) && (erg == NULL)){
84
85
/* output for debugging */
86
if (INFO_LEVEL & 4){
87
fprintf(stderr,"got %i conjugated subgroups so far\n",found);
88
fprintf(stderr,"dealt with %i of these\n",dealt);
89
}
90
/* loop over the generators of N */
91
for (i=0;(i<Nanz) & (erg == NULL);i++){
92
93
/* calculating the new element */
94
test_subgroup = mat_mul(orbit[dealt],N[i]);
95
96
/* see if this gives really a new element */
97
j=0;
98
tmp = mat_inv(test_subgroup);
99
while ((test_subgroup != NULL) && (j< found)){
100
tmp2 = mat_mul(orbit[j],tmp);
101
tmp3 = mat_inv(tmp2);
102
k=0;
103
flag = TRUE;
104
while (flag && (k<G->gen_no)){
105
tmp4 = mat_mul(tmp2,G->gen[k]);
106
tmp4 = mat_muleq(tmp4,tmp3);
107
if (!is_element(tmp4,G,strong,NULL)){
108
flag = FALSE;
109
}
110
free_mat(tmp4);
111
k++;
112
}
113
114
if (flag){
115
free_mat(test_subgroup);
116
test_subgroup = NULL;
117
}
118
free_mat(tmp2);
119
free_mat(tmp3);
120
j++;
121
}
122
123
/* if it was a new element, we should memorize it and check whether
124
is over H */
125
if ( test_subgroup!= NULL){
126
/* so let's see whether it is really over H */
127
flag = TRUE;
128
k=0;
129
while(flag && (k<H->gen_no)){
130
tmp2 = mat_mul(test_subgroup,H->gen[k]);
131
mat_muleq(tmp2,tmp);
132
if (!is_element(tmp2,G,strong,NULL)){
133
flag = FALSE;
134
}
135
free_mat(tmp2);
136
k++;
137
}
138
/* get more memory */
139
orbit = (matrix_TYP **) realloc(orbit,(found+1)*sizeof(matrix_TYP*));
140
orbit[found] = test_subgroup;
141
found++;
142
if (flag){ erg = long_mat_inv(test_subgroup); }
143
}
144
145
free_mat(tmp);
146
147
} /* for (i= .... */
148
dealt++;
149
}
150
151
152
/* cleaning up memory */
153
for (i=0;i<found;i++){
154
free_mat(orbit[i]);
155
}
156
free(orbit);
157
158
return erg;
159
}
160
161
162