Orbiter 2022
Combinatorial Objects
exceptional_isomorphism_O4.cpp
Go to the documentation of this file.
1/*
2 * exceptional_isomorphism_O4.cpp
3 *
4 * Created on: Mar 30, 2019
5 * Author: betten
6 */
7
8
10#include "group_actions.h"
11
12using namespace std;
13
14
15namespace orbiter {
16namespace layer3_group_actions {
17namespace groups {
18
19
21{
22 Fq = NULL;
23 A2 = NULL;
24 A4 = NULL;
25 A5 = NULL;
26
27 E5a = NULL;
28 E4a = NULL;
29 E2a = NULL;
30 E2b = NULL;
31//null();
32}
33
35{
36 freeself();
37}
38
40{
41 Fq = NULL;
42 A2 = NULL;
43 A4 = NULL;
44 A5 = NULL;
45
46 E5a = NULL;
47 E4a = NULL;
48 E2a = NULL;
49 E2b = NULL;
50}
51
53{
54 int verbose_level = 0;
55 int f_v = (verbose_level >= 1);
56
57 null();
58 if (f_v) {
59 cout << "exceptional_isomorphism_O4::freeself finished" << endl;
60 }
61}
62
65 int verbose_level)
66{
67 int f_v = (verbose_level >= 1);
68
69 if (f_v) {
70 cout << "exceptional_isomorphism_O4::init" << endl;
71 }
76
77 if (A5) {
79 }
83 if (f_v) {
84 cout << "exceptional_isomorphism_O4::init done" << endl;
85 }
86}
87
88
90 int f_switch, int *mtx2x2_T, int *mtx2x2_S, int *Elt,
91 int verbose_level)
92{
93 int f_v = (verbose_level >= 1);
94 int mtx4x4[16];
95 int mtx5x5[25];
96 int *E1;
98
99 if (f_v) {
100 cout << "exceptional_isomorphism_O4::apply_2to4_embedded" << endl;
101 }
103 if (f_v) {
104 cout << "input in 2x2, 2x2:" << endl;
105 cout << "f_switch=" << f_switch << endl;
106 Int_vec_print_integer_matrix_width(cout, mtx2x2_T, 2, 2, 2, 3);
107 cout << "," << endl;
108 Int_vec_print_integer_matrix_width(cout, mtx2x2_S, 2, 2, 2, 3);
109 }
110
111 Algebra.O4_isomorphism_2to4(Fq, mtx2x2_T, mtx2x2_S, f_switch, mtx4x4);
112
113 A4->make_element(E1, mtx4x4, 0);
114 if (f_v) {
115 cout << "in 4x4:" << endl;
116 A4->element_print_quick(E1, cout);
117 }
118
119 apply_4_to_5(E1, mtx5x5, verbose_level - 2);
120 if (f_v) {
121 cout << "in 5x5:" << endl;
122 Int_vec_print_integer_matrix_width(cout, mtx5x5, 5, 5, 5, 3);
123 }
124 A5->make_element(Elt, mtx5x5, 0);
125 if (f_v) {
126 cout << "as group element:" << endl;
127 A5->element_print_quick(Elt, cout);
128 }
129 FREE_int(E1);
130 if (f_v) {
131 cout << "exceptional_isomorphism_O4::apply_2to4_embedded "
132 "done" << endl;
133 }
134}
135
137 int *mtx4x4, int *mtx5x5, int verbose_level)
138{
139 int f_v = (verbose_level >= 1);
140 int Data[25];
141 int u, v;
142
143 if (f_v) {
144 cout << "exceptional_isomorphism_O4::apply_5_to_4" << endl;
145 }
146 Int_vec_copy(mtx5x5, Data, 25);
148 if (f_v) {
149 cout << "as 5 x 5:" << endl;
150 Int_vec_print_integer_matrix_width(cout, Data, 5, 5, 5, 3);
151 }
152
153 for (u = 0; u < 4; u++) {
154 for (v = 0; v < 4; v++) {
155 mtx4x4[u * 4 + v] = Data[(u + 1) * 5 + v + 1];
156 }
157 }
158 if (f_v) {
159 cout << "as 4 x 4:" << endl;
160 Int_vec_print_integer_matrix_width(cout, mtx4x4, 4, 4, 4, 3);
161 }
162 if (f_v) {
163 cout << "exceptional_isomorphism_O4::apply_5_to_4 done" << endl;
164 }
165}
166
168 int *E4, int *E5, int verbose_level)
169{
170 int f_v = (verbose_level >= 1);
171 int i, j;
172 int value;
173 int sqrt_value, sqrt_inv;
174 int discrete_log;
175 int gram[16];
176 int M5[26];
177 //int M5t[26];
178 int M4[16];
179 int M4t[16];
180 int mtx_tmp1[16];
181 int mtx_tmp2[16];
182 //int M5_tmp1[25];
183 //int M5_tmp2[25];
184 int Gram5[25];
185 int Gram5_transformed[25];
186 int ord4, ord4b, ord5;
187 int *E4b;
188
189 if (f_v) {
190 cout << "exceptional_isomorphism_O4::apply_4_to_5" << endl;
191 }
192 E4b = NEW_int(A4->elt_size_in_int);
193 if (f_v) {
194 cout << "E4:" << endl;
195 A4->element_print_quick(E4, cout);
196 }
197 ord4 = A4->element_order(E4);
198 if (f_v) {
199 cout << "ord4=" << ord4 << endl;
200 }
201
202 Int_vec_copy(E4, M4, 16);
203 Int_vec_zero(gram, 16);
204 gram[0 * 4 + 1] = 1;
205 gram[1 * 4 + 0] = 1;
206 gram[2 * 4 + 3] = 1;
207 gram[3 * 4 + 2] = 1;
208
209 Fq->Linear_algebra->transpose_matrix(M4, M4t, 4, 4);
210 if (f_v) {
211 cout << "Gram matrix:" << endl;
212 Int_vec_print_integer_matrix_width(cout, gram, 4, 4, 4, 3);
213 cout << "M4:" << endl;
214 Int_vec_print_integer_matrix_width(cout, M4, 4, 4, 4, 3);
215 cout << "M4t:" << endl;
216 Int_vec_print_integer_matrix_width(cout, M4t, 4, 4, 4, 3);
217 }
218 Fq->Linear_algebra->mult_matrix_matrix(M4, gram, mtx_tmp1, 4, 4, 4,
219 0 /* verbose_level */);
220 Fq->Linear_algebra->mult_matrix_matrix(mtx_tmp1, M4t, mtx_tmp2, 4, 4, 4,
221 0 /* verbose_level */);
222 if (f_v) {
223 cout << "transformed Gram matrix:" << endl;
224 Int_vec_print_integer_matrix_width(cout, mtx_tmp2, 4, 4, 4, 3);
225 }
226
227 value = 0;
228 for (i = 0; i < 16; i++) {
229 if (!mtx_tmp2[i]) {
230 continue;
231 }
232 if (value == 0) {
233 value = mtx_tmp2[i];
234 continue;
235 }
236 if (value != mtx_tmp2[i]) {
237 cout << "the transformed Gram matrix "
238 "has several values" << endl;
239 exit(1);
240 }
241 value = mtx_tmp2[i];
242 }
243
244 if (f_v) {
245 cout << "value=" << value << endl;
246 }
247 discrete_log = Fq->log_alpha(value);
248
249 if (f_v) {
250 cout << "discrete_log=" << discrete_log << endl;
251 }
252 if (ODD(discrete_log)) {
253 cout << "value is not a square: discrete_log=" << discrete_log << endl;
254 exit(1);
255 }
256 sqrt_value = Fq->alpha_power(discrete_log >> 1);
257 if (f_v) {
258 cout << "prim elt=" << Fq->alpha_power(1) << endl;
259 }
260 if (f_v) {
261 cout << "sqrt_value=" << sqrt_value << endl;
262 }
263 sqrt_inv = Fq->inverse(sqrt_value);
264 if (f_v) {
265 cout << "sqrt_inv=" << sqrt_inv << endl;
266 }
267 for (i = 0; i < 16; i++) {
268 M4[i] = Fq->mult(M4[i], sqrt_inv);
269 }
270 A4->make_element(E4b, M4, 0);
271 if (f_v) {
272 cout << "E4b:" << endl;
273 A4->element_print_quick(E4b, cout);
274 }
275 ord4b = A4->element_order(E4b);
276 if (f_v) {
277 cout << "ord4b=" << ord4b << endl;
278 }
280 ord4b, 0 /*verbose_level*/);
281
282 if (f_v) {
283 cout << "E4b^" << ord4b << "=" << endl;
284 A4->element_print_quick(E4b, cout);
285 }
286
287 Int_vec_zero(M5, 26); // 26 in case we are semilinear
288
289 M5[0] = 1;
290 //M5[0] = sqrt_value;
291 for (i = 0; i < 4; i++) {
292 for (j = 0; j < 4; j++) {
293 M5[(i + 1) * 5 + j + 1] = M4[i * 4 + j];
294 }
295 }
296
297 A5->make_element(E5, M5, 0);
298 if (f_v) {
299 cout << "E5:" << endl;
300 A5->element_print_quick(E5, cout);
301 }
302
303
304 Int_vec_zero(Gram5, 25);
305 Gram5[0 * 5 + 0] = Fq->add(1, 1);
306 Gram5[1 * 5 + 2] = 1;
307 Gram5[2 * 5 + 1] = 1;
308 Gram5[3 * 5 + 4] = 1;
309 Gram5[4 * 5 + 3] = 1;
310
311 if (f_v) {
312 cout << "Gram5 matrix:" << endl;
313 Int_vec_print_integer_matrix_width(cout, Gram5, 5, 5, 5, 3);
314 cout << "M5:" << endl;
315 Int_vec_print_integer_matrix_width(cout, M5, 5, 5, 5, 3);
316 }
317
318
319 Fq->Linear_algebra->transform_form_matrix(M5, Gram5, Gram5_transformed, 5, 0 /* verbose_level */);
320 // computes Gram_transformed = A * Gram * A^\top
321
322
323#if 0
324 Fq->transpose_matrix(M5, M5t, 5, 5);
325#endif
326
327#if 0
328 Fq->mult_matrix_matrix(M5, gram5, M5_tmp1, 5, 5, 5,
329 0 /* verbose_level */);
330 Fq->mult_matrix_matrix(M5_tmp1, M5t, M5_tmp2, 5, 5, 5,
331 0 /* verbose_level */);
332#endif
333 if (f_v) {
334 cout << "transformed Gram5 matrix:" << endl;
335 Int_vec_print_integer_matrix_width(cout, Gram5_transformed, 5, 5, 5, 3);
336 }
337 ord5 = A5->element_order(E5);
338 if (f_v) {
339 cout << "ord4=" << ord4 << " ord5=" << ord5 << endl;
340 }
341 FREE_int(E4b);
342 if (f_v) {
343 cout << "exceptional_isomorphism_O4::apply_4_to_5 done" << endl;
344 }
345}
346
348 int *E4, int &f_switch, int *E2_a, int *E2_b,
349 int verbose_level)
350{
351 int f_v = (verbose_level >= 1);
352 int Data[16];
353 int M2a[4];
354 int M2b[4];
356
357 if (f_v) {
358 cout << "exceptional_isomorphism_O4::apply_4_to_2" << endl;
359 }
360 if (f_v) {
361 cout << "E4:" << endl;
362 A4->element_print_quick(E4, cout);
363 }
364 Int_vec_copy(E4, Data, 16);
366 if (f_v) {
367 cout << "as 4 x 4:" << endl;
368 Int_vec_print_integer_matrix_width(cout, Data, 4, 4, 4, 3);
369 }
370 Algebra.O4_isomorphism_4to2(Fq, M2a, M2b,
371 f_switch, Data, 0 /*verbose_level*/);
372 A2->make_element(E2_a, M2a, 0);
373 A2->make_element(E2_b, M2b, 0);
374 if (f_v) {
375 cout << "as 2 x 2:" << endl;
376 cout << "f_switch=" << f_switch << endl;
377 cout << "E2_a=" << endl;
378 A2->element_print_quick(E2_a, cout);
379 cout << "E2_b=" << endl;
380 A2->element_print_quick(E2_b, cout);
381 }
382 if (f_v) {
383 cout << "exceptional_isomorphism_O4::apply_4_to_2 done" << endl;
384 }
385}
386
388 int &f_switch, int *E2_a, int *E2_b, int *E4,
389 int verbose_level)
390{
391 int f_v = (verbose_level >= 1);
392 int Data[16];
394
395 if (f_v) {
396 cout << "exceptional_isomorphism_O4::apply_2_to_4" << endl;
397 }
398 if (f_v) {
399 cout << "as 2 x 2:" << endl;
400 cout << "f_switch=" << f_switch << endl;
401 cout << "E2_a=" << endl;
402 A2->element_print_quick(E2_a, cout);
403 cout << "E2_b=" << endl;
404 A2->element_print_quick(E2_b, cout);
405 }
406
407 Algebra.O4_isomorphism_2to4(Fq,
408 E2_a, E2_b, f_switch, Data);
409
410 A4->make_element(E4, Data, 0);
411 if (f_v) {
412 cout << "E4:" << endl;
413 A4->element_print_quick(E4, cout);
414 }
415
416 if (f_v) {
417 cout << "exceptional_isomorphism_O4::apply_2_to_4 done" << endl;
418 }
419}
420
422{
423 int small[8], f_switch, r, order;
424 int *elt1;
426
427 elt1 = NEW_int(A2->elt_size_in_int);
428 Algebra.O4_isomorphism_4to2(Fq,
429 small, small + 4,
430 f_switch, mtx4x4, 0/*verbose_level*/);
431 //cout << "after isomorphism:" << endl;
432 //cout << "f_switch=" << f_switch << endl;
433 for (r = 0; r < 2; r++) {
434 cout << "component " << r << ":" << endl;
435 Fq->PG_element_normalize_from_front(small + r * 4, 1, 4);
436 Int_vec_print_integer_matrix_width(cout, small + r * 4, 2, 2, 2, 3);
437 A2->make_element(elt1, small + r * 4, 0);
438 order = A2->element_order(elt1);
439 cout << "has order " << order << endl;
440 A2->element_print_as_permutation(elt1, cout);
441 cout << endl;
442 A2->element_print_quick(elt1, cout);
443 cout << endl;
444
445 }
446 FREE_int(elt1);
447}
448
449#if 0
450static void print_from_to(int d, int i, int j, int *v1, int *v2)
451{
452 cout << i << "=";
453 int_vec_print(cout, v1, d);
454 cout << " -> " << j << " = ";
455 int_vec_print(cout, v2, d);
456 cout << endl;
457}
458#endif
459
460
461}}}
462
global functions related to finite fields, irreducible polynomials and such
Definition: algebra.h:130
void O4_isomorphism_4to2(field_theory::finite_field *F, int *At, int *As, int &f_switch, int *B, int verbose_level)
void O4_isomorphism_2to4(field_theory::finite_field *F, int *At, int *As, int f_switch, int *B)
void transform_form_matrix(int *A, int *Gram, int *new_Gram, int d, int verbose_level)
void transpose_matrix(int *A, int *At, int ma, int na)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_quick(void *elt, std::ostream &ost)
Definition: action_cb.cpp:353
void element_power_int_in_place(int *Elt, int n, int verbose_level)
Definition: action.cpp:2000
void make_element(int *Elt, int *data, int verbose_level)
Definition: action.cpp:1875
void element_print_as_permutation(void *elt, std::ostream &ost)
Definition: action_cb.cpp:421
void apply_4_to_2(int *E4, int &f_switch, int *E2_a, int *E2_b, int verbose_level)
void init(field_theory::finite_field *Fq, actions::action *A2, actions::action *A4, actions::action *A5, int verbose_level)
void apply_2to4_embedded(int f_switch, int *mtx2x2_T, int *mtx2x2_S, int *Elt, int verbose_level)
void apply_2_to_4(int &f_switch, int *E2_a, int *E2_b, int *E4, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_int(n)
Definition: foundations.h:625
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
Definition: foundations.h:691
#define ODD(x)
Definition: foundations.h:222
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
the orbiter library for the classification of combinatorial objects