Orbiter 2022
Combinatorial Objects
spread_classify2.cpp
Go to the documentation of this file.
1// spread2.cpp
2//
3// Anton Betten
4// November 17, 2009
5//
6//
7//
8// moved here from translation_plane.cpp: April 23, 2013
9// moved to TOP_LEVEL: November 2, 2013
10// renamed to spread2.cpp from translation_plane2.cpp: March 25, 2018
11//
12//
13
14#include "orbiter.h"
15
16using namespace std;
17
18namespace orbiter {
19namespace layer5_applications {
20namespace spreads {
21
22
23
24// spread_classify2.cpp
25#if 0
26static int spread_check_function_callback(int len, long int *S,
27 void *data, int verbose_level);
28static void spread_callback_report(isomorph *Iso, void *data, int verbose_level);
29static void spread_callback_make_quotients(isomorph *Iso, void *data,
30 int verbose_level);
31static void callback_spread_print(std::ostream &ost, int len, long int *S, void *data);
32#endif
33
35 int iso_cnt, groups::sims *Stab, groups::schreier &Orb,
36 long int *data, int verbose_level)
37// called from callback_print_isomorphism_type()
38{
39 int f_v = (verbose_level >= 1);
40 string fname;
41 string fname_klein;
42 char str[1000];
43
44
45
46
47 if (f_v) {
48 cout << "spread_classify::print_isomorphism_type" << endl;
49 }
50
51 fname.assign(Iso->prefix);
52 sprintf(str, "_%d.tex", iso_cnt);
53 fname.append(str);
54
55 //sprintf(fname, "%s_%d.tex", Iso->prefix, iso_cnt);
56
57
58 fname_klein.assign(Iso->prefix);
59 sprintf(str, "_%d_klein.tex", iso_cnt);
60 fname_klein.append(str);
61
62 //sprintf(fname_klein, "%s_%d_klein.tex", Iso->prefix, iso_cnt);
63
64 int save_longinteger_f_print_scientific = orbiter_kernel_system::Orbiter->longinteger_f_print_scientific;
66 {
67 ofstream file(fname);
69 //ofstream file_klein(fname_klein);
70 if (f_v) {
71 cout << "opening file " << fname << " for writing" << endl;
72 //cout << "opening file " << fname_klein << " for writing" << endl;
73 }
74
75 L.head(file,
76 FALSE/* f_book*/, FALSE /* f_title */, NULL /*title*/,
77 "Orbiter" /*char *author*/, FALSE/* f_toc*/,
78 FALSE /* f_landscape*/,
79 FALSE /* f_12pt */,
80 TRUE /* f_enlarged_page */,
81 TRUE /* f_pagenumbers */,
82 NULL /* extra_praeamble */);
83
84
85 print_isomorphism_type2(Iso, file, iso_cnt, Stab, Orb, data, verbose_level);
86
87 L.foot(file);
88
89 orbiter_kernel_system::Orbiter->longinteger_f_print_scientific = save_longinteger_f_print_scientific;
90 }
91
93
94 if (f_v) {
95 cout << "spread_classify::print_isomorphism_type written file "
96 << fname << " of size " << Fio.file_size(fname) << endl;
97 cout << "spread_classify::print_isomorphism_type written file "
98 << fname_klein << " of size "
99 << Fio.file_size(fname_klein) << endl;
100 }
101
102
103
104}
105
106
108 ostream &ost,
109 int iso_cnt, groups::sims *Stab, groups::schreier &Orb,
110 long int *data, int verbose_level)
111{
112 int f_v = (verbose_level >= 1);
113 int i;
115 long int *pt_list;
116 int f, l, j, idx, pt;
117 int p, h;
118 int f_elements_exponential = FALSE;
119 string symbol_for_print;
120
123
124 if (f_v) {
125 cout << "spread_classify::print_isomorphism_type2" << endl;
126 }
127
128
129 symbol_for_print.assign("\\alpha");
130
131
132 NT.factor_prime_power(q, p, h);
133 if (h > 1) {
134 f_elements_exponential = TRUE;
135 }
136
137 ost << "\\parindent=0pt" << endl;
138 ost << endl;
139 ost << "\\section{Spread " << iso_cnt << "}" << endl;
140 //int_vec_print(file, data, q + 1);
141 //file << endl;
142
143 Stab->group_order(so);
144
146
147
148 C.init(Orb.orbit_len, Orb.nb_orbits, FALSE, 0);
149
150 ost << "Stabilizer has order " << so << "\\\\" << endl;
151
152 ost << "\\bigskip" << endl;
153
154 ost << "There are $" << Orb.nb_orbits
155 << "$ orbits on the set.\\\\" << endl;
156 ost << "The orbit type is $[";
157 C.print_naked_tex(ost, FALSE /*f_backwards*/);
158 ost << "]$\\\\" << endl;
159 ost << "\\bigskip" << endl;
160
161
162 if (k == 2) {
163 klein(ost, /*file_klein,*/ Iso, iso_cnt,
164 Stab, Orb, data, Iso->size, verbose_level);
165 }
166
167 ost << "The set of " << k - 1 << "-Subspaces in "
168 "PG($" << n - 1 << ", " << q << "$) is:\\\\" << endl;
169
170 for (i = 0; i < Iso->size; i++) {
171 ost << "$S_{" << i + 1 << "}$ has rank " << data[i]
172 << " and is generated by\\\\" << endl;
173 Grass->unrank_lint(data[i], 0);
174 ost << "$$" << endl;
175 ost << "\\left[" << endl;
176 Mtx->GFq->latex_matrix(ost, f_elements_exponential, symbol_for_print,
177 Grass->M, k, n);
178 ost << "\\right]" << endl;
179 ost << "$$" << endl << endl;
180 }
181
182 ost << "The stabilizer of order " << so
183 << " is generated by:\\\\" << endl;
184 for (i = 0; i < Stab->gens.len; i++) {
185
186 int *fp, n;
187
188 fp = NEW_int(A->degree);
189 n = A->find_fixed_points(Stab->gens.ith(i), fp, 0);
190 //cout << "with " << n << " fixed points" << endl;
191 FREE_int(fp);
192
193 ost << "$$ g_{" << i + 1 << "}=" << endl;
194 A->element_print_latex(Stab->gens.ith(i), ost);
195 ost << "$$" << endl << "with " << n << " fixed points" << endl;
196 }
197
198
199
200 if (f_v) {
201 cout << "spread_classify::print_isomorphism_type "
202 "calling induced_action_on_set_and_kernel" << endl;
203 }
205 A, Stab, Iso->size, data, verbose_level - 1);
206
207 if (f_v) {
208 cout << "spread_classify::print_isomorphism_type "
209 "induced_action_on_set_and_kernel finished" << endl;
210 }
211
212
213#if 0
214 for (i = 0; i < Stab->gens.len; i++) {
215 file << "$g_{" << setw(2) << i + 1 << "} = ";
216 AA->element_print_as_permutation_with_offset(Stab->gens.ith(i), file, 1);
217 file << "$\\\\" << endl;
218 }
219#endif
220
221 pt_list = NEW_lint(Iso->size);
222
223 ost << "The orbits on the set are:\\\\" << endl;
224 for (i = 0; i < Orb.nb_orbits; i++) {
225 f = Orb.orbit_first[i];
226 l = Orb.orbit_len[i];
227 ost << "$O_{" << i << "}=\\{";
228 for (j = 0; j < l; j++) {
229 idx = f + j;
230 pt = Orb.orbit[idx];
231 pt_list[j] = pt;
232 }
233
234 Sorting.lint_vec_heapsort(pt_list, l);
235
236 for (j = 0; j < l; j++) {
237 ost << pt_list[j] + 1;
238 if (j < l - 1)
239 ost << ",";
240 }
241 ost << "\\}$ (length $" << l << "$)\\\\" << endl;
242 }
243
244#if 0
245
246 if (Orb.nb_orbits > 1) {
247 file << "\\bigskip" << endl;
248 file << "The actions induced on the orbits are:\\\\" << endl;
249
250 for (i = 0; i < Orb.nb_orbits; i++) {
251 induced_action_on_orbit(file, AA, Stab, Orb, i, verbose_level - 2);
252 }
253 }
254#endif
255
256
257
258 FREE_lint(pt_list);
259
260
261 if (f_v) {
262 cout << "spread_classify::print_isomorphism_type2 done" << endl;
263 }
264
265}
266
268 int iso_cnt,
269 long int *data, int data_size, int verbose_level)
270{
271 int f_v = (verbose_level >= 1);
273 long int **Pts_on_plane;
274 int *nb_pts_on_plane;
275 int nb_planes;
276 int i, j;
277
278 if (f_v) {
279 cout << "spread_classify::klein_invariants" << endl;
280 }
281
282 if (Klein == NULL) {
283 cout << "spread_classify::klein_invariants Klein == NULL" << endl;
284 exit(1);
285 }
286
287 Klein->plane_intersections(data, data_size,
288 R,
289 Pts_on_plane,
290 nb_pts_on_plane,
291 nb_planes,
292 verbose_level - 2);
293
294
295 Vector v;
296
297 v.m_l(3);
298 v.m_ii(0, nb_planes);
299 v.s_i(1).change_to_vector();
300 v.s_i(2).change_to_vector();
301
302 v.s_i(1).as_vector().m_l(nb_planes);
303 v.s_i(2).as_vector().m_l(nb_planes);
304 for (i = 0; i < nb_planes; i++) {
305 v.s_i(1).as_vector().m_ii(i, R[i].as_int());
306 //v.s_i(1).as_vector().s_i(i).change_to_longinteger();
307 //v.s_i(1).as_vector().s_i(i).as_longinteger().allocate(1, R[i].rep());
308 v.s_i(2).as_vector().s_i(i).change_to_vector();
309 v.s_i(2).as_vector().s_i(i).as_vector().m_l(nb_pts_on_plane[i]);
310 for (j = 0; j < nb_pts_on_plane[i]; j++) {
311 v.s_i(2).as_vector().s_i(i).as_vector().m_ii(j, Pts_on_plane[i][j]);
312 }
313 }
314
315 char fname[1000];
316
317 sprintf(fname, "%s%d_klein_invariant.bin", prefix, iso_cnt);
318 v.save_file(fname);
319
320 delete [] R;
321 for (i = 0; i < nb_planes; i++) {
322 FREE_lint(Pts_on_plane[i]);
323 }
324 FREE_plint(Pts_on_plane);
325 FREE_int(nb_pts_on_plane);
326
327 if (f_v) {
328 cout << "spread_classify::klein_invariants done" << endl;
329 }
330}
331
332void spread_classify::klein(ostream &ost,
333 isomorph *Iso,
334 int iso_cnt, groups::sims *Stab, groups::schreier &Orb,
335 long int *data, int data_size, int verbose_level)
336// Called from print_isomorphism_type if k == 2
337{
338 int f_v = (verbose_level >= 1);
340 long int **Pts_on_plane;
341 int *nb_pts_on_plane;
342 int nb_planes;
343
344
345
346 int set_size = data_size;
347 int a, i, j, h;
348
349 Klein->plane_intersections(data, data_size,
350 R,
351 Pts_on_plane,
352 nb_pts_on_plane,
353 nb_planes,
354 verbose_level);
355
357 int f_second = FALSE;
358
359 C.init(nb_pts_on_plane, nb_planes, f_second, 0);
360 if (f_v) {
361 cout << "spread::klein: plane-intersection type: ";
362 C.print(FALSE /*f_backwards*/);
363 }
364
365 ost << "Plane type of Klein-image is $( ";
366 C.print_naked_tex(ost, FALSE /*f_backwards*/);
367 ost << " )$" << endl << endl;
368 ost << "\\bigskip" << endl << endl;
369
370 int nb_blocks, f, l, m, u, uu, idx;
371 int *Inc;
372
373 m = 0;
374 for (i = 0; i < C.nb_types; i++) {
375 f = C.type_first[i];
376 l = C.type_len[i];
377 a = C.data_sorted[f];
378 m = MAXIMUM(a, m);
379 }
380
381 nb_blocks = 0;
382 for (i = 0; i < C.nb_types; i++) {
383 f = C.type_first[i];
384 l = C.type_len[i];
385 a = C.data_sorted[f];
386 if (a == m) {
387 nb_blocks += l;
388 }
389 }
390 if (f_v) {
391 cout << "There are " << nb_blocks
392 << " interesting planes" << endl;
393 }
394 Inc = NEW_int(set_size * nb_blocks);
395 for (i = 0; i < set_size * nb_blocks; i++) {
396 Inc[i] = 0;
397 }
398 j = 0;
399 for (h = 0; h < C.nb_types; h++) {
400 f = C.type_first[h];
401 l = C.type_len[h];
402 a = C.data_sorted[f];
403 if (a == m) {
404 for (u = 0; u < l; u++) {
405 a = C.data_sorted[f + u];
406 idx = C.sorting_perm_inv[f + u];
407 for (uu = 0; uu < a; uu++) {
408 i = Pts_on_plane[idx][uu];
409 Inc[i * nb_blocks + j] = 1;
410 }
411 j++;
412 } // next u
413 } // if
414 } // next h
415
416 if (nb_blocks < 20) {
417
418 cout << "we will draw an incidence picture" << endl;
419
420 string fname_pic;
421 char str[1000];
424
426 I->init_by_matrix(set_size, nb_blocks, Inc, 0 /* verbose_level */);
428 Stack->allocate(set_size + nb_blocks, 0 /* verbose_level */);
429 Stack->subset_continguous(set_size, nb_blocks);
430 Stack->split_cell(0 /* verbose_level */);
431 Stack->sort_cells();
432
433 fname_pic.assign(Iso->prefix);
434 sprintf(str, "_%d_planes.tex", iso_cnt);
435 fname_pic.append(str);
436
437 {
438 ofstream fp_pic(fname_pic);
439
440 ost << "\\input " << fname_pic << endl;
441 I->latex_it(fp_pic, *Stack);
442 ost << "\\\\" << endl;
443 }
444 FREE_OBJECT(Stack);
445 FREE_OBJECT(I);
446 }
447
448 // compute TDO:
449 {
452 int depth = INT_MAX;
453
455 I->init_by_matrix(set_size, nb_blocks, Inc, 0 /* verbose_level */);
457 Stack->allocate(set_size + nb_blocks, 0 /* verbose_level */);
458 Stack->subset_continguous(set_size, nb_blocks);
459 Stack->split_cell(0 /* verbose_level */);
460 Stack->sort_cells();
461
462 I->compute_TDO_safe(*Stack, depth, verbose_level + 2);
463
464 char str[1000];
465 string fname_row_scheme;
466 string fname_col_scheme;
467
468
469 fname_row_scheme.assign(Iso->prefix);
470 sprintf(str, "_%d_planes_row_scheme.tex", iso_cnt);
471 fname_row_scheme.append(str);
472
473 fname_col_scheme.assign(Iso->prefix);
474 sprintf(str, "_%d_planes_col_scheme.tex", iso_cnt);
475 fname_col_scheme.append(str);
476
477 {
478 ofstream fp_row_scheme(fname_row_scheme);
479 ofstream fp_col_scheme(fname_col_scheme);
481 fp_row_scheme, FALSE /* f_enter_math */,
482 TRUE /* f_print_subscripts */, *Stack);
484 fp_col_scheme, FALSE /* f_enter_math */,
485 TRUE /* f_print_subscripts */, *Stack);
486 }
487
488
489#if 0
490 ost2 << "\\section*{Spread " << iso_cnt << "}" << endl << endl;
491
492 longinteger_object go;
493 Stab->group_order(go);
494
495 ost2 << "Stabilizer has order " << go << "\\\\" << endl;
496
497 ost2 << "\\bigskip" << endl;
498
499
500 tally C0;
501 C0.init(Orb.orbit_len, Orb.nb_orbits, FALSE, 0);
502
503 ost2 << "There are $" << Orb.nb_orbits << "$ orbits on the set.\\\\" << endl;
504 ost2 << "The orbit type is $[";
505 C0.print_naked_tex(ost2);
506 ost2 << "]$\\\\" << endl;
507 ost2 << "\\bigskip" << endl;
508
509 ost2 << "Plane type of Klein-image is $(";
510 C.print_naked_tex(ost2);
511 ost2 << ")$" << endl << endl;
512#endif
513
514
515 ost << "\\bigskip" << endl << endl;
516 ost << "\\[" << endl;
517 ost << "\\input " << fname_row_scheme << endl;
518 ost << "\\quad" << endl;
519 ost << "\\input " << fname_col_scheme << endl;
520 ost << "\\]" << endl;
521
522 FREE_OBJECT(Stack);
523 FREE_OBJECT(I);
524 }
525
526 FREE_int(Inc);
527
529 for (i = 0; i < nb_planes; i++) {
530 FREE_lint(Pts_on_plane[i]);
531 }
532 FREE_plint(Pts_on_plane);
533 FREE_int(nb_pts_on_plane);
534
535 if (f_v) {
536 cout << "spread_classify::klein done" << endl;
537 }
538}
539
544 long int *data, int size,
545 int *&intersection_type, int &highest_intersection_number,
546 int verbose_level)
547{
548 int f_v = (verbose_level >= 1);
549 int f_v3 = FALSE; //(verbose_level >= 3);
550 //finite_field *F;
551 long int N;
552 long int *the_set_out;
553
554 if (f_v) {
555 cout << "spread_classify::plane_intersection_type_of_klein_image" << endl;
556 }
557 the_set_out = NEW_lint(size);
558
559 if (f_v3) {
560 P3->print_line_set_numerical(data, size);
561 }
562 P3->klein_correspondence(P5,
563 data, size, the_set_out, 0/*verbose_level*/);
564 if (f_v) {
565 cout << "after Klein correspondence:" << endl;
566 Lint_vec_print(cout, the_set_out, size);
567 cout << endl;
568 }
569 if (f_v3) {
570 P5->print_set_numerical(cout, the_set_out, size);
571 }
572
573
574 //F = P3->F;
575
576 if (f_v) {
577 cout << "spread_classify::plane_intersection_type_of_klein_image "
578 "after P3->klein_correspondence" << endl;
579 }
580
581
582 N = P5->nb_rk_k_subspaces_as_lint(3);
583 if (f_v) {
584 cout << "spread_classify::klein N = " << N << endl;
585 }
586
587
589 the_set_out, size,
590 intersection_type, highest_intersection_number,
591 verbose_level - 2);
592
593 FREE_lint(the_set_out);
594}
595
596void spread_classify::czerwinski_oakden(int level, int verbose_level)
597{
598 int f_v = (verbose_level >= 1);
599 int f_vv = (verbose_level >= 2);
600 int sz = 26;
601 long int data[26];
602 int M[8];
603 int h, u, i, a = 0, b = 0, c = 0, d = 0;
605 int spreads[] =
606 {
607 // S1:
608 0,0,0,0,
609 1,0,0,1,
610 2,0,0,2,
611 3,0,0,3,
612 4,0,0,4,
613 4,3,3,0,
614 0,3,3,1,
615 2,1,1,4,
616 4,4,4,2,
617 2,3,3,3,
618 3,4,4,1,
619 1,1,1,3,
620 3,2,2,2,
621 0,1,1,2,
622 1,2,2,0,
623 0,2,2,4,
624 2,4,4,0,
625 0,4,4,3,
626 3,1,1,0,
627 1,4,4,4,
628 4,2,2,3,
629 3,3,3,4,
630 4,1,1,1,
631 1,3,3,2,
632 2,2,2,1,
633
634 //S2:
635 0,0,0,0,
636 1,0,0,1,
637 2,0,0,2,
638 3,0,0,3,
639 4,0,0,4,
640 1,2,2,0,
641 0,2,2,4,
642 4,3,3,0,
643 0,3,3,1,
644 2,1,3,3,
645 4,4,4,1,
646 2,3,1,3,
647 3,4,2,2,
648 1,1,1,4,
649 3,2,4,2,
650 0,1,1,2,
651 2,4,4,0,
652 0,4,4,3,
653 3,1,1,0,
654 1,4,4,4,
655 4,2,2,3,
656 3,3,3,4,
657 4,1,1,1,
658 1,3,3,2,
659 2,2,2,1,
660
661 // S3:
662 0,0,0,0,
663 1,0,0,1,
664 1,2,2,0,
665 0,2,2,4,
666 4,0,0,4,
667 4,3,3,0,
668 0,3,3,1,
669 2,1,3,3,
670 4,4,4,1,
671 2,3,1,3,
672 3,4,2,2,
673 1,1,1,4,
674 3,2,4,2,
675 0,1,4,0,
676 2,0,4,3,
677 2,4,0,3,
678 0,4,1,0,
679 3,0,1,2,
680 3,1,0,2,
681 1,4,4,4,
682 4,2,2,3,
683 3,3,3,4,
684 4,1,1,1,
685 1,3,3,2,
686 2,2,2,1,
687
688 //S4:
689 0,0,0,0,
690 1,0,0,1,
691 1,2,2,0,
692 0,2,2,4,
693 4,0,0,4,
694 4,3,3,0,
695 0,3,3,1,
696 2,1,3,3,
697 4,4,4,1,
698 2,3,1,3,
699 3,4,2,2,
700 1,1,1,4,
701 3,2,4,2,
702 0,1,1,2,
703 2,0,0,2,
704 2,4,4,0,
705 0,4,4,3,
706 3,0,0,3,
707 3,1,1,0,
708 1,4,3,4,
709 4,2,1,1,
710 3,3,3,2,
711 4,1,2,1,
712 1,3,4,4,
713 2,2,2,3,
714
715 // S5:
716 0,0,0,0,
717 1,0,0,1,
718 2,0,0,2,
719 3,0,0,3,
720 4,0,0,4,
721 0,2,1,0,
722 0,3,4,0,
723 1,1,3,1,
724 1,4,2,1,
725 4,1,3,4,
726 4,4,2,4,
727 1,2,1,4,
728 1,3,4,4,
729 2,1,2,0,
730 2,2,4,3,
731 2,3,3,3,
732 2,4,1,3,
733 3,1,4,2,
734 3,2,2,2,
735 3,3,1,2,
736 3,4,3,0,
737 4,2,1,1,
738 4,3,4,1,
739 0,1,2,3,
740 0,4,3,2,
741
742 // A1:
743 0,0,0,0,
744 1,0,0,1,
745 2,0,0,2,
746 3,0,0,3,
747 4,0,0,4,
748 1,1,3,1,
749 4,4,2,4,
750 1,4,2,1,
751 4,1,3,4,
752 3,2,1,3,
753 2,2,1,2,
754 3,3,4,3,
755 2,3,4,2,
756 4,2,4,4,
757 1,3,1,1,
758 3,4,3,0,
759 2,1,2,0,
760 0,4,3,3,
761 0,1,2,2,
762 1,2,4,0,
763 4,3,1,0,
764 2,4,3,2,
765 3,1,2,3,
766 0,2,4,1,
767 0,3,1,4,
768
769 //A2:
770 0,0,0,0,
771 1,0,0,1,
772 2,0,0,2,
773 3,0,0,3,
774 4,0,0,4,
775 2,2,1,2,
776 0,3,4,0,
777 0,1,3,0,
778 4,1,3,4,
779 2,4,2,2,
780 3,4,2,3,
781 3,2,3,1,
782 4,3,2,1,
783 3,1,4,2,
784 2,1,4,1,
785 4,4,1,0,
786 0,4,1,1,
787 1,1,1,3,
788 1,4,4,4,
789 2,3,3,3,
790 1,3,3,2,
791 0,2,2,4,
792 1,2,2,0,
793 4,2,4,3,
794 3,3,1,4,
795
796 //A3:
797 0,0,0,0,
798 1,0,0,1,
799 2,0,0,2,
800 3,0,0,3,
801 4,0,0,4,
802 1,3,4,1,
803 2,3,4,2,
804 4,2,1,4,
805 2,4,4,2,
806 1,4,2,1,
807 2,2,3,0,
808 3,2,3,1,
809 3,3,2,0,
810 0,1,4,4,
811 4,1,4,3,
812 4,4,2,3,
813 0,4,2,4,
814 1,1,3,2,
815 1,2,1,3,
816 0,2,1,2,
817 2,1,1,0,
818 3,1,1,1,
819 3,4,4,0,
820 0,3,3,4,
821 4,3,3,3,
822
823 // A4:
824 0,0,0,0,
825 1,0,0,1,
826 2,0,0,2,
827 3,0,0,3,
828 4,0,0,4,
829 2,2,1,2,
830 0,3,4,0,
831 4,1,3,4,
832 3,4,2,3,
833 3,2,3,1,
834 3,1,4,2,
835 2,1,4,1,
836 4,4,1,0,
837 1,4,4,4,
838 2,3,3,3,
839 0,2,2,4,
840 1,2,2,0,
841 4,2,4,3,
842 3,3,1,4,
843 2,4,2,1,
844 0,1,1,3,
845 4,3,2,2,
846 1,1,3,0,
847 1,3,1,1,
848 0,4,3,2,
849
850 // A5:
851 0,0,0,0,
852 1,0,0,1,
853 2,0,0,2,
854 3,0,0,3,
855 4,0,0,4,
856 0,1,3,0,
857 1,2,1,4,
858 2,3,3,3,
859 3,4,1,2,
860 1,3,4,4,
861 4,3,4,2,
862 0,4,2,4,
863 3,1,3,4,
864 0,2,4,0,
865 3,2,4,3,
866 2,1,2,2,
867 1,4,3,1,
868 4,1,2,1,
869 1,1,2,3,
870 2,2,4,1,
871 0,3,1,1,
872 2,4,1,3,
873 4,4,1,0,
874 3,3,2,0,
875 4,2,3,2,
876
877 //A6:
878 0,0,0,0,
879 1,0,0,1,
880 2,0,0,2,
881 3,0,0,3,
882 4,0,0,4,
883 4,2,1,1,
884 1,3,4,4,
885 3,4,2,2,
886 3,2,1,0,
887 0,2,1,2,
888 2,2,2,3,
889 3,3,3,2,
890 1,1,1,4,
891 2,3,3,1,
892 4,3,3,3,
893 0,1,3,0,
894 0,4,2,0,
895 0,3,4,0,
896 4,4,2,4,
897 1,4,2,1,
898 2,4,1,3,
899 3,1,4,2,
900 1,2,3,4,
901 2,1,4,1,
902 4,1,4,3,
903
904 //A7:
905 0,0,0,0,
906 1,0,0,1,
907 2,0,0,2,
908 3,0,0,3,
909 4,0,0,4,
910 2,2,2,3,
911 1,3,3,0,
912 1,4,4,3,
913 2,1,1,0,
914 4,2,1,1,
915 4,3,4,2,
916 0,4,2,4,
917 3,1,3,4,
918 2,3,3,3,
919 1,2,2,0,
920 1,1,1,3,
921 2,4,4,0,
922 3,4,1,2,
923 0,1,4,1,
924 3,3,2,1,
925 0,2,3,2,
926 4,4,3,1,
927 4,1,2,2,
928 0,3,1,4,
929 3,2,4,4,
930
931 //A8:
932 0,0,0,0,
933 1,0,0,1,
934 2,0,0,2,
935 3,0,0,3,
936 4,0,0,4,
937 1,3,4,4,
938 4,3,4,2,
939 4,1,2,1,
940 2,1,2,4,
941 0,2,4,0,
942 4,4,3,4,
943 2,4,1,3,
944 3,3,2,0,
945 3,1,3,3,
946 4,2,1,4,
947 1,4,1,0,
948 0,3,2,3,
949 1,2,2,2,
950 2,3,3,1,
951 3,4,4,1,
952 0,1,1,2,
953 3,2,1,1,
954 1,1,3,0,
955 0,4,3,2,
956 2,2,4,3,
957
958 // B1:
959 0,0,0,0,
960 1,0,0,1,
961 3,0,0,3,
962 2,2,4,2,
963 2,4,3,2,
964 0,3,1,0,
965 1,2,3,4,
966 2,0,1,2,
967 2,3,2,1,
968 4,3,0,2,
969 0,4,3,1,
970 0,2,4,1,
971 1,3,4,4,
972 4,4,2,3,
973 3,4,2,4,
974 3,1,1,1,
975 1,1,1,3,
976 0,1,2,2,
977 4,0,1,4,
978 3,2,3,3,
979 2,1,0,4,
980 4,1,4,0,
981 4,2,3,0,
982 3,3,4,3,
983 1,4,2,0,
984
985 // B2:
986 0,0,0,0,
987 1,0,0,1,
988 4,0,0,4,
989 3,4,3,3,
990 3,3,1,3,
991 4,1,2,4,
992 1,4,1,2,
993 0,4,4,1,
994 1,2,2,3,
995 2,1,0,3,
996 3,1,0,2,
997 3,2,2,2,
998 4,2,1,4,
999 2,2,1,0,
1000 1,1,3,1,
1001 2,4,3,4,
1002 0,2,2,1,
1003 2,3,2,0,
1004 4,4,4,0,
1005 2,0,4,3,
1006 3,0,4,2,
1007 0,3,1,1,
1008 4,3,3,2,
1009 0,1,3,0,
1010 1,3,4,4,
1011
1012 // B3:
1013 0,0,0,0,
1014 1,0,0,1,
1015 4,0,0,4,
1016 4,4,3,4,
1017 2,2,4,2,
1018 4,1,2,4,
1019 0,4,3,0,
1020 0,2,4,4,
1021 4,2,4,0,
1022 1,2,2,3,
1023 3,1,2,0,
1024 2,1,3,3,
1025 1,3,1,4,
1026 1,1,3,2,
1027 2,4,2,1,
1028 0,1,1,1,
1029 1,4,4,3,
1030 4,3,1,0,
1031 3,2,3,1,
1032 2,3,0,3,
1033 2,0,1,3,
1034 3,0,1,2,
1035 0,3,2,2,
1036 3,4,0,2,
1037 3,3,4,1,
1038
1039 // B4:
1040 0,0,0,0,
1041 1,0,0,1,
1042 4,0,0,4,
1043 3,4,3,3,
1044 3,1,2,3,
1045 1,3,1,1,
1046 1,2,4,1,
1047 0,1,1,2,
1048 2,3,2,0,
1049 2,0,3,2,
1050 2,4,0,2,
1051 1,1,3,0,
1052 0,4,2,1,
1053 2,2,1,0,
1054 0,3,4,2,
1055 4,3,1,3,
1056 3,3,1,4,
1057 4,4,4,0,
1058 0,2,3,4,
1059 2,1,4,4,
1060 4,2,2,2,
1061 3,0,4,3,
1062 3,2,0,3,
1063 1,4,2,4,
1064 4,1,3,1,
1065
1066 // B5:
1067 0,0,0,0,
1068 1,0,0,1,
1069 2,0,0,2,
1070 4,3,1,4,
1071 1,2,4,1,
1072 3,3,1,3,
1073 1,1,2,1,
1074 1,4,1,2,
1075 2,3,3,1,
1076 3,0,4,4,
1077 4,2,0,3,
1078 0,4,1,1,
1079 1,3,3,0,
1080 0,3,2,2,
1081 2,1,1,0,
1082 3,4,0,4,
1083 4,0,3,3,
1084 0,2,4,2,
1085 2,2,4,0,
1086 4,4,2,0,
1087 0,1,3,4,
1088 4,1,4,3,
1089 3,2,2,4,
1090 2,4,2,3,
1091 3,1,3,2,
1092
1093 // B6:
1094 0,0,0,0,
1095 1,0,0,1,
1096 4,2,2,3,
1097 1,2,2,0,
1098 3,2,2,2,
1099 2,2,2,4,
1100 3,3,3,1,
1101 1,4,4,2,
1102 2,4,1,1,
1103 1,1,1,0,
1104 3,4,0,4,
1105 0,1,4,4,
1106 2,0,4,3,
1107 1,3,3,0,
1108 3,1,4,1,
1109 4,0,3,4,
1110 4,1,0,3,
1111 0,4,1,3,
1112 0,2,2,1,
1113 2,1,3,2,
1114 4,4,4,0,
1115 2,3,0,2,
1116 0,3,3,3,
1117 3,0,1,2,
1118 4,3,1,4,
1119
1120 //B7:
1121 0,0,0,0,
1122 1,0,0,1,
1123 2,2,4,2,
1124 3,2,4,3,
1125 1,2,4,1,
1126 3,3,1,3,
1127 2,4,3,2,
1128 1,1,1,0,
1129 0,3,2,1,
1130 3,1,0,2,
1131 2,0,2,3,
1132 4,1,0,3,
1133 3,0,2,4,
1134 4,4,4,0,
1135 0,2,3,4,
1136 4,3,3,0,
1137 0,4,1,4,
1138 3,4,3,1,
1139 0,1,4,4,
1140 1,4,3,3,
1141 4,2,2,0,
1142 2,3,0,4,
1143 4,0,1,2,
1144 1,3,2,2,
1145 2,1,1,1,
1146
1147 // B8:
1148 0,0,0,0,
1149 1,0,0,1,
1150 2,0,0,2,
1151 3,0,0,3,
1152 4,2,2,0,
1153 0,2,2,3,
1154 4,3,3,0,
1155 0,4,4,3,
1156 4,4,4,2,
1157 4,0,1,4,
1158 4,1,0,4,
1159 3,2,4,4,
1160 3,4,2,4,
1161 0,1,1,2,
1162 2,3,1,1,
1163 2,1,3,1,
1164 1,4,1,0,
1165 1,1,4,0,
1166 3,1,3,3,
1167 2,2,2,1,
1168 3,3,1,3,
1169 2,4,4,1,
1170 1,2,3,2,
1171 1,3,2,2,
1172 0,3,3,4,
1173
1174 };
1175
1176 if (f_v) {
1177 cout << "spread_classify::czerwinski_oakden" << endl;
1178 }
1179
1180 const char *label[] = {
1181 "S1",
1182 "S2",
1183 "S3",
1184 "S4",
1185 "S5",
1186 "A1",
1187 "A2",
1188 "A3",
1189 "A4",
1190 "A5",
1191 "A6",
1192 "A7",
1193 "A8",
1194 "B1",
1195 "B2",
1196 "B3",
1197 "B4",
1198 "B5",
1199 "B6",
1200 "B7",
1201 "B8",
1202 };
1203 char fname[] = "Czerwinski_Oakden.txt";
1204 string fname2;
1205 {
1206 ofstream fp(fname);
1207
1208 for (h = 0; h < 21; h++) {
1209 for (u = 0; u < sz; u++) {
1210 for (i = 0; i < 8; i++) {
1211 M[i] = 0;
1212 }
1213 if (u == 0) {
1214 M[0 * 4 + 2] = 1;
1215 M[1 * 4 + 3] = 1;
1216 }
1217 else {
1218 M[0 * 4 + 0] = 1;
1219 M[1 * 4 + 1] = 1;
1220 a = spreads[h * 25 * 4 + (u - 1) * 4 + 0];
1221 b = spreads[h * 25 * 4 + (u - 1) * 4 + 1];
1222 c = spreads[h * 25 * 4 + (u - 1) * 4 + 2];
1223 d = spreads[h * 25 * 4 + (u - 1) * 4 + 3];
1224 M[0 * 4 + 2] = a;
1225 M[0 * 4 + 3] = b;
1226 M[1 * 4 + 2] = c;
1227 M[1 * 4 + 3] = d;
1228 }
1229 for (i = 0; i < 8; i++) {
1230 Grass->M[i] = M[i];
1231 }
1232 if (f_vv) {
1233 cout << "spread " << h << ", element " << u << ":" << endl;
1234 if (u) {
1235 cout << "a=" << a << " b=" << b
1236 << " c=" << c << " d=" << d << endl;
1237 }
1238 }
1239 Int_matrix_print(Grass->M, 2, 4);
1240 data[u] = Grass->rank_lint(0);
1241
1242 } // next u
1243
1244 cout << "spread " << h << ":";
1245 Lint_vec_print(cout, data, sz);
1246 cout << endl;
1247
1248 fp << "0 "; // a dummy
1249 for (i = 0; i < sz; i++) {
1250 fp << data[i] << " ";
1251 }
1252 fp << endl;
1253
1254
1255 fname2.assign("Czerwinski_Oakden_");
1256 fname2.append(label[h]);
1257 fname2.append(".txt");
1258
1259 Fio.write_set_to_file(fname2, data, sz, 0/*verbose_level*/);
1260 cout << "Written file " << fname2 << " of size "
1261 << Fio.file_size(fname2) << endl;
1262 } // next h
1263 fp << -1 << endl;
1264 }
1265 cout << "Written file " << fname << " of size " << Fio.file_size(fname) << endl;
1266}
1267
1268void spread_classify::write_spread_to_file(int type_of_spread, int verbose_level)
1269{
1270 int f_v = (verbose_level >= 1);
1271 long int *data;
1272 int sz = order + 1;
1273 char str[1000];
1274
1275 if (f_v) {
1276 cout << "spread_classify::write_spread_to_file" << endl;
1277 }
1278 if (type_of_spread == SPREAD_OF_TYPE_FTWKB) {
1279 sprintf(str, "spread_q%d_FTW.txt", q);
1280 }
1281 else if (type_of_spread == SPREAD_OF_TYPE_KANTOR) {
1282 sprintf(str, "spread_q%d_Kantor.txt", q);
1283 }
1284 else if (type_of_spread == SPREAD_OF_TYPE_KANTOR2) {
1285 sprintf(str, "spread_q%d_Kantor2.txt", q);
1286 }
1287 else if (type_of_spread == SPREAD_OF_TYPE_GANLEY) {
1288 sprintf(str, "spread_q%d_Ganley.txt", q);
1289 }
1290 else if (type_of_spread == SPREAD_OF_TYPE_LAW_PENTTILA) {
1291 sprintf(str, "spread_q%d_Law_Penttila.txt", q);
1292 }
1293 else if (type_of_spread == SPREAD_OF_TYPE_DICKSON_KANTOR) {
1294 sprintf(str, "spread_q%d_DicksonKantor.txt", q);
1295 }
1296 else if (type_of_spread == SPREAD_OF_TYPE_HUDSON) {
1297 sprintf(str, "spread_q%d_Hudson.txt", q);
1298 }
1299
1300 string fname;
1301
1302 fname.assign(str);
1303
1305
1306 data = NEW_lint(sz);
1307 if (type_of_spread == SPREAD_OF_TYPE_DICKSON_KANTOR ||
1308 type_of_spread == SPREAD_OF_TYPE_HUDSON) {
1309 make_spread(data, type_of_spread, verbose_level);
1310 }
1311 else {
1312 make_spread_from_q_clan(data, type_of_spread, verbose_level);
1313 }
1314 Fio.write_set_to_file(fname, data, sz, 0/*verbose_level*/);
1315 cout << "Written file " << fname << " of size "
1316 << Fio.file_size(fname) << endl;
1317 FREE_lint(data);
1318}
1319
1321 int type_of_spread, int verbose_level)
1322{
1323 int f_v = (verbose_level >= 1);
1324 int f_vv = (verbose_level >= 2);
1325 int sz = order + 1;
1326 int M[8];
1327 int h, i, h1, s, t, sq, tq, x, y, w, z, eta, exponent;
1329 int q1 = NT.i_power_j(Mtx->GFq->p, (Mtx->GFq->e >> 1));
1330
1331 if (f_v) {
1332 cout << "spread_classify::make_spread q=" << q << " q1=" << q1 << endl;
1333 }
1334 if (n != 4) {
1335 cout << "spread_classify::make_spread n != 4" << endl;
1336 exit(1);
1337 }
1338 if (EVEN(q)) {
1339 cout << "spread_classify::make_spread need q odd" << endl;
1340 exit(1);
1341 }
1342 if (k != 2) {
1343 cout << "spread_classify::make_spread k != 2" << endl;
1344 exit(1);
1345 }
1346 for (eta = q1; eta < q; eta++) {
1347 if (Mtx->GFq->negate(Mtx->GFq->power(eta, q1)) == eta) {
1348 if (f_v) {
1349 cout << "spread_classify::make_spread eta=" << eta << endl;
1350 }
1351 break;
1352 }
1353 }
1354 exponent = (Mtx->GFq->q + 2 * q1 - 1) >> 1;
1355 for (h = 0; h < sz; h++) {
1356 for (i = 0; i < 8; i++) {
1357 M[i] = 0;
1358 }
1359 if (h == 0) {
1360 M[0 * 4 + 2] = 1;
1361 M[1 * 4 + 3] = 1;
1362 }
1363 else {
1364 M[0 * 4 + 0] = 1;
1365 M[1 * 4 + 1] = 1;
1366 h1 = h - 1;
1367 s = h1 % q;
1368 t = (h1 - s) / q;
1369 x = s;
1370 y = t;
1371 sq = Mtx->GFq->power(s, q1);
1372 tq = Mtx->GFq->power(t, q1);
1373 if (type_of_spread == SPREAD_OF_TYPE_DICKSON_KANTOR) {
1374 w = Mtx->GFq->add(sq, tq);
1375 }
1376 else {
1377 w = Mtx->GFq->add(sq, Mtx->GFq->power(t, exponent));
1378 }
1379 z = Mtx->GFq->add(Mtx->GFq->mult(eta, sq), tq);
1380 M[0 * 4 + 2] = x;
1381 M[0 * 4 + 3] = y;
1382 M[1 * 4 + 2] = w;
1383 M[1 * 4 + 3] = z;
1384 }
1385 for (i = 0; i < 8; i++) {
1386 Grass->M[i] = M[i];
1387 }
1388 if (f_vv) {
1389 cout << "spread element " << h << ":" << endl;
1390 Int_matrix_print(Grass->M, 2, 4);
1391 }
1392 data[h] = Grass->rank_lint(0);
1393 } // next h
1394 if (check_function(sz, data, verbose_level - 2)) {
1395 if (f_v) {
1396 cout << "spread_classify::make_spread The set is a spread" << endl;
1397 }
1398 }
1399 else {
1400 cout << "spread_classify::make_spread The set is NOT a spread" << endl;
1401 exit(1);
1402 }
1403
1404 if (f_v) {
1405 cout << "spread_classify::make_spread done" << endl;
1406 }
1407}
1408
1409
1411 int type_of_spread, int verbose_level)
1412{
1413 int f_v = (verbose_level >= 1);
1414 int f_vv = (verbose_level >= 2);
1415 int sz = order + 1;
1416 int M[8];
1417 int h, h1, i, s, t, t2, t3, t4, t5, t7, t9;
1418 int a_t = 0, b_t = 0, c_t = 0, x, y, w, z, r;
1419 int three, five, nonsquare = 0, minus_nonsquare = 0, nonsquare_inv = 0;
1421
1422 if (f_v) {
1423 cout << "spread_classify::make_spread_from_q_clan" << endl;
1424 }
1425 if (n != 4) {
1426 cout << "spread_classify::make_spread_from_q_clan n != 4" << endl;
1427 exit(1);
1428 }
1429 if (k != 2) {
1430 cout << "spread_classify::make_spread_from_q_clan k != 2" << endl;
1431 exit(1);
1432 }
1433 three = Mtx->GFq->add3(1, 1, 1);
1434 five = Mtx->GFq->add3(three, 1, 1);
1435 if (type_of_spread == SPREAD_OF_TYPE_KANTOR ||
1436 type_of_spread == SPREAD_OF_TYPE_GANLEY ||
1437 type_of_spread == SPREAD_OF_TYPE_LAW_PENTTILA) {
1438 nonsquare = Mtx->GFq->alpha_power(1);
1439 nonsquare_inv = Mtx->GFq->inverse(nonsquare);
1440 minus_nonsquare = Mtx->GFq->negate(nonsquare);
1441 }
1442 for (h = 0; h < sz; h++) {
1443 for (i = 0; i < 8; i++) {
1444 M[i] = 0;
1445 }
1446 if (h == 0) {
1447 M[0 * 4 + 2] = 1;
1448 M[1 * 4 + 3] = 1;
1449 }
1450 else {
1451 M[0 * 4 + 0] = 1;
1452 M[1 * 4 + 1] = 1;
1453 h1 = h - 1;
1454 s = h1 % q;
1455 t = (h1 - s) / q;
1456
1457 // create the q-clan:
1458
1459 if (type_of_spread == SPREAD_OF_TYPE_FTWKB) {
1460 // Fisher Thas Walker Betten:
1461 // a_t = t, b_t = 3t^2, c_t = 3t^3
1462 // only when q \equiv 2 mod 3
1463 r = q % 3;
1464 if (r != 2) {
1465 cout << "FTWKB needs q equiv 2 mod 3" << endl;
1466 exit(1);
1467 }
1468 a_t = t;
1469 b_t = Mtx->GFq->product3(three, t, t);
1470 c_t = Mtx->GFq->mult(b_t, t);
1471 }
1472 else if (type_of_spread == SPREAD_OF_TYPE_KANTOR) {
1473 if (EVEN(q)) {
1474 cout << "KANTOR needs q to be odd" << endl;
1475 exit(1);
1476 }
1477 if (NT.is_prime(q)) {
1478 cout << "KANTOR needs q to be a prime power" << endl;
1479 exit(1);
1480 }
1481 a_t = t;
1482 b_t = 0;
1483 c_t = Mtx->GFq->mult(minus_nonsquare, Mtx->GFq->frobenius_power(t, 1));
1484 }
1485 else if (type_of_spread == SPREAD_OF_TYPE_KANTOR2) {
1486 if (EVEN(q)) {
1487 cout << "KANTOR2 needs q to be odd" << endl;
1488 exit(1);
1489 }
1490 if ((q % 5) != 2 && (q % 5) != 3) {
1491 cout << "KANTOR needs q congruent 2 or 3 mod 5" << endl;
1492 exit(1);
1493 }
1494 t3 = Mtx->GFq->product3(t, t, t);
1495 t5 = Mtx->GFq->product3(t3, t, t);
1496 a_t = t;
1497 b_t = Mtx->GFq->mult(five, t3);
1498 c_t = Mtx->GFq->mult(five, t5);
1499 }
1500 else if (type_of_spread == SPREAD_OF_TYPE_GANLEY) {
1501 int tmp1, tmp2;
1502 if (q % 3) {
1503 cout << "GANLEY, q needs to be "
1504 "a power of three" << endl;
1505 exit(1);
1506 }
1507 t3 = Mtx->GFq->product3(t, t, t);
1508 t9 = Mtx->GFq->product3(t3, t3, t3);
1509 a_t = t;
1510 b_t = t3;
1511 tmp1 = Mtx->GFq->mult(nonsquare, t);
1512 tmp2 = Mtx->GFq->mult(nonsquare_inv, t9);
1513 c_t = Mtx->GFq->negate(Mtx->GFq->add(tmp1, tmp2));
1514 }
1515 else if (type_of_spread == SPREAD_OF_TYPE_LAW_PENTTILA) {
1516 int tmp1, tmp2;
1517 int n2, n3;
1518 if (q % 3) {
1519 cout << "LAW_PENTTILA, q needs to "
1520 "be a power of three" << endl;
1521 exit(1);
1522 }
1523 t2 = Mtx->GFq->mult(t, t);
1524 t3 = Mtx->GFq->product3(t, t, t);
1525 t4 = Mtx->GFq->mult(t2, t2);
1526 t7 = Mtx->GFq->mult(t4, t3);
1527 t9 = Mtx->GFq->product3(t3, t3, t3);
1528 n2 = Mtx->GFq->mult(nonsquare, nonsquare);
1529 n3 =Mtx->GFq->product3(nonsquare, nonsquare, nonsquare);
1530 a_t = t;
1531 b_t = Mtx->GFq->negate(Mtx->GFq->add(t4, Mtx->GFq->mult(nonsquare, t2)));
1532 tmp1 = Mtx->GFq->add(t7, Mtx->GFq->mult(n2, t3));
1533 tmp2 = Mtx->GFq->negate(Mtx->GFq->add(Mtx->GFq->mult(nonsquare_inv, t9),
1534 Mtx->GFq->mult(n3, t)));
1535 c_t = Mtx->GFq->add(tmp1, tmp2);
1536 if (h == 34) {
1537 cout << "s=" << s << endl;
1538 cout << "t=" << t << endl;
1539 cout << "n=" << nonsquare << endl;
1540 cout << "t2=" << t2 << endl;
1541 cout << "t3=" << t3 << endl;
1542 cout << "t4=" << t4 << endl;
1543 cout << "t7=" << t7 << endl;
1544 cout << "t9=" << t9 << endl;
1545 cout << "a_t=" << a_t << endl;
1546 cout << "b_t=" << b_t << endl;
1547 cout << "c_t=" << c_t << endl;
1548 }
1549 }
1550
1551
1552 // create the spread element
1553 // according to Gevaert-Johnson 1988:
1554
1555 x = a_t;
1556 y = Mtx->GFq->add(b_t, s);
1557 w = Mtx->GFq->negate(s);
1558 z = c_t;
1559 M[0 * 4 + 2] = x;
1560 M[0 * 4 + 3] = y;
1561 M[1 * 4 + 2] = w;
1562 M[1 * 4 + 3] = z;
1563 }
1564 for (i = 0; i < 8; i++) {
1565 Grass->M[i] = M[i];
1566 }
1567 if (f_vv) {
1568 cout << "spread element " << h << ":" << endl;
1569 Int_matrix_print(Grass->M, 2, 4);
1570 }
1571 data[h] = Grass->rank_lint(0);
1572 }
1573 if (check_function(sz, data, verbose_level - 2)) {
1574 cout << "The set is a spread" << endl;
1575 }
1576 else {
1577 cout << "The set is NOT a spread" << endl;
1578 exit(1);
1579 }
1580}
1581
1582void spread_classify::read_and_print_spread(std::string &fname, int verbose_level)
1583{
1584 long int *data;
1585 int sz;
1587
1588 Fio.read_set_from_file(fname, data, sz, verbose_level);
1589 print_spread(cout, data, sz);
1590 FREE_lint(data);
1591}
1592
1593void spread_classify::HMO(std::string &fname, int verbose_level)
1594{
1595 long int *data;
1596 int sz, i, h, h1;
1597 int *G, *H;
1598 int *Ge, *He;
1599 int *GG, *HH;
1600 int alpha, beta, omega, x, y, tmp1, tmp2, f, z;
1601 int M[8];
1603
1604 if (order != q * q) {
1605 cout << "spread_classify::print_spread order != q * q" << endl;
1606 exit(1);
1607 }
1608 Fio.read_set_from_file(fname, data, sz, verbose_level);
1609 G = NEW_int(order);
1610 H = NEW_int(order);
1611 Ge = NEW_int(order);
1612 He = NEW_int(order);
1613 print_spread(cout, data, sz);
1614 get_spread_matrices(G, H, data, verbose_level);
1615
1616
1617 int q2;
1620
1621 q2 = q * q;
1624 Fq2->finite_field_init(q2, FALSE /* f_without_tables */, verbose_level);
1625 Sub->init(Fq2, Mtx->GFq, verbose_level);
1626 for (i = 0; i < q * q; i++) {
1627 Ge[i] = Sub->FQ_embedding[G[i]];
1628 He[i] = Sub->FQ_embedding[H[i]];
1629 }
1630 cout << "spread::HMO after embedding" << endl;
1631 cout << "Ge:" << endl;
1632 Int_matrix_print(Ge, q, q);
1633 cout << "He:" << endl;
1634 Int_matrix_print(He, q, q);
1635
1636 GG = NEW_int(q2 * q2);
1637 HH = NEW_int(q2 * q2);
1638 omega = Sub->Basis[1];
1639 cout << "omega=" << omega << endl;
1640 for (alpha = 0; alpha < q2; alpha++) {
1641 for (beta = 0; beta < q2; beta++) {
1642 x = Sub->components[beta * 2 + 0];
1643 y = Sub->components[beta * 2 + 1];
1644 cout << "alpha=" << alpha << " beta=" << beta
1645 << " x=" << x << " y=" << y << endl;
1646 tmp1 = Ge[x * q + y];
1647 tmp2 = Fq2->negate(Fq2->mult(He[x * q + y], omega));
1648 f = Fq2->add(tmp1, tmp2);
1649 z = Fq2->frobenius_power(alpha, Fq2->e / 2);
1650 GG[alpha * q2 + beta] = f;
1651 HH[alpha * q2 + beta] = z;
1652 }
1653 }
1654 cout << "GG:" << endl;
1655 Int_matrix_print(GG, q2, q2);
1656 cout << "HH:" << endl;
1657 Int_matrix_print(HH, q2, q2);
1658
1660 long int *Data2;
1661 int Sz;
1662
1664 Gq2->init(n, k, Fq2, verbose_level);
1665
1666 Sz = q2 * q2 + 1;
1667 Data2 = NEW_lint(Sz);
1668
1669 for (h = 0; h < Sz; h++) {
1670 for (i = 0; i < 8; i++) {
1671 M[i] = 0;
1672 }
1673 if (h == 1) {
1674 M[0 * 4 + 2] = 1;
1675 M[1 * 4 + 3] = 1;
1676 }
1677 else {
1678 if (h > 1) {
1679 h1 = h - 1;
1680 }
1681 else {
1682 h1 = 0;
1683 }
1684 M[0 * 4 + 0] = 1;
1685 M[1 * 4 + 1] = 1;
1686 y = h1 % q2;
1687 x = (h1 - y) / q2;
1688 cout << "h=" << h << " x=" << x << " y=" << y << endl;
1689 M[0 * 4 + 2] = x;
1690 M[0 * 4 + 3] = y;
1691 M[1 * 4 + 2] = GG[x * q2 + y];
1692 M[1 * 4 + 3] = HH[x * q2 + y];
1693 }
1694 cout << "element " << h << ":" << endl;
1695 Int_matrix_print(M, 2, 4);
1696 for (i = 0; i < 8; i++) {
1697 Gq2->M[i] = M[i];
1698 }
1699 Data2[h] = Gq2->rank_lint(0);
1700 cout << "has rank " << Data2[h] << endl;
1701 }
1702
1703 string fname2;
1704
1705 fname2.assign("HMO_");
1706 fname2.append(fname);
1707
1708 Fio.write_set_to_file(fname2, Data2, Sz, verbose_level);
1709
1711 FREE_OBJECT(Gq2);
1712 FREE_OBJECT(Fq2);
1713 FREE_OBJECT(Sub);
1714 FREE_lint(data);
1715 FREE_int(G);
1716 FREE_int(H);
1717 FREE_int(Ge);
1718 FREE_int(He);
1719 FREE_int(GG);
1720 FREE_int(HH);
1721}
1722
1724 long int *data, int verbose_level)
1725{
1726 int f_v = (verbose_level >= 1);
1727 int h, i, x, y, f, g;
1728 int sz = order + 1;
1729 int M[8];
1730
1731 if (f_v) {
1732 cout << "spread_classify::get_spread_matrices" << endl;
1733 }
1734 for (i = 0; i < order; i++) {
1735 G[i] = -1;
1736 H[i] = -1;
1737 }
1738 for (h = 0; h < sz; h++) {
1739 Grass->unrank_lint(data[h], 0);
1740 for (i = 0; i < 8; i++) {
1741 M[i] = Grass->M[i];
1742 }
1743 //cout << "element " << h << ":" << endl;
1744 //int_matrix_print(M, 2, 4);
1745 if (M[0 * 4 + 0] == 0 &&
1746 M[0 * 4 + 1] == 0 &&
1747 M[1 * 4 + 0] == 0 &&
1748 M[1 * 4 + 1] == 0) {
1749 continue;
1750 }
1751 if (M[0 * 4 + 0] != 1) {
1752 cout << "generator matrix is not in standard form" << endl;
1753 exit(1);
1754 }
1755 if (M[1 * 4 + 1] != 1) {
1756 cout << "generator matrix is not in standard form" << endl;
1757 exit(1);
1758 }
1759 if (M[0 * 4 + 1] != 0) {
1760 cout << "generator matrix is not in standard form" << endl;
1761 exit(1);
1762 }
1763 if (M[1 * 4 + 0] != 0) {
1764 cout << "generator matrix is not in standard form" << endl;
1765 exit(1);
1766 }
1767 x = M[0 * 4 + 2];
1768 y = M[0 * 4 + 3];
1769 f = M[1 * 4 + 2];
1770 g = M[1 * 4 + 3];
1771 G[x * q + y] = f;
1772 H[x * q + y] = g;
1773 }
1774 if (f_v) {
1775 cout << "spread::get_FG_matrices" << endl;
1776 cout << "G:" << endl;
1777 Int_matrix_print(G, q, q);
1778 cout << "H:" << endl;
1779 Int_matrix_print(H, q, q);
1780 }
1781}
1782
1783void spread_classify::print_spread(ostream &ost, long int *data, int sz)
1784{
1785 //int sz = order + 1;
1786 int h;
1787
1788 for (h = 0; h < sz; h++) {
1789 Grass->unrank_lint(data[h], 0);
1790 ost << "Spread element " << h << ":" << endl;
1792 }
1793}
1794
1795void spread_classify::report2(isomorph &Iso, int verbose_level)
1796{
1797 int f_v = (verbose_level >= 1);
1798 char fname[1000];
1799
1800 if (f_v) {
1801 cout << "spread_classify::report2" << endl;
1802 }
1803 sprintf(fname, "report_Spreads_q%d_k%d.tex", q, k);
1804
1805 {
1806 ofstream f(fname);
1807 int f_book = TRUE;
1808 int f_title = TRUE;
1809 char title[1000];
1810 const char *author = "Orbiter";
1811 int f_toc = TRUE;
1812 int f_landscape = FALSE;
1813 int f_12pt = FALSE;
1814 int f_enlarged_page = TRUE;
1815 int f_pagenumbers = TRUE;
1817
1818 sprintf(title, "$%d$-Spreads of PG($%d,%d$)", k - 1, 2 * k - 1, q);
1819 cout << "Writing file " << fname << " with "
1820 << Iso.Reps->count << " spreads:" << endl;
1821 L.head(f, f_book, f_title,
1822 title, author,
1823 f_toc, f_landscape, f_12pt, f_enlarged_page, f_pagenumbers,
1824 NULL /* extra_praeamble */);
1825
1826 report3(Iso, f, verbose_level);
1827
1828 L.foot(f);
1829
1830 }
1832
1833 cout << "Written file " << fname << " of size "
1834 << Fio.file_size(fname) << endl;
1835
1836}
1837
1838void spread_classify::report3(isomorph &Iso, ostream &ost, int verbose_level)
1839{
1840 int f_v = (verbose_level >= 1);
1841
1842 if (f_v) {
1843 cout << "spread_classify::report3" << endl;
1844 }
1845
1846 int target_size = order + 1;
1848
1849 ost << "\\chapter{Summary}" << endl << endl;
1850 ost << "There are " << Iso.Reps->count << " spreads." << endl << endl;
1851
1852
1853 //Iso.setup_and_open_solution_database(verbose_level - 1);
1854
1855 int i, first, /*c,*/ id;
1856 int u, v, h, rep, tt;
1858 long int data[1000];
1859
1860
1861
1862 ring_theory::longinteger_object *Ago, *Ago_induced;
1863 int *Ago_int;
1864
1867 Ago_int = NEW_int(Iso.Reps->count);
1868
1869
1870 for (h = 0; h < Iso.Reps->count; h++) {
1871 rep = Iso.Reps->rep[h];
1872 first = Iso.orbit_fst[rep];
1873 //c = Iso.starter_number[first];
1874 id = Iso.orbit_perm[first];
1875 Iso.load_solution(id, data);
1876
1877 groups::sims *Stab;
1878
1879 Stab = Iso.Reps->stab[h];
1880
1881 Iso.Reps->stab[h]->group_order(Ago[h]);
1882 Ago_int[h] = Ago[h].as_int();
1883 //f << "Stabilizer has order $";
1884 //go.print_not_scientific(f);
1885 if (f_v) {
1886 cout << "spread::print_isomorphism_types computing "
1887 "induced action on the set (in data)" << endl;
1888 }
1889 Iso.induced_action_on_set(Stab, data, 0 /*verbose_level*/);
1890
1891
1892 Iso.AA->group_order(Ago_induced[h]);
1893 }
1894
1895
1897
1898 C_ago.init(Ago_int, Iso.Reps->count, FALSE, 0);
1899 cout << "Classification by ago:" << endl;
1900 C_ago.print(FALSE /*f_backwards*/);
1901
1902
1903
1904 ost << "\\chapter{Invariants}" << endl << endl;
1905
1906 ost << "Classification by automorphism group order: $";
1907 C_ago.print_naked_tex(ost, FALSE /*f_backwards*/);
1908 ost << "$" << endl;
1909 ost << "\\\\" << endl;
1910
1911 ost << "\\begin{center}" << endl;
1912 ost << "\\begin{tabular}{|c|l|}" << endl;
1913 ost << "\\hline" << endl;
1914 ost << "Ago & Isom. Types \\\\" << endl;
1915 ost << "\\hline" << endl;
1916 ost << "\\hline" << endl;
1917
1918 int cnt, length, t, vv, *set;
1919
1920 cnt = 0;
1921 for (u = C_ago.nb_types - 1; u >= 0; u--) {
1922 first = C_ago.type_first[u];
1923 length = C_ago.type_len[u];
1924 t = C_ago.data_sorted[first];
1925
1926 ost << t << " & ";
1927
1928 set = NEW_int(length);
1929 for (v = 0; v < length; v++, cnt++) {
1930 vv = first + v;
1931 i = C_ago.sorting_perm_inv[vv];
1932 set[v] = i;
1933 }
1934
1935 Sorting.int_vec_heapsort(set, length);
1936
1937 for (v = 0; v < length; v++, cnt++) {
1938
1939 ost << set[v];
1940
1941 if (v < length - 1) {
1942 ost << ",";
1943 if ((v + 1) % 10 == 0) {
1944 ost << "\\\\" << endl;
1945 ost << " & " << endl;
1946 }
1947 }
1948 }
1949 ost << "\\\\" << endl;
1950 if (u > 0) {
1951 ost << "\\hline" << endl;
1952 }
1953 FREE_int(set);
1954 }
1955 ost << "\\hline" << endl;
1956 ost << "\\end{tabular}" << endl;
1957 ost << "\\end{center}" << endl << endl;
1958
1959
1960 ost << "\\clearpage" << endl << endl;
1961
1962 ost << "\\begin{center}" << endl;
1963 ost << "\\begin{tabular}{|r|r|r|r|r|r|}" << endl;
1964 ost << "\\hline" << endl;
1965 ost << "ID & Isom. Type & $|\\mbox{Aut}|$ & $|\\mbox{Aut}|$ "
1966 "(induced) & \\# Orbits & Orbit Type\\\\" << endl;
1967 ost << "\\hline" << endl;
1968 ost << "\\hline" << endl;
1969
1970 cnt = 0;
1971 for (u = 0; u < C_ago.nb_types; u ++) {
1972 first = C_ago.type_first[u];
1973 length = C_ago.type_len[u];
1974 t = C_ago.data_sorted[first];
1975
1976 set = NEW_int(length);
1977 for (v = 0; v < length; v++) {
1978 vv = first + v;
1979 i = C_ago.sorting_perm_inv[vv];
1980 set[v] = i;
1981 }
1982
1983 Sorting.int_vec_heapsort(set, length);
1984
1985
1986 for (v = 0; v < length; v++) {
1987 vv = first + v;
1988 i = C_ago.sorting_perm_inv[vv];
1989 h = set[v];
1990 ost << setw(3) << first + v + 1 << " & ";
1991 ost << setw(3) << h << " & ";
1992 Ago[h].print_not_scientific(ost);
1993 ost << " & ";
1994 Ago_induced[h].print_not_scientific(ost);
1995
1996 orbit_info_short(ost, Iso, h);
1997
1998
1999 ost << "\\\\" << endl;
2000 cnt++;
2001 if ((cnt % 30) == 0) {
2002 ost << "\\hline" << endl;
2003 ost << "\\end{tabular}" << endl;
2004 ost << "\\end{center}" << endl << endl;
2005 ost << "\\begin{center}" << endl;
2006 ost << "\\begin{tabular}{|r|r|r|r|r|r|}" << endl;
2007 ost << "\\hline" << endl;
2008 ost << "ID & Isom. Type & $|\\mbox{Aut}|$ & $|\\mbox{Aut}|$ "
2009 "(induced) & \\# Orbits & Orbit Type\\\\" << endl;
2010 ost << "\\hline" << endl;
2011 ost << "\\hline" << endl;
2012 }
2013 }
2014 FREE_int(set);
2015 }
2016
2017 ost << "\\hline" << endl;
2018 ost << "\\end{tabular}" << endl;
2019 ost << "\\end{center}" << endl << endl;
2020
2021
2022 ost << "\\chapter{The Spreads}" << endl << endl;
2023
2024 ost << "\\clearpage" << endl << endl;
2025
2026
2027 for (h = 0; h < Iso.Reps->count; h++) {
2028 rep = Iso.Reps->rep[h];
2029 first = Iso.orbit_fst[rep];
2030 //c = Iso.starter_number[first];
2031 id = Iso.orbit_perm[first];
2032 Iso.load_solution(id, data);
2033
2034
2035 ost << "\\section{Isomorphism type " << h << "}" << endl;
2036 ost << "\\bigskip" << endl;
2037
2038 //f << "The ambient space has dimension "
2039 //<< Rk_of_span[h] << "\\\\" << endl;
2040
2041 if (Iso.Reps->stab[h]) {
2042 Iso.Reps->stab[h]->group_order(go);
2043 ost << "Stabilizer has order $";
2044 go.print_not_scientific(ost);
2045 ost << "$\\\\" << endl;
2046 }
2047 else {
2048 //cout << endl;
2049 }
2050
2051#if 0
2052 if (h == 35) {
2053 cout << "Isomorphism type 35:" << endl;
2054 cout << "rep=" << rep << endl;
2055 cout << "first=" << first << endl;
2056 cout << "id=" << id << endl;
2057 cout << "starter_number=" << c << endl;
2058 cout << "solution:" << endl;
2059 int_vec_print(cout, data, target_size);
2060 cout << endl;
2061 }
2062#endif
2063
2064 groups::sims *Stab;
2065
2066 Stab = Iso.Reps->stab[h];
2067
2068 if (f_v) {
2069 cout << "spread::print_isomorphism_types computing "
2070 "induced action on the set (in data)" << endl;
2071 }
2072 Iso.induced_action_on_set(Stab, data, 0 /*verbose_level*/);
2073
2075
2076 Iso.AA->group_order(go1);
2077 cout << "action " << Iso.AA->label << " computed, "
2078 "group order is " << go1 << endl;
2079
2080 ost << "Order of the group that is induced on the "
2081 "collection of subspaces is ";
2082 ost << "$";
2083 go1.print_not_scientific(ost);
2084 ost << "$\\\\" << endl;
2085
2086
2087 groups::schreier Orb;
2088 //longinteger_object go2;
2089
2091 Stab->gens, verbose_level - 2);
2092 ost << "With " << Orb.nb_orbits
2093 << " orbits on the subspaces\\\\" << endl;
2094
2096
2097 C_ol.init(Orb.orbit_len, Orb.nb_orbits, FALSE, 0);
2098
2099 ost << "Orbit lengths: $";
2100 //int_vec_print(f, Orb.orbit_len, Orb.nb_orbits);
2101 C_ol.print_naked_tex(ost, FALSE /*f_backwards*/);
2102 ost << "$ \\\\" << endl;
2103
2104 ost << "Orbits: $";
2105 Orb.list_all_orbits_tex(ost);
2106 ost << "$ \\\\" << endl;
2107
2108
2109 tt = (target_size + 3) / 4;
2110
2111 ost << "The subspaces by ranks:\\\\" << endl;
2112 ost << "\\begin{center}" << endl;
2113
2114 for (u = 0; u < 4; u++) {
2115 ost << "\\begin{tabular}[t]{|c|c|}" << endl;
2116 ost << "\\hline" << endl;
2117 ost << "$i$ & Rank \\\\" << endl;
2118 ost << "\\hline" << endl;
2119 for (i = 0; i < tt; i++) {
2120 v = u * tt + i;
2121 if (v < target_size) {
2122 ost << "$" << v << "$ & $" << data[v] << "$ \\\\" << endl;
2123 }
2124 }
2125 ost << "\\hline" << endl;
2126 ost << "\\end{tabular}" << endl;
2127 }
2128 ost << "\\end{center}" << endl;
2129
2130 ost << "The subspaces:\\\\" << endl;
2131 for (i = 0; i < target_size; i++) {
2132 Grass->unrank_lint(data[i], 0/*verbose_level - 4*/);
2133 if ((i % 4) == 0) {
2134 if (i) {
2135 ost << "$$" << endl;
2136 }
2137 ost << "$$" << endl;
2138 }
2139 ost << "\\left[" << endl;
2140 ost << "\\begin{array}{c}" << endl;
2141 for (u = 0; u < k; u++) {
2142 for (v = 0; v < n; v++) {
2143 ost << Grass->M[u * n + v];
2144 }
2145 ost << "\\\\" << endl;
2146 }
2147 ost << "\\end{array}" << endl;
2148 ost << "\\right]" << endl;
2149 }
2150 ost << "$$" << endl;
2151
2152
2153 report_stabilizer(Iso, ost, h /* orbit */, 0 /* verbose_level */);
2154
2155 if (k == 2) {
2156 klein(ost, &Iso, h, Stab, Orb, data, Iso.size, verbose_level);
2157 }
2158
2159 ost << "" << endl;
2160 ost << "\\bigskip" << endl;
2161 ost << "" << endl;
2162 ost << "Induced action on the orbits:\\\\" << endl;
2163 ost << "$$" << endl;
2164 ost << "\\begin{array}{|c|c|c|c|}" << endl;
2165 ost << "\\hline" << endl;
2166 ost << "\\mbox{Orbit} & \\mbox{Length} & \\mbox{Induced} "
2167 "& \\mbox{Kernel} \\\\" << endl;
2168 ost << "\\hline" << endl;
2169 for (i = 0; i < Orb.nb_orbits; i++) {
2170 int fst, len, j;
2171 fst = Orb.orbit_first[i];
2172 len = Orb.orbit_len[i];
2173
2174 cout << "inducing action on orbit " << i
2175 << " of length " << len << endl;
2176 ost << i << " & " << len << " & ";
2177 long int *set;
2178 actions::action *A1;
2180
2181 set = NEW_lint(len);
2182 //A1 = NEW_OBJECT(action);
2183 for (j = 0; j < len; j++) {
2184 set[j] = data[Orb.orbit[fst + j]];
2185 }
2187 Stab,
2188 len, set,
2189 TRUE,
2190 0/*verbose_level*/);
2191 if (f_v) {
2192 cout << "after induced_action_by_restriction" << endl;
2193 }
2194 A1->group_order(go1);
2195 A1->Kernel->group_order(gok);
2196 cout << "induced group order " << go1
2197 << " kernel order " << gok << endl;
2198
2199 ost << go1 << " & " << gok << "\\\\" << endl;
2200
2201 FREE_lint(set);
2202 FREE_OBJECT(A1);
2203 }
2204 ost << "\\hline" << endl;
2205 ost << "\\end{array}" << endl;
2206 ost << "$$" << endl;
2207
2208
2209
2210 for (i = 0; i < Orb.nb_orbits; i++) {
2211 int fst, len, j;
2212 fst = Orb.orbit_first[i];
2213 len = Orb.orbit_len[i];
2214
2215 cout << "inducing action on orbit " << i
2216 << " of length " << len << endl;
2217 ost << "Generators for the kernel in the action "
2218 "on orbit " << i << " are:";
2219 long int *set;
2220 actions::action *A1;
2222 int *tl;
2224
2225 set = NEW_lint(len);
2226 //A1 = NEW_OBJECT(action);
2228 tl = NEW_int(Iso.A_base->base_len());
2229 for (j = 0; j < len; j++) {
2230 set[j] = data[Orb.orbit[fst + j]];
2231 }
2233 Stab,
2234 len, set,
2235 TRUE,
2236 0/*verbose_level*/);
2237 if (f_v) {
2238 cout << "after induced_action_by_restriction" << endl;
2239 }
2240 A1->group_order(go1);
2241 A1->Kernel->group_order(gok);
2242 cout << "induced group order " << go1
2243 << " kernel order " << gok << endl;
2244 A1->Kernel->extract_strong_generators_in_order(*gens, tl, 0);
2245
2246 if (gens->len == 0) {
2247 ost << " No generators\\\\" << endl;
2248 }
2249 for (j = 0; j < gens->len; j++) {
2250
2251
2252 ost << "$$ g_{" << j + 1 << "}=" << endl;
2253 A->element_print_latex(gens->ith(j), ost);
2254 ost << "$$" << endl;
2255 }
2256
2257 FREE_lint(set);
2258 FREE_OBJECT(A1);
2259 FREE_OBJECT(gens);
2260 FREE_int(tl);
2261 }
2262
2263
2264 }
2265
2266 //Iso.close_solution_database(verbose_level - 1);
2267
2268 char prefix[1000];
2269 char label_of_structure_plural[1000];
2270
2271 sprintf(prefix, "Spreads_%d_%d", q, k);
2272 sprintf(label_of_structure_plural, "Spreads");
2273
2274
2275 isomorph_global IG;
2276
2277 IG.init(Iso.A_base, Iso.A, Iso.gen, verbose_level);
2278
2280 prefix, label_of_structure_plural, ost, verbose_level);
2281
2282
2283
2284 FREE_int(Ago_int);
2285 FREE_OBJECTS(Ago);
2286 FREE_OBJECTS(Ago_induced);
2287
2288 if (f_v) {
2289 cout << "spread_classify::report3 done" << endl;
2290 }
2291}
2292
2293
2295 isomorph &Iso, int verbose_level)
2296{
2297 int f_v = (verbose_level >= 1);
2298 int h;
2299 char fname[1000];
2300 int cnt = 0;
2301
2302 if (f_v) {
2303 cout << "spread_classify::all_cooperstein_thas_quotients" << endl;
2304 }
2305
2306
2307 //Iso.setup_and_open_solution_database(verbose_level - 1);
2308
2309
2310 sprintf(fname, "quotients_q%d.txt", order);
2311 {
2312 ofstream f(fname);
2313
2314
2315 for (h = 0; h < Iso.Reps->count; h++) {
2316
2317 cooperstein_thas_quotients(Iso, f, h, cnt, verbose_level - 1);
2318
2319 }
2320
2321
2322 f << -1 << endl;
2323 }
2325
2326 cout << "Written file " << fname << " of size "
2327 << Fio.file_size(fname) << endl;
2328
2329
2330 //Iso.close_solution_database(verbose_level - 1);
2331
2332 if (f_v) {
2333 cout << "spread::all_cooperstein_thas_quotients done" << endl;
2334 }
2335}
2336
2337
2338
2340 ofstream &f, int h, int &cnt, int verbose_level)
2341{
2342 int f_v = (verbose_level >= 1);
2343 int f_vv = (verbose_level >= 2);
2344 int rep, first, /*c,*/ id;
2345 groups::sims *Stab;
2346 long int data[1000];
2347 long int data2[1000];
2348 int u, fst, orbit_length, i, idx, i0, j, the_point, pivot, rem;
2349 long int a, b;
2350 int *M;
2351 int *vec1;
2352 int *vec2;
2353 long int **Pts;
2354 int nb_points = 0;
2355 int *List;
2361
2362
2363
2364 if (f_v ) {
2365 cout << "spread_classify::cooperstein_thas_quotients" << endl;
2366 cout << "spread_classify::cooperstein_thas_quotients h=" << h << endl;
2367 }
2368
2369 rep = Iso.Reps->rep[h];
2370 first = Iso.orbit_fst[rep];
2371 //c = Iso.starter_number[first];
2372 id = Iso.orbit_perm[first];
2373 Iso.load_solution(id, data);
2374
2375
2376 Stab = Iso.Reps->stab[h];
2377
2378 groups::schreier Orb;
2381
2382 Stab->group_order(go);
2383
2384 if (f_v) {
2385 cout << "spread_classify::cooperstein_thas_quotients "
2386 "Isomorphism type " << h << " with automorphism group "
2387 "of order " << go << ":" << endl;
2388 }
2389
2390 if (f_vv) {
2391 cout << "spread_classify::cooperstein_thas_quotients "
2392 "before compute_all_point_orbits" << endl;
2393 }
2394
2396 Stab->gens, 0 /*verbose_level - 2*/);
2397
2398 if (f_vv) {
2399 cout << "spread_classify::cooperstein_thas_quotients There are "
2400 << Orb.nb_orbits << " orbits on points" << endl;
2401 }
2402
2403
2404
2405 M = NEW_int(k * n);
2406 vec1 = NEW_int(n);
2407 vec2 = NEW_int(n);
2408 Pts = NEW_plint(order + 1);
2409 List = NEW_int(order);
2411
2412 Gr->init(n - 1, k, Mtx->GFq, 0 /* verbose_level */);
2413 for (i = 0; i < order + 1; i++) {
2414 Grass->unrank_lint_here(M, data[i], 0/*verbose_level - 4*/);
2416 Pts[i], nb_points, 0 /* verbose_level */);
2417 Sorting.lint_vec_heapsort(Pts[i], nb_points);
2418 }
2419
2420 for (u = 0; u < Orb.nb_orbits; u++) {
2421 fst = Orb.orbit_first[u];
2422 orbit_length = Orb.orbit_len[u];
2423
2424 the_point = Orb.orbit[fst];
2425 Dom.integral_division_by_int(go, orbit_length, stab_order, rem);
2426
2427 if (f_vv) {
2428 cout << "spread_classify::cooperstein_thas_quotients Orbit " << u
2429 << " is represented by point " << the_point
2430 << " orbit length = " << orbit_length
2431 << " stabilizer order before " << go
2432 << " after " << stab_order << endl;
2433 }
2434
2435
2436 Mtx->GFq->PG_element_unrank_modified(vec1, 1, n, the_point);
2439
2440 for (i = 0; i < order + 1; i++) {
2441 if (Sorting.lint_vec_search(Pts[i], nb_points, the_point, idx, 0)) {
2442 break;
2443 }
2444 }
2445 if (i == order + 1) {
2446 cout << "spread_classify::cooperstein_thas_quotients "
2447 "Did not find the point" << endl;
2448 exit(1);
2449 }
2450 i0 = i;
2451 j = 0;
2452 for (i = 0; i < order + 1; i++) {
2453 if (i != i0) {
2454 List[j++] = i;
2455 }
2456 }
2457 if (j != order) {
2458 cout << "spread_classify::cooperstein_thas_quotients j != order" << endl;
2459 exit(1);
2460 }
2461 for (i = 0; i < order; i++) {
2462 a = data[List[i]];
2463 Grass->unrank_lint_here(M, a, 0/*verbose_level - 4*/);
2464 Int_vec_copy(vec1, vec2, n);
2465 for (j = 0; j < k; j++) {
2466 Mtx->GFq->Linear_algebra->Gauss_step(vec2, M + j * n, n, pivot,
2467 0 /* verbose_level*/);
2468 // afterwards: v2[idx] = 0 and
2469 // v1,v2 span the same space as before
2470 // v1 is not changed if v1[idx] is nonzero
2471 }
2472
2473#if 1
2474 // delete column 'pivot' in the k x n matrix M.
2475 // Afterwards, the matrix is k x (n - 1)
2476
2478#endif
2479
2480 if (f_vv) {
2481 cout << "spread_classify::cooperstein_thas_quotients the reduction "
2482 "of the " << i << "-th matrix is:" << endl;
2483 Int_matrix_print(M, k, n - 1);
2484 }
2485
2486 b = Gr->rank_lint_here(M, 0/*verbose_level - 4*/);
2487 data2[i] = b;
2488 }
2489
2490 if (f_vv) {
2491 cout << "spread_classify::cooperstein_thas_quotients The quotient "
2492 "system with respect to orbit " << u << " / "
2493 << Orb.nb_orbits << " is:" << endl;
2494 Lint_vec_print(cout, data2, order);
2495 cout << endl;
2496 }
2497
2498
2499 f << h << " " << u << " " << the_point << " " << orbit_length << " ";
2501 f << " ";
2502 stab_order.print_not_scientific(f);
2503 f << " ";
2504 for (i = 0; i < order; i++) {
2505 f << " " << data2[i];
2506 }
2507 f << endl;
2508
2509
2510
2511 char str[1000];
2512 sprintf(str, "quotient_q%d_iso%d_nb%d_orbit_length%d.txt",
2513 NT.i_power_j(q, k), h, u, orbit_length);
2514
2515 string fname;
2516
2517 fname.assign(str);
2518 Fio.write_set_to_file(fname, data2, order, 0 /* verbose_level*/);
2519 cnt++;
2520
2521
2522 } // next u
2523
2524 FREE_int(M);
2525 FREE_int(vec1);
2526 FREE_int(vec2);
2527 for (i = 0; i < order + 1; i++) {
2528 FREE_lint(Pts[i]);
2529 }
2530 FREE_plint(Pts);
2531 FREE_int(List);
2532 FREE_OBJECT(Gr);
2533 if (f_v ) {
2534 cout << "spread_classify::cooperstein_thas_quotients done" << endl;
2535 }
2536}
2537
2538void spread_classify::orbit_info_short(ostream &ost, isomorph &Iso, int h)
2539{
2540 int rep, first, /*c,*/ id;
2541
2542 groups::sims *Stab;
2543
2544 long int data[1000];
2545
2546 rep = Iso.Reps->rep[h];
2547 first = Iso.orbit_fst[rep];
2548 //c = Iso.starter_number[first];
2549 id = Iso.orbit_perm[first];
2550 Iso.load_solution(id, data);
2551
2552
2553 Stab = Iso.Reps->stab[h];
2554
2555 Iso.induced_action_on_set(Stab, data, 0 /*verbose_level*/);
2556
2558
2559 Iso.AA->group_order(go1);
2560 cout << "action " << Iso.AA->label << " computed, "
2561 "group order is " << go1 << endl;
2562
2563
2564#if 0
2565 f << "Order of the group that is induced on the "
2566 "collection of subspaces is ";
2567 f << "$";
2568 go1.print_not_scientific(f);
2569 f << "$\\\\" << endl;
2570#endif
2571
2572 groups::schreier Orb;
2573 //longinteger_object go2;
2574
2575 Iso.AA->compute_all_point_orbits(Orb, Stab->gens, 0 /*verbose_level - 2*/);
2576 //f << "With " << Orb.nb_orbits << " orbits on the subspaces\\\\" << endl;
2577
2578 ost << " & " << Orb.nb_orbits << " & ";
2579
2581
2582 C_ol.init(Orb.orbit_len, Orb.nb_orbits, FALSE, 0);
2583
2584 //f << "Orbit lengths: ";
2585 //int_vec_print(f, Orb.orbit_len, Orb.nb_orbits);
2586 ost << "$";
2587 C_ol.print_naked_tex(ost, FALSE /*f_backwards*/);
2588 ost << "$";
2589 //f << " \\\\" << endl;
2590
2591}
2592
2593
2594
2596 ostream &ost, int orbit, int verbose_level)
2597{
2598 groups::sims *Stab;
2600 int i;
2601
2602 Stab = Iso.Reps->stab[orbit];
2603 Stab->group_order(go);
2604
2605 ost << "The stabilizer of order $" << go << "$ is generated by:\\\\" << endl;
2606 for (i = 0; i < Stab->gens.len; i++) {
2607
2608 int *fp, n, ord;
2609
2610 fp = NEW_int(A->degree);
2611 n = A->find_fixed_points(Stab->gens.ith(i), fp, 0);
2612 //cout << "with " << n << " fixed points" << endl;
2613 FREE_int(fp);
2614
2615 ord = A->element_order(Stab->gens.ith(i));
2616
2617 ost << "$$ g_{" << i + 1 << "}=" << endl;
2618 A->element_print_latex(Stab->gens.ith(i), ost);
2619 ost << "$$" << endl << "of order $" << ord << "$ and with "
2620 << n << " fixed points" << endl;
2621 }
2622}
2623
2624
2625
2626// #############################################################################
2627// global functions:
2628// #############################################################################
2629
2630
2631
2632
2633#if 0
2634static int spread_check_function_callback(int len,
2635 long int *S, void *data, int verbose_level)
2636{
2637 spread_classify *Spread = (spread_classify *) data;
2638 int f_OK;
2639
2640 f_OK = Spread->check_function(len, S, verbose_level);
2641 return f_OK;
2642}
2643
2644static void spread_callback_report(isomorph *Iso, void *data, int verbose_level)
2645{
2646 spread_classify *Spread = (spread_classify *) data;
2647
2648 Spread->report2(*Iso, verbose_level);
2649}
2650
2651static void spread_callback_make_quotients(isomorph *Iso,
2652 void *data, int verbose_level)
2653{
2654 spread_classify *Spread = (spread_classify *) data;
2655
2656 Spread->all_cooperstein_thas_quotients(*Iso, verbose_level);
2657}
2658
2659static void callback_spread_print(ostream &ost, int len, long int *S, void *data)
2660{
2661 spread_classify *Spread = (spread_classify *) data;
2662
2663 Spread->print_spread(ost, S, len);
2664}
2665#endif
2666
2667}}}
2668
2669
void matrix_print_ost(std::ostream &ost, int *p, int m, int n)
void matrix_delete_column_in_place(int *Mtx, int k, int n, int pivot)
Definition: int_vec.cpp:916
data structure for set partitions following Jeffrey Leon
a collection of functions related to sorted vectors
int lint_vec_search(long int *v, int len, long int a, int &idx, int verbose_level)
Definition: sorting.cpp:1157
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 print_naked_tex(std::ostream &ost, int f_backwards)
Definition: tally.cpp:413
void all_PG_elements_in_subspace(int *genma, int k, int n, long int *&point_list, int &nb_points, int verbose_level)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
void finite_field_init(int q, int f_without_tables, int verbose_level)
void latex_matrix(std::ostream &f, int f_elements_exponential, std::string &symbol_for_print, int *M, int m, int n)
a finite field as a vector space over a subfield
void init(finite_field *FQ, finite_field *Fq, int verbose_level)
to rank and unrank subspaces of a fixed dimension in F_q^n
Definition: geometry.h:892
void unrank_lint(long int rk, int verbose_level)
Definition: grassmann.cpp:343
long int rank_lint_here(int *Mtx, int verbose_level)
Definition: grassmann.cpp:275
void unrank_lint_here(int *Mtx, long int rk, int verbose_level)
Definition: grassmann.cpp:269
void init(int n, int k, field_theory::finite_field *F, int verbose_level)
Definition: grassmann.cpp:70
interface for various incidence geometries
Definition: geometry.h:1099
void get_and_print_row_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math, int f_print_subscripts, data_structures::partitionstack &PStack)
void get_and_print_column_tactical_decomposition_scheme_tex(std::ostream &ost, int f_enter_math, int f_print_subscripts, data_structures::partitionstack &PStack)
void init_by_matrix(int m, int n, int *M, int verbose_level)
void compute_TDO_safe(data_structures::partitionstack &PStack, int depth, int verbose_level)
void latex_it(std::ostream &ost, data_structures::partitionstack &P)
void plane_intersections(long int *lines_in_PG3, int nb_lines, ring_theory::longinteger_object *&R, long int **&Pts_on_plane, int *&nb_pts_on_plane, int &nb_planes, int verbose_level)
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
void print_set_numerical(std::ostream &ost, long int *set, int set_size)
void klein_correspondence(projective_space *P5, long int *set_in, int set_size, long int *set_out, int verbose_level)
void print_line_set_numerical(long int *set, int set_size)
void plane_intersection_type(grassmann *G, long int *set, int set_size, int *&intersection_type, int &highest_intersection_number, int verbose_level)
void Gauss_step(int *v1, int *v2, int len, int idx, int verbose_level)
void read_set_from_file(std::string &fname, long int *&the_set, int &set_size, int verbose_level)
Definition: file_io.cpp:2374
void write_set_to_file(std::string &fname, long int *the_set, int set_size, int verbose_level)
Definition: file_io.cpp:2434
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_by_int(longinteger_object &a, int b, longinteger_object &q, int &r)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
DISCRETA vector class for vectors of DISCRETA objects.
Definition: discreta.h:797
discreta_base & s_i(int i)
Definition: vector.cpp:202
void m_ii(int i, int a)
Definition: discreta.h:824
void save_file(const char *fname)
Definition: base.cpp:1571
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 compute_all_point_orbits(groups::schreier &S, data_structures_groups::vector_ge &gens, int verbose_level)
Definition: action.cpp:995
void group_order(ring_theory::longinteger_object &go)
Definition: action.cpp:2223
action * create_induced_action_by_restriction(groups::sims *S, int size, long int *set, int f_induce, int verbose_level)
int find_fixed_points(void *elt, int *fixed_points, int verbose_level)
Definition: action.cpp:579
Schreier trees for orbits of groups on points.
Definition: groups.h:839
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void extract_strong_generators_in_order(data_structures_groups::vector_ge &SG, int *tl, int verbose_level)
Definition: sims.cpp:1704
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
data_structures_groups::vector_ge gens
Definition: groups.h:1280
auxiliary class for class isomorph
Definition: isomorph.h:789
void report_data_in_source_code_inside_tex(isomorph &Iso, const char *prefix, char *label_of_structure_plural, std::ostream &f, int verbose_level)
void init(actions::action *A_base, actions::action *A, poset_classification::poset_classification *gen, int verbose_level)
classification of combinatorial objects using subobjects
Definition: isomorph.h:30
void induced_action_on_set_and_kernel(std::ostream &file, actions::action *A, groups::sims *Stab, int size, long int *set, int verbose_level)
void load_solution(int id, long int *data)
void induced_action_on_set(groups::sims *S, long int *set, int verbose_level)
poset_classification::poset_classification * gen
Definition: isomorph.h:122
to classify spreads of PG(k-1,q) in PG(n-1,q) where k divides n
Definition: spreads.h:106
void save_klein_invariants(char *prefix, int iso_cnt, long int *data, int data_size, int verbose_level)
void read_and_print_spread(std::string &fname, int verbose_level)
void print_isomorphism_type(isomorph *Iso, int iso_cnt, groups::sims *Stab, groups::schreier &Orb, long int *data, int verbose_level)
void report3(isomorph &Iso, std::ostream &ost, int verbose_level)
void report_stabilizer(isomorph &Iso, std::ostream &ost, int orbit, int verbose_level)
void get_spread_matrices(int *F, int *G, long int *data, int verbose_level)
void make_spread_from_q_clan(long int *data, int type_of_spread, int verbose_level)
void write_spread_to_file(int type_of_spread, int verbose_level)
void print_spread(std::ostream &ost, long int *data, int sz)
void cooperstein_thas_quotients(isomorph &Iso, std::ofstream &f, int h, int &cnt, int verbose_level)
void klein(std::ostream &ost, isomorph *Iso, int iso_cnt, groups::sims *Stab, groups::schreier &Orb, long int *data, int data_size, int verbose_level)
void orbit_info_short(std::ostream &ost, isomorph &Iso, int h)
void plane_intersection_type_of_klein_image(geometry::projective_space *P3, geometry::projective_space *P5, geometry::grassmann *Gr, long int *data, int size, int *&intersection_type, int &highest_intersection_number, int verbose_level)
int check_function(int len, long int *S, int verbose_level)
void all_cooperstein_thas_quotients(isomorph &Iso, int verbose_level)
void HMO(std::string &fname, int verbose_level)
void make_spread(long int *data, int type_of_spread, int verbose_level)
void print_isomorphism_type2(isomorph *Iso, std::ostream &ost, int iso_cnt, groups::sims *Stab, groups::schreier &Orb, long int *data, int verbose_level)
geometry::klein_correspondence * Klein
Definition: spreads.h:161
#define FREE_OBJECTS(p)
Definition: foundations.h:652
#define NEW_plint(n)
Definition: foundations.h:629
#define FREE_int(p)
Definition: foundations.h:640
#define FREE_plint(p)
Definition: foundations.h:643
#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_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 EVEN(x)
Definition: foundations.h:221
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define MAXIMUM(x, y)
Definition: foundations.h:217
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects
#define SPREAD_OF_TYPE_LAW_PENTTILA
Definition: spreads.h:98
#define SPREAD_OF_TYPE_KANTOR
Definition: spreads.h:95
#define SPREAD_OF_TYPE_HUDSON
Definition: spreads.h:100
#define SPREAD_OF_TYPE_GANLEY
Definition: spreads.h:97
#define SPREAD_OF_TYPE_KANTOR2
Definition: spreads.h:96
#define SPREAD_OF_TYPE_DICKSON_KANTOR
Definition: spreads.h:99
#define SPREAD_OF_TYPE_FTWKB
Definition: spreads.h:94