Orbiter 2022
Combinatorial Objects
hermitian_spreads_classify.cpp
Go to the documentation of this file.
1/*
2 * hermitian_spreads_classify.cpp
3 *
4 * Created on: Nov 6, 2019
5 * Author: anton
6 */
7
8
9
10#include "orbiter.h"
11
12using namespace std;
13
14namespace orbiter {
15namespace layer5_applications {
16namespace apps_geometry {
17
18static void HS_early_test_func_callback(long int *S, int len,
19 long int *candidates, int nb_candidates,
20 long int *good_candidates, int &nb_good_candidates,
21 void *data, int verbose_level);
22static void projective_space_init_line_action(
24 actions::action *A_points, actions::action *&A_on_lines, int verbose_level);
25
27{
28 null();
29}
30
32{
33 freeself();
34}
35
37{
38 F = NULL;
39 H = NULL;
40 Pts = NULL;
41 v = NULL;
42 P = NULL;
43 A = NULL;
44 A2 = NULL;
45 line_type = NULL;
46 Intersection_sets = NULL;
47 secants = NULL;
48 Adj = NULL;
49 //GU = NULL;
50 sg = NULL;
51 A2r = NULL;
52 Poset = NULL;
53 gen = NULL;
54}
55
57{
58 int f_v = FALSE;
59 int i;
60
61 if (F) {
63 }
64 if (H) {
66 }
67 if (Pts) {
69 }
70 if (v) {
71 FREE_int(v);
72 }
73 if (P) {
75 }
76 if (A) {
78 }
79 if (A2) {
81 }
82 if (line_type) {
84 }
86 for (i = 0; i < nb_secants; i++) {
88 }
89 }
90 if (f_v) {
91 cout << "hermitian_spreads_classify::freeself deleting secants" << endl;
92 }
93 if (secants) {
95 }
96 if (f_v) {
97 cout << "hermitian_spreads_classify::freeself deleting Adj" << endl;
98 }
99 if (Adj) {
100 FREE_int(Adj);
101 }
102 if (f_v) {
103 cout << "hermitian_spreads_classify::freeself deleting GU" << endl;
104 }
105#if 0
106 if (GU) {
107 delete GU;
108 }
109#endif
110 if (f_v) {
111 cout << "hermitian_spreads_classify::freeself deleting sg" << endl;
112 }
113 if (sg) {
115 }
116 if (f_v) {
117 cout << "hermitian_spreads_classify::freeself deleting A2r" << endl;
118 }
119 if (A2r) {
121 }
122 if (f_v) {
123 cout << "hermitian_spreads_classify::freeself deleting gen" << endl;
124 }
125 if (Poset) {
127 }
128 if (gen) {
130 }
131 null();
132}
133
134void hermitian_spreads_classify::init(int n, int Q, int verbose_level)
135{
136 int f_v = (verbose_level >= 1);
137 int i;
139
140 if (f_v) {
141 cout << "hermitian_spreads_classify::init" << endl;
142 cout << "n=" << n << endl;
143 cout << "Q=" << Q << endl;
144 }
148 F->finite_field_init(Q, FALSE /* f_without_tables */, 0);
149
150 len = n + 1;
151
153 H->init(F, len, verbose_level - 2);
154
155
156
157
159 int f, j, a, b, idx;
160
161
162
163 v = NEW_int(len);
164 H->list_of_points_embedded_in_PG(Pts, nb_pts, verbose_level);
165 cout << "We found " << nb_pts << " points, they are:" << endl;
166 for (i = 0; i < nb_pts; i++) {
167 cout << i << " : " << Pts[i] << " : ";
169 Int_vec_print(cout, v, len);
170 cout << endl;
171 }
172
173
175
176 cout << "Creating projective_space" << endl;
178 TRUE /* f_init_incidence_structure */,
179 0 /* verbose_level */);
180 cout << "Creating projective_space done" << endl;
181
183
184 cout << "Creating linear group" << endl;
187 TRUE /* f_semilinear */, TRUE /* f_basis */, TRUE /* f_init_sims */,
188 nice_gens,
189 verbose_level - 2);
190 FREE_OBJECT(nice_gens);
191
192 cout << "Creating action on lines" << endl;
193 projective_space_init_line_action(P, A, A2, verbose_level);
194
195
196
197
199
200 P->line_intersection_type(Pts, nb_pts, line_type, verbose_level);
201
202
203 C.init(line_type, P->N_lines, FALSE, 0);
204 cout << "The line type is:" << endl;
205 C.print(TRUE /* f_backwards*/);
206
207 cout << "The secants are:" << endl;
208 f = C.type_first[1];
209 nb_secants = C.type_len[1];
211 sz = C.data_sorted[f];
212
213
215
216 for (j = 0; j < nb_secants; j++) {
217 a = C.sorting_perm_inv[f + j];
218 secants[j] = a;
219 }
220
221 int intersection_set_size;
222
223 for (j = 0; j < nb_secants; j++) {
224 a = C.sorting_perm_inv[f + j];
225 cout << j << " : " << a << " : ";
226
228 P->Grass_lines, a, Pts, nb_pts,
229 Intersection_sets[j], intersection_set_size,
230 0 /* verbose_level */);
231 if (intersection_set_size != sz) {
232 cout << "intersection_set_size != sz" << endl;
233 exit(1);
234 }
235 for (i = 0; i < sz; i++) {
236 b = Intersection_sets[j][i];
237 if (!Sorting.lint_vec_search_linear(Pts, nb_pts, b, idx)) {
238 cout << "cannot find the point" << endl;
239 exit(1);
240 }
241 Intersection_sets[j][i] = idx;
242 }
243
245 cout << endl;
246 }
247
248
249 cout << "Computing Adjacency matrix:" << endl;
251 for (i = 0; i < nb_secants * nb_secants; i++) {
252 Adj[i] = 0;
253 }
254 for (i = 0; i < nb_secants; i++) {
255 for (j = i + 1; j < nb_secants; j++) {
258 Adj[i * nb_secants + j] = 1;
259 Adj[j * nb_secants + i] = 1;
260 }
261 }
262 }
263 cout << "Adj" << endl;
265
266
267 cout << "Computing the unitary group:" << endl;
268
269 //int canonical_pt;
271 Pts, nb_pts, /*canonical_pt,*/ NULL,
272 verbose_level);
273 //GU = P->set_stabilizer(Pts, nb_pts, verbose_level);
275
276 sg->group_order(go);
277 cout << "Group has been computed, group order = " << go << endl;
278
279
280
281 cout << "strong generators are:" << endl;
282 sg->print_generators(cout);
283
284
285
286 //A2r = NEW_OBJECT(action);
287
288 cout << "Creating restricted action on secants:" << endl;
290 NULL,
292 FALSE /* f_induce_action */,
293 0 /* verbose_level */);
294 cout << "Creating restricted action on secants done." << endl;
295
296
297 if (f_v) {
298 cout << "hermitian_spread_classify::init done" << endl;
299 }
300}
301
302void hermitian_spreads_classify::read_arguments(int argc, std::string *argv)
303{
304 int i;
306
310
311#if 0
312 for (i = 1; i < argc; i++) {
313 cout << argv[i] << endl;
314 }
315#endif
316 //gen->read_arguments(argc, argv, 1);
317
318
319 for (i = 0; i < argc; i++) {
320 if (ST.stringcmp(argv[i], "-poset_classification_control") == 0) {
322 i += Control->read_arguments(argc - (i + 1),
323 argv + i + 1, 0 /*verbose_level*/);
324
325 cout << "done with -poset_classification_control" << endl;
326 cout << "i = " << i << endl;
327 cout << "argc = " << argc << endl;
328 if (i < argc) {
329 cout << "next argument is " << argv[i] << endl;
330 }
331 }
332 }
333}
334
336{
337 int f_v = (verbose_level >= 1);
338 //int f_vv = (verbose_level >= 2);
339 //int depth;
340 char prefix[1000];
341
342 if (f_v) {
343 cout << "hermitian_spreads_classify::init2" << endl;
344 }
345 //depth = order + 1;
346
347 sprintf(prefix, "HS_%d_%d", n, Q);
348
350 sg,
351 verbose_level);
352
353 if (f_v) {
354 cout << "hermitian_spreads_classify::init2 before "
355 "Poset->add_testing_without_group" << endl;
356 }
358 HS_early_test_func_callback,
359 this /* void *data */,
360 verbose_level);
361
362
363 //gen->f_allowed_to_show_group_elements = TRUE;
364
365
366
367#if 0
368 gen->f_print_function = TRUE;
369 gen->print_function = print_set;
370 gen->print_function_data = this;
371#endif
372
373
374 if (f_v) {
375 cout << "hermitian_spreads_classify::init2 done" << endl;
376 }
377}
378
379void hermitian_spreads_classify::compute(int depth, int verbose_level)
380{
381 int f_v = (verbose_level >= 1);
382 int schreier_depth = depth;
383 int f_use_invariant_subset_if_available = TRUE;
384 int f_debug = FALSE;
385 int t0;
387
388
390 Control->depth = depth;
391
392
393
395 nb_pts / sz,
396 //"", prefix,
397 verbose_level - 2);
398
399
400
401#if 0
402 if (f_override_schreier_depth) {
403 schreier_depth = override_schreier_depth;
404 }
405#endif
406 if (f_v) {
407 cout << "hermitian_spreads_classify::compute calling generator_main" << endl;
408 }
409
410 t0 = Os.os_ticks();
411 gen->main(t0,
412 schreier_depth,
413 f_use_invariant_subset_if_available,
414 f_debug,
415 verbose_level - 1);
416
417 int length;
418
419 if (f_v) {
420 cout << "hermitian_spreads_classify::compute done with generator_main" << endl;
421 }
422 length = gen->nb_orbits_at_level(depth);
423
424#if 0
425 int f_sideways = FALSE;
426
427 gen->draw_poset(gen->get_problem_label_with_path(), depth, 0 /* data1 */,
428 f_embedded, f_sideways, 100, verbose_level);
429 gen->print_data_structure_tex(depth, verbose_level);
430#endif
431
432 if (f_v) {
433 cout << "hermitian_spreads_classify::compute "
434 "We found " << length << " orbits" << endl;
435 }
436}
437
438
440 long int *candidates, int nb_candidates,
441 long int *good_candidates, int &nb_good_candidates,
442 int verbose_level)
443{
444 int f_v = (verbose_level >= 1);
445 int i, j, a, b, i0;
446
447 if (f_v) {
448 cout << "hermitian_spreads_classify::early_test_func checking set ";
449 Lint_vec_print(cout, S, len);
450 cout << endl;
451 cout << "candidate set of size " << nb_candidates << ":" << endl;
452 Lint_vec_print(cout, candidates, nb_candidates);
453 cout << endl;
454 }
455
456 nb_good_candidates = 0;
457 for (j = 0; j < nb_candidates; j++) {
458
459 a = candidates[j];
460
461 if (len == 0) {
462 i0 = 0;
463 }
464 else {
465 i0 = len - 1;
466 }
467 for (i = i0; i < len; i++) {
468 b = S[i];
469 if (Adj[a * nb_secants + b] == 0) {
470 break;
471 }
472 else {
473 }
474 } // next i
475
476
477
478 if (i == len) {
479 good_candidates[nb_good_candidates++] = candidates[j];
480 }
481 } // next j
482
483}
484
485
486static void HS_early_test_func_callback(long int *S, int len,
487 long int *candidates, int nb_candidates,
488 long int *good_candidates, int &nb_good_candidates,
489 void *data, int verbose_level)
490{
492 int f_v = (verbose_level >= 1);
493
494 if (f_v) {
495 cout << "HS_early_test_func for set ";
496 Lint_vec_print(cout, S, len);
497 cout << endl;
498 }
499 HS->early_test_func(S, len,
500 candidates, nb_candidates,
501 good_candidates, nb_good_candidates,
502 verbose_level - 2);
503 if (f_v) {
504 cout << "HS_early_test_func done" << endl;
505 }
506}
507
508
509static void projective_space_init_line_action(
511 actions::action *A_points, actions::action *&A_on_lines, int verbose_level)
512{
513 int f_v = (verbose_level >= 1);
515
516 if (f_v) {
517 cout << "projective_space_init_line_action" << endl;
518 }
519 A_on_lines = NEW_OBJECT(actions::action);
520
522
523 AoL->init(*A_points, P->Grass_lines, verbose_level - 5);
524
525
526 if (f_v) {
527 cout << "projective_space_init_line_action "
528 "action on grassmannian established" << endl;
529 }
530
531 if (f_v) {
532 cout << "projective_space_init_line_action "
533 "initializing A_on_lines" << endl;
534 }
535 int f_induce_action = TRUE;
536 groups::sims S;
538
539 S.init(A_points, 0);
540 S.init_generators(*A_points->Strong_gens->gens,
541 0/*verbose_level*/);
543 A_points->get_transversal_length(),
544 0/*verbose_level - 1*/);
545 S.group_order(go1);
546 if (f_v) {
547 cout << "projective_space_init_line_action "
548 "group order " << go1 << endl;
549 }
550
551 if (f_v) {
552 cout << "projective_space_init_line_action "
553 "initializing action on grassmannian" << endl;
554 }
555 A_on_lines->induced_action_on_grassmannian(A_points, AoL,
556 f_induce_action, &S, verbose_level);
557 if (f_v) {
558 cout << "projective_space_init_line_action "
559 "initializing A_on_lines done" << endl;
560 A_on_lines->print_info();
561 }
562
563 if (f_v) {
564 cout << "projective_space_init_line_action "
565 "computing strong generators" << endl;
566 }
567 if (!A_on_lines->f_has_strong_generators) {
568 cout << "projective_space_init_line_action "
569 "induced action does not have strong generators" << endl;
570 }
571 if (f_v) {
572 cout << "projective_space_init_line_action done" << endl;
573 }
574}
575
576
577
578}}}
579
580
a collection of functions related to sorted vectors
int lint_vec_search_linear(long int *v, int len, long int a, int &idx)
Definition: sorting.cpp:699
int test_if_sets_are_disjoint_not_assuming_sorted(long int *v, long int *w, int len)
Definition: sorting.cpp:2864
functions related to strings and character arrays
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 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 init(field_theory::finite_field *F, int nb_vars, int verbose_level)
Definition: hermitian.cpp:73
void list_of_points_embedded_in_PG(long int *&Pts, int &nb_pts, int verbose_level)
Definition: hermitian.cpp:170
projective space PG(n,q) of dimension n over Fq
Definition: geometry.h:1916
void intersection_of_subspace_with_point_set(grassmann *G, int rk, long int *set, int set_size, long int *&intersection_set, int &intersection_set_size, int verbose_level)
void line_intersection_type(long int *set, int set_size, int *type, int verbose_level)
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
a permutation group in a fixed action.
Definition: actions.h:99
void init_general_linear_group(int n, field_theory::finite_field *F, int f_semilinear, int f_basis, int f_init_sims, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
groups::strong_generators * set_stabilizer_in_projective_space(geometry::projective_space *P, long int *set, int set_size, int *canonical_set_or_NULL, int verbose_level)
groups::strong_generators * Strong_gens
Definition: actions.h:130
action * induced_action_on_grassmannian(int k, int verbose_level)
action * create_induced_action_by_restriction(groups::sims *S, int size, long int *set, int f_induce, int verbose_level)
a permutation group represented via a stabilizer chain
Definition: groups.h:1273
void init(actions::action *A, int verbose_level)
Definition: sims.cpp:289
void group_order(ring_theory::longinteger_object &go)
Definition: sims.cpp:951
void compute_base_orbits_known_length(int *tl, int verbose_level)
Definition: sims_main.cpp:57
void init_generators(data_structures_groups::vector_ge &generators, int verbose_level)
Definition: sims.cpp:660
data_structures_groups::vector_ge * gens
Definition: groups.h:1708
void group_order(ring_theory::longinteger_object &go)
induced action on the grassmannian (subspaces of a fixed dimension of a vectors space)
void init(actions::action &A, geometry::grassmann *G, int verbose_level)
to control the behavior of the poset classification algorithm
void initialize_and_allocate_root_node(poset_classification_control *PC_control, poset_with_group_action *Poset, int depth, int verbose_level)
int main(int t0, int schreier_depth, int f_use_invariant_subset_if_available, int f_debug, int verbose_level)
void draw_poset(std::string &fname_base, int depth, int data, graphics::layered_graph_draw_options *LG_Draw_options, int verbose_level)
void init_subset_lattice(actions::action *A, actions::action *A2, groups::strong_generators *Strong_gens, int verbose_level)
void add_testing_without_group(void(*func)(long int *S, int len, long int *candidates, int nb_candidates, long int *good_candidates, int &nb_good_candidates, void *data, int verbose_level), void *data, int verbose_level)
poset_classification::poset_classification_control * Control
Definition: tl_geometry.h:435
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)
poset_classification::poset_with_group_action * Poset
Definition: tl_geometry.h:436
#define NEW_plint(n)
Definition: foundations.h:629
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define Lint_vec_print(A, B, C)
Definition: foundations.h:686
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define Int_matrix_print(A, B, C)
Definition: foundations.h:707
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define FREE_lint(p)
Definition: foundations.h:642
#define NEW_lint(n)
Definition: foundations.h:628
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
the orbiter library for the classification of combinatorial objects