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

563516 views
1
#include <typedef.h>
2
#include <getput.h>
3
#include <bravais.h>
4
#include <matrix.h>
5
#include <base.h>
6
#include <datei.h>
7
#include <idem.h>
8
#include <longtools.h>
9
10
int INFO_LEVEL;
11
extern int SFLAG;
12
13
int main(int argc,char **argv){
14
15
bravais_TYP *G = NULL,
16
*H;
17
18
matrix_TYP *F,
19
*FI,
20
*ID,
21
*T= NULL;
22
23
lattice_element **RES;
24
25
int almost,
26
zclass,
27
number,
28
i,
29
j,
30
no_N_classes;
31
32
char comment[1000],
33
*symb = NULL;
34
35
read_header(argc,argv);
36
37
if ((is_option('h') && optionnumber('h')==0) ||
38
((FILEANZ != 1))){
39
printf("Usage: %s 'file' [-S]\n",argv[0]);
40
printf("\n");
41
printf("file: bravais_TYP containing a Bravais group G.\n");
42
printf("\n");
43
printf("Lists representatives of the Bravais subgroups (resp. Bravais supergroups \n");
44
printf("with option -S) of the BRAVAIS GROUP G under the conjugation action of\n");
45
printf("the normalizer of G in GL_n(Z).\n");
46
printf("Remark: Without option -G only the symbols of the Bravais groups are given.\n");
47
printf("\n");
48
printf("Options:\n");
49
printf("-S: Search for all supergroups\n");
50
printf("-G: Calculate generators for the groups as well\n");
51
printf("\n");
52
printf("Cf. Bravais_catalog, Symbol.\n");
53
if (is_option('h')){
54
exit(0);
55
}
56
else{
57
exit(31);
58
}
59
}
60
61
INFO_LEVEL = optionnumber('h');
62
63
if (INFO_LEVEL & 12){
64
SFLAG = 1;
65
}
66
67
if (FILEANZ == 1){
68
G = get_bravais(FILENAMES[0]);
69
70
/* cause the program to recalculate the formspace if desired */
71
if (is_option('f')){
72
for (i=0;i<G->form_no;i++){
73
free_mat(G->form[i]);
74
}
75
free(G->form);
76
G->form=NULL;
77
G->form_no = 0;
78
}
79
80
/* we desperately will need the space of forms */
81
if (G->form_no == 0 || G->form == NULL){
82
G->form = formspace(G->gen,G->gen_no,1,&G->form_no);
83
}
84
85
/* if (!is_option('b')){
86
H = bravais_group(G,FALSE);
87
free_bravais(G);
88
G = H;
89
H = NULL;
90
} */
91
92
ID = init_mat(G->dim,G->dim,"1");
93
F = rform(G->gen,G->gen_no,ID,101);
94
symb = symbol(G,F);
95
H = catalog_number(G,symb,&T,&almost,&zclass);
96
free_bravais(H);
97
free_mat(F);
98
free_mat(ID);
99
}
100
101
if (is_option('S')){
102
RES = super_lattice(symb,G->dim,almost,zclass,&number,is_option('G'));
103
104
if (!is_option('G')){
105
printf("Bravais groups which contain a Z-equivalent subgroup\n");
106
for (i=0;i<number;i++){
107
printf("Symbol: %s homogeneously d.: %d zclass: %d\n",
108
RES[i]->symbol,RES[i]->almost,RES[i]->zclass);
109
}
110
}
111
else{
112
/* we now have to care for the transformation matrix */
113
printf("bravais supergroups of the groups G in %s\n",FILENAMES[0]);
114
printf("number of Z-conjugacy classes: %d\n",number);
115
no_N_classes = 0;
116
for (i=0;i<number;i++){
117
no_N_classes += RES[i]->N_orbits;
118
}
119
printf("number of N_GLn(Z)(G)-conjugacy classes: %d\n",no_N_classes);
120
for (i=0;i<number;i++){
121
for (j=0;j<RES[i]->N_orbits;j++){
122
F = mat_mul(T,RES[i]->TR[j]);
123
FI = long_mat_inv(F);
124
H = konj_bravais(RES[i]->grp,FI);
125
free_mat(F);
126
free_mat(FI);
127
sprintf(comment,"%s %d %d, %d-th N-orbit",RES[i]->symbol,
128
RES[i]->almost,RES[i]->zclass,j+1);
129
130
131
if (is_option('A')){
132
sprintf(comment,"%s.%s.%d.%d.%d",FILENAMES[0],RES[i]->symbol,
133
RES[i]->almost,RES[i]->zclass,j+1);
134
put_bravais(H,comment,NULL);
135
}
136
else{
137
put_bravais(H,NULL,comment);
138
}
139
free_bravais(H);
140
}
141
}
142
}
143
144
}
145
else{
146
RES = lattice(symb,G->dim,almost,zclass,&number,is_option('G'));
147
148
if (!is_option('G')){
149
printf("Bravais subgroups of the groups G in %s\n",FILENAMES[0]);
150
for (i=0;i<number;i++){
151
printf("Symbol: %s homogeneously d.: %d zclass: %d\n",
152
RES[i]->symbol,RES[i]->almost,RES[i]->zclass);
153
printf("Number of occurences in the group: %d\n",RES[i]->alpha);
154
printf("Number of orbits under the normalizer: %d\n",
155
RES[i]->N_orbits);
156
}
157
}
158
else{
159
/* we now have to care for the transformation matrix */
160
printf("bravais subgroups of the groups G in %s\n",FILENAMES[0]);
161
printf("number of Z-conjugacy classes: %d\n",number);
162
no_N_classes = 0;
163
for (i=0;i<number;i++){
164
no_N_classes += RES[i]->N_orbits;
165
}
166
printf("number of N_GLn(Z)(G)-conjugacy classes: %d\n",no_N_classes);
167
F = mat_inv(T);
168
free_mat(T);
169
T = F;
170
for (i=0;i<number;i++){
171
for (j=0;j<RES[i]->N_orbits;j++){
172
F = mat_inv(RES[i]->TR[j]);
173
ID = mat_mul(T,F);
174
free_mat(F);
175
H = konj_bravais(RES[i]->grp,ID);
176
free_mat(ID);
177
sprintf(comment,"%s %d %d, %d-th N-orbit",RES[i]->symbol,
178
RES[i]->almost,RES[i]->zclass,j+1);
179
put_bravais(H,NULL,comment);
180
free_bravais(H);
181
}
182
}
183
}
184
}
185
186
187
/* clean up the lattice */
188
for (i=0;i<number;i++){
189
free_lattice_element(RES[i]);
190
}
191
free(RES);
192
193
/* clean up */
194
if (G != NULL) free_bravais(G);
195
if (T != NULL) free_mat(T);
196
if (symb != NULL) free(symb);
197
198
if (INFO_LEVEL & 12){
199
fprintf(stderr,"write pointer_statistics\n");
200
pointer_statistics(0,0);
201
}
202
203
exit(0);
204
205
} /* main */
206
207