Orbiter 2022
Combinatorial Objects
any_group_linear.cpp
Go to the documentation of this file.
1/*
2 * any_group_linear.cpp
3 *
4 * Created on: Sep 27, 2021
5 * Author: betten
6 */
7
8
9#include "orbiter.h"
10
11using namespace std;
12using namespace orbiter::layer1_foundations;
13
14namespace orbiter {
15namespace layer5_applications {
16namespace apps_algebra {
17
19{
20 int f_v = (verbose_level >= 1);
21
22 if (f_v) {
23 cout << "any_group::classes_based_on_normal_form" << endl;
24 }
25
26 if (!f_linear_group) {
27 cout << "any_group::classes_based_on_normal_form !f_linear_group" << endl;
28 exit(1);
29 }
30 groups::sims *G;
32
33 G = LG->Strong_gens->create_sims(verbose_level);
34
35
37 G,
38 label,
40 verbose_level);
41
42 FREE_OBJECT(G);
43 if (f_v) {
44 cout << "any_group::classes_based_on_normal_form done" << endl;
45 }
46}
47
48
49void any_group::classes(int verbose_level)
50{
51 int f_v = (verbose_level >= 1);
52
53 if (f_v) {
54 cout << "any_group::classes" << endl;
55 }
56
57 if (!f_linear_group) {
58 cout << "any_group::classes !f_linear_group" << endl;
59 exit(1);
60 }
61
62 groups::sims *G;
63
64 G = LG->Strong_gens->create_sims(verbose_level);
65
66 if (f_v) {
67 cout << "any_group::classes "
68 "before A2->conjugacy_classes_and_normalizers" << endl;
69 }
71 label, label_tex, verbose_level);
72 if (f_v) {
73 cout << "any_group::classes "
74 "after A2->conjugacy_classes_and_normalizers" << endl;
75 }
76
77 FREE_OBJECT(G);
78 if (f_v) {
79 cout << "any_group::classes done" << endl;
80 }
81}
82
83void any_group::find_singer_cycle(int verbose_level)
84{
85 int f_v = (verbose_level >= 1);
86
87 if (f_v) {
88 cout << "any_group::find_singer_cycle" << endl;
89 }
90 if (!f_linear_group) {
91 cout << "any_group::find_singer_cycle !f_linear_group" << endl;
92 exit(1);
93 }
94
96
97 Algebra.find_singer_cycle(this,
98 A, A,
99 verbose_level);
100 if (f_v) {
101 cout << "any_group::find_singer_cycle done" << endl;
102 }
103}
104
105void any_group::search_element_of_order(int order, int verbose_level)
106{
107 int f_v = (verbose_level >= 1);
108
109 if (f_v) {
110 cout << "any_group::search_element_of_order" << endl;
111 }
112 if (!f_linear_group) {
113 cout << "any_group::search_element_of_order !f_linear_group" << endl;
114 exit(1);
115 }
117
118 Algebra.search_element_of_order(this,
119 A, A,
120 order, verbose_level);
121
122 if (f_v) {
123 cout << "any_group::search_element_of_order done" << endl;
124 }
125}
126
128 int order_b,
129 int order_ab,
130 int verbose_level)
131{
132 int f_v = (verbose_level >= 1);
133
134 if (f_v) {
135 cout << "any_group::find_standard_generators" << endl;
136 }
137 if (!f_linear_group) {
138 cout << "any_group::find_standard_generators !f_linear_group" << endl;
139 exit(1);
140 }
142
143 Algebra.find_standard_generators(this,
144 A, A,
145 order_a, order_b, order_ab, verbose_level);
146
147 if (f_v) {
148 cout << "any_group::find_standard_generators done" << endl;
149 }
150
151}
152
153
154void any_group::isomorphism_Klein_quadric(std::string &fname, int verbose_level)
155{
156 int f_v = (verbose_level >= 1);
157 int f_vv = (verbose_level >= 5);
158
159 if (f_v) {
160 cout << "any_group::isomorphism_Klein_quadric" << endl;
161 }
162
163 if (!f_linear_group) {
164 cout << "any_group::isomorphism_Klein_quadric !f_linear_group" << endl;
165 exit(1);
166 }
167
169 groups::sims *H;
171
172 F = LG->F;
173 //G = LG->initial_strong_gens->create_sims(verbose_level);
174 H = LG->Strong_gens->create_sims(verbose_level);
175
176 //cout << "group order G = " << G->group_order_int() << endl;
177 cout << "group order H = " << H->group_order_lint() << endl;
178
179 int *Elt;
180
181 Elt = NEW_int(A->elt_size_in_int);
182
183
184 cout << "Reading file " << fname << " of size " << Fio.file_size(fname) << endl;
185
186 int *M;
187 int m, n;
188 Fio.int_matrix_read_csv(fname, M, m, n, verbose_level);
189
190 cout << "Read a set of size " << m << endl;
191
192 if (n != A->make_element_size) {
193 cout << "n != A->make_element_size" << endl;
194 exit(1);
195 }
196
197
198
199
200
201 int i, j, c;
202 int Basis1[] = {
203#if 1
204 1,0,0,0,0,0,
205 0,1,0,0,0,0,
206 0,0,1,0,0,0,
207 0,0,0,1,0,0,
208 0,0,0,0,1,0,
209 0,0,0,0,0,1,
210#else
211 1,0,0,0,0,0,
212 0,0,0,0,0,1,
213 0,1,0,0,0,0,
214 0,0,0,0,-1,0,
215 0,0,1,0,0,0,
216 0,0,0,1,0,0,
217#endif
218 };
219 //int Basis1b[36];
220 int Basis2[36];
221 int An2[37];
222 int v[6];
223 int w[6];
224 int C[36];
225 int D[36];
226 int E[36];
227 int B[] = {
228 1,0,0,0,0,0,
229 0,0,0,2,0,0,
230 1,3,0,0,0,0,
231 0,0,0,1,3,0,
232 1,0,2,0,0,0,
233 0,0,0,2,0,4,
234 };
235 int Target[] = {
236 1,0,0,0,0,0,
237 3,2,2,0,0,0,
238 1,4,2,0,0,0,
239 0,0,0,1,0,0,
240 0,0,0,3,2,2,
241 0,0,0,1,4,2,
242 };
243 int Bv[36];
245
246#if 0
247 for (i = 0; i < 6; i++) {
248 if (Basis1[i] == -1) {
249 Basis1b[i] = F->negate(1);
250 }
251 else {
252 Basis1b[i] = Basis1[i];
253 }
254 }
255#endif
256
257 for (i = 0; i < 6; i++) {
258 F->klein_to_wedge(Basis1 + i * 6, Basis2 + i * 6);
259 }
260
261 F->Linear_algebra->matrix_inverse(B, Bv, 6, 0 /* verbose_level */);
262
263
264 for (i = 0; i < m; i++) {
265
266 A->make_element(Elt, M + i * A->make_element_size, 0);
267
268 if ((i % 10000) == 0) {
269 cout << i << " / " << m << endl;
270 }
271
272 if (f_vv) {
273 cout << "Element " << i << " / " << m << endl;
274 A->element_print(Elt, cout);
275 cout << endl;
276 }
277
278 F->Linear_algebra->exterior_square(Elt, An2, 4, 0 /*verbose_level*/);
279
280 if (f_vv) {
281 cout << "Exterior square:" << endl;
282 Int_matrix_print(An2, 6, 6);
283 cout << endl;
284 }
285
286 for (j = 0; j < 6; j++) {
287 F->Linear_algebra->mult_vector_from_the_left(Basis2 + j * 6, An2, v, 6, 6);
288 // v[m], A[m][n], vA[n]
289 F->wedge_to_klein(v /* W */, w /*K*/);
290 Int_vec_copy(w, C + j * 6, 6);
291 }
292
293 int Gram[] = {
294 0,1,0,0,0,0,
295 1,0,0,0,0,0,
296 0,0,0,1,0,0,
297 0,0,1,0,0,0,
298 0,0,0,0,0,1,
299 0,0,0,0,1,0,
300 };
301 int new_Gram[36];
302
304 new_Gram, 6, 0 /* verbose_level*/);
305
306 if (f_vv) {
307 cout << "Transformed Gram matrix:" << endl;
308 Int_matrix_print(new_Gram, 6, 6);
309 cout << endl;
310 }
311
312
313 if (f_vv) {
314 cout << "orthogonal matrix :" << endl;
315 Int_matrix_print(C, 6, 6);
316 cout << endl;
317 }
318
319 F->Linear_algebra->mult_matrix_matrix(Bv, C, D, 6, 6, 6, 0 /*verbose_level */);
320 F->Linear_algebra->mult_matrix_matrix(D, B, E, 6, 6, 6, 0 /*verbose_level */);
321
323
324 if (f_vv) {
325 cout << "orthogonal matrix in the special form:" << endl;
326 Int_matrix_print(E, 6, 6);
327 cout << endl;
328 }
329
330 int special_Gram[] = {
331 0,0,0,3,4,1,
332 0,0,0,4,1,3,
333 0,0,0,1,3,4,
334 3,4,1,0,0,0,
335 4,1,3,0,0,0,
336 1,3,4,0,0,0,
337 };
338 int new_special_Gram[36];
339
340 F->Linear_algebra->transform_form_matrix(E, special_Gram,
341 new_special_Gram, 6, 0 /* verbose_level*/);
342
343 if (f_vv) {
344 cout << "Transformed special Gram matrix:" << endl;
345 Int_matrix_print(new_special_Gram, 6, 6);
346 cout << endl;
347 }
348
349
350
351 c = Sorting.integer_vec_compare(E, Target, 36);
352 if (c == 0) {
353 cout << "We found it! i=" << i << " element = ";
355 cout << endl;
356
357 cout << "Element :" << endl;
358 A->element_print(Elt, cout);
359 cout << endl;
360
361 cout << "exterior square :" << endl;
362 Int_matrix_print(An2, 6, 6);
363 cout << endl;
364
365 cout << "orthogonal matrix :" << endl;
366 Int_matrix_print(C, 6, 6);
367 cout << endl;
368
369 cout << "orthogonal matrix in the special form:" << endl;
370 Int_matrix_print(E, 6, 6);
371 cout << endl;
372
373 //exit(1);
374 }
375
376
377 }
378
379 FREE_int(Elt);
380 FREE_int(M);
381 FREE_OBJECT(H);
382
383 if (f_v) {
384 cout << "any_group::isomorphism_Klein_quadric" << endl;
385 }
386}
387
390 int depth, int verbose_level)
391{
392 int f_v = (verbose_level >= 1);
393
394 if (f_v) {
395 cout << "any_group::do_orbits_on_subspaces" << endl;
396 }
397
398
399
400
401
402 if (!f_linear_group) {
403 cout << "any_group::do_orbits_on_subspaces !f_linear_group" << endl;
404 exit(1);
405 }
406
407
409
411
412 OoS->init(GTA, Control, depth, verbose_level);
413
414
415 //finite_field *F;
416
417 //F = LG->F;
418
419
420 FREE_OBJECT(OoS);
421
422
423 if (f_v) {
424 cout << "any_group::do_orbits_on_subspaces done" << endl;
425 }
426}
427
429 poset_classification::poset_classification_control *Control, int depth, int verbose_level)
430{
431 int f_v = (verbose_level >= 1);
432
433 if (f_v) {
434 cout << "any_group::do_tensor_classify" << endl;
435 }
436
437 if (!f_linear_group) {
438 cout << "any_group::do_tensor_classify !f_linear_group" << endl;
439 exit(1);
440 }
441
443
444 F = LG->F;
445
446
447
448
450
452
453 if (f_v) {
454 cout << "any_group::do_tensor_classify before T->init" << endl;
455 }
456 T->init(F, LG, verbose_level - 1);
457 if (f_v) {
458 cout << "any_group::do_tensor_classify after T->init" << endl;
459 }
460
461 if (f_v) {
462 cout << "any_group::do_tensor_classify before classify_poset" << endl;
463 }
464 T->classify_poset(depth,
465 Control,
466 verbose_level);
467 if (f_v) {
468 cout << "any_group::do_tensor_classify after classify_poset" << endl;
469 }
470
471
472
473 FREE_OBJECT(T);
474
475 if (f_v) {
476 cout << "any_group::do_tensor_classify done" << endl;
477 }
478}
479
480
482{
483 int f_v = (verbose_level >= 1);
484
485 if (f_v) {
486 cout << "any_group::do_tensor_permutations" << endl;
487 }
488
489 if (!f_linear_group) {
490 cout << "any_group::do_tensor_permutations !f_linear_group" << endl;
491 exit(1);
492 }
494
495 F = LG->F;
496
497
499
501
502 T->init(F, LG, verbose_level - 1);
503
504
505 FREE_OBJECT(T);
506
507 if (f_v) {
508 cout << "any_group::do_tensor_permutations done" << endl;
509 }
510}
511
512
515 int minimum_distance,
516 int target_size, int verbose_level)
517{
518 int f_v = (verbose_level >= 1);
519
520 if (f_v) {
521 cout << "any_group::do_linear_codes" << endl;
522 }
523
524 if (!f_linear_group) {
525 cout << "any_group::do_linear_codes !f_linear_group" << endl;
526 exit(1);
527 }
528
529
531
532 if (f_v) {
533 cout << "any_group::do_linear_codes before "
534 "Algebra.linear_codes_with_bounded_minimum_distance" << endl;
535 }
536
538 Control, LG,
539 minimum_distance, target_size, verbose_level);
540
541 if (f_v) {
542 cout << "any_group::do_linear_codes after "
543 "Algebra.linear_codes_with_bounded_minimum_distance" << endl;
544 }
545
546
547 if (f_v) {
548 cout << "any_group::do_linear_codes done" << endl;
549 }
550}
551
554 apps_geometry::ovoid_classify_description *Ovoid_classify_description,
555 int verbose_level)
556{
557 int f_v = (verbose_level >= 1);
558
559 if (f_v) {
560 cout << "any_group::do_classify_ovoids" << endl;
561 }
562
563 if (!f_linear_group) {
564 cout << "any_group::do_classify_ovoids !f_linear_group" << endl;
565 exit(1);
566 }
567
568 apps_geometry::ovoid_classify *Ovoid_classify;
569
570
572
573 Ovoid_classify_description->Control = Control;
574
575 Ovoid_classify->init(Ovoid_classify_description,
576 LG,
577 verbose_level);
578
579 FREE_OBJECT(Ovoid_classify);
580
581 if (f_v) {
582 cout << "any_group::do_classify_ovoids done" << endl;
583 }
584}
585
586
587
589 int len, long int *S, int verbose_level)
590{
591
592 //cout << "any_group::subspace_orbits_test_set temporarily disabled" << endl;
594
595#if 1
596 int f_v = TRUE;//(verbose_level >= 1);
597 int f_vv = (verbose_level >= 2);
598 int ret = TRUE;
599 int rk;
600 int n;
602 int *orbits_on_subspaces_M;
603 int *orbits_on_subspaces_base_cols;
604
605
606
607 if (f_v) {
608 cout << "any_group::subspace_orbits_test_set" << endl;
609 }
610
611 if (!f_linear_group) {
612 cout << "any_group::subspace_orbits_test_set !f_linear_group" << endl;
613 exit(1);
614 }
615
616 if (f_v) {
617 cout << "Testing set ";
618 Lint_vec_print(cout, S, len);
619 cout << endl;
620 cout << "LG->n=" << LG->n << endl;
621 }
622
623 n = LG->n;
624 F = LG->F;
625
626 orbits_on_subspaces_M = NEW_int(len * n);
627 orbits_on_subspaces_base_cols = NEW_int(n);
628
630 orbits_on_subspaces_M, len, n, S);
631
632 if (f_vv) {
633 cout << "coordinate matrix:" << endl;
635 orbits_on_subspaces_M, len, n, n, F->log10_of_q);
636 }
637
638 rk = F->Linear_algebra->Gauss_simple(orbits_on_subspaces_M, len, n,
639 orbits_on_subspaces_base_cols, 0 /*verbose_level - 2*/);
640
641 if (f_v) {
642 cout << "the matrix has rank " << rk << endl;
643 }
644
645 FREE_int(orbits_on_subspaces_base_cols);
646 FREE_int(orbits_on_subspaces_M);
647
648 if (rk < len) {
649 ret = FALSE;
650 }
651
652#if 0
653 if (ret) {
654 if (f_has_extra_test_func) {
655 ret = (*extra_test_func)(this,
656 len, S, extra_test_func_data, verbose_level);
657 }
658 }
659#endif
660
661 if (ret) {
662 if (f_v) {
663 cout << "any_group::subspace_orbits_test_set OK" << endl;
664 }
665 }
666 else {
667 if (f_v) {
668 cout << "any_group::subspace_orbits_test_set not OK" << endl;
669 }
670 }
671 return ret;
672#endif
673}
674
675
676}}}
677
678
679
a collection of functions related to sorted vectors
int integer_vec_compare(int *p, int *q, int len)
Definition: sorting.cpp:2313
void PG_elements_unrank_lint(int *M, int k, int n, long int *rank_vec)
void mult_vector_from_the_left(int *v, int *A, int *vA, int m, int n)
void exterior_square(int *An, int *An2, int n, int verbose_level)
void transform_form_matrix(int *A, int *Gram, int *new_Gram, int d, int verbose_level)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
int Gauss_simple(int *A, int m, int n, int *base_cols, int verbose_level)
void matrix_inverse(int *A, int *Ainv, int n, int verbose_level)
void int_matrix_read_csv(std::string &fname, int *&M, int &m, int &n, int verbose_level)
Definition: file_io.cpp:1477
void element_print(void *elt, std::ostream &ost)
Definition: action_cb.cpp:347
void conjugacy_classes_and_normalizers(groups::sims *override_Sims, std::string &label, std::string &label_tex, int verbose_level)
void make_element(int *Elt, int *data, int verbose_level)
Definition: action.cpp:1875
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
to control the behavior of the poset classification algorithm
void search_element_of_order(any_group *Any_group, actions::action *A1, actions::action *A2, int order, int verbose_level)
void find_singer_cycle(any_group *Any_group, actions::action *A1, actions::action *A2, int verbose_level)
void linear_codes_with_bounded_minimum_distance(poset_classification::poset_classification_control *Control, groups::linear_group *LG, int d, int target_depth, int verbose_level)
void conjugacy_classes_based_on_normal_forms(actions::action *A, groups::sims *override_Sims, std::string &label, std::string &label_tex, int verbose_level)
void find_standard_generators(any_group *Any_group, actions::action *A1, actions::action *A2, int order_a, int order_b, int order_ab, int verbose_level)
void do_tensor_classify(poset_classification::poset_classification_control *Control, int depth, int verbose_level)
void do_classify_ovoids(poset_classification::poset_classification_control *Control, apps_geometry::ovoid_classify_description *Ovoid_classify_description, int verbose_level)
void find_standard_generators(int order_a, int order_b, int order_ab, int verbose_level)
void do_orbits_on_subspaces(group_theoretic_activity *GTA, poset_classification::poset_classification_control *Control, int depth, int verbose_level)
void do_linear_codes(poset_classification::poset_classification_control *Control, int minimum_distance, int target_size, int verbose_level)
int subspace_orbits_test_set(int len, long int *S, int verbose_level)
void search_element_of_order(int order, int verbose_level)
void isomorphism_Klein_quadric(std::string &fname, int verbose_level)
void init(group_theoretic_activity *GTA, poset_classification::poset_classification_control *Control, int depth, int verbose_level)
description of a problem of classification of ovoids in orthogonal spaces
Definition: tl_geometry.h:602
poset_classification::poset_classification_control * Control
Definition: tl_geometry.h:607
classification of ovoids in orthogonal spaces
Definition: tl_geometry.h:631
void init(ovoid_classify_description *Descr, groups::linear_group *LG, int &verbose_level)
classification of tensors under the wreath product group
Definition: tl_geometry.h:899
void init(field_theory::finite_field *F, groups::linear_group *LG, int verbose_level)
void classify_poset(int depth, poset_classification::poset_classification_control *Control, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#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 Int_matrix_print(A, B, C)
Definition: foundations.h:707
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
algebra, combinatorics and graph theory, geometry, linear algebra, number theory, data structures,...
Definition: a_domain.cpp:18
the orbiter library for the classification of combinatorial objects