Orbiter 2022
Combinatorial Objects
action_group_theory.cpp
Go to the documentation of this file.
1/*
2 * action_group_theory.cpp
3 *
4 * Created on: Feb 5, 2019
5 * Author: betten
6 */
7
9#include "group_actions.h"
10
11using namespace std;
12
13
14namespace orbiter {
15namespace layer3_group_actions {
16namespace actions {
17
18
19
21 std::string &fname_magma_prefix,
23 int verbose_level)
24{
25 int f_v = (verbose_level >= 1);
26 string fname_magma;
27 string fname_output;
29
30 if (f_v) {
31 cout << "action::normalizer_using_MAGMA" << endl;
32 }
33
34 fname_magma.assign(fname_magma_prefix);
35 fname_magma.append(".magma");
36 fname_output.assign(fname_magma_prefix);
37 fname_output.append(".txt");
38
39 int n;
40
43
45 G_gen->init_from_sims(G, 0 /* verbose_level */);
46
48 H_gen->init_from_sims(H, 0 /* verbose_level */);
49
50 n = degree;
51 if (f_v) {
52 cout << "action::normalizer_using_MAGMA n = " << n << endl;
53 }
54 {
55 ofstream fp(fname_magma);
56
57 fp << "G := PermutationGroup< " << n << " | " << endl;
58 G_gen->print_generators_MAGMA(this, fp);
59 fp << ">;" << endl;
60
61
62 fp << "H := sub< G |" << endl;
63 H_gen->print_generators_MAGMA(this, fp);
64 fp << ">;" << endl;
65
66 fp << "N := Normalizer(G, H);" << endl;
67 fp << "SetOutputFile(\"" << fname_output << "\");" << endl;
68 fp << "printf \"%o\", #N; printf \"\\n\";" << endl;
69 fp << "printf \"%o\", #Generators(N); printf \"\\n\";" << endl;
70 fp << "for h := 1 to #Generators(N) do for i := 1 to "
71 << n << " do printf \"%o\", i^N.h; printf \" \"; "
72 "if i mod 25 eq 0 then printf \"\n\"; end if; "
73 "end for; printf \"\\n\"; end for;" << endl;
74 fp << "UnsetOutputFile();" << endl;
75 }
76
77 if (Fio.file_size(fname_output) <= 0) {
78
80
81 Magma.run_magma_file(fname_magma, verbose_level);
82 cout << "please run magma on the file " << fname_magma << endl;
83 cout << "for instance, try" << endl;
84 cout << Magma.Orbiter_session->magma_path << "magma " << fname_magma << endl;
85 exit(1);
86 }
87
88 if (f_v) {
89 cout << "file " << fname_output << " exists, reading it" << endl;
90 }
91
92 int i, j;
93 int go, nb_gens;
94 int *perms;
95
96 if (f_v) {
97 cout << "action::normalizer_using_MAGMA" << endl;
98 }
99 {
100 ifstream fp(fname_output);
101
102 fp >> go;
103 fp >> nb_gens;
104 if (f_v) {
105 cout << "action::normalizer_using_MAGMA We found " << nb_gens
106 << " generators for a group of order " << go << endl;
107 }
108
109 perms = NEW_int(nb_gens * degree);
110
111 for (i = 0; i < nb_gens; i++) {
112 for (j = 0; j < degree; j++) {
113 fp >> perms[i * degree + j];
114 }
115 }
116 if (f_v) {
117 cout << "action::normalizer_using_MAGMA we read all "
118 "generators from file " << fname_output << endl;
119 }
120 }
121 for (i = 0; i < nb_gens * degree; i++) {
122 perms[i]--;
123 }
124
125 //longinteger_object go1;
126
127
129 if (f_v) {
130 cout << "action::normalizer_using_MAGMA "
131 "before gens->init_from_permutation_"
132 "representation" << endl;
133 }
134
136
138 perms,
139 nb_gens, go, nice_gens,
140 verbose_level);
141 if (f_v) {
142 cout << "action::normalizer_using_MAGMA "
143 "after gens->init_from_permutation_"
144 "representation" << endl;
145 }
146 FREE_OBJECT(nice_gens);
147
148 cout << "action::normalizer_using_MAGMA "
149 "after gens->init_from_permutation_representation gens_N=" << endl;
151
152
153
154
155 if (f_v) {
156 cout << "action::normalizer_using_MAGMA done" << endl;
157 }
158}
159
161 groups::sims *G, int verbose_level)
162{
163 int f_v = (verbose_level >= 1);
164 string fname_magma;
165 string fname_output;
166
167 if (f_v) {
168 cout << "action::conjugacy_classes_using_MAGMA" << endl;
169 }
170
171 fname_magma.assign(prefix);
172 fname_magma.append("conjugacy_classes.magma");
173 fname_output.assign(prefix);
174 fname_output.append("conjugacy_classes.txt");
175
176 int n;
177
179
181 G_gen->init_from_sims(G, 0 /* verbose_level */);
182
183 n = degree;
184 if (f_v) {
185 cout << "action::conjugacy_classes_using_MAGMA n = " << n << endl;
186 }
187 {
188 ofstream fp(fname_magma);
189
190 fp << "G := PermutationGroup< " << n << " | " << endl;
191 G_gen->print_generators_MAGMA(this, fp);
192 fp << ">;" << endl;
193
194
195 fp << "C := ConjugacyClasses(G);" << endl;
196
197 fp << "SetOutputFile(\"" << fname_output << "\");" << endl;
198 fp << "printf \"%o\", #C; printf \"\\n\";" << endl;
199 fp << "for h := 1 to #C do printf \"%o\", C[h][1]; printf \" \";"
200 "printf \"%o\", C[h][2]; printf \" \"; for i := 1 to "
201 << n << " do printf \"%o\", i^C[h][3]; printf \" \"; end for; "
202 "printf \"\\n\"; end for;" << endl;
203 fp << "UnsetOutputFile();" << endl;
204 }
205
206
207
210
211 Magma.run_magma_file(fname_magma, verbose_level);
212 if (Fio.file_size(fname_output) == 0) {
213 cout << "please run magma on the file " << fname_magma << endl;
214 cout << "for instance, try" << endl;
215 cout << Magma.Orbiter_session->magma_path << "magma " << fname_magma << endl;
216 exit(1);
217 }
218
219
220 FREE_OBJECT(G_gen);
221
222
223
224 if (f_v) {
225 cout << "action::conjugacy_classes_using_MAGMA done" << endl;
226 }
227}
228
229//G := PermutationGroup< 85 | ...
230//C := ConjugacyClasses(G);
231//SetOutputFile("PGGL_4_4conjugacy_classes.txt");
232//printf "%o", #C; printf "\n";
233//for h := 1 to #C do printf "%o", C[h][1]; printf " "; printf "%o", C[h][2]; printf " "; for i := 1 to 85 do printf "%o", i^C[h][3]; printf " "; end for; printf "\n"; end for;
234//UnsetOutputFile();
235
236// outputs:
237//63
238//1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
239//2 5355 1 2 9 26 45 6 7 8 3 11 10 13 12 15 14 17 16 19 18 21 20 23 22 25 24 4 30 29 28 27 34 33 32 31 38 37 36 35 41 42 39 40 44 43 5 48 49 46 47 52 53 50 51 55 54 57 56 59 58 61 60 63 62 65 64 67 66 69 68 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
240// etc.
241
242
243#if 0
244void action::read_conjugacy_classes_from_MAGMA(
245 char *fname,
246 int &nb_classes,
247 int *&perms,
248 int *&class_size,
249 int *&class_order_of_element,
250 int verbose_level)
251{
252 int f_v = (verbose_level >= 1);
253 int i, j;
254
255 if (f_v) {
256 cout << "action::read_conjugacy_classes_from_MAGMA" << endl;
257 }
258 {
259 ifstream fp(fname);
260
261 fp >> nb_classes;
262 if (f_v) {
263 cout << "action::read_conjugacy_classes_from_MAGMA "
264 "We found " << nb_classes
265 << " conjugacy classes" << endl;
266 }
267
268 perms = NEW_int(nb_classes * degree);
269 class_size = NEW_int(nb_classes);
270 class_order_of_element = NEW_int(nb_classes);
271
272 for (i = 0; i < nb_classes; i++) {
273 fp >> class_order_of_element[i];
274 fp >> class_size[i];
275 for (j = 0; j < degree; j++) {
276 fp >> perms[i * degree + j];
277 }
278 }
279 if (f_v) {
280 cout << "action::read_conjugacy_classes_from_MAGMA "
281 "we read all class representatives "
282 "from file " << fname << endl;
283 }
284 }
285 for (i = 0; i < nb_classes * degree; i++) {
286 perms[i]--;
287 }
288 if (f_v) {
289 cout << "action::read_conjugacy_classes_from_MAGMA done" << endl;
290 }
291}
292#endif
293
295 std::string &prefix,
296 std::string &fname_magma, std::string &fname_output)
297{
298 fname_magma.assign(prefix);
299 fname_magma.append("_classes.magma");
300 fname_output.assign(prefix);
301 fname_output.append("_classes_out.txt");
302}
303
305 std::string &prefix,
306 groups::sims *G, int verbose_level)
307{
308 int f_v = (verbose_level >= 1);
309 string fname_magma;
310 string fname_output;
311
312 if (f_v) {
313 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA" << endl;
314 }
315 conjugacy_classes_and_normalizers_using_MAGMA_make_fnames(prefix, fname_magma, fname_output);
316 if (f_v) {
317 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA, fname_magma = " << fname_magma << endl;
318 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA, fname_output = " << fname_output << endl;
319 }
320
321 int n;
322
324
326 if (f_v) {
327 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA before G_gen->init_from_sims" << endl;
328 }
329 G_gen->init_from_sims(G, verbose_level);
330 if (f_v) {
331 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA after G_gen->init_from_sims" << endl;
332 }
333
334 n = degree;
335 if (f_v) {
336 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA n = " << n << endl;
337 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA fname_magma = " << fname_magma << endl;
338 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA fname_output = " << fname_output << endl;
339 }
340 {
341 ofstream fp(fname_magma);
342
343 fp << "G := PermutationGroup< " << n << " | " << endl;
344 G_gen->print_generators_MAGMA(this, fp);
345 fp << ">;" << endl;
346
347
348 //fp << "# compute conjugacy classes of G:" << endl;
349 fp << "C := ConjugacyClasses(G);" << endl;
350 fp << "SetOutputFile(\"" << fname_output << "\");" << endl;
351 fp << "printf \"%o\", #C; printf \"\\n\";" << endl;
352 fp << "for h := 1 to #C do" << endl;
353 fp << " printf \"%o\", C[h][1]; printf \" \";" << endl;
354 fp << " printf \"%o\", C[h][2]; printf \" \";" << endl;
355 fp << " for i := 1 to " << n << " do" << endl;
356 fp << " printf \"%o\", i^C[h][3]; printf \" \";" << endl;
357 fp << " end for; " << endl;
358 fp << " printf \"\\n\";" << endl;
359 fp << "end for;" << endl;
360
361 //fp << "# compute normalizers of the cyclic subgroups generated by the class reps:" << endl;
362 fp << "for h := 1 to #C do" << endl;
363 fp << " S := sub< G | C[h][3]>;" << endl;
364 fp << " N := Normalizer(G, S);";
365 fp << " printf \"%o\", #N;" << endl;
366 fp << " printf \"\\n\";" << endl;
367 fp << " printf \"%o\", #Generators(N); printf \"\\n\";" << endl;
368 fp << " for g in Generators(N) do " << endl;
369 fp << " for i := 1 to " << n << " do " << endl;
370 fp << " printf \"%o\", i^g; printf \" \";" << endl;
371 fp << " end for;" << endl;
372 fp << " printf \"\\n\";" << endl;
373 fp << " end for;" << endl;
374 fp << "end for;" << endl;
375 fp << "UnsetOutputFile();" << endl;
376 }
377
378
381
382 Magma.run_magma_file(fname_magma, verbose_level);
383 if (Fio.file_size(fname_output) <= 0) {
384 cout << "please run magma on the file " << fname_magma << endl;
385 cout << "for instance, try" << endl;
386 cout << Magma.Orbiter_session->magma_path << "magma " << fname_magma << endl;
387 exit(1);
388 }
389
390
391 if (f_v) {
392 cout << "command ConjugacyClasses in MAGMA has finished" << endl;
393 }
394
395 FREE_OBJECT(G_gen);
396
397
398
399
400
401 if (f_v) {
402 cout << "action::conjugacy_classes_and_normalizers_using_MAGMA done" << endl;
403 }
404}
405
406
407//> M24 := sub< Sym(24) |
408//> (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24),
409//> (2,16,9,6,8)(3,12,13,18,4)(7,17,10,11,22)(14,19,21,20,15),
410//> (1,22)(2,11)(3,15)(4,17)(5,9)(6,19)(7,13)(8,20)(10,16)(12,21)(14,18)(23,24)>;
411//> M24;
412
413
415 std::string &fname,
416 int &nb_classes,
417 int *&perms,
418 int *&class_size,
419 int *&class_order_of_element,
420 long int *&class_normalizer_order,
421 int *&class_normalizer_number_of_generators,
422 int **&normalizer_generators_perms,
423 int verbose_level)
424{
425 int f_v = (verbose_level >= 1);
426 int i, j, h;
427
428 if (f_v) {
429 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA" << endl;
430 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA fname=" << fname << endl;
431 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA degree=" << degree << endl;
432 }
433 {
434 ifstream fp(fname);
435
436 fp >> nb_classes;
437 if (f_v) {
438 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA "
439 "We found " << nb_classes
440 << " conjugacy classes" << endl;
441 }
442
443 perms = NEW_int(nb_classes * degree);
444 class_size = NEW_int(nb_classes);
445 class_order_of_element = NEW_int(nb_classes);
446
447 for (i = 0; i < nb_classes; i++) {
448 fp >> class_order_of_element[i];
449 if (f_v) {
450 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA "
451 "class " << i << " / " << nb_classes << " order=" << class_order_of_element[i] << endl;
452 }
453 fp >> class_size[i];
454 for (j = 0; j < degree; j++) {
455 fp >> perms[i * degree + j];
456 }
457 }
458 if (f_v) {
459 cout << "perms:" << endl;
460 Int_matrix_print(perms, nb_classes, degree);
461 }
462 for (i = 0; i < nb_classes * degree; i++) {
463 perms[i]--;
464 }
465
466 class_normalizer_order = NEW_lint(nb_classes);
467 class_normalizer_number_of_generators = NEW_int(nb_classes);
468 normalizer_generators_perms = NEW_pint(nb_classes);
469
470 if (f_v) {
471 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA "
472 "reading normalizer generators:" << endl;
473 }
474 for (i = 0; i < nb_classes; i++) {
475 if (f_v) {
476 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA "
477 "class " << i << " / " << nb_classes << endl;
478 }
479 fp >> class_normalizer_order[i];
480
481 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA class " << i << " class_normalizer_order[i]=" << class_normalizer_order[i] << endl;
482
483 if (class_normalizer_order[i] <= 0) {
484 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA class_normalizer_order[i] <= 0" << endl;
485 cout << "class_normalizer_order[i]=" << class_normalizer_order[i] << endl;
486 exit(1);
487 }
488 if (f_v) {
489 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA "
490 "class " << i << " / " << nb_classes << " class_normalizer_order[i]=" << class_normalizer_order[i] << endl;
491 }
492 fp >> class_normalizer_number_of_generators[i];
493 normalizer_generators_perms[i] =
494 NEW_int(class_normalizer_number_of_generators[i] * degree);
495 for (h = 0; h < class_normalizer_number_of_generators[i]; h++) {
496 for (j = 0; j < degree; j++) {
497 fp >> normalizer_generators_perms[i][h * degree + j];
498 }
499 }
500 for (h = 0; h < class_normalizer_number_of_generators[i] * degree; h++) {
501 normalizer_generators_perms[i][h]--;
502 }
503 }
504 if (f_v) {
505 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA "
506 "we read all class representatives "
507 "from file " << fname << endl;
508 }
509 }
510 if (f_v) {
511 cout << "action::read_conjugacy_classes_and_normalizers_from_MAGMA done" << endl;
512 }
513}
514
515
516void action::normalizer_of_cyclic_group_using_MAGMA(std::string &fname_magma_prefix,
517 groups::sims *G, int *Elt, groups::strong_generators *&gens_N,
518 int verbose_level)
519{
520 int f_v = (verbose_level >= 1);
521
522 if (f_v) {
523 cout << "action::normalizer_of_cyclic_group_using_MAGMA" << endl;
524 }
525 groups::sims *H;
526
528 if (f_v) {
529 cout << "action::normalizer_of_cyclic_group_using_MAGMA "
530 "before H->init_cyclic_group_from_generator" << endl;
531 }
532 H->init_cyclic_group_from_generator(G->A, Elt, verbose_level);
533 if (f_v) {
534 cout << "action::normalizer_of_cyclic_group_using_MAGMA "
535 "after H->init_cyclic_group_from_generator" << endl;
536 }
537
538 if (f_v) {
539 cout << "action::normalizer_of_cyclic_group_using_MAGMA "
540 "before normalizer_using_MAGMA" << endl;
541 }
543 fname_magma_prefix,
544 G, H, gens_N,
545 verbose_level);
546 if (f_v) {
547 cout << "action::normalizer_of_cyclic_group_using_MAGMA "
548 "after normalizer_using_MAGMA" << endl;
549 }
550
551 if (f_v) {
552 cout << "action::normalizer_of_cyclic_group_using_MAGMA done" << endl;
553 }
554}
555
556void action::centralizer_using_MAGMA(std::string &prefix,
557 groups::sims *override_Sims, int *Elt, groups::strong_generators *&gens,
558 int verbose_level)
559{
560 int f_v = (verbose_level >= 1);
561 string fname_magma;
562 string fname_output;
564
565 if (f_v) {
566 cout << "action::centralizer_using_MAGMA" << endl;
567 }
568
569 fname_magma.assign(prefix);
570 fname_magma.append("_centralizer.magma");
571 fname_output.assign(prefix);
572 fname_output.append("_centralizer.txt");
573
574
575 if (Fio.file_size(fname_output) > 0) {
576 read_centralizer_magma(fname_output, override_Sims,
577 gens, verbose_level);
578 }
579 else {
580 if (f_v) {
581 cout << "action::centralizer_using_MAGMA before "
582 "centralizer_using_magma2" << endl;
583 }
584 centralizer_using_magma2(prefix, fname_magma, fname_output,
585 override_Sims, Elt, verbose_level);
586 if (f_v) {
587 cout << "action::centralizer_using_MAGMA after "
588 "centralizer_using_magma2" << endl;
589 }
590 }
591 if (f_v) {
592 cout << "action::centralizer_using_MAGMA done" << endl;
593 }
594}
595
596void action::read_centralizer_magma(std::string &fname_output,
597 groups::sims *override_Sims, groups::strong_generators *&gens,
598 int verbose_level)
599{
600 int f_v = (verbose_level >= 1);
601 int number_of_generators;
602 int *generator_perms;
603 int goi, h, j;
604
605 if (f_v) {
606 cout << "action::read_centralizer_magma" << endl;
607 }
608 {
609 ifstream fp(fname_output);
610
611 fp >> goi;
612 fp >> number_of_generators;
613 generator_perms = NEW_int(number_of_generators * degree);
614 for (h = 0; h < number_of_generators; h++) {
615 for (j = 0; j < degree; j++) {
616 fp >> generator_perms[h * degree + j];
617 }
618 }
619 for (h = 0; h < number_of_generators * degree; h++) {
620 generator_perms[h]--;
621 }
622 }
623
625
626
628
630 override_Sims,
631 generator_perms,
632 number_of_generators, goi, nice_gens,
633 verbose_level);
634
635 if (f_v) {
637
638 cout << "action::read_centralizer_magma "
639 "after gens->init_from_permutation_representation" << endl;
640 cout << "centralizer order = " << goi
641 << " : " << endl;
642 cout << "action::read_centralizer_magma created generators for a group" << endl;
643 gens->print_generators(cout);
645 gens->group_order(go1);
646 cout << "action::read_centralizer_magma "
647 "The group has order " << go1 << endl;
648 }
649
650 FREE_int(generator_perms);
651 FREE_OBJECT(nice_gens);
652
653 if (f_v) {
654 cout << "action::read_centralizer_magma done" << endl;
655 }
656}
657
658void action::centralizer_using_magma2(std::string &prefix,
659 std::string &fname_magma,
660 std::string &fname_output,
661 groups::sims *override_Sims, int *Elt, int verbose_level)
662{
663 int f_v = (verbose_level >= 1);
664 int n;
665
666 if (f_v) {
667 cout << "action::centralizer_using_magma2" << endl;
668 }
671
673 G_gen->init_from_sims(override_Sims, 0 /* verbose_level */);
674
675 n = degree;
676 if (f_v) {
677 cout << "action::centralizer_using_magma2 n = " << n << endl;
678 }
679 {
680 ofstream fp(fname_magma);
681
682 fp << "G := PermutationGroup< " << n << " | " << endl;
683 G_gen->print_generators_MAGMA(this, fp);
684 fp << ">;" << endl;
685
686 fp << "h := G ! ";
688 1 /* offset */, TRUE /* f_do_it_anyway_even_for_big_degree */,
689 FALSE /* f_print_cycles_of_length_one */, 0 /* verbose_level */);
690 fp << ";" << endl;
691
692 fp << "C := Centralizer(G, h);" << endl;
693
694 fp << "SetOutputFile(\"" << fname_output << "\");" << endl;
695 fp << "printf \"%o\", #C; printf \"\\n\";" << endl;
696 fp << "printf \"%o\", #Generators(C); printf \"\\n\";" << endl;
697 fp << "for h := 1 to #Generators(C) do for i := 1 to "
698 << n << " do printf \"%o\", i^C.h; printf \" \"; end for;"
699 " printf \"\\n\"; end for;" << endl;
700 fp << "UnsetOutputFile();" << endl;
701 }
702 cout << "Written file " << fname_magma
703 << " of size " << Fio.file_size(fname_magma) << endl;
704
705
706
708
709 Magma.run_magma_file(fname_magma, verbose_level);
710 if (Fio.file_size(fname_output) == 0) {
711 cout << "please run magma on the file " << fname_magma << endl;
712 cout << "for instance, try" << endl;
713 cout << Magma.Orbiter_session->magma_path << "magma " << fname_magma << endl;
714 exit(1);
715 }
716
717
718 cout << "command centralizer in MAGMA has finished" << endl;
719
720 FREE_OBJECT(G_gen);
721
722 if (f_v) {
723 cout << "action::centralizer_using_magma2 done" << endl;
724 }
725}
726
727
728void action::find_subgroups_using_MAGMA(std::string &prefix,
729 groups::sims *override_Sims,
730 int subgroup_order,
731 int &nb_subgroups,
733 int verbose_level)
734{
735 int f_v = (verbose_level >= 1);
736 string fname_magma;
737 string fname_output;
739
740 if (f_v) {
741 cout << "action::find_subgroups_using_MAGMA" << endl;
742 }
743 fname_magma.assign(prefix);
744 fname_magma.append("_subgroup.magma");
745
746 fname_output.assign(prefix);
747 fname_output.append("_subgroup.txt");
748
749
750 if (Fio.file_size(fname_output) > 0) {
751 read_subgroups_magma(fname_output, override_Sims, subgroup_order,
752 nb_subgroups, H_gens, N_gens, verbose_level);
753 }
754 else {
755 if (f_v) {
756 cout << "action::find_subgroups_using_MAGMA before "
757 "find_subgroups_using_MAGMA2" << endl;
758 }
759 find_subgroups_using_MAGMA2(prefix, fname_magma, fname_output,
760 override_Sims, subgroup_order,
761 verbose_level);
762 if (f_v) {
763 cout << "action::find_subgroups_using_MAGMA after "
764 "find_subgroups_using_MAGMA2" << endl;
765 }
766 cout << "please run the magma file " << fname_magma
767 << ", retrieve the output file " << fname_output
768 << " and come back" << endl;
769 }
770 if (f_v) {
771 cout << "action::find_subgroups_using_MAGMA done" << endl;
772 }
773}
774
775
776void action::read_subgroups_magma(std::string &fname_output,
777 groups::sims *override_Sims, int subgroup_order,
778 int &nb_subgroups,
780 int verbose_level)
781{
782 int f_v = (verbose_level >= 1);
784 int u, h, j;
785
786 if (f_v) {
787 cout << "action::read_subgroups_magma" << endl;
788 }
789
790 {
791 ifstream fp(fname_output);
792
793 fp >> nb_subgroups;
794
795 H_gens = NEW_OBJECTS(groups::strong_generators, nb_subgroups);
796 N_gens = NEW_OBJECTS(groups::strong_generators, nb_subgroups);
797
798
799 // read generators for H[]:
800
801 for (u = 0; u < nb_subgroups; u++) {
802
803 int *generator_perms;
804 int number_of_generators;
805
806 fp >> number_of_generators;
807 generator_perms = NEW_int(number_of_generators * degree);
808 for (h = 0; h < number_of_generators; h++) {
809 for (j = 0; j < degree; j++) {
810 fp >> generator_perms[h * degree + j];
811 }
812 }
813 for (h = 0; h < number_of_generators * degree; h++) {
814 generator_perms[h]--;
815 }
816
818
819
820
822 override_Sims,
823 generator_perms,
824 number_of_generators, subgroup_order, nice_gens,
825 verbose_level);
826
827 if (f_v) {
829
830 cout << "action::read_subgroups_magma "
831 "after gens->init_from_permutation_representation" << endl;
832 cout << "group order = " << subgroup_order
833 << " : " << endl;
834 cout << "action::read_centralizer_magma created generators for a group" << endl;
835 H_gens[u].print_generators(cout);
837 H_gens[u].group_order(go1);
838 cout << "action::read_subgroups_magma "
839 "The group H[" << u << "] has order " << go1 << endl;
840 }
841
842 FREE_int(generator_perms);
843 FREE_OBJECT(nice_gens);
844
845 }
846
847 // read generators for N[]:
848
849 for (u = 0; u < nb_subgroups; u++) {
850
851 int *generator_perms;
852 int number_of_generators;
853 int goi;
854
855 fp >> goi;
856 fp >> number_of_generators;
857 generator_perms = NEW_int(number_of_generators * degree);
858 for (h = 0; h < number_of_generators; h++) {
859 for (j = 0; j < degree; j++) {
860 fp >> generator_perms[h * degree + j];
861 }
862 }
863 for (h = 0; h < number_of_generators * degree; h++) {
864 generator_perms[h]--;
865 }
866
868
869
870
872 override_Sims,
873 generator_perms,
874 number_of_generators, goi, nice_gens,
875 verbose_level);
876
877 if (f_v) {
879
880 cout << "action::read_subgroups_magma "
881 "after gens->init_from_permutation_representation" << endl;
882 cout << "group order = " << subgroup_order
883 << " : " << endl;
884 cout << "action::read_centralizer_magma created generators for a group" << endl;
885 N_gens[u].print_generators(cout);
887 N_gens[u].group_order(go1);
888 cout << "action::read_subgroups_magma "
889 "The group N[" << u << "] has order " << go1 << endl;
890 }
891
892 FREE_int(generator_perms);
893 FREE_OBJECT(nice_gens);
894
895 }
896
897 }
898
899
900
901 if (f_v) {
902 cout << "action::read_subgroups_magma done" << endl;
903 }
904}
905
906void action::find_subgroups_using_MAGMA2(std::string &prefix,
907 std::string &fname_magma, std::string &fname_output,
908 groups::sims *override_Sims, int subgroup_order,
909 int verbose_level)
910{
911 int f_v = (verbose_level >= 1);
913 int n;
914
915 if (f_v) {
916 cout << "action::find_subgroups_using_MAGMA2" << endl;
917 }
918
919
920 string cmd;
922
924 G_gen->init_from_sims(override_Sims, 0 /* verbose_level */);
925
926 n = degree;
927 if (f_v) {
928 cout << "action::find_subgroups_using_MAGMA2 n = " << n << endl;
929 }
930 {
931 ofstream fp(fname_magma);
932
933 fp << "G := PermutationGroup< " << n << " | " << endl;
934 G_gen->print_generators_MAGMA(this, fp);
935 fp << ">;" << endl;
936
937
938
939 fp << "Subgroups:=ElementaryAbelianSubgroups(G: OrderEqual:=" << subgroup_order << ");" << endl;
940 fp << "Indicator:=[true: i in [1..#Subgroups]];" << endl;
941
942
943 fp << "if #Subgroups ge 1 then" << endl;
944 fp << "for i in [1..# Subgroups] do" << endl;
945 fp << "H:= Subgroups[i]`subgroup;" << endl;
946 fp << "f:=NumberingMap(H);" << endl;
947 fp << "g:=Inverse(f);" << endl;
948 fp << "for j in [1..Order(H)] do" << endl;
949 fp << "if Order(Centralizer(G, G!g(j))) eq 368640 then" << endl;
950 fp << "Indicator[i]:=false;" << endl;
951 fp << "end if;" << endl;
952 fp << "end for;" << endl;
953 fp << "end for;" << endl;
954 fp << "end if;" << endl;
955
956
957
958 fp << "SetOutputFile(\"" << fname_output << "\");" << endl;
959
960 fp << "S:= [j: j in [1..#Subgroups]|Indicator[j]];" << endl;
961 fp << "#S;" << endl;
962 //fp << "printf \"\\n\";" << endl;
963 fp << "for i in S do" << endl;
964 fp << "gens:=FewGenerators(Subgroups[i]`subgroup);" << endl;
965 fp << "#gens;" << endl;
966 fp << "for g in gens do" << endl;
967 fp << "for k in [1..Degree(G)] do" << endl;
968 fp << " printf \"%o\", k^g; printf \" \";" << endl;
969 fp << " end for; " << endl;
970 fp << "printf \"\\n\";" << endl;
971 fp << "end for;" << endl;
972 //fp << "printf \"\\n\";" << endl;
973 fp << "end for;" << endl;
974
975
976 //#S;
977 //fp << "printf \"\\n\";" << endl;
978 fp << "for i in S do" << endl;
979 fp << "N:=Normalizer(G,Subgroups[i]`subgroup);" << endl;
980 fp << "gens:=FewGenerators(N);" << endl;
981 fp << "#N;" << endl;
982 fp << "#gens;" << endl;
983 fp << "for g in gens do" << endl;
984 fp << "for k in [1..Degree(G)] do" << endl;
985 fp << " printf \"%o\", k^g; printf \" \";" << endl;
986 fp << " end for; " << endl;
987 fp << " printf \"\\n\";" << endl;
988 fp << "end for;" << endl;
989 //fp << "printf \"\\n\";" << endl;
990 fp << "end for;" << endl;
991
992
993 //fp << "printf \"%o\", #C; printf \"\\n\";" << endl;
994 //fp << "printf \"%o\", #Generators(C); printf \"\\n\";" << endl;
995 //fp << "for h := 1 to #Generators(C) do for i := 1 to "
996 // << n << " do printf \"%o\", i^C.h; printf \" \"; end for;"
997 // " printf \"\\n\"; end for;" << endl;
998 fp << "UnsetOutputFile();" << endl;
999 }
1000 cout << "Written file " << fname_magma
1001 << " of size " << Fio.file_size(fname_magma) << endl;
1002
1004
1005 Magma.run_magma_file(fname_magma, verbose_level);
1006 if (Fio.file_size(fname_output) == 0) {
1007 cout << "please run magma on the file " << fname_magma << endl;
1008 cout << "for instance, try" << endl;
1009 cout << Magma.Orbiter_session->magma_path << "magma " << fname_magma << endl;
1010 exit(1);
1011 }
1012
1013
1014
1015 cout << "command script in MAGMA has finished" << endl;
1016
1017 FREE_OBJECT(G_gen);
1018
1019
1020
1021 if (f_v) {
1022 cout << "action::find_subgroups_using_MAGMA2 done" << endl;
1023 }
1024}
1025
1027 std::string &label,
1028 std::string &label_tex,
1029 int verbose_level)
1030{
1031 int f_v = (verbose_level >= 1);
1032 string prefix;
1033 string fname_magma;
1034 string fname_output;
1036
1037
1038 if (f_v) {
1039 cout << "action::conjugacy_classes_and_normalizers" << endl;
1040 }
1041
1042 prefix.assign(label);
1043 fname_magma.assign(label);
1044 fname_magma.append("_classes.magma");
1045 fname_output.assign(label);
1046 fname_output.append("_classes_out.txt");
1047
1048
1049 if (Fio.file_size(fname_output) <= 0) {
1050 if (f_v) {
1051 cout << "action::conjugacy_classes_and_normalizers before "
1052 "conjugacy_classes_and_normalizers_using_MAGMA" << endl;
1053 }
1055 override_Sims, verbose_level);
1056 if (f_v) {
1057 cout << "action::conjugacy_classes_and_normalizers after "
1058 "conjugacy_classes_and_normalizers_using_MAGMA" << endl;
1059 }
1060 }
1061
1062
1063 if (Fio.file_size(fname_output) > 0) {
1064 if (f_v) {
1065 cout << "action::conjugacy_classes_and_normalizers before read_conjugacy_classes_and_normalizers" << endl;
1066 }
1067 read_conjugacy_classes_and_normalizers(fname_output, override_Sims, label_tex, verbose_level);
1068 if (f_v) {
1069 cout << "action::conjugacy_classes_and_normalizers after read_conjugacy_classes_and_normalizers" << endl;
1070 }
1071 }
1072 else {
1074
1075 cout << "please run magma on the file " << fname_magma << endl;
1076 cout << "for instance, try" << endl;
1077 cout << Magma.Orbiter_session->magma_path << "magma " << fname_magma << endl;
1078 exit(1);
1079
1080 }
1081
1082 if (f_v) {
1083 cout << "action::conjugacy_classes_and_normalizers done" << endl;
1084 }
1085}
1086
1087
1089 groups::sims *override_Sims, int verbose_level)
1090{
1091 int f_v = (verbose_level >= 1);
1092 string prefix;
1093 string fname1;
1094 string fname2;
1096
1097
1098 if (f_v) {
1099 cout << "action::conjugacy_classes_and_normalizers" << endl;
1100 }
1101
1102 prefix.assign(label);
1103 fname1.assign(label);
1104 fname1.append("_classes.magma");
1105 fname2.assign(label);
1106 fname2.append("_classes_out.txt");
1107
1108
1109 if (Fio.file_size(fname2) > 0) {
1110 if (f_v) {
1111 cout << "action::conjugacy_classes_and_normalizers the file "
1112 << fname2 << " exists, reading it " << endl;
1113 }
1115 fname2, override_Sims, verbose_level);
1116 }
1117 else {
1118 if (f_v) {
1119 cout << "action::conjugacy_classes_and_normalizers the file " << fname2
1120 << " does not exist, calling conjugacy_classes_and_normalizers_using_MAGMA" << endl;
1121 }
1122 if (!f_has_sims) {
1123 cout << "action::report_conjugacy_classes_and_normalizers we don't have sims, skipping" << endl;
1124 }
1125 else {
1127 Sims, verbose_level);
1128 }
1129 }
1130
1131 if (f_v) {
1132 cout << "action::conjugacy_classes_and_normalizers done" << endl;
1133 }
1134}
1135
1136
1137
1139 std::string &fname, groups::sims *override_sims,
1140 std::string &label_latex, int verbose_level)
1141{
1142 int f_v = (verbose_level >= 1);
1143 int i;
1144 int nb_classes;
1145 int *perms;
1146 int *class_size;
1147 int *class_order_of_element;
1148 long int *class_normalizer_order;
1149 int *class_normalizer_number_of_generators;
1150 int **normalizer_generators_perms;
1152
1153 if (f_v) {
1154 cout << "action::read_conjugacy_classes_and_normalizers" << endl;
1155 }
1156
1157 if (f_v) {
1158 cout << "action::read_conjugacy_classes_and_normalizers "
1159 "before read_conjugacy_classes_and_normalizers_from_MAGMA" << endl;
1160 }
1162 fname,
1163 nb_classes,
1164 perms,
1165 class_size,
1166 class_order_of_element,
1167 class_normalizer_order,
1168 class_normalizer_number_of_generators,
1169 normalizer_generators_perms,
1170 verbose_level - 1);
1171 if (f_v) {
1172 cout << "action::read_conjugacy_classes_and_normalizers "
1173 "after read_conjugacy_classes_and_normalizers_from_MAGMA" << endl;
1174 }
1175
1176 cout << "i : class_order_of_element : class_normalizer_order" << endl;
1177 for (i = 0; i < nb_classes; i++) {
1178 cout << i << " : " << class_order_of_element[i] << " : " << class_normalizer_order[i] << endl;
1179 }
1180
1181
1182#if 0
1183 PA = NEW_OBJECT(projective_space_with_action);
1184
1185 int f_semilinear;
1186
1187 if (is_prime(q)) {
1188 f_semilinear = FALSE;
1189 }
1190 else {
1191 f_semilinear = TRUE;
1192 }
1193 PA->init(
1194 F, 3 /* n */, f_semilinear,
1195 FALSE /* f_init_incidence_structure */,
1196 verbose_level);
1197#endif
1198
1199
1202
1203 override_sims->group_order(go);
1204 cout << "The group has order " << go << endl;
1205
1206 string fname_latex;
1208
1209 fname_latex.assign(fname);
1210
1211 ST.replace_extension_with(fname_latex, ".tex");
1212
1213 {
1214 ofstream fp(fname_latex);
1215 string title;
1217
1218 title.assign("Conjugacy classes of ");
1219 title.append("$");
1220 title.append(label_latex);
1221 title.append("$");
1222
1223 L.head(fp,
1224 FALSE /* f_book */, TRUE /* f_title */,
1225 title.c_str(), "computed by Orbiter and MAGMA" /* const char *author */,
1226 FALSE /* f_toc */, FALSE /* f_landscape */, TRUE /* f_12pt */,
1227 TRUE /* f_enlarged_page */, TRUE /* f_pagenumbers */,
1228 NULL /* extra_praeamble */);
1229 //latex_head_easy(fp);
1230
1231 fp << "\\section{Conjugacy classes in $" << label_latex << "$}" << endl;
1232
1233
1234 fp << "The group order is " << endl;
1235 fp << "$$" << endl;
1236 go.print_not_scientific(fp);
1237 fp << endl;
1238 fp << "$$" << endl;
1239
1240 cout << "second time" << endl;
1241
1242 cout << "i : class_order_of_element : class_normalizer_order" << endl;
1243 for (i = 0; i < nb_classes; i++) {
1244 cout << i << " : " << class_order_of_element[i] << " : " << class_normalizer_order[i] << endl;
1245 }
1246
1247
1248
1249 cout << "The conjugacy classes are:" << endl;
1250 for (i = 0; i < nb_classes; i++) {
1251
1253 ring_theory::longinteger_object go1, Class_size, centralizer_order;
1254 long int goi;
1256 long int ngo;
1257 int nb_perms;
1260
1261
1262 cout << "The conjugacy class " << i << " / " << nb_classes << " is:" << endl;
1263
1264 goi = class_order_of_element[i];
1265 ngo = class_normalizer_order[i];
1266
1267
1268
1269 cout << "goi=" << goi << endl;
1270 cout << "ngo=" << ngo << endl;
1271
1272
1274
1275
1276 if (f_v) {
1277 cout << "action::read_conjugacy_classes_and_normalizers computing H, "
1278 "before gens->init_from_permutation_representation" << endl;
1279 }
1280 gens->init_from_permutation_representation(this, override_sims,
1281 perms + i * degree,
1282 1, goi, nice_gens,
1283 verbose_level - 5);
1284
1285 if (f_v) {
1286 cout << "action::read_conjugacy_classes_and_normalizers computing H, "
1287 "after gens->init_from_permutation_representation" << endl;
1288 }
1289
1290 Class_size.create(class_size[i], __FILE__, __LINE__);
1291
1292 D.integral_division_exact(go, Class_size, centralizer_order);
1293
1294
1295
1296
1297
1298 nb_perms = class_normalizer_number_of_generators[i];
1299
1300 //int *class_normalizer_order;
1301 //int *class_normalizer_number_of_generators;
1302 //int **normalizer_generators_perms;
1303
1304 if (f_v) {
1305 cout << "action::read_conjugacy_classes_and_normalizers computing N, "
1306 "before gens->init_from_permutation_representation" << endl;
1307 }
1309 N_gens->init_from_permutation_representation(this, override_sims,
1310 normalizer_generators_perms[i],
1311 nb_perms, ngo, nice_gens_N,
1312 verbose_level - 5);
1313 if (f_v) {
1314 cout << "action::read_conjugacy_classes_and_normalizers computing N, "
1315 "after gens->init_from_permutation_representation" << endl;
1316 }
1317
1318 cout << "class " << i << " / " << nb_classes
1319 << " size = " << class_size[i]
1320 << " order of element = " << class_order_of_element[i]
1321 << " centralizer order = " << centralizer_order
1322 << " normalizer order = " << ngo
1323 << " : " << endl;
1324 cout << "packing::read_conjugacy_classes_and_normalizers created "
1325 "generators for a group" << endl;
1326 gens->print_generators(cout);
1328 gens->group_order(go1);
1329 cout << "packing::read_conjugacy_classes_and_normalizers "
1330 "The group has order " << go1 << endl;
1331
1332 fp << "\\bigskip" << endl;
1333 fp << "\\subsection*{Class " << i << " / "
1334 << nb_classes << "}" << endl;
1335 fp << "Order of element = " << class_order_of_element[i]
1336 << "\\\\" << endl;
1337 fp << "Class size = " << class_size[i] << "\\\\" << endl;
1338 fp << "Centralizer order = " << centralizer_order
1339 << "\\\\" << endl;
1340 fp << "Normalizer order = " << ngo
1341 << "\\\\" << endl;
1342
1343 int *Elt = NULL;
1344
1345
1346 cout << "latex output element: " << endl;
1347
1348 if (class_order_of_element[i] > 1) {
1349 Elt = nice_gens->ith(0);
1350 fp << "Representing element is" << endl;
1351
1352 string label;
1353 char str[1000];
1354
1355 sprintf(str, "c_{%d} = ", i);
1356 label.assign(str);
1357
1359
1360 #if 0
1361
1362 fp << "$$" << endl;
1363 element_print_latex(Elt, fp);
1364 fp << "$$" << endl;
1365 #endif
1366
1367 fp << "$";
1369 fp << "$\\\\" << endl;
1370
1371
1372
1373 }
1374
1375 cout << "latex output normalizer: " << endl;
1376
1377
1378 fp << "The normalizer is generated by:\\\\" << endl;
1379 N_gens->print_generators_tex(fp);
1380
1381
1382 #if 0
1383 if (class_order_of_element[i] > 1) {
1384 fp << "The fix structure is:\\\\" << endl;
1385 PA->report_fixed_objects_in_PG_3_tex(
1386 Elt, fp,
1387 verbose_level);
1388
1389 fp << "The orbit structure is:\\\\" << endl;
1390 PA->report_orbits_in_PG_3_tex(
1391 Elt, fp,
1392 verbose_level);
1393 }
1394 if (class_order_of_element[i] > 1) {
1395
1396 PA->report_decomposition_by_single_automorphism(
1397 Elt, fp,
1398 verbose_level);
1399 // PA->
1400 //action *A; // linear group PGGL(d,q)
1401 //action *A_on_lines; // linear group PGGL(d,q) acting on lines
1402
1403
1404 }
1405 #endif
1406
1407 FREE_int(normalizer_generators_perms[i]);
1408
1409 FREE_OBJECT(nice_gens_N);
1410 FREE_OBJECT(nice_gens);
1411 FREE_OBJECT(N_gens);
1412 FREE_OBJECT(gens);
1413 }
1414 L.foot(fp);
1415 }
1416 cout << "Written file " << fname_latex << " of size "
1417 << Fio.file_size(fname_latex) << endl;
1418
1419 FREE_int(perms);
1420 FREE_int(class_size);
1421 FREE_int(class_order_of_element);
1422 FREE_lint(class_normalizer_order);
1423 FREE_int(class_normalizer_number_of_generators);
1424 FREE_pint(normalizer_generators_perms);
1425 //FREE_OBJECT(PA);
1426
1427 if (f_v) {
1428 cout << "action::read_conjugacy_classes_and_normalizers done" << endl;
1429 }
1430}
1431
1433 std::string &fname, groups::sims *override_Sims, int verbose_level)
1434{
1435 int f_v = (verbose_level >= 1);
1436 int i;
1437 int nb_classes;
1438 int *perms;
1439 int *class_size;
1440 int *class_order_of_element;
1441 long int *class_normalizer_order;
1442 int *class_normalizer_number_of_generators;
1443 int **normalizer_generators_perms;
1444 //projective_space_with_action *PA;
1445
1446 if (f_v) {
1447 cout << "action::read_and_report_conjugacy_classes_and_normalizers" << endl;
1448 }
1449
1450 if (f_v) {
1451 cout << "action::read_and_report_conjugacy_classes_and_normalizers "
1452 "before read_conjugacy_classes_and_normalizers_from_MAGMA" << endl;
1453 }
1455 fname,
1456 nb_classes,
1457 perms,
1458 class_size,
1459 class_order_of_element,
1460 class_normalizer_order,
1461 class_normalizer_number_of_generators,
1462 normalizer_generators_perms,
1463 verbose_level - 1);
1464 if (f_v) {
1465 cout << "action::read_and_report_conjugacy_classes_and_normalizers "
1466 "after read_conjugacy_classes_and_normalizers_from_MAGMA" << endl;
1467 }
1468
1469
1470#if 0
1471 PA = NEW_OBJECT(projective_space_with_action);
1472
1473 int f_semilinear;
1474
1475 if (is_prime(q)) {
1476 f_semilinear = FALSE;
1477 }
1478 else {
1479 f_semilinear = TRUE;
1480 }
1481 PA->init(
1482 F, 3 /* n */, f_semilinear,
1483 FALSE /* f_init_incidence_structure */,
1484 verbose_level);
1485#endif
1486
1487
1490
1491 group_order(go);
1492 cout << "The group has order " << go << endl;
1493
1494 string fname_latex;
1496
1497 fname_latex.assign(fname);
1498
1499 ST.replace_extension_with(fname_latex, ".tex");
1500
1501
1502 ost << "\\section{Conjugacy classes in $" << label_tex << "$}" << endl;
1503
1504
1505 ost << "The group order is " << endl;
1506 ost << "$$" << endl;
1507 go.print_not_scientific(ost);
1508 ost << endl;
1509 ost << "$$" << endl;
1510
1511
1512 cout << "The conjugacy classes are:" << endl;
1513 for (i = 0; i < nb_classes; i++) {
1515 ring_theory::longinteger_object go1, Class_size, centralizer_order;
1516 int goi;
1518
1519
1520 goi = class_order_of_element[i];
1522
1523 gens->init_from_permutation_representation(this, override_Sims,
1524 perms + i * degree,
1525 1, goi, nice_gens,
1526 verbose_level);
1527
1528 if (f_v) {
1529 cout << "action::normalizer_using_MAGMA "
1530 "after gens->init_from_permutation_"
1531 "representation" << endl;
1532 }
1533
1534 Class_size.create(class_size[i], __FILE__, __LINE__);
1535
1536 D.integral_division_exact(go, Class_size, centralizer_order);
1537
1538
1539
1540 long int ngo;
1541 int nb_perms;
1544
1545 ngo = class_normalizer_order[i];
1546 nb_perms = class_normalizer_number_of_generators[i];
1547
1548 //int *class_normalizer_order;
1549 //int *class_normalizer_number_of_generators;
1550 //int **normalizer_generators_perms;
1551
1553 N_gens->init_from_permutation_representation(this, override_Sims,
1554 normalizer_generators_perms[i],
1555 nb_perms, ngo, nice_gens_N,
1556 verbose_level - 1);
1557
1558 cout << "class " << i << " / " << nb_classes
1559 << " size = " << class_size[i]
1560 << " order of element = " << class_order_of_element[i]
1561 << " centralizer order = " << centralizer_order
1562 << " normalizer order = " << ngo
1563 << " : " << endl;
1564 cout << "packing::read_conjugacy_classes_and_normalizers created "
1565 "generators for a group" << endl;
1566 gens->print_generators(cout);
1568 gens->group_order(go1);
1569 cout << "packing::read_conjugacy_classes_and_normalizers "
1570 "The group has order " << go1 << endl;
1571
1572 ost << "\\bigskip" << endl;
1573 ost << "\\subsection*{Class " << i << " / "
1574 << nb_classes << "}" << endl;
1575 ost << "Order of element = " << class_order_of_element[i]
1576 << "\\\\" << endl;
1577 ost << "Class size = " << class_size[i] << "\\\\" << endl;
1578 ost << "Centralizer order = " << centralizer_order
1579 << "\\\\" << endl;
1580 ost << "Normalizer order = " << ngo
1581 << "\\\\" << endl;
1582
1583 int *Elt = NULL;
1584
1585
1586 if (class_order_of_element[i] > 1) {
1587 Elt = nice_gens->ith(0);
1588 ost << "Representing element is" << endl;
1589 ost << "$$" << endl;
1590 element_print_latex(Elt, ost);
1591 ost << "$$" << endl;
1592 ost << "$";
1594 ost << "$\\\\" << endl;
1595
1596
1597
1598 }
1599 ost << "The normalizer is generated by:\\\\" << endl;
1600 N_gens->print_generators_tex(ost);
1601
1602
1603#if 0
1604 if (class_order_of_element[i] > 1) {
1605 fp << "The fix structure is:\\\\" << endl;
1606 PA->report_fixed_objects_in_PG_3_tex(
1607 Elt, fp,
1608 verbose_level);
1609
1610 fp << "The orbit structure is:\\\\" << endl;
1611 PA->report_orbits_in_PG_3_tex(
1612 Elt, fp,
1613 verbose_level);
1614 }
1615 if (class_order_of_element[i] > 1) {
1616
1617 PA->report_decomposition_by_single_automorphism(
1618 Elt, fp,
1619 verbose_level);
1620 // PA->
1621 //action *A; // linear group PGGL(d,q)
1622 //action *A_on_lines; // linear group PGGL(d,q) acting on lines
1623
1624
1625 }
1626#endif
1627
1628 FREE_int(normalizer_generators_perms[i]);
1629
1630 FREE_OBJECT(nice_gens_N);
1631 FREE_OBJECT(nice_gens);
1632 FREE_OBJECT(N_gens);
1633 FREE_OBJECT(gens);
1634 } // next i
1635
1636 FREE_int(perms);
1637 FREE_int(class_size);
1638 FREE_int(class_order_of_element);
1639 FREE_lint(class_normalizer_order);
1640 FREE_int(class_normalizer_number_of_generators);
1641 FREE_pint(normalizer_generators_perms);
1642 //FREE_OBJECT(PA);
1643
1644 if (f_v) {
1645 cout << "action::read_and_report_conjugacy_classes_and_normalizers done" << endl;
1646 }
1647}
1648
1649
1651 int nb_subgroups,
1653 int verbose_level)
1654{
1655 int f_v = (verbose_level >= 1);
1656 int u;
1658
1659 if (f_v) {
1660 cout << "action::report_groups_and_normalizers" << endl;
1661 }
1662
1663 for (u = 0; u < nb_subgroups; u++) {
1664
1665 ost << "\\subsection*{Class " << u << " / " << nb_subgroups << "}" << endl;
1666
1667 H_gens[u].group_order(go1);
1668 N_gens[u].group_order(go2);
1669
1670 ost << "Group order = " << go1 << "\\\\" << endl;
1671 ost << "Normalizer order = " << go2 << "\\\\" << endl;
1672
1673 ost << "Generators for $H$:\\\\" << endl;
1674
1676 H_gens[u].print_generators_as_permutations_tex(ost, this);
1677
1678 ost << "\\bigskip" << endl;
1679
1680 ost << "Generators for $N(H)$:\\\\" << endl;
1681
1683 N_gens[u].print_generators_as_permutations_tex(ost, this);
1684
1685 }
1686
1687
1688 if (f_v) {
1689 cout << "action::report_groups_and_normalizers done" << endl;
1690 }
1691}
1692
1694 char *fname_latex, int verbose_level)
1695{
1696 int f_v = (verbose_level >= 1);
1697 //int i, j, cnt;
1698 //int v[4];
1700
1701 if (f_v) {
1702 cout << "action::report_fixed_objects" << endl;
1703 }
1704
1705
1706 {
1707 ofstream fp(fname_latex);
1708 char title[2000];
1710
1711 snprintf(title, 2000, "Fixed Objects");
1712
1713 L.head(fp,
1714 FALSE /* f_book */, TRUE /* f_title */,
1715 title, "" /* const char *author */,
1716 FALSE /* f_toc */, FALSE /* f_landscape */, TRUE /* f_12pt */,
1717 TRUE /* f_enlarged_page */, TRUE /* f_pagenumbers */,
1718 NULL /* extra_praeamble */);
1719 //latex_head_easy(fp);
1720
1721 fp << "\\section{Fixed Objects}" << endl;
1722
1723
1724
1725 fp << "The element" << endl;
1726 fp << "$$" << endl;
1727 element_print_latex(Elt, fp);
1728 fp << "$$" << endl;
1729 fp << "has the following fixed objects:\\\\" << endl;
1730
1731
1732 #if 0
1733 fp << "\\subsection{Fixed Points}" << endl;
1734
1735 cnt = 0;
1736 for (i = 0; i < P3->N_points; i++) {
1737 j = element_image_of(i, Elt, 0 /* verbose_level */);
1738 if (j == i) {
1739 cnt++;
1740 }
1741 }
1742
1743 fp << "There are " << cnt << " fixed points, they are: \\\\" << endl;
1744 for (i = 0; i < P3->N_points; i++) {
1745 j = element_image_of(i, Elt, 0 /* verbose_level */);
1746 F->PG_element_unrank_modified(v, 1, 4, i);
1747 if (j == i) {
1748 fp << i << " : ";
1749 int_vec_print(fp, v, 4);
1750 fp << "\\\\" << endl;
1751 cnt++;
1752 }
1753 }
1754
1755 fp << "\\subsection{Fixed Lines}" << endl;
1756
1757 {
1758 action *A2;
1759
1760 A2 = induced_action_on_grassmannian(2, 0 /* verbose_level*/);
1761
1762 cnt = 0;
1763 for (i = 0; i < A2->degree; i++) {
1764 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
1765 if (j == i) {
1766 cnt++;
1767 }
1768 }
1769
1770 fp << "There are " << cnt << " fixed lines, they are: \\\\" << endl;
1771 cnt = 0;
1772 for (i = 0; i < A2->degree; i++) {
1773 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
1774 if (j == i) {
1775 fp << i << " : $\\left[";
1777 fp << "\\right]$\\\\" << endl;
1778 cnt++;
1779 }
1780 }
1781
1782 FREE_OBJECT(A2);
1783 }
1784
1785 fp << "\\subsection{Fixed Planes}" << endl;
1786
1787 {
1788 action *A2;
1789
1790 A2 = induced_action_on_grassmannian(3, 0 /* verbose_level*/);
1791
1792 cnt = 0;
1793 for (i = 0; i < A2->degree; i++) {
1794 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
1795 if (j == i) {
1796 cnt++;
1797 }
1798 }
1799
1800 fp << "There are " << cnt << " fixed planes, they are: \\\\" << endl;
1801 cnt = 0;
1802 for (i = 0; i < A2->degree; i++) {
1803 j = A2->element_image_of(i, Elt, 0 /* verbose_level */);
1804 if (j == i) {
1805 fp << i << " : $\\left[";
1807 fp << "\\right]$\\\\" << endl;
1808 cnt++;
1809 }
1810 }
1811
1812 FREE_OBJECT(A2);
1813 }
1814 #endif
1815
1816
1817 L.foot(fp);
1818 }
1819 cout << "Written file " << fname_latex << " of size "
1820 << Fio.file_size(fname_latex) << endl;
1821
1822
1823 if (f_v) {
1824 cout << "action::report_fixed_objects done" << endl;
1825 }
1826}
1827
1829 int *Elt_B, int *Elt_C, int verbose_level)
1830{
1831 int f_v = (verbose_level >= 1);
1832 //int f_vv = (verbose_level >= 2);
1833 int *Elt1, *Elt2;
1834
1835
1836 if (f_v) {
1837 cout << "action::element_conjugate_bvab" << endl;
1838 }
1841 if (f_v) {
1842 cout << "action::element_conjugate_bvab A=" << endl;
1843 element_print_quick(Elt_A, cout);
1844 cout << "action::element_conjugate_bvab B=" << endl;
1845 element_print_quick(Elt_B, cout);
1846 }
1847
1848 element_invert(Elt_B, Elt1, 0);
1849 element_mult(Elt1, Elt_A, Elt2, 0);
1850 element_mult(Elt2, Elt_B, Elt_C, 0);
1851 if (f_v) {
1852 cout << "action::element_conjugate_bvab C=B^-1 * A * B" << endl;
1853 element_print_quick(Elt_C, cout);
1854 }
1855 FREE_int(Elt1);
1856 FREE_int(Elt2);
1857 if (f_v) {
1858 cout << "action::element_conjugate_bvab done" << endl;
1859 }
1860}
1861
1863 int *Elt_B, int *Elt_C, int verbose_level)
1864{
1865 int f_v = (verbose_level >= 1);
1866 //int f_vv = (verbose_level >= 2);
1867 int *Elt1, *Elt2;
1868
1869
1870 if (f_v) {
1871 cout << "action::element_conjugate_babv" << endl;
1872 }
1875
1876 element_invert(Elt_B, Elt1, 0);
1877 element_mult(Elt_B, Elt_A, Elt2, 0);
1878 element_mult(Elt2, Elt1, Elt_C, 0);
1879
1880 FREE_int(Elt1);
1881 FREE_int(Elt2);
1882}
1883
1885 int *Elt_B, int *Elt_C, int verbose_level)
1886{
1887 int f_v = (verbose_level >= 1);
1888 //int f_vv = (verbose_level >= 2);
1889 int *Elt1, *Elt2, *Elt3, *Elt4;
1890
1891
1892 if (f_v) {
1893 cout << "action::element_commutator_abavbv" << endl;
1894 }
1899
1900 element_invert(Elt_A, Elt1, 0);
1901 element_invert(Elt_B, Elt2, 0);
1902 element_mult(Elt_A, Elt_B, Elt3, 0);
1903 element_mult(Elt3, Elt1, Elt4, 0);
1904 element_mult(Elt4, Elt2, Elt_C, 0);
1905
1906 FREE_int(Elt1);
1907 FREE_int(Elt2);
1908 FREE_int(Elt3);
1909 FREE_int(Elt4);
1910}
1911
1913 groups::strong_generators *&projectivity_gens,
1914 groups::strong_generators *Aut_gens, int verbose_level)
1915{
1916 int f_v = (verbose_level >= 1);
1917
1918 if (f_v) {
1919 cout << "action::compute_projectivity_subgroup" << endl;
1920 }
1921
1923 if (f_v) {
1924 cout << "action::compute_projectivity_subgroup "
1925 "computing projectivity subgroup" << endl;
1926 }
1927
1928 projectivity_gens = NEW_OBJECT(groups::strong_generators);
1929 {
1930 groups::sims *S;
1931
1932 if (f_v) {
1933 cout << "action::compute_projectivity_subgroup "
1934 "before Aut_gens->create_sims" << endl;
1935 }
1936 S = Aut_gens->create_sims(0 /*verbose_level */);
1937 if (f_v) {
1938 cout << "action::compute_projectivity_subgroup "
1939 "after Aut_gens->create_sims" << endl;
1940 }
1941 if (f_v) {
1942 cout << "action::compute_projectivity_subgroup "
1943 "before projectivity_group_gens->projectivity_subgroup" << endl;
1944 }
1945 projectivity_gens->projectivity_subgroup(S, verbose_level - 3);
1946 if (f_v) {
1947 cout << "action::compute_projectivity_subgroup "
1948 "after projectivity_group_gens->projectivity_subgroup" << endl;
1949 }
1950 FREE_OBJECT(S);
1951 }
1952 if (f_v) {
1953 cout << "action::compute_projectivity_subgroup "
1954 "computing projectivity subgroup done" << endl;
1955 }
1956 }
1957 else {
1958 projectivity_gens = NULL;
1959 }
1960
1961
1962 if (f_v) {
1963 cout << "action::compute_projectivity_subgroup done" << endl;
1964 }
1965}
1966
1967
1968
1969}}}
1970
functions related to strings and character arrays
void replace_extension_with(char *p, const char *new_ext)
void print_single_generator_matrix_tex(std::ostream &ost, long int a)
Definition: grassmann.cpp:122
void head(std::ostream &ost, int f_book, int f_title, const char *title, const char *author, int f_toc, int f_landscape, int f_12pt, int f_enlarged_page, int f_pagenumbers, const char *extras_for_preamble)
domain to compute with objects of type longinteger
Definition: ring_theory.h:240
void integral_division_exact(longinteger_object &a, longinteger_object &b, longinteger_object &a_over_b)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
void create(long int i, const char *file, int line)
a permutation group in a fixed action.
Definition: actions.h:99
void element_print_latex(void *elt, std::ostream &ost)
Definition: action_cb.cpp:364
void element_print_as_permutation_with_offset(void *elt, std::ostream &ost, int offset, int f_do_it_anyway_even_for_big_degree, int f_print_cycles_of_length_one, int verbose_level)
Definition: action_cb.cpp:463
void compute_projectivity_subgroup(groups::strong_generators *&projectivity_gens, groups::strong_generators *Aut_gens, int verbose_level)
void element_conjugate_babv(int *Elt_A, int *Elt_B, int *Elt_C, int verbose_level)
void centralizer_using_MAGMA(std::string &prefix, groups::sims *G, int *Elt, groups::strong_generators *&gens, int verbose_level)
void element_conjugate_bvab(int *Elt_A, int *Elt_B, int *Elt_C, int verbose_level)
void conjugacy_classes_using_MAGMA(std::string &prefix, groups::sims *G, int verbose_level)
void element_print_quick(void *elt, std::ostream &ost)
Definition: action_cb.cpp:353
void normalizer_using_MAGMA(std::string &fname_magma_prefix, groups::sims *G, groups::sims *H, groups::strong_generators *&gens_N, int verbose_level)
void conjugacy_classes_and_normalizers(groups::sims *override_Sims, std::string &label, std::string &label_tex, int verbose_level)
void element_print_latex_with_extras(void *elt, std::string &label, std::ostream &ost)
Definition: action_cb.cpp:370
void element_mult(void *a, void *b, void *ab, int verbose_level)
Definition: action_cb.cpp:315
void normalizer_of_cyclic_group_using_MAGMA(std::string &fname_magma_prefix, groups::sims *G, int *Elt, groups::strong_generators *&gens_N, int verbose_level)
void element_print_for_make_element(void *elt, std::ostream &ost)
Definition: action_cb.cpp:409
void find_subgroups_using_MAGMA(std::string &prefix, groups::sims *override_Sims, int subgroup_order, int &nb_subgroups, groups::strong_generators *&H_gens, groups::strong_generators *&N_gens, int verbose_level)
void element_invert(void *a, void *av, int verbose_level)
Definition: action_cb.cpp:322
void read_centralizer_magma(std::string &fname_output, groups::sims *override_Sims, groups::strong_generators *&gens, int verbose_level)
void read_subgroups_magma(std::string &fname_output, groups::sims *override_Sims, int subgroup_order, int &nb_subgroups, groups::strong_generators *&H_gens, groups::strong_generators *&N_gens, int verbose_level)
void conjugacy_classes_and_normalizers_using_MAGMA(std::string &prefix, groups::sims *G, int verbose_level)
void read_conjugacy_classes_and_normalizers_from_MAGMA(std::string &fname, int &nb_classes, int *&perms, int *&class_size, int *&class_order_of_element, long int *&class_normalizer_order, int *&class_normalizer_number_of_generators, int **&normalizer_generators_perms, int verbose_level)
void centralizer_using_magma2(std::string &prefix, std::string &fname_magma, std::string &fname_output, groups::sims *override_Sims, int *Elt, int verbose_level)
action * induced_action_on_grassmannian(int k, int verbose_level)
void element_commutator_abavbv(int *Elt_A, int *Elt_B, int *Elt_C, int verbose_level)
void report_fixed_objects(int *Elt, char *fname_latex, int verbose_level)
void report_conjugacy_classes_and_normalizers(std::ostream &ost, groups::sims *override_Sims, int verbose_level)
void find_subgroups_using_MAGMA2(std::string &prefix, std::string &fname_magma, std::string &fname_output, groups::sims *override_Sims, int subgroup_order, int verbose_level)
void group_order(ring_theory::longinteger_object &go)
Definition: action.cpp:2223
void read_conjugacy_classes_and_normalizers(std::string &fname, groups::sims *override_sims, std::string &label_latex, int verbose_level)
long int element_image_of(long int a, void *elt, int verbose_level)
Definition: action_cb.cpp:198
void report_groups_and_normalizers(std::ostream &ost, int nb_subgroups, groups::strong_generators *H_gens, groups::strong_generators *N_gens, int verbose_level)
void read_and_report_conjugacy_classes_and_normalizers(std::ostream &ost, std::string &fname, groups::sims *override_Sims, int verbose_level)
void conjugacy_classes_and_normalizers_using_MAGMA_make_fnames(std::string &prefix, std::string &fname_magma, std::string &fname_output)
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void init_cyclic_group_from_generator(actions::action *A, int *Elt, int verbose_level)
Definition: sims.cpp:378
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void print_generators_as_permutations_tex(std::ostream &ost, actions::action *A2)
void print_generators_MAGMA(actions::action *A, std::ostream &ost)
void init_from_permutation_representation(actions::action *A, sims *parent_group_S, int *data, int nb_elements, long int group_order, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
void init_from_sims(groups::sims *S, int verbose_level)
void group_order(ring_theory::longinteger_object &go)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_pint(n)
Definition: foundations.h:627
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define Int_matrix_print(A, B, C)
Definition: foundations.h:707
#define NEW_OBJECTS(type, n)
Definition: foundations.h:639
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define FREE_pint(p)
Definition: foundations.h:641
the orbiter library for the classification of combinatorial objects
induced_actions::action_on_grassmannian * AG