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: 418384
1
#include"typedef.h"
2
#include"longtools.h"
3
#include"getput.h"
4
#include"bravais.h"
5
#include"symm.h"
6
#include"autgrp.h"
7
#include"matrix.h"
8
#include"voronoi.h"
9
#include"polyeder.h"
10
11
12
int INFO_LEVEL;
13
extern int SFLAG;
14
15
main (int argc, char *argv[])
16
{
17
18
bravais_TYP *G,
19
*G_tr,
20
*H,
21
*H_tr;
22
23
matrix_TYP *erg;
24
25
char comment[1000];
26
27
int i,
28
tmp;
29
30
read_header(argc, argv);
31
if ((FILEANZ < 2) || (is_option('h') && optionnumber('h') ==0)){
32
printf("Usage: %s 'file1' 'file2'\n",argv[0]);
33
printf("\n");
34
printf("file1: bravais_TYP containing G.\n");
35
printf("file2: bravais_TYP containing H.\n");
36
printf("\n");
37
printf("Tests whether the BRAVAIS GROUPS of the groups\n");
38
printf("G and H respectively are conjugated in GL_n(Z).\n");
39
printf("If so, it returns a conjugating matrix X which conjugates\n");
40
printf("the BRAVAIS GROUPS, ie. X^1 B(G) X = B(H).\n");
41
printf("\n");
42
printf("WARNING: The procedure may involve calculating the normalizer\n");
43
printf(" of the groups. This may be very time comsuming,\n");
44
printf(" especially when both groups are <-I_n>, where n>5.\n");
45
if (is_option('h')){
46
exit(0);
47
}
48
else{
49
exit(31);
50
}
51
}
52
53
INFO_LEVEL = optionnumber('h');
54
if (INFO_LEVEL & 12){
55
SFLAG = 1;
56
}
57
58
G = get_bravais(FILENAMES[0]);
59
H = get_bravais(FILENAMES[1]);
60
61
/* we might not deal with th whole bravais group */
62
G->order = H->order = 0;
63
64
/* paranoia setting: recalculate the formspace because it has to be a
65
Z-basis */
66
if (G->form !=NULL){
67
for (i=0;i<G->form_no;i++){
68
free_mat(G->form[i]);
69
}
70
free(G->form);
71
}
72
G->form = formspace(G->gen,G->gen_no,1,&tmp);
73
G->form_no = tmp;
74
if (H->form !=NULL){
75
for (i=0;i<H->form_no;i++){
76
free_mat(H->form[i]);
77
}
78
free(H->form);
79
}
80
H->form = formspace(H->gen,H->gen_no,1,&tmp);
81
H->form_no = tmp;
82
83
G_tr = tr_bravais(G,1,FALSE);
84
H_tr = tr_bravais(H,1,FALSE);
85
86
/* output for debugging purposes
87
put_bravais(G,NULL,NULL);
88
put_bravais(H,NULL,NULL); */
89
90
erg = is_z_equivalent(G,G_tr,H,H_tr);
91
92
if (erg == NULL){
93
printf("the bravais groups are not conjugated\n");
94
}
95
else{
96
sprintf(comment,"conjugates the group of %s in the group of %s",
97
FILENAMES[0],FILENAMES[1]);
98
put_mat(erg,NULL,comment,2);
99
free_mat(erg);
100
}
101
102
/* output the groups again, just to make sure we didn't change
103
them */
104
if (INFO_LEVEL == 5){
105
put_bravais(H,NULL,NULL);
106
put_bravais(H_tr,NULL,NULL);
107
}
108
109
free_bravais(G);
110
free_bravais(G_tr);
111
free_bravais(H);
112
free_bravais(H_tr);
113
114
115
if (INFO_LEVEL & 12){
116
pointer_statistics(0,0);
117
}
118
exit(0);
119
}
120
121