Orbiter 2022
Combinatorial Objects
difference_set_in_heisenberg_group.cpp
Go to the documentation of this file.
1/*
2 * difference_set_in_heisenberg_group.cpp
3 *
4 * Created on: Oct 28, 2019
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace apps_combinatorics {
18
19#if 0
20static void difference_set_in_heisenberg_group_early_test_func(
21 long int *S, int len,
22 long int *candidates, int nb_candidates,
23 long int *good_candidates, int &nb_good_candidates,
24 void *data, int verbose_level);
25#endif
26
27
29 field_theory::finite_field *F, int verbose_level)
30{
31 int f_v = (verbose_level >= 1);
32 int i; //, j, a, b, ord;
34
35 if (f_v) {
36 cout << "difference_set_in_heisenberg_group::init" << endl;
37 }
40 q = F->q;
41
43 H->init(F, n, verbose_level);
44
45 cout << "group order = " << H->group_order << endl;
46 H->group_table(Table, verbose_level);
47 cout << "group_table:" << endl;
48 if (H->group_order < 50) {
50 Table, H->group_order, H->group_order, FALSE /* f_tex */);
51 }
52 else {
53 cout << "Too big to print" << endl;
54 }
55 H->group_table_abv(Table_abv, verbose_level);
56 cout << "group order = " << H->group_order << endl;
57
58
59 H->generating_set(gens, nb_gens, verbose_level);
60 cout << "Generating set of size " << nb_gens << ":" << endl;
62 cout << endl;
63
64 for (i = 0; i < nb_gens; i++) {
65 cout << "generator " << i << " / " << nb_gens
66 << " is " << gens[i] << ":" << endl;
67 H->unrank_element(H->Elt1, gens[i]);
68 Int_vec_print(cout, H->Elt1, H->len);
69 cout << endl;
70 }
71
72 char str[1000];
73 sprintf(str, "H_%d_%d", n, q);
74 fname_base.assign(str);
75 //magma_write_permutation_group(fname_base,
76 //H->group_order, Table, gens, nb_gens, verbose_level);
77
78
80 //given_base = gens;
81
84
85#if 0
86 magma_normalizer_in_Sym_n(fname_base,
88 N_gens, N_nb_gens, N_go, verbose_level);
89
90 cout << "The holomorph has order " << N_go
91 << " and is generated by " << N_nb_gens
92 << " elements" << endl;
93 for (i = 0; i < N_nb_gens; i++) {
94 cout << "holomorph generator " << i << " / "
95 << N_nb_gens << ":" << endl;
96
97 ord = perm_order(N_gens + i * H->group_order, H->group_order);
98 cout << "an element of order " << ord << endl;
99 for (j = 0; j < nb_gens; j++) {
100 a = gens[j];
101 b = N_gens[i * H->group_order + a];
102 cout << a << " -> " << b << " : ";
103 H->unrank_element(H->Elt1, a);
104 H->unrank_element(H->Elt2, b);
105 int_vec_print(cout, H->Elt1, H->len);
106 cout << " -> ";
107 int_vec_print(cout, H->Elt2, H->len);
108 cout << endl;
109 }
110 }
113 for (i = 0; i < given_base_length; i++) {
114 given_base[i] = i_power_j(q, i);
115 }
116 cout << "given base: ";
117 int_vec_print(cout, given_base, given_base_length);
118 cout << endl;
119
120#if 0
121 H_gens = NEW_int(H->group_order * nb_gens);
122 for (i = 0; i < nb_gens; i++) {
123 int_vec_copy(Table + gens[i] * H->group_order,
124 H_gens + i * H->group_order, H->group_order);
125 }
126#endif
127
128 A = NEW_OBJECT(action);
129
130
131 cout << "creating holomorph" << endl;
135 0 /*verbose_level*/);
136 {
137 longinteger_object go;
138 A->group_order(go);
139 cout << "The order of the holomorph is " << go << endl;
140 }
141
142 cout << "creating automorphism group" << endl;
143 Aut_gens = A->Strong_gens->point_stabilizer(0 /* pt */, verbose_level);
145 cout << "The automorphism group has order " << Aut_order << endl;
146#endif
147
149
152 Aut_gens,
153 verbose_level);
154
156
157
158
159 if (f_v) {
160 cout << "difference_set_in_heisenberg_group::init done" << endl;
161 }
162}
163
165{
166 int f_v = (verbose_level >= 1);
167 int i, j, a, b, t;
168 int h, k, f, /*l,*/ u, v, len1, len2, /*pos,*/ s;
171
172 if (f_v) {
173 cout << "difference_set_in_heisenberg_group::do_n2q3" << endl;
174 }
175
178
180
181 base_image_elts[0] = 1;
182 base_image_elts[2] = 1;
183 base_image_elts[4] = 2;
184
185 base_image_elts[5 + 1] = 1;
186 base_image_elts[5 + 3] = 1;
187 base_image_elts[5 + 4] = 2;
188
189 base_image_elts[10 + 2] = 1;
190
191 base_image_elts[15 + 3] = 1;
192
193 base_image_elts[20 + 4] = 1;
194
195 for (i = 0; i < 5; i++) {
197 }
198
200
201 cout << "making element" << endl;
202 A->make_element_from_base_image(E1, A->Sims, base_image, verbose_level);
203 cout << "generator has been created:" << endl;
204 A->element_print(E1, cout);
205 cout << endl;
206
207
209 U_gens->init_single(A, E1, verbose_level - 2);
210
211 Aut = Aut_gens->create_sims(verbose_level);
213
214 cout << "The group U" << endl;
216 U_gens, 0 /* verbose_level */);
218 cout << "The order of U is " << U_go << endl;
219
220
221
223 Sch->init(A, verbose_level - 2);
224 Sch->init_generators(*U_gens, verbose_level - 2);
225 Sch->compute_all_point_orbits(0 /*verbose_level*/);
226 cout << "The orbits of U are:" << endl;
230
231 char str[1000];
232 sprintf(str, "N_U_2_3");
233 prefix.assign(str);
234
235 cout << "computing normalizer of U in G:" << endl;
236
238
239 A->normalizer_using_MAGMA(prefix, Aut, U, gens_N, verbose_level);
240 // added gens_N, Oct 12, 2018
241
242 fname_magma_out.assign(prefix);
243 fname_magma_out.append("normalizer.txt");
244
245
247 H->group_order, N_gens, N_nb_gens, N_go, verbose_level);
248
249
250
253 int f_no_base = FALSE;
254
255 n_go.create(N_go, __FILE__, __LINE__);
257 TRUE, n_go,
260 f_no_base,
261 0 /*verbose_level*/);
263
264 cout << "created the normalizer N of order " << N_order << endl;
265
266
268 cout << "rk_E1 = " << rk_E1 << endl;
269
271
272 cout << "creating action on orbits:" << endl;
274 TRUE /* f_play_it_safe */,
275 verbose_level);
276
277 cout << "action on orbits has been created, degree = "
278 << N_on_orbits->degree << endl;
279
280
282 for (i = 0; i < Sch->nb_orbits; i++) {
283 f = Sch->orbit_first[i];
284 //l = Sch->orbit_len[i];
285 a = Sch->orbit[f];
286 b = H->element_negate_by_rank(a, 0 /* verbose_level */);
287 //pos = Sch->orbit_inv[b];
288 j = Sch->orbit_number(b);
289 // Sch->orbit_no[pos];
290 Paired_with[i] = j;
291 }
292 cout << "Paired_with:" << endl;
293 for (i = 0; i < Sch->nb_orbits; i++) {
294 cout << i << " : " << Paired_with[i] << endl;
295 }
297 Pairs = NEW_lint(Sch->nb_orbits * 2);
299 for (i = 0; i < Sch->nb_orbits; i++) {
300 if (Paired_with[i] <= i) {
301 // omit the self paired orbit of the identity element
302 continue;
303 }
304 Pairs[2 * nb_paired_orbits + 0] = i;
305 Pairs[2 * nb_paired_orbits + 1] = Paired_with[i];
308 }
309 cout << "We found " << nb_paired_orbits << " paired orbits" << endl;
310 for (h = 0; h < nb_paired_orbits; h++) {
311 a = Pairs[2 * h + 0];
312 b = Pairs[2 * h + 1];
313 u = Sch->orbit_first[a];
314 v = Sch->orbit_first[b];
315 len1 = Sch->orbit_len[a];
316 len2 = Sch->orbit_len[b];
317 cout << h << " / " << nb_paired_orbits << " : "
318 << a << "," << b << " = {";
319 for (k = 0; k < len1; k++) {
320 i = Sch->orbit[u + k];
321 cout << i;
322 if (k < len1 - 1) {
323 cout << ", ";
324 }
325 }
326 cout << "}, ";
327 cout << "{";
328 for (k = 0; k < len2; k++) {
329 j = Sch->orbit[v + k];
330 cout << j;
331 if (k < len2 - 1) {
332 cout << ", ";
333 }
334 }
335 cout << "}, orbits of length " << len1 << endl;
336 if (len1 != len2) {
337 cout << "len1 != len2" << endl;
338 exit(1);
339 }
340 }
341
342
343 data_structures::tally Pair_orbit_type;
344 Pair_orbit_type.init(Pair_orbit_length, nb_paired_orbits, FALSE, 0);
345
347
348
349 Pair_orbit_type.get_class_by_value(Pairs_of_type1,
350 nb_pairs_of_type1, 1, 0 /* verbose_level */);
351 Pair_orbit_type.get_class_by_value(Pairs_of_type2,
352 nb_pairs_of_type2, 3, 0 /* verbose_level */);
355 cout << "We found " << nb_pairs_of_type1
356 << " pairs of short orbits, they are:" << endl;
358 cout << endl;
359 cout << "We found " << nb_pairs_of_type2
360 << " pairs of long orbits, they are:" << endl;
362 cout << endl;
363
364
365
367 for (s = 0; s < nb_pairs_of_type1; s++) {
368 h = Pairs_of_type1[s];
369 a = Pairs[2 * h + 0];
370 b = Pairs[2 * h + 1];
371 u = Sch->orbit_first[a];
372 v = Sch->orbit_first[b];
373 len1 = Sch->orbit_len[a];
374 len2 = Sch->orbit_len[b];
375 Sets1[s * 2 + 0] = Sch->orbit[u];
376 Sets1[s * 2 + 1] = Sch->orbit[v];
377 }
379 for (s = 0; s < nb_pairs_of_type2; s++) {
380 h = Pairs_of_type2[s];
381 a = Pairs[2 * h + 0];
382 b = Pairs[2 * h + 1];
383 u = Sch->orbit_first[a];
384 v = Sch->orbit_first[b];
385 len1 = Sch->orbit_len[a];
386 len2 = Sch->orbit_len[b];
387 for (k = 0; k < 3; k++) {
388 Sets2[s * 6 + k] = Sch->orbit[u + k];
389 }
390 for (k = 0; k < 3; k++) {
391 Sets2[s * 6 + 3 + k] = Sch->orbit[v + k];
392 }
393 }
394 cout << "Sets1:" << endl;
396 Sets1, nb_pairs_of_type1, 2, FALSE /* f_tex */);
397 cout << "Sets2:" << endl;
399 Sets2, nb_pairs_of_type2, 6, FALSE /* f_tex */);
400
401
402
403
406
407
410
413
414 for (s = 0; s < nb_pairs_of_type1; s++) {
415 h = Pairs_of_type1[s];
416 Lint_vec_copy(Pairs + 2 * h, Short_pairs + 2 * s, 2);
417 for (t = 0; t < 2; t++) {
418 a = Short_pairs[2 * s + t];
419 Short_orbit_inverse[a] = 2 * s + t;
420 }
421 }
422
423
424 for (s = 0; s < nb_pairs_of_type2; s++) {
425 h = Pairs_of_type2[s];
426 Lint_vec_copy(Pairs + 2 * h, Long_pairs + 2 * s, 2);
427 }
428
429 cout << "Short_pairs:" << endl;
431 Short_pairs, nb_pairs_of_type1, 2, FALSE /* f_tex */);
432 cout << "Long_pairs:" << endl;
434 Long_pairs, nb_pairs_of_type2, 2, FALSE /* f_tex */);
435
436
437 cout << "creating restricted action on short orbits:" << endl;
439 Short_pairs, nb_short_orbits, verbose_level);
440
441
442 //create_minimal_overgroups(verbose_level);
443
444 check_overgroups_of_order_nine(verbose_level);
445}
446
447
449 int verbose_level)
450{
451 int f_v = (verbose_level >= 1);
454
455
456
457 if (f_v) {
458 cout << "difference_set_in_heisenberg_group::check_"
459 "overgroups_of_order_nine" << endl;
460 }
461 int second_gen_idx[] = {
462 731, 353, 381, 379, 46, 357, 700, 359, 698, 721,
463 696, 694, 723, 355, 725, 44, 690, 688, 686, 664,
464 733, 383, 660, 347, 42, 656, 345, 652, 343, 1035,
465 648, 1037, 387, 40, 991, 1295, 1293, 995, 1289, 1287,
466 997, 1283, 1279, 1258, 1254, 38, 1244, 1220, 1218, 1216,
467 1027, 1248, 1210, 1208, 1206, 1007, 1078, 1003, 1072, 1070,
468 426, 1064, 999, 424, 1062, 1043, 1041, 422, 1285, 420,
469 418, 52, 1250, 414, 50, 993, 391, 658, 737, 385,
470 48, 1029 };
471
472 int *Elt1, *Elt2;
473 int h;
474 int nb_overgroups = sizeof(second_gen_idx) / sizeof(int);
475
476 Elt1 = NEW_int(A->elt_size_in_int);
477 Elt2 = NEW_int(A->elt_size_in_int);
478
479
480 cout << "making element Elt1:" << endl;
481 N->Sims->element_unrank_lint(rk_E1, Elt1, 0);
482 A->element_print(Elt1, cout);
483 cout << endl;
484
485
486 for (h = 0; h < nb_overgroups; h++) {
487
488 cout << "overgroup " << h << " / "
489 << nb_overgroups << ":" << endl;
490
491 groups::sims *O;
494 groups::schreier *Sch1;
495
496
497 cout << "making element" << endl;
498 N->Sims->element_unrank_lint(second_gen_idx[h], Elt2, 0);
499 cout << "second generator has been created:" << endl;
500 A->element_print(Elt2, cout);
501 cout << endl;
502
503
505 O_gens->init_double(A, Elt1, Elt2, verbose_level - 2);
506
508
509 cout << "The group O" << endl;
511 O_gens, 0 /* verbose_level */);
512 O->group_order(O_go);
513 cout << "The order of O is " << O_go << endl;
514 if (O_go.as_int() != 9) {
515 cout << "The group O does not have order 9" << endl;
516 exit(1);
517 }
518
519
520
522 Sch1->init(N_on_orbits, verbose_level - 2);
523 Sch1->init_generators(*O_gens, verbose_level - 2);
524 Sch1->compute_all_point_orbits(0 /*verbose_level*/);
525 cout << "The orbits of O are:" << endl;
526 Sch1->print_and_list_orbits_tex(cout);
527 Sch1->print_orbit_lengths(cout);
529
530
531 data_structures::tally Overgroup_orbit_type;
532 Overgroup_orbit_type.init(Sch1->orbit_len,
533 Sch1->nb_orbits, FALSE, 0);
534 cout << "Overgroup orbit type:" << endl;
535 Overgroup_orbit_type.print_naked(TRUE);
536 cout << endl;
537
538 int *Pairing;
539 int s, a, b, f, l, o1, o2; //, pos;
540
541
542 Pairing = NEW_int(nb_long_orbits);
543 for (a = 0; a < Sch1->nb_orbits; a++) {
544 f = Sch1->orbit_first[a];
545 l = Sch1->orbit_len[a];
546 o1 = Sch1->orbit[f];
547 o2 = Paired_with[o1];
548
549
550 cout << "normalizer orbit " << a << " / "
551 << Sch1->nb_orbits << " is U-orbit " << o1 << endl;
552 cout << "U-orbit " << o1 << " is paired with U-orbit " << o2 << endl;
553 //pos = Sch1->orbit_inv[o2];
554 b = Sch1->orbit_number(o2); // Sch1->orbit_no[pos];
555 cout << "Which is normalizer orbit " << b << endl;
556 Pairing[a] = b;
557 }
558 cout << "Pairing:" << endl;
560 Pairing, Sch1->nb_orbits, 1, FALSE /* f_tex */);
561
562
563 int *long_orbits;
564 int nb_long_orbits;
565 int *Pairs_of_long_orbits;
566 int nb_pairs_of_long_orbits;
567
568
569 Overgroup_orbit_type.get_class_by_value(
570 long_orbits, nb_long_orbits, 3, 0 /* verbose_level */);
571 Sorting.int_vec_heapsort(long_orbits, nb_long_orbits);
572 cout << "We found " << nb_long_orbits
573 << " long orbits, they are:" << endl;
574 Int_vec_print(cout, long_orbits, nb_long_orbits);
575 cout << endl;
576
577
578
579
580 Pairs_of_long_orbits = NEW_int(Sch1->nb_orbits * 2);
581 nb_pairs_of_long_orbits = 0;
582 for (s = 0; s < nb_long_orbits; s++) {
583 a = long_orbits[s];
584 b = Pairing[a];
585 if (b <= a) {
586 continue;
587 }
588 Pairs_of_long_orbits[nb_pairs_of_long_orbits * 2 + 0] = a;
589 Pairs_of_long_orbits[nb_pairs_of_long_orbits * 2 + 1] = b;
590 nb_pairs_of_long_orbits++;
591 }
592 cout << "Pairs_of_long_orbits:" << endl;
594 Pairs_of_long_orbits, nb_pairs_of_long_orbits,
595 2, FALSE /* f_tex */);
596
597
598 int N;
599 int *selection;
600 int *count;
601 int *D;
602 int D_sz;
603 int u, t, ff, ll, v, k, di, dj;
604 int i, j;
605 int nb_good, nb_bad;
608
609 N = NT.i_power_j(2, nb_pairs_of_long_orbits);
610 cout << "N=" << N << endl;
611 selection = NEW_int(nb_pairs_of_long_orbits);
612 D = NEW_int(H->group_order);
613 count = NEW_int(H->group_order);
614 nb_good = 0;
615 nb_bad = 0;
616 for (u = 0; u < N; u++) {
617 Gg.AG_element_unrank(2, selection, 1,
618 nb_pairs_of_long_orbits, u);
619 D_sz = 0;
620 for (t = 0; t < nb_pairs_of_long_orbits; t++) {
621 if (selection[t]) {
622 a = Pairs_of_long_orbits[t * 2 + 1];
623 }
624 else {
625 a = Pairs_of_long_orbits[t * 2 + 0];
626 }
627 f = Sch1->orbit_first[a];
628 l = Sch1->orbit_len[a];
629 if (l != 3) {
630 cout << "l != 3" << endl;
631 cout << "a=" << a << endl;
632 cout << "l=" << l << endl;
633 cout << "s=" << s << endl;
634 cout << "t=" << t << endl;
635 cout << "testing case " << u << " = ";
636 Int_vec_print(cout, selection,
637 nb_pairs_of_long_orbits);
638 cout << endl;
639 exit(1);
640 }
641 for (v = 0; v < l; v++) {
642 o1 = Sch1->orbit[f + v];
643 ff = Sch->orbit_first[o1];
644 ll = Sch->orbit_len[o1];
645 if (ll != 3) {
646 cout << "ll != 3" << endl;
647 exit(1);
648 }
649 for (k = 0; k < ll; k++) {
650 D[D_sz++] = Sch->orbit[ff + k];
651 }
652 }
653 }
654 if (((u + 250) % 1) == 0) {
655 cout << "testing case " << u << " = ";
656 Int_vec_print(cout, selection,
657 nb_pairs_of_long_orbits);
658 cout << endl;
659 cout << "We found a set D of size "
660 << D_sz << ":" << endl;
661 Int_vec_print(cout, D, D_sz);
662 cout << endl;
663 }
664 Int_vec_zero(count, H->group_order);
665 for (i = 0; i < D_sz; i++) {
666 di = D[i];
667 for (j = 0; j < D_sz; j++) {
668 if (j == i) {
669 continue;
670 }
671 dj = D[j];
672 k = Table_abv[di * H->group_order + dj];
673 count[k]++;
674 }
675 }
676
678 D_type.init(count, H->group_order, FALSE, 0);
679 cout << "D type:" << endl;
680 D_type.print_naked(TRUE);
681 cout << endl;
682 for (i = 0; i < H->group_order; i++) {
683 if (count[i] > 60) {
684 break;
685 }
686 }
687 if (i < H->group_order) {
688 cout << "bad" << endl;
689 nb_bad++;
690 }
691 else {
692 cout << "good" << endl;
693 nb_good++;
694 }
695
696
697 }
698 cout << "group " << h << ":" << endl;
699 cout << "nb_good=" << nb_good << endl;
700 cout << "nb_bad=" << nb_bad << endl;
701
702 if (nb_good) {
703 break;
704 }
705
706 delete Sch1;
707 delete O;
708 delete O_gens;
709
710 //exit(1);
711 } // next h
712
713 if (f_v) {
714 cout << "difference_set_in_heisenberg_group::check_"
715 "overgroups_of_order_nine done" << endl;
716 }
717}
718
720 int verbose_level)
721{
722 int f_v = (verbose_level >= 1);
723 int *Zuppos;
724 int nb_zuppos;
725 int goi;
727 int i, j, t;
728
729 if (f_v) {
730 cout << "difference_set_in_heisenberg_group::create_"
731 "minimal_overgroups" << endl;
732 }
733
734 N->Sims->group_order(go);
735 cout << "go=" << go << endl;
736 goi = go.as_int();
737
738
739 Zuppos = NEW_int(goi);
740 N->Sims->zuppo_list(Zuppos, nb_zuppos, verbose_level);
741
742 cout << "We found " << nb_zuppos << " zuppos." << endl;
743 Int_vec_print(cout, Zuppos, nb_zuppos);
744 cout << endl;
745
746 int *subgroup_elements;
747 int subgroup_sz;
748 int *gens;
749 int nb_gens;
750 int *cosets;
751 //int new_gen;
752 int *group;
753 int group_sz;
754
755 subgroup_elements = NEW_int(goi);
756 gens = NEW_int(goi);
757 cosets = NEW_int(goi);
758 group = NEW_int(goi);
759 groups::subgroup **Subs;
760 int *Group_order;
761 int z;
762
763 Subs = new groups::psubgroup[nb_zuppos];
764
765 Group_order = NEW_int(nb_zuppos);
766
767 for (z = 0; z < nb_zuppos; z++) {
768 //cout << "zuppo " << z << " / " << nb_zuppos << ":" << endl;
769 subgroup_elements[0] = 0;
770 subgroup_sz = 1;
771 nb_gens = 0;
772 N->Sims->dimino(
773 subgroup_elements, subgroup_sz, gens, nb_gens,
774 cosets,
775 Zuppos[z] /* new_gen*/,
776 group, group_sz,
777 0 /* verbose_level */);
778
779#if 0
780 cout << "found a group of order " << group_sz << " : ";
781 int_vec_print(cout, group, group_sz);
782 cout << endl;
783#endif
784
785 Group_order[z] = group_sz;
786
787 Subs[z] = new groups::subgroup;
788 Subs[z]->init(group, group_sz, gens, nb_gens);
789
790 }
791 data_structures::tally Group_orders;
792 int *Idx_subgroup;
793 int nb_subgroups;
794 int o, idx_E1;
795
796 Group_orders.init(Group_order, nb_zuppos, FALSE, 0);
797 cout << "We found the following group orders: ";
798 Group_orders.print_naked(TRUE);
799 cout << endl;
800
801
802 groups::subgroup **Subgroups_of_order;
803
804 for (i = 0; i < Group_orders.nb_types; i++) {
805 o = Group_orders.data_sorted[Group_orders.type_first[i]];
806 Group_orders.get_class_by_value(
807 Idx_subgroup, nb_subgroups,
808 o /* value */, verbose_level);
809 cout << "We have " << nb_subgroups
810 << " subgroups of order " << o << endl;
811
812 Subgroups_of_order = new groups::psubgroup[nb_subgroups];
813 for (j = 0; j < nb_subgroups; j++) {
814 Subgroups_of_order[j] = Subs[Idx_subgroup[j]];
815 Subs[Idx_subgroup[j]] = NULL;
816 }
817
818 cout << "The subgroups of order " << o << " are:" << endl;
819 for (j = 0; j < nb_subgroups; j++) {
820 Subgroups_of_order[j]->print();
821 }
822
823 if (o == 3) {
824 // search for the group which contains the element rk_E1:
825 for (j = 0; j < nb_subgroups; j++) {
826
827 if (Subgroups_of_order[j]->contains_this_element(rk_E1)) {
828 break;
829 }
830 }
831 if (j == nb_subgroups) {
832 cout << "We could not find the group containing "
833 "the element rk_E1" << endl;
834 exit(1);
835 }
836 idx_E1 = j;
837 cout << "The subgroup containing the element E1=" << rk_E1
838 << " has index " << idx_E1 << ":" << endl;
839 Subgroups_of_order[j]->print();
840
841 actions::action *A_on_subgroups;
842
843 cout << "creating action on the subgroups:" << endl;
844 A_on_subgroups = N->create_induced_action_on_subgroups(
845 N->Sims,
846 nb_subgroups, o /* group_order */,
847 Subgroups_of_order, verbose_level);
848 cout << "action on subgroups created:" << endl;
849 A_on_subgroups->print_info();
850
851
852 groups::schreier *Sch_subgroups;
853
854 cout << "computing orbit of conjugated subgroups:" << endl;
855 Sch_subgroups = N->Strong_gens->orbit_of_one_point_schreier(
856 A_on_subgroups, idx_E1, verbose_level);
857
858 cout << "found an orbit of conjugated subgroups of length "
859 << Sch_subgroups->orbit_len[0] << endl;
860
861 // compute minimal overgroups:
862 groups::subgroup **Overgroups;
863 int *Overgroup_order;
864
865 Overgroups = new groups::psubgroup[nb_zuppos];
866
867 Overgroup_order = NEW_int(nb_zuppos);
868
869 for (z = 0; z < nb_zuppos; z++) {
870 cout << "zuppo " << z << " / " << nb_zuppos << ":" << endl;
871 Int_vec_copy(Subgroups_of_order[j]->Elements,
872 subgroup_elements,
873 Subgroups_of_order[j]->group_order);
874 subgroup_sz = Subgroups_of_order[j]->group_order;
875 Int_vec_copy(Subgroups_of_order[j]->gens,
876 gens,
877 Subgroups_of_order[j]->nb_gens);
878 nb_gens = Subgroups_of_order[j]->nb_gens;
879 N->Sims->dimino(
880 subgroup_elements, subgroup_sz, gens, nb_gens,
881 cosets,
882 Zuppos[z] /* new_gen*/,
883 group, group_sz,
884 0 /* verbose_level */);
885
886 cout << "found a group of order " << group_sz << " : ";
887 Int_vec_print(cout, group, group_sz);
888 cout << endl;
889
890 Overgroup_order[z] = group_sz;
891
892 Overgroups[z] = new groups::subgroup;
893 Overgroups[z]->init(group, group_sz, gens, nb_gens);
894
895 }
896 data_structures::tally Overgroup_orders;
897
898 Overgroup_orders.init(Overgroup_order, nb_zuppos, FALSE, 0);
899 cout << "We found the following overgroup orders: ";
900 Overgroup_orders.print_naked(TRUE);
901 cout << endl;
902
903 int *Idx_overgroup;
904 int nb_overgroups;
905 int ii, oo, f, a;
906
907 groups::subgroup **Overgroups_of_order;
908
909 for (ii = 0; ii < Overgroup_orders.nb_types; ii++) {
910 oo = Overgroup_orders.data_sorted[
911 Overgroup_orders.type_first[ii]];
912 if (oo == 3) {
913 continue;
914 }
915 Overgroup_orders.get_class_by_value(
916 Idx_overgroup, nb_overgroups,
917 oo /* value */,
918 verbose_level);
919 cout << "We have " << nb_overgroups
920 << " overgroups of order " << oo << endl;
921
922 Overgroups_of_order = new groups::psubgroup[nb_overgroups];
923 for (j = 0; j < nb_overgroups; j++) {
924 Overgroups_of_order[j] = Overgroups[Idx_overgroup[j]];
925 Overgroups[Idx_overgroup[j]] = NULL;
926 }
927
928
929#if 0
930 cout << "The overgroups of order " << oo << " are:" << endl;
931 for (j = 0; j < nb_overgroups; j++) {
932 cout << j << " / " << nb_overgroups << " : ";
933 Overgroups_of_order[j]->print();
934 }
935#endif
936 actions::action *A_on_overgroups;
937
938 cout << "creating action on the overgroups of order "
939 << oo << ":" << endl;
940 A_on_overgroups = N->create_induced_action_on_subgroups(
941 N->Sims,
942 nb_overgroups, oo /* group_order */,
943 Overgroups_of_order,
944 0 /*verbose_level*/);
945 cout << "action on overgroups created:" << endl;
946 A_on_overgroups->print_info();
947
948
949 groups::schreier *Sch_overgroups;
950
951 cout << "computing the orbits of conjugated "
952 "overgroups of order " << oo << ":" << endl;
953 Sch_overgroups = N->Strong_gens->orbits_on_points_schreier(
954 A_on_overgroups, 0 /*verbose_level*/);
955
956 cout << "The conjugacy classes of overgroups of order "
957 << oo << " have the following lengths: ";
958 Sch_overgroups->print_orbit_length_distribution(cout);
959 cout << "There are " << Sch_overgroups->nb_orbits
960 << " classes" << endl;
961 cout << "Representatives of the conjugacy "
962 "classes are:" << endl;
963
964 int *second_generator;
965 second_generator = NEW_int(Sch_overgroups->nb_orbits);
966 for (j = 0; j < Sch_overgroups->nb_orbits; j++) {
967 //cout << "orbit " << j << " / "
968 //<< Sch_overgroups->nb_orbits << ":" << endl;
969 f = Sch_overgroups->orbit_first[j];
970 a = Sch_overgroups->orbit[f];
971 //Overgroups_of_order[a]->print();
972 for (t = 0; t < 2; t++) {
973 if (Overgroups_of_order[a]->gens[t] != rk_E1) {
974 second_generator[j] =
975 Overgroups_of_order[a]->gens[t];
976 break;
977 }
978 }
979 if (t == 2) {
980 cout << "t == 2" << endl;
981 exit(1);
982 }
983 }
984 cout << "the second generators are:" << endl;
985 //print_integer_matrix_with_standard_labels(cout,
986 // second_generator, Sch_overgroups->nb_orbits,
987 // 1, FALSE /* f_tex */);
989 second_generator, Sch_overgroups->nb_orbits);
990 cout << endl;
991 } // next ii
992 exit(1);
993 }
994 }
995#if 0
996 char prefix[000];
997 int f_W = TRUE;
998 int f_w = FALSE;
999 int target_depth = nb_pairs_of_type1;
1000
1001 sprintf(prefix, "H_%d_%d_short", n, q);
1002
1003 cout << "classifying subsets:" << endl;
1004
1006
1007 compute_orbits_on_subsets(gen,
1008 target_depth,
1009 prefix,
1010 f_W, f_w,
1012 N->Strong_gens,
1013 difference_set_in_heisenberg_group_early_test_func,
1014 this /* void *early_test_func_data */,
1015 NULL, // int (*candidate_incremental_check_func)(
1016 //int len, int *S, void *data, int verbose_level),
1017 this /* void *candidate_incremental_check_data */,
1018 verbose_level);
1019
1020#endif
1021
1022 if (f_v) {
1023 cout << "difference_set_in_heisenberg_group::do_n2q3 done" << endl;
1024 }
1025}
1026
1028 long int *candidates, int nb_candidates,
1029 long int *good_candidates, int &nb_good_candidates,
1030 int verbose_level)
1031{
1032 verbose_level = 1;
1033 int f_v = (verbose_level >= 1);
1034 int i, a, aa, b, bb;
1035
1036 if (f_v) {
1037 cout << "difference_set_in_heisenberg_group::early_test_func" << endl;
1038 cout << "S=";
1039 Lint_vec_print(cout, S, len);
1040 cout << endl;
1041 }
1042
1043 nb_good_candidates = 0;
1045
1046
1047 for (i = 0; i < len; i++) {
1048 if (f_v) {
1049 cout << "set element " << i << " / " << len << ":" << endl;
1050 }
1051 a = S[i];
1052 f_orbit_select[a] = TRUE;
1053 aa = Short_pairs[a];
1054 bb = Paired_with[aa];
1055 b = Short_orbit_inverse[bb];
1056 if (f_v) {
1057 cout << "orbit " << a << "=" << aa << " is paired with "
1058 << bb << "=" << b << endl;
1059 }
1060 if (b == -1) {
1061 cout << "difference_set_in_heisenberg_group::early_test_func "
1062 "b = -1" << endl;
1063 cout << "chosen orbit " << a << "=" << aa
1064 << " which is paired with " << bb
1065 << "=" << b << endl;
1066 exit(1);
1067 }
1068 if (f_orbit_select[b]) {
1069 cout << "difference_set_in_heisenberg_group::early_test_func "
1070 "the set is not admissible" << endl;
1071 exit(1);
1072 }
1073 }
1074 for (i = 0; i < nb_candidates; i++) {
1075 a = candidates[i];
1076 if (f_orbit_select[a]) {
1077 continue; // we don't allow an orbit twice.
1078 }
1079 aa = Short_pairs[a];
1080 bb = Paired_with[aa];
1081 b = Short_orbit_inverse[bb];
1082 if (f_v) {
1083 cout << "testing orbit " << a << "=" << aa
1084 << " which is paired with " << bb << "=" << b << " : ";
1085 }
1086 if (b == -1) {
1087 cout << "difference_set_in_heisenberg_group::early_test_func "
1088 "b = -1" << endl;
1089 cout << "testing orbit " << a << "=" << aa
1090 << " which is paired with " << bb << "="
1091 << b << " : " << endl;
1092 exit(1);
1093 }
1094 if (!f_orbit_select[b]) {
1095 if (f_v) {
1096 cout << " is OK" << endl;
1097 }
1098 good_candidates[nb_good_candidates++] = a;
1099 }
1100 else {
1101 if (f_v) {
1102 cout << " is bad" << endl;
1103 }
1104 }
1105 }
1106 if (f_v) {
1107 cout << "we found " << nb_good_candidates
1108 << " good candidates" << endl;
1109 }
1110 if (f_v) {
1111 cout << "They are:" << endl;
1112 Lint_vec_print(cout, good_candidates, nb_good_candidates);
1113 cout << endl;
1114 }
1115 if (f_v) {
1116 cout << "difference_set_in_heisenberg_group::early_test_func done" << endl;
1117 }
1118}
1119
1120
1121#if 0
1122static void difference_set_in_heisenberg_group_early_test_func(
1123 long int *S, int len,
1124 long int *candidates, int nb_candidates,
1125 long int *good_candidates, int &nb_good_candidates,
1126 void *data, int verbose_level)
1127{
1130
1131 DS->early_test_func(S, len,
1132 candidates, nb_candidates,
1133 good_candidates, nb_good_candidates,
1134 verbose_level);
1135}
1136#endif
1137
1138
1139
1140}}}
1141
Heisenberg group of n x n matrices.
Definition: algebra.h:542
void generating_set(int *&gens, int &nb_gens, int verbose_level)
Definition: heisenberg.cpp:180
void init(field_theory::finite_field *F, int n, int verbose_level)
Definition: heisenberg.cpp:52
int element_negate_by_rank(int rk_a, int verbose_level)
Definition: heisenberg.cpp:121
void group_table_abv(int *&Table_abv, int verbose_level)
Definition: heisenberg.cpp:155
void group_table(int *&Table, int verbose_level)
Definition: heisenberg.cpp:131
void unrank_element(int *Elt, long int rk)
Definition: heisenberg.cpp:76
void print_Cpp(std::ostream &ost, int *v, int len)
Definition: int_vec.cpp:556
a collection of functions related to sorted vectors
a statistical analysis of data consisting of single integers
void init(int *data, int data_length, int f_second, int verbose_level)
Definition: tally.cpp:72
void get_class_by_value(int *&Pts, int &nb_pts, int value, int verbose_level)
Definition: tally.cpp:644
various functions related to geometries
Definition: geometry.h:721
void AG_element_unrank(int q, int *v, int stride, int len, long int a)
void print_lint_matrix_with_standard_labels(std::ostream &ost, long int *p, int m, int n, int f_tex)
void print_integer_matrix_with_standard_labels(std::ostream &ost, int *p, int m, int n, int f_tex)
void read_permutation_group(std::string &fname, int degree, int *&gens, int &nb_gens, int &go, int verbose_level)
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
action * restricted_action(long int *points, int nb_points, int verbose_level)
void element_print(void *elt, std::ostream &ost)
Definition: action_cb.cpp:347
void normalizer_using_MAGMA(std::string &fname_magma_prefix, groups::sims *G, groups::sims *H, groups::strong_generators *&gens_N, int verbose_level)
action * create_induced_action_on_subgroups(groups::sims *S, int nb_subgroups, int group_order, groups::subgroup **Subgroups, int verbose_level)
groups::strong_generators * Strong_gens
Definition: actions.h:130
void induced_action_on_orbits(action *old_action, groups::schreier *Sch, int f_play_it_safe, int verbose_level)
void init_automorphism_group_from_group_table(std::string &fname_base, int *Table, int group_order, int *gens, int nb_gens, groups::strong_generators *&Aut_gens, int verbose_level)
groups::sims * create_sims_from_generators_without_target_group_order(data_structures_groups::vector_ge *gens, int verbose_level)
void group_order(ring_theory::longinteger_object &go)
Definition: action.cpp:2223
void make_element_from_base_image(int *Elt, groups::sims *S, int *data, int verbose_level)
Definition: action.cpp:1695
void init_permutation_group_from_generators(int degree, int f_target_go, ring_theory::longinteger_object &target_go, int nb_gens, int *gens, int given_base_length, long int *given_base, int f_no_base, int verbose_level)
void init_double(actions::action *A, int *Elt1, int *Elt2, int verbose_level)
Definition: vector_ge.cpp:125
void init_single(actions::action *A, int *Elt, int verbose_level)
Definition: vector_ge.cpp:110
Schreier trees for orbits of groups on points.
Definition: groups.h:839
void compute_all_point_orbits(int verbose_level)
Definition: schreier.cpp:988
void init_generators(data_structures_groups::vector_ge &generators, int verbose_level)
Definition: schreier.cpp:373
void print_orbit_length_distribution(std::ostream &ost)
void init(actions::action *A, int verbose_level)
Definition: schreier.cpp:308
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void dimino(int *subgroup, int subgroup_sz, int *gens, int &nb_gens, int *cosets, int new_gen, int *group, int &group_sz, int verbose_level)
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
void zuppo_list(int *Zuppos, int &nb_zuppos, int verbose_level)
void element_unrank_lint(long int rk, int *Elt, int verbose_level)
Definition: sims.cpp:1326
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
strong_generators * point_stabilizer(int pt, int verbose_level)
schreier * orbit_of_one_point_schreier(actions::action *A_given, int pt, int verbose_level)
schreier * orbits_on_points_schreier(actions::action *A_given, int verbose_level)
void group_order(ring_theory::longinteger_object &go)
a subgroup of a group using a list of elements
Definition: groups.h:2039
void init(int *Elements, int group_order, int *gens, int nb_gens)
Definition: subgroup.cpp:96
void early_test_func(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, int verbose_level)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define NEW_int(n)
Definition: foundations.h:625
#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_copy_to_lint(A, B, C)
Definition: foundations.h:722
#define NEW_lint(n)
Definition: foundations.h:628
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects