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
#include "ZZ.h"
2
#include "typedef.h"
3
#include "getput.h"
4
#include "name.h"
5
#include "bravais.h"
6
#include "datei.h"
7
#include "matrix.h"
8
#include "voronoi.h"
9
#include "autgrp.h"
10
#include "symm.h"
11
#include "contrib.h"
12
#include "base.h"
13
#include "zass.h"
14
#include "gmp.h"
15
#include "longtools.h"
16
17
#define DATABASE_NAME TOPDIR "/tables/qcatalog/data"
18
19
boolean GRAPH = FALSE;
20
int SFLAG;
21
int INFO_LEVEL;
22
int main (int argc, char *argv[])
23
24
25
26
{
27
28
bravais_TYP *P,
29
*R,
30
*Rnew,
31
*RC,
32
*DATAQ = (bravais_TYP *) 1,
33
*DATAZ;
34
35
matrix_TYP *T,
36
*TI,
37
*TZ,
38
*PRES;
39
40
database *database;
41
42
MP_INT aff_name;
43
44
char qname[1024],
45
symb[1024];
46
47
48
int zname[2];
49
50
char comment[1024];
51
52
read_header (argc, argv);
53
54
55
if (is_option('h'))
56
INFO_LEVEL = optionnumber('h');
57
58
if (INFO_LEVEL == 8)
59
SFLAG = 1;
60
61
if ((is_option('h') && INFO_LEVEL != 8) || FILEANZ == 0)
62
{
63
printf("Usage: %s file [-T] [-Z] [-o] [-M] [-c]\n",argv[0]);
64
printf("\n");
65
printf("file: bravais_TYP containing the space group R or the finite unimodular\n");
66
printf(" group G.\n");
67
printf("\n");
68
printf("The program is used to give crystallographic groups a name, i.e.\n");
69
printf("compute a string which is depends only on the crystallographic\n");
70
printf("class of the group R/G, and determines it uniquely.\n");
71
printf("CAUTION: the program assumes the translation lattice to be Z^n.\n");
72
printf("If called with -Z, the program assumes file to contain a finite unimodular\n");
73
printf("group G, and will output a name for the arithmetic class of G.\n");
74
printf("Otherwise, it will assume file to contain generators for the space group\n");
75
printf("R, and will output a name for the affine class of R.\n");
76
printf("\n");
77
printf("Note that the first part of the name for a space group R is exactly the\n");
78
printf("name for the arithmetic class of the point group G of R.\n");
79
printf("\n");
80
printf("Options:\n");
81
printf("-h : gives this help.\n");
82
printf("-T : output a matrix transforming the given group R/G into CARAT's\n");
83
printf(" representative.\n");
84
printf("-o : output CARAT's representative for this affine/arithmetic class.\n");
85
printf("-Z : assume file to contain a finite unimodular group, more details\n");
86
printf(" see above.\n");
87
printf("-M : give short Hermann-Mauguin symbols to describe a group\n");
88
printf(" isomorphic to the given only (has an effect only if the\n");
89
printf(" degree of R is two or three)\n");
90
printf("-c : gives the CARAT name as\n"); // Oliver: 10.04.2002
91
printf(" \"Q-class-name\"-\"Z-class-name\"(-\"name for the affine class\")\n");
92
printf("\n");
93
printf("Cf.: Q_catalog, QtoZ, Extensions, Symbol, Standard_affine_form.\n");
94
95
if (FILEANZ == 0)
96
exit(0);
97
else
98
exit(31);
99
}
100
101
R = get_bravais(FILENAMES[0]);
102
103
if (is_option('Z')) {
104
P = copy_bravais(R);
105
}
106
else{
107
P = point_group(R,2);
108
}
109
110
database = load_database (DATABASE_NAME,P->dim);
111
112
T = q_class_inf (P,database,qname,symb,&DATAQ,&PRES,FALSE);
113
114
TZ = z_class_inf(P,DATAQ,&DATAZ,zname);
115
free_bravais(DATAQ);
116
117
118
if (is_option('Z')){
119
/* we are finished here */
120
if (is_option('c')){ // Oliver: 10.04.2002
121
printf("%s-%d.%d\n",qname,zname[0],zname[1]);
122
}
123
else{
124
printf("qname: %s ",qname);
125
printf("zname: %d %d\n",zname[0],zname[1]);
126
}
127
128
if (is_option('T')){
129
sprintf(comment,"transformation matrix for %s",FILENAMES[0]);
130
put_mat(TZ,NULL,comment,2);
131
}
132
133
if (is_option('o')){
134
sprintf(comment,"standard group for %s",FILENAMES[0]);
135
put_bravais(DATAZ,NULL,comment);
136
}
137
138
free_bravais(P);
139
free_bravais(R);
140
free_mat(TZ);
141
free_bravais(DATAZ);
142
free_database (database);
143
cleanup_prime();
144
145
if (INFO_LEVEL == 8) pointer_statistics(0,0);
146
147
exit(0);
148
}
149
150
extend(TZ);
151
Rnew = konj_bravais(R,TZ);
152
153
T = mat_inv(TZ); free_mat(TZ); TZ = T; T = NULL;
154
155
if (INFO_LEVEL & 4)
156
put_bravais(Rnew,NULL,NULL);
157
158
if (INFO_LEVEL & 4)
159
put_mat(TZ,NULL,"transformation matrix",2);
160
161
162
mpz_init(&aff_name);
163
164
if (is_option('o'))
165
T = aff_class_inf(Rnew,DATAZ,PRES,&aff_name,&RC);
166
else
167
T = aff_class_inf(Rnew,DATAZ,PRES,&aff_name,NULL);
168
169
/* put_mat(TZ,0,"TZ",0);
170
put_mat(T,0,"T",0); */
171
172
if (is_option('T')){
173
Check_mat(T);
174
Check_mat(TZ);
175
TI = long_mat_inv(T);
176
mat_muleq(TZ,TI);
177
put_mat(TZ,NULL,"transformation matrix",2);
178
free_mat(TI);
179
}
180
181
if (is_option('o')){
182
sprintf(comment,"standard group for %s",FILENAMES[0]);
183
put_bravais(RC,NULL,comment);
184
free_bravais(RC);
185
}
186
187
if (is_option('c')){ // Oliver: 10.04.2002
188
printf("%s-%d.%d-", qname, zname[0], zname[1]);
189
mpz_out_str(stdout, 10, &aff_name);
190
printf("\n");
191
}
192
else{
193
printf("qname: %s ",qname);
194
printf("zname: %d %d ",zname[0],zname[1]);
195
printf("aff_name: "); mpz_out_str(stdout,10,&aff_name); printf("\n");
196
}
197
198
if (is_option('M') && (R->dim == 4 || R->dim == 3)){
199
display_HM_symbol(qname,zname[0],zname[1],&aff_name);
200
}
201
202
free_mat(PRES);
203
free_mat(TZ);
204
free_mat(T);
205
free_bravais(P);
206
free_bravais(Rnew);
207
free_bravais(R);
208
free_bravais(DATAZ);
209
free_database (database);
210
mpz_clear(&aff_name);
211
cleanup_prime();
212
213
if (INFO_LEVEL == 8) pointer_statistics(0,0);
214
215
exit(0);
216
}
217
218