13namespace layer1_foundations {
60 if (Line_to_point_on_quadric) {
63 if (Point_on_quadric_to_line) {
68 if (Point_on_quadric_embedded_in_P5) {
69 FREE_lint(Point_on_quadric_embedded_in_P5);
73 if (coordinates_of_quadric_points) {
74 FREE_int(coordinates_of_quadric_points);
87 int f_v = (verbose_level >= 1);
94 cout <<
"klein_correspondence::init" << endl;
107 cout <<
"klein_correspondence::init before P3->projective_space_init" << endl;
116 cout <<
"klein_correspondence::init before P5->projective_space_init" << endl;
122 cout <<
"klein_correspondence::after after P5->projective_space_init" << endl;
146 for (h = 0; h < 3; h++) {
153 cout <<
"klein_correspondence::init Form matrix:" << endl;
158 cout <<
"klein_correspondence::init before allocate "
159 "Line_to_point_on_quadric P3->N_lines="
164 cout <<
"klein_correspondence::init before allocate "
165 "Point_on_quadric_to_line P3->N_lines="
170 cout <<
"klein_correspondence::init before allocate "
171 "Point_on_quadric_embedded_in_P5 P3->N_lines="
180 int *x4, *y4, a, b, c, val;
183 long int point_rk, line_rk;
187 Point_on_quadric_to_line[i] = -1;
190 cout <<
"klein_correspondence::init computing "
191 "Line_to_point_on_quadric[] / Point_on_quadric_to_line[]" << endl;
197 if ((i % N100) == 0) {
198 cout <<
"klein_correspondence::init at " << i <<
" which is " << (double) i / (
double) N100 <<
"%" << endl;
203 v6[0] =
F->Pluecker_12(x4, y4);
204 v6[1] =
F->Pluecker_34(x4, y4);
205 v6[2] =
F->Pluecker_13(x4, y4);
206 v6[3] =
F->Pluecker_42(x4, y4);
207 v6[4] =
F->Pluecker_14(x4, y4);
208 v6[5] =
F->Pluecker_23(x4, y4);
209 a =
F->
mult(v6[0], v6[1]);
210 b =
F->
mult(v6[2], v6[3]);
211 c =
F->
mult(v6[4], v6[5]);
212 val =
F->
add3(a, b, c);
216 cout <<
"klein_correspondence::init point does "
217 "not lie on quadric" << endl;
223 cout <<
"klein_correspondence::init i=" << i
225 int_vec_print(cout, v6, 6);
226 cout <<
" : j=" << j << endl;
228 if (Point_on_quadric_to_line[j] != -1) {
229 cout <<
"Something is wrong with "
230 "Point_on_quadric_to_line: Point_on_quadric_to_line[j] != -1" << endl;
236 cout <<
"klein_correspondence::init point_rk != j" << endl;
241 cout <<
"klein_correspondence::init line_rk != i" << endl;
245 Line_to_point_on_quadric[i] = j;
246 Point_on_quadric_to_line[j] = i;
249 if (Point_on_quadric_to_line[i] == -1) {
250 cout <<
"Something is wrong with "
251 "Point_on_quadric_to_line" << endl;
252 cout <<
"Point_on_quadric_to_line[i] == -1" << endl;
253 cout <<
"i=" << i << endl;
262 cout <<
"klein_correspondence::init computing "
263 "Point_on_quadric_embedded_in_P5[]" << endl;
267 Point_on_quadric_embedded_in_P5[i] =
P5->
rank_point(v6);
274 cout <<
"klein_correspondence::init before coordinates_"
275 "of_quadric_points P3->N_lines * d="
282 cout <<
"klein_correspondence::init before allocate "
283 "Pt_rk P3->N_lines=" <<
P3->
N_lines << endl;
288 cout <<
"klein_correspondence::init after allocate "
289 "Pt_rk P3->N_lines=" <<
P3->
N_lines << endl;
290 cout <<
"klein_correspondence::init computing Pt_rk[]" << endl;
294 coordinates_of_quadric_points + i * d, 1, i, 0);
296 coordinates_of_quadric_points + i * d, v6, 6);
301 cout <<
"klein_correspondence::init computing Pt_rk[] done" << endl;
305 cout <<
"Points on the Klein quadric:" << endl;
307 for (i = 0; i <
nb_Pts; i++) {
310 cout << i <<
" & " << endl;
311 cout <<
"\\left[" << endl;
312 cout <<
"\\begin{array}{cccc}" << endl;
313 for (u = 0; u < 2; u++) {
314 for (v = 0; v < 4; v++) {
315 cout << basis_line[u * 4 + v] <<
" ";
320 cout <<
"\\\\" << endl;
322 cout <<
"\\end{array}" << endl;
323 cout <<
"\\right] & " << endl;
325 coordinates_of_quadric_points + i * d, d);
327 cout <<
"\\\\" << endl;
331 cout <<
"too many points to print" << endl;
338 cout <<
"klein_correspondence::init nb_pts_PG = " <<
nb_pts_PG << endl;
344 cout <<
"klein_correspondence::init before "
345 "allocate Pt_idx nb_pts_P=" <<
nb_pts_PG << endl;
351 for (i = 0; i <
nb_Pts; i++) {
359 cout <<
"klein_correspondence::init done" << endl;
364 long int *lines_in_PG3,
int nb_lines,
366 long int **&Pts_on_plane,
367 int *&nb_pts_on_plane,
371 int f_v = (verbose_level >= 1);
372 int f_vv = (verbose_level >= 2);
377 cout <<
"klein_correspondence::plane_intersections" << endl;
382 lines_in_PG3, nb_lines, pts, 0);
385 R, Pts_on_plane, nb_pts_on_plane, nb_planes,
390 cout <<
"klein_correspondence::plane_intersections: "
391 "We found " << nb_planes <<
" planes." << endl;
393 for (i = 0; i < nb_planes; i++) {
394 cout << setw(3) << i <<
" : " << R[i]
395 <<
" : " << setw(5) << nb_pts_on_plane[i] <<
" : ";
404 cout <<
"klein_correspondence::plane_intersections done" << endl;
420 int f_v = (verbose_level >= 1);
423 cout <<
"klein_correspondence::line_to_point_on_quadric" << endl;
432 cout <<
"klein_correspondence::line_to_point_on_quadric line_rk=" << line_rk
435 cout <<
" : point_rk=" << point_rk << endl;
439 cout <<
"klein_correspondence::line_to_point_on_quadric done" << endl;
446 int f_v = (verbose_level >= 1);
449 cout <<
"klein_correspondence::line_to_Pluecker" << endl;
452 int *x4, *y4, a, b, c, val;
463 a =
F->
mult(v6[0], v6[1]);
464 b =
F->
mult(v6[2], v6[3]);
465 c =
F->
mult(v6[4], v6[5]);
466 val =
F->
add3(a, b, c);
470 cout <<
"klein_correspondence::line_to_Pluecker point does "
471 "not lie on quadric" << endl;
476 cout <<
"klein_correspondence::line_to_Pluecker done" << endl;
482 int f_v = (verbose_level >= 1);
485 cout <<
"klein_correspondence::point_on_quadric_to_line" << endl;
489 long int line_rk = 0;
493 cout <<
"klein_correspondence::point_on_quadric_to_line v6=";
502 cout <<
"klein_correspondence::point_on_quadric_to_line "
503 "point_rk=" << point_rk <<
" line_rk=" << line_rk <<
" done" << endl;
506 cout <<
"klein_correspondence::point_on_quadric_to_line "
507 "line_rk >= P3->N_lines" << endl;
512 cout <<
"klein_correspondence::point_on_quadric_to_line done" << endl;
520 int f_v = (verbose_level >= 1);
521 int p12, p34, p13, p24, p14, p23;
525 cout <<
"klein_correspondence::Pluecker_to_line" << endl;
544 basis_line, verbose_level);
548 cout <<
"klein_correspondence::Pluecker_to_line done" << endl;
555 int f_v = (verbose_level >= 1);
560 cout <<
"klein_correspondence::Pluecker_to_line_rk" << endl;
569 cout <<
"klein_correspondence::Pluecker_to_line_rk done" << endl;
579 int f_v = (verbose_level >= 1);
580 int p12, p13, p14, p23, p24, p34;
585 cout <<
"klein_correspondence::exterior_square_to_line" << endl;
598 if (p12 == 0 && p13 == 0 && p14 == 0) {
601 cout <<
"klein_correspondence::exterior_square_to_line x1=0" << endl;
604 if (p23 == 0 && p24 == 0) {
605 basis_line[2] = basis_line[7] = 1;
629 cout <<
"klein_correspondence::exterior_square_to_line x1=1" << endl;
635 if (y2 == 0 && y3 == 0) {
665 cout <<
"klein_correspondence::exterior_square_to_line done" << endl;
673 std::vector<long int> &External_lines,
int verbose_level)
676 int f_v = (verbose_level >= 1);
682 int nb_points_covered;
685 cout <<
"klein_correspondence::compute_external_lines" << endl;
692 cout <<
"klein_correspondence::compute_external_lines "
699 cout <<
"klein_correspondence::compute_external_lines "
700 "nb_points_covered=" << nb_points_covered << endl;
706 cout <<
"klein_correspondence::compute_external_lines "
707 "computing external lines:" << endl;
709 int pt, a, b, c, val;
716 for (j = 0; j < nb_points_covered; j++) {
720 a =
F->
mult(v6[0], v6[1]);
721 b =
F->
mult(v6[2], v6[3]);
722 c =
F->
mult(v6[4], v6[5]);
723 val =
F->
add3(a, b, c);
729 if (j == nb_points_covered) {
730 External_lines.push_back(i);
734 cout <<
"klein_correspondence::compute_external_lines "
735 "We found " << External_lines.size()
736 <<
" external lines" << endl;
743 cout <<
"klein_correspondence::compute_external_lines done" << endl;
750 std::vector<long int> &External_lines,
751 long int *&spread_to_external_line_idx,
752 long int *&external_line_to_spread,
760 int f_v = (verbose_level >= 1);
763 cout <<
"klein_correspondence::identify_external_lines_and_spreads" << endl;
769 int *basis_elliptic_quadric;
771 int *basis_external_line;
775 external_line_to_spread =
NEW_lint(External_lines.size());
780 basis_external_line =
NEW_int(2 * d);
782 for (i = 0; i < External_lines.size(); i++) {
783 external_line_to_spread[i] = -1;
789 if ((i % N100) == 0) {
790 cout <<
"klein_correspondence::identify_external_lines_and_spreads "
791 "progress " << ((double)i / N100) <<
" %" << endl;
800 cout <<
"klein_correspondence::identify_external_lines_and_spreads"
802 <<
" the elliptic quadric space" << endl;
808 cout <<
"klein_correspondence::identify_external_lines_and_spreads "
809 "spread " << i <<
" the elliptic quadric space "
810 "does not have rank 4" << endl;
821 cout <<
"klein_correspondence::identify_external_lines_and_spreads spread "
822 " cannot find the external line i = " << i << endl;
825 spread_to_external_line_idx[i] = idx;
826 external_line_to_spread[idx] = i;
830 for (i = 0; i < External_lines.size(); i++) {
831 if (external_line_to_spread[i] == -1) {
832 cout <<
"klein_correspondence::identify_external_lines_and_spreads "
833 "something is wrong with the correspondence" << endl;
844 cout <<
"klein_correspondence::identify_external_lines_and_spreads done" << endl;
852 int f_v = (verbose_level >= 1);
866 cout <<
"klein_correspondence::reverse_isomorphism" << endl;
870 cout <<
"A6=" << endl;
891 for (i = 0; i < 6; i++) {
895 F->mult_matrix_matrix(Basis2, A6, Image, 6, 6, 6, 0 );
896 for (i = 0; i < 6; i++) {
902 int_vec_copy(A6, A6_copy, 36);
905 for (i = 0; i < 6; i++) {
906 u1 = A6_copy[3 * 6 + i];
908 A6_copy[3 * 6 + i] = u2;
911 for (i = 0; i < 6; i++) {
912 u1 = A6_copy[i * 6 + 3];
914 A6_copy[i * 6 + 3] = u2;
918 cout <<
"A6_copy=" << endl;
919 int_matrix_print(A6_copy, 6, 6);
936 cout <<
"X=" << endl;
938 cout <<
"Y=" << endl;
940 cout <<
"Z=" << endl;
950 cout <<
"Xv=" << endl;
952 cout <<
"Yv=" << endl;
954 cout <<
"Zv=" << endl;
961 cout <<
"XYv=" << endl;
968 cout <<
"XZv=" << endl;
978 M[0 * 8 + 0] = XYv[0 * 4 + 2];
979 M[0 * 8 + 1] = XYv[1 * 4 + 2];
980 M[1 * 8 + 0] = XYv[0 * 4 + 3];
981 M[1 * 8 + 1] = XYv[1 * 4 + 3];
982 M[2 * 8 + 4] = XYv[2 * 4 + 2];
983 M[2 * 8 + 5] = XYv[3 * 4 + 2];
984 M[3 * 8 + 4] = XYv[2 * 4 + 3];
985 M[3 * 8 + 5] = XYv[3 * 4 + 3];
986 M[4 * 8 + 2] = XYv[0 * 4 + 0];
987 M[4 * 8 + 3] = XYv[1 * 4 + 0];
988 M[5 * 8 + 2] = XYv[0 * 4 + 1];
989 M[5 * 8 + 3] = XYv[1 * 4 + 1];
990 M[6 * 8 + 6] = XYv[2 * 4 + 0];
991 M[6 * 8 + 7] = XYv[3 * 4 + 0];
992 M[7 * 8 + 6] = XYv[2 * 4 + 1];
993 M[7 * 8 + 7] = XYv[3 * 4 + 1];
995 M[8 * 8 + 0] = XZv[0 * 4 + 2];
996 M[8 * 8 + 1] = XZv[1 * 4 + 2];
997 M[9 * 8 + 0] = XZv[0 * 4 + 3];
998 M[9 * 8 + 1] = XZv[1 * 4 + 3];
999 M[10 * 8 + 6] = XZv[2 * 4 + 2];
1000 M[10 * 8 + 7] = XZv[3 * 4 + 2];
1001 M[11 * 8 + 6] = XZv[2 * 4 + 3];
1002 M[11 * 8 + 7] = XZv[3 * 4 + 3];
1003 M[12 * 8 + 2] = XZv[0 * 4 + 0];
1004 M[12 * 8 + 3] = XZv[1 * 4 + 0];
1005 M[13 * 8 + 2] = XZv[0 * 4 + 1];
1006 M[13 * 8 + 3] = XZv[1 * 4 + 1];
1007 M[14 * 8 + 4] = XZv[2 * 4 + 0];
1008 M[14 * 8 + 5] = XZv[3 * 4 + 0];
1009 M[15 * 8 + 4] = XZv[2 * 4 + 1];
1010 M[15 * 8 + 5] = XZv[3 * 4 + 1];
1016 cout <<
"M=" << endl;
1028 cout <<
"has rank " << rk << endl;
1032 cout <<
"base columns: " << endl;
1037 int kernel_m, kernel_n;
1042 kernel_m, kernel_n, K, 0 );
1046 cout <<
"kernel: " << endl;
1052 int a, b, c, d, e, f, g, h;
1054 for (i = 0; i < 8; i++) {
1059 for (j = 0; j < kernel_n; j++) {
1060 for (i = 0; i < 8; i++) {
1061 if (K[i * kernel_n + j]) {
1062 abcdefgh[i] = K[i * kernel_n + j];
1088 cout <<
"D=" << endl;
1095 cout <<
"A4=" << endl;
1106 cout <<
"A6b=" << endl;
1112 cout <<
"matrices are not projectively equal" << endl;
1116 cout <<
"matrices are projectively the same, success" << endl;
1120 cout <<
"klein_correspondence::reverse_isomorphism done" << endl;
a collection of combinatorial functions
void q_binomial(ring_theory::longinteger_object &a, int n, int k, int q, int verbose_level)
a collection of functions related to sorted vectors
int vector_lint_search(std::vector< long int > &v, long int a, int &idx, int verbose_level)
void PG_element_rank_modified(int *v, int stride, int len, int &a)
void PG_element_unrank_modified(int *v, int stride, int len, int a)
int test_if_vectors_are_projectively_equal(int *v1, int *v2, int len)
int add3(int i1, int i2, int i3)
int a_over_b(int a, int b)
void klein_to_wedge(int *K, int *W)
linear_algebra::linear_algebra * Linear_algebra
void wedge_to_klein(int *W, int *K)
various functions related to geometries
long int nb_PG_elements(int n, int q)
to rank and unrank subspaces of a fixed dimension in F_q^n
int nb_points_covered(int verbose_level)
void unrank_lint_here(int *Mtx, long int rk, int verbose_level)
void init(int n, int k, field_theory::finite_field *F, int verbose_level)
void points_covered(long int *the_points, int verbose_level)
void Pluecker_to_line(int *v6, int *basis_line, int verbose_level)
long int point_on_quadric_embedded_in_P5(long int pt)
void init(field_theory::finite_field *F, orthogonal_geometry::orthogonal *O, int verbose_level)
void identify_external_lines_and_spreads(spread_tables *T, std::vector< long int > &External_lines, long int *&spread_to_external_line_idx, long int *&external_line_to_spread, int verbose_level)
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)
void exterior_square_to_line(int *v, int *basis_line, int verbose_level)
long int line_to_point_on_quadric(long int line_rk, int verbose_level)
long int nb_lines_orthogonal
void reverse_isomorphism(int *A6, int *A4, int verbose_level)
long int point_on_quadric_to_line(long int point_rk, int verbose_level)
orthogonal_geometry::orthogonal * O
field_theory::finite_field * F
void compute_external_lines(std::vector< long int > &External_lines, int verbose_level)
void line_to_Pluecker(long int line_rk, int *v6, int verbose_level)
long int Pluecker_to_line_rk(int *v6, int verbose_level)
projective space PG(n,q) of dimension n over Fq
void plane_intersection_type_fast(grassmann *G, long int *set, int set_size, ring_theory::longinteger_object *&R, long int **&Pts_on_plane, int *&nb_pts_on_plane, int &len, int verbose_level)
long int rank_line(int *basis)
void klein_correspondence(projective_space *P5, long int *set_in, int set_size, long int *set_out, int verbose_level)
long int rank_point(int *v)
void projective_space_init(int n, field_theory::finite_field *F, int f_init_incidence_structure, int verbose_level)
void unrank_line(int *basis, long int rk)
tables with line-spreads in PG(3,q)
int Pluecker_34(int *x4, int *y4)
int Pluecker_13(int *x4, int *y4)
void exterior_square(int *An, int *An2, int n, int verbose_level)
void invert_matrix(int *A, int *A_inv, int n, int verbose_level)
void mult_matrix_matrix(int *A, int *B, int *C, int m, int n, int o, int verbose_level)
int Gauss_easy(int *A, int m, int n)
int Pluecker_14(int *x4, int *y4)
int perp(int n, int k, int *A, int *Gram, int verbose_level)
int Pluecker_12(int *x4, int *y4)
int Pluecker_42(int *x4, int *y4)
int Pluecker_23(int *x4, int *y4)
int Gauss_simple(int *A, int m, int n, int *base_cols, int verbose_level)
void matrix_get_kernel(int *M, int m, int n, int *base_cols, int nb_base_cols, int &kernel_m, int &kernel_n, int *kernel, int verbose_level)
an orthogonal geometry O^epsilon(n,q)
long int rank_point(int *v, int stride, int verbose_level)
void unrank_point(int *v, int stride, long int rk, int verbose_level)
a class to represent arbitrary precision integers
#define Int_vec_zero(A, B)
#define Lint_vec_print(A, B, C)
#define Int_matrix_print(A, B, C)
#define Int_vec_copy(A, B, C)
#define Int_vec_print(A, B, C)
the orbiter library for the classification of combinatorial objects