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

563665 views
1
#include "typedef.h"
2
#include "getput.h"
3
#include "name.h"
4
#include "gmp.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 "base.h"
12
#include "zass.h"
13
#include "longtools.h"
14
#include "idem.h"
15
16
matrix_TYP *z_equivalent(bravais_TYP *G,
17
bravais_TYP **G_tr,
18
bravais_TYP *H)
19
{
20
21
bravais_TYP *H_tr,
22
*G_neu,
23
*Aut;
24
25
matrix_TYP *erg,
26
**base,
27
**N,
28
**forms,
29
*SV,
30
*A,
31
*id;
32
33
bahn **strong;
34
35
int i,
36
tmp;
37
38
if (G->form == NULL){
39
G->form = formspace(G->gen,G->gen_no,1,&tmp);
40
G->form_no = tmp;
41
}
42
43
if (H->form == NULL){
44
H->form = formspace(H->gen,H->gen_no,1,&tmp);
45
H->form_no = tmp;
46
}
47
48
if (*G_tr == NULL)
49
*G_tr = tr_bravais(G,1,FALSE);
50
51
H_tr = tr_bravais(H,1,FALSE);
52
53
54
/* look whether the bravais groups have the same type */
55
erg = is_z_equivalent(G,*G_tr,H,H_tr);
56
57
if (INFO_LEVEL & 4){
58
printf("nach is_z_equivalent\n");
59
put_mat(erg,"erg","erg",2);
60
}
61
62
if (erg != NULL){
63
/* conjugate the groups with this element */
64
G_neu = konj_bravais(G,erg);
65
66
/* G_neu is not nessesarily the whole bravais_group */
67
/* and apply a trick to speed up for large generating sets */
68
id = init_mat(G->dim,G->dim,"1");
69
A = rform(G_neu->gen,G_neu->gen_no,id,101);
70
free_mat(id);
71
72
73
forms = (matrix_TYP **) malloc((G->form_no+1)*sizeof(matrix_TYP *));
74
forms[0] = A;
75
SV = short_vectors(A,max_diagonal_entry(A),0,0,0,&i);
76
for (i=0;i<G_neu->form_no;i++){forms[i+1] = G_neu->form[i];}
77
Aut = autgrp(forms,G_neu->form_no+1,SV,NULL,0,NULL);
78
free_mat(SV);
79
free_mat(A);
80
free(forms);
81
82
/* stick the right elements into N, i.e. the generators of Aut and
83
the generators of the normlizer of G_neu */
84
N = (matrix_TYP **) malloc((G_neu->normal_no + Aut->gen_no) *
85
sizeof(matrix_TYP *));
86
for (i=0;i<(G_neu->normal_no+Aut->gen_no);i++){
87
if (i<G_neu->normal_no){
88
N[i] = G_neu->normal[i];
89
}
90
else{
91
N[i] = Aut->gen[i-G_neu->normal_no];
92
}
93
}
94
95
96
/* get strong generators for G_neu */
97
base = get_base(G_neu);
98
strong = strong_generators(base,G_neu,FALSE);
99
G_neu->order = size(strong);
100
if (is_option('d')) put_bravais(G_neu,NULL,NULL);
101
102
/* let's see whether we can conjugate G_neu to a be a supergroup
103
of H */
104
A = conjugated(G_neu,H,N,G_neu->normal_no + Aut->gen_no, strong);
105
106
/* we will need this space for strong generators for H */
107
for (i=0;i<G->dim;i++){
108
free_bahn(strong[i]);
109
free(strong[i]);
110
}
111
free(strong);
112
113
if (A==NULL){
114
/* the groups have the same bravais type, but are not conjugates */
115
free_mat(erg);
116
erg = NULL;
117
}
118
else{
119
/* they are conjugate iff the have the same order */
120
strong = strong_generators(base,H,FALSE);
121
if (size(strong) == G_neu->order){
122
mat_muleq(A,erg);
123
free_mat(erg);
124
erg = A;
125
A = NULL;
126
}
127
else{
128
free_mat(erg);
129
erg = NULL;
130
free_mat(A);
131
}
132
for (i=0;i<G->dim;i++){
133
free_bahn(strong[i]);
134
free(strong[i]);
135
}
136
free(strong);
137
}
138
139
/* cleaning up */
140
free_bravais(G_neu);
141
free(N);
142
free_bravais(Aut);
143
for (i=0;i<G->dim;i++) free_mat(base[i]);
144
free(base);
145
}
146
147
free_bravais(H_tr);
148
149
return erg;
150
151
}
152
153
154