Orbiter 2022
Combinatorial Objects
quartic_curve_create.cpp
Go to the documentation of this file.
1/*
2 * quartic_curve_create.cpp
3 *
4 * Created on: May 20, 2021
5 * Author: betten
6 */
7
8
9
10
11#include "orbiter.h"
12
13using namespace std;
14
15namespace orbiter {
16namespace layer5_applications {
17namespace applications_in_algebraic_geometry {
18namespace quartic_curves {
19
20
21
23{
25 F = NULL;
26 PA = NULL;
27 QCDA = NULL;
28 QO = NULL;
29 QOA = NULL;
31 Sg = NULL;
33 nice_gens = NULL;
34 null();
35}
36
38{
39 freeself();
40}
41
43{
44}
45
47{
48 if (f_ownership) {
49 if (F) {
51 }
52 if (PA) {
54 }
55 }
56 if (Sg) {
58 }
59 if (nice_gens) {
61 }
62 null();
63}
64
69 int verbose_level)
70{
71 int f_v = (verbose_level >= 1);
73
74
75 if (f_v) {
76 cout << "quartic_curve_create::init_with_data" << endl;
77 }
78
80
84
85
86 if (NT.is_prime(q)) {
88 }
89 else {
91 }
92
94 q = F->q;
95 if (Descr->q != F->q) {
96 cout << "quartic_curve_create::init_with_data "
97 "Descr->q != F->q" << endl;
98 exit(1);
99 }
100
101 if (f_v) {
102 cout << "quartic_curve_create::init_with_data "
103 "before create_surface_from_description" << endl;
104 }
106 if (f_v) {
107 cout << "quartic_curve_create::init_with_data "
108 "after create_surface_from_description" << endl;
109 }
110
111 if (f_v) {
112 cout << "quartic_curve_create::init_with_data "
113 "done" << endl;
114 }
115}
116
117
122 int verbose_level)
123{
124 int f_v = (verbose_level >= 1);
126
127
128 if (f_v) {
129 cout << "quartic_curve_create::init" << endl;
130 }
132
133 if (!Descr->f_q) {
134 cout << "quartic_curve_create::init !Descr->f_q" << endl;
135 exit(1);
136 }
137 q = Descr->q;
138 if (f_v) {
139 cout << "quartic_curve_create::init q = " << q << endl;
140 }
141
144
146 if (F->q != q) {
147 cout << "quartic_curve_create::init q = " << q << endl;
148 exit(1);
149 }
150
151
152
153
154 if (NT.is_prime(q)) {
156 }
157 else {
159 }
160
161
162 if (f_v) {
163 cout << "quartic_curve_create::init before create_surface_from_description" << endl;
164 }
166 if (f_v) {
167 cout << "quartic_curve_create::init after create_surface_from_description" << endl;
168 }
169
170
171 if (f_v) {
172 cout << "quartic_curve_create::init done" << endl;
173 }
174}
175
177{
178 int f_v = (verbose_level >= 1);
179
180
181 if (f_v) {
182 cout << "quartic_curve_create::create_quartic_curve_from_description" << endl;
183 }
184
185
187
188
191 verbose_level);
192
193
194 }
195
196 else if (Descr->f_catalogue) {
197
198
200 DomA,
201 Descr->iso,
202 verbose_level);
203
204
205
206
207 }
208 else if (Descr->f_by_equation) {
209
217 verbose_level);
218 }
219
220 else {
221 cout << "quartic_curve_create::create_quartic_curve_from_description we do not "
222 "recognize the type of surface" << endl;
223 exit(1);
224 }
225
226
227 if (Descr->f_override_group) {
228
232 verbose_level);
233 }
234
235 if (f_v) {
236 cout << "quartic_curve_create::create_quartic_curve_from_description coeffs = ";
237 Int_vec_print(cout, QO->eqn15, 15);
238 cout << endl;
239 }
240
241 if (f_v) {
242 cout << "quartic_curve_create::create_quartic_curve_from_description bitangents = ";
243 Lint_vec_print(cout, QO->bitangents28, 28);
244 cout << endl;
245 }
246
247
248 if (f_v) {
249 if (f_has_group) {
250 cout << "quartic_curve_create::create_quartic_curve_from_description the stabilizer is:" << endl;
252 }
253 else {
254 cout << "quartic_curve_create::create_quartic_curve_from_description "
255 "The surface has no group computed" << endl;
256 }
257 }
258
259#if 0
260 if (f_has_group) {
261 if (f_v) {
262 cout << "quartic_curve_create::create_quartic_curve_from_description before Surf_A->test_group" << endl;
263 }
264 Surf_A->test_group(this, verbose_level);
265 if (f_v) {
266 cout << "quartic_curve_create::create_quartic_curve_from_description after Surf_A->test_group" << endl;
267 }
268 }
269#endif
270
271 if (f_v) {
272 cout << "quartic_curve_create::create_quartic_curve_from_description done" << endl;
273 }
274}
275
276void quartic_curve_create::override_group(std::string &group_order_text,
277 int nb_gens, std::string &gens_text, int verbose_level)
278{
279 int f_v = (verbose_level >= 1);
280 int *data;
281 int sz;
282
283 if (f_v) {
284 cout << "quartic_curve_create::override_group "
285 "group_order=" << group_order_text
286 << " nb_gens=" << nb_gens << endl;
287 }
289
290 if (f_v) {
291 cout << "quartic_curve_create::override_group before Sg->stabilizer_of_cubic_surface_from_catalogue" << endl;
292 }
293
294 Int_vec_scan(gens_text, data, sz);
295 if (sz != PA->A->make_element_size * nb_gens) {
296 cout << "quartic_curve_create::override_group sz != Surf_A->A->make_element_size * nb_gens" << endl;
297 exit(1);
298 }
299
301
303 nb_gens, PA->A->make_element_size, group_order_text.c_str(),
304 nice_gens,
305 verbose_level);
306
308
309
311
312 if (f_v) {
313 cout << "quartic_curve_create::override_group done" << endl;
314 }
315}
316
318 int verbose_level)
319{
320 int f_v = (verbose_level >= 1);
321
322 if (f_v) {
323 cout << "quartic_curve_create::create_quartic_curve_by_coefficients" << endl;
324 }
325
326 if (f_v) {
327 cout << "quartic_curve_create::create_quartic_curve_by_coefficients surface is given "
328 "by the coefficients" << endl;
329 }
330
331 int coeffs15[15];
332 int *coeff_list, nb_coeff_list;
333 int i;
334
335 Int_vec_scan(coefficients_text, coeff_list, nb_coeff_list);
336#if 0
337 if (ODD(nb_coeff_list)) {
338 cout << "quartic_curve_create::create_quartic_curve_by_coefficients number of "
339 "terms given must be even" << endl;
340 exit(1);
341 }
342 Orbiter->Int_vec.zero(coeffs15, 15);
343 nb_terms = nb_coeff_list >> 1;
344 for (i = 0; i < nb_terms; i++) {
345 a = coeff_list[2 * i + 0];
346 b = coeff_list[2 * i + 1];
347 if (a < 0 || a >= q) {
348 if (F->e == 1) {
349 number_theory_domain NT;
350
351 a = NT.mod(a, F->q);
352 }
353 else {
354 cout << "quartic_curve_create::create_quartic_curve_by_coefficients "
355 "coefficient out of range" << endl;
356 exit(1);
357 }
358 }
359 if (b < 0 || b >= 15) {
360 cout << "quartic_curve_create::create_quartic_curve_by_coefficients "
361 "variable index out of range" << endl;
362 exit(1);
363 }
364 coeffs15[b] = a;
365 }
366#else
367 if (nb_coeff_list != 15) {
368 cout << "quartic_curve_create::create_quartic_curve_by_coefficients number of "
369 "terms must be 15" << endl;
370 exit(1);
371 }
372 for (i = 0; i < nb_coeff_list; i++) {
373 coeffs15[i] = coeff_list[i];
374 }
375#endif
376 FREE_int(coeff_list);
377
378
380
381 if (f_v) {
382 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector "
383 "before QO->init_equation_but_no_bitangents" << endl;
384 }
386 coeffs15,
387 verbose_level);
388 if (f_v) {
389 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector "
390 "after QO->init_equation_but_no_bitangents" << endl;
391 }
392
393
394
395
396
397 char str_q[1000];
398
399 sprintf(str_q, "%d", F->q);
400
401
402 prefix.assign("by_coefficients_q");
403 prefix.append(str_q);
404
405 label_txt.assign("by_coefficients_q");
406 label_txt.append(str_q);
407
408 label_tex.assign("by\\_coefficients\\_q");
409 label_tex.append(str_q);
410
411 if (f_v) {
412 cout << "quartic_curve_create::create_quartic_curve_by_coefficients done" << endl;
413 }
414
415}
416
418 int verbose_level)
419{
420 int f_v = (verbose_level >= 1);
421
422 if (f_v) {
423 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector" << endl;
424 }
425
426 if (f_v) {
427 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector surface is given "
428 "by the coefficients" << endl;
429 }
430
431
432
434
435 if (f_v) {
436 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector "
437 "before QO->init_equation_but_no_bitangents" << endl;
438 }
440 eqn15,
441 verbose_level);
442 if (f_v) {
443 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector "
444 "after QO->init_equation_but_no_bitangents" << endl;
445 }
446
447
448
449
450
451
452
453
454 if (f_v) {
455 cout << "quartic_curve_create::create_quartic_curve_by_coefficient_vector done" << endl;
456 }
457
458}
459
460
462 int iso,
463 int verbose_level)
464{
465 int f_v = (verbose_level >= 1);
466
467 if (f_v) {
468 cout << "quartic_curve_create::create_quartic_curve_from_catalogue" << endl;
469 }
470 if (f_v) {
471 cout << "quartic_curve_create::create_quartic_curve_from_catalogue surface from catalogue" << endl;
472 }
473
474 int *p_eqn;
475 int eqn15[15];
476
477 long int *p_bitangents;
478 long int bitangents28[28];
479 int nb_iso;
481
482 nb_iso = K.quartic_curves_nb_reps(q);
483 if (Descr->iso >= nb_iso) {
484 cout << "quartic_curve_create::create_quartic_curve_from_catalogue iso >= nb_iso, "
485 "this cubic surface does not exist" << endl;
486 exit(1);
487 }
488 p_eqn = K.quartic_curves_representative(q, iso);
489 p_bitangents = K.quartic_curves_bitangents(q, iso);
490
491 if (f_v) {
492 cout << "eqn15:";
493 Int_vec_print(cout, p_eqn, 15);
494 cout << endl;
495 cout << "bitangents28:";
496 Lint_vec_print(cout, p_bitangents, 28);
497 cout << endl;
498 }
499 Int_vec_copy(p_eqn, eqn15, 15);
500 Lint_vec_copy(p_bitangents, bitangents28, 28);
501
502
504
505 if (f_v) {
506 cout << "quartic_curve_create::create_quartic_curve_from_catalogue before QO->init_equation_and_bitangents" << endl;
507 }
509 eqn15, bitangents28,
510 verbose_level);
511
512 if (f_v) {
513 cout << "quartic_curve_create::create_quartic_curve_from_catalogue after QO->init_equation_and_bitangents" << endl;
514 }
515
516
518 if (f_v) {
519 cout << "quartic_curve_create::create_quartic_curve_from_catalogue before Sg->stabilizer_of_cubic_surface_from_catalogue" << endl;
520 }
522 F, iso,
523 verbose_level);
525
526 if (f_v) {
527 cout << "quartic_curve_create::create_quartic_curve_from_catalogue after Sg->stabilizer_of_cubic_surface_from_catalogue" << endl;
528 }
529
531
532 QOA->init(DomA,
533 QO,
534 Sg,
535 verbose_level);
536
537
538 char str_q[1000];
539 char str_a[1000];
540
541 sprintf(str_q, "%d", F->q);
542 sprintf(str_a, "%d", iso);
543
544
545
546 prefix.assign("catalogue_q");
547 prefix.append(str_q);
548 prefix.append("_iso");
549 prefix.append(str_a);
550
551 label_txt.assign("catalogue_q");
552 label_txt.append(str_q);
553 label_txt.append("_iso");
554 label_txt.append(str_a);
555
556 label_tex.assign("catalogue\\_q");
557 label_tex.append(str_q);
558 label_tex.append("\\_iso");
559 label_tex.append(str_a);
560 if (f_v) {
561 cout << "quartic_curve_create::create_quartic_curve_from_catalogue done" << endl;
562 }
563}
564
565
567 std::string &name_of_formula,
568 std::string &name_of_formula_tex,
569 std::string &managed_variables,
570 std::string &equation_text,
571 std::string &equation_parameters,
572 std::string &equation_parameters_tex,
573 int verbose_level)
574{
575 int f_v = (verbose_level >= 1);
576
577 if (f_v) {
578 cout << "quartic_curve_create::create_quartic_curve_by_equation" << endl;
579 }
580
581 int coeffs15[15];
583
584
585
586
589 int i;
590
592
593 if (f_v) {
594 cout << "quartic_curve_create::create_quartic_curve_by_equation Formula " << name_of_formula << " is " << equation_text << endl;
595 cout << "quartic_curve_create::create_quartic_curve_by_equation Managed variables: " << managed_variables << endl;
596 }
597
598 const char *p = managed_variables.c_str();
599 char str[1000];
600
601 while (TRUE) {
602 if (!ST.s_scan_token_comma_separated(&p, str)) {
603 break;
604 }
605 string var;
606
607 var.assign(str);
608 if (f_v) {
609 cout << "quartic_curve_create::create_quartic_curve_by_equation adding managed variable " << var << endl;
610 }
611
612 tree->managed_variables.push_back(var);
614
615 }
616
617 int nb_vars;
618
619 nb_vars = tree->managed_variables.size();
620
621 if (f_v) {
622 cout << "quartic_curve_create::create_quartic_curve_by_equation Managed variables: " << endl;
623 for (i = 0; i < nb_vars; i++) {
624 cout << i << " : " << tree->managed_variables[i] << endl;
625 }
626 }
627
628
629 if (f_v) {
630 cout << "quartic_curve_create::create_quartic_curve_by_equation Starting to parse " << name_of_formula << endl;
631 }
632 Parser.parse(tree, equation_text, 0/*verbose_level*/);
633 if (f_v) {
634 cout << "Parsing " << name_of_formula << " finished" << endl;
635 }
636
637
638 if (f_v) {
639 cout << "quartic_curve_create::create_quartic_curve_by_equation Syntax tree:" << endl;
640 //tree->print(cout);
641 }
642
643 std::string fname;
644 fname.assign(name_of_formula);
645 fname.append(".gv");
646
647 {
648 std::ofstream ost(fname);
649 tree->Root->export_graphviz(name_of_formula, ost);
650 }
651
652 int ret, degree;
653 if (f_v) {
654 cout << "quartic_curve_create::create_quartic_curve_by_equation before is_homogeneous" << endl;
655 }
656 ret = tree->is_homogeneous(degree, 0 /* verbose_level */);
657 if (f_v) {
658 cout << "quartic_curve_create::create_quartic_curve_by_equation after is_homogeneous" << endl;
659 }
660 if (!ret) {
661 cout << "quartic_curve_create::create_quartic_curve_by_equation The given equation is not homogeneous" << endl;
662 exit(1);
663 }
664 if (f_v) {
665 cout << "quartic_curve_create::create_quartic_curve_by_equation homogeneous of degree " << degree << endl;
666 }
667
668 if (degree != 3) {
669 cout << "quartic_curve_create::create_quartic_curve_by_equation The given equation is homogeneous, but not of degree 3" << endl;
670 exit(1);
671 }
672
674
676
677 if (f_v) {
678 cout << "quartic_curve_create::create_quartic_curve_by_equation before Poly->init" << endl;
679 }
680 Poly->init(F,
681 nb_vars /* nb_vars */, degree,
682 FALSE /* f_init_incidence_structure */,
683 t_PART,
684 0/*verbose_level*/);
685 if (f_v) {
686 cout << "quartic_curve_create::create_quartic_curve_by_equation after Poly->init" << endl;
687 }
688
690 int nb_monomials;
691
692
693 nb_monomials = Poly->get_nb_monomials();
694
695 if (nb_monomials != 15) {
696 cout << "quartic_curve_create::create_quartic_curve_by_equation nb_monomials != 15" << endl;
697 exit(1);
698 }
699
700 if (f_v) {
701 cout << "quartic_curve_create::create_quartic_curve_by_equation before tree->split_by_monomials" << endl;
702 }
703 tree->split_by_monomials(Poly, Subtrees, 0 /*verbose_level*/);
704 if (f_v) {
705 cout << "quartic_curve_create::create_quartic_curve_by_equation after tree->split_by_monomials" << endl;
706 }
707
708 if (f_v) {
709 for (i = 0; i < nb_monomials; i++) {
710 cout << "quartic_curve_create::create_quartic_curve_by_equation Monomial " << i << " : ";
711 if (Subtrees[i]) {
712 Subtrees[i]->print_expression(cout);
713 cout << " * ";
714 Poly->print_monomial(cout, i);
715 cout << endl;
716 }
717 else {
718 cout << "quartic_curve_create::create_quartic_curve_by_equation no subtree" << endl;
719 }
720 }
721 }
722
723 if (f_v) {
724 cout << "quartic_curve_create::create_quartic_curve_by_equation before evaluate" << endl;
725 }
726
727 p = equation_parameters.c_str();
728 //char str[1000];
729
730 std::map<std::string, std::string> symbol_table;
731 //vector<string> symbols;
732 //vector<string> values;
733
734 while (TRUE) {
735 if (!ST.s_scan_token_comma_separated(&p, str)) {
736 break;
737 }
738 string assignment;
739 int len;
740
741 assignment.assign(str);
742 len = strlen(str);
743
744 std::size_t found;
745
746 found = assignment.find('=');
747 if (found == std::string::npos) {
748 cout << "did not find '=' in variable assignment" << endl;
749 exit(1);
750 }
751 std::string symb = assignment.substr (0, found);
752 std::string val = assignment.substr (found + 1, len - found - 1);
753
754
755
756 if (f_v) {
757 cout << "quartic_curve_create::create_quartic_curve_by_equation adding symbol " << symb << " = " << val << endl;
758 }
759
760 symbol_table[symb] = val;
761 //symbols.push_back(symb);
762 //values.push_back(val);
763
764 }
765
766#if 0
767 cout << "quartic_curve_create::create_quartic_curve_by_equation symbol table:" << endl;
768 for (i = 0; i < symbol_table.size(); i++) {
769 cout << i << " : " << symbol_table[i] << " = " << values[i] << endl;
770 }
771#endif
772 int a;
773
774 for (i = 0; i < nb_monomials; i++) {
775 if (f_v) {
776 cout << "quartic_curve_create::create_quartic_curve_by_equation Monomial " << i << " : ";
777 }
778 if (Subtrees[i]) {
779 //Subtrees[i]->print_expression(cout);
780 a = Subtrees[i]->evaluate(symbol_table, F, 0/*verbose_level*/);
781 coeffs15[i] = a;
782 if (f_v) {
783 cout << "quartic_curve_create::create_quartic_curve_by_equation Monomial " << i << " : ";
784 cout << a << " * ";
785 Poly->print_monomial(cout, i);
786 cout << endl;
787 }
788 }
789 else {
790 if (f_v) {
791 cout << "quartic_curve_create::create_quartic_curve_by_equation no subtree" << endl;
792 }
793 coeffs15[i] = 0;
794 }
795 }
796 if (f_v) {
797 cout << "quartic_curve_create::create_quartic_curve_by_equation evaluated polynomial:" << endl;
798 for (i = 0; i < nb_monomials; i++) {
799 cout << coeffs15[i] << " * ";
800 Poly->print_monomial(cout, i);
801 cout << endl;
802 }
803 cout << "quartic_curve_create::create_quartic_curve_by_equation coefficient vector: ";
804 Int_vec_print(cout, coeffs15, nb_monomials);
805 cout << endl;
806 }
807
808
809
810 FREE_OBJECT(Poly);
811
812
813
814
815
816
817
819
820
821 if (f_v) {
822 cout << "quartic_curve_create::create_quartic_curve_by_equation before QO->init_equation_but_no_bitangents" << endl;
823 }
824
825 QO->init_equation_but_no_bitangents(QCDA->Dom, coeffs15, verbose_level);
826
827
828 if (f_v) {
829 cout << "quartic_curve_create::create_quartic_curve_by_equation after QO->init_equation_but_no_bitangents" << endl;
830 }
831
832
833
835
836 char str_q[1000];
837
838 sprintf(str_q, "%d", F->q);
839
840
841 prefix.assign("equation_");
842 prefix.append(name_of_formula);
843 prefix.append("_q");
844 prefix.append(str_q);
845
846 label_txt.assign("equation_");
847 label_txt.append(name_of_formula);
848 label_txt.append("_q");
849 label_txt.append(str_q);
850
851 label_tex.assign(name_of_formula_tex);
853
854 string my_parameters_tex;
855
856 my_parameters_tex.assign(equation_parameters_tex);
857 ST.string_fix_escape_characters(my_parameters_tex);
858 label_tex.append(" with ");
859 label_tex.append(my_parameters_tex);
860
861 //label_tex.append("\\_q");
862 //label_tex.append(str_q);
863
864
865
866 cout << "prefix = " << prefix << endl;
867 cout << "label_txt = " << label_txt << endl;
868 cout << "label_tex = " << label_tex << endl;
869
870 //AL->print(fp);
871
872
873 if (f_v) {
874 cout << "quartic_curve_create::create_quartic_curve_by_equation done" << endl;
875 }
876}
877
878
880 std::vector<std::string> &transform_coeffs,
881 std::vector<int> &f_inverse_transform,
882 int verbose_level)
883{
884 int f_v = (verbose_level >= 1);
885 //int f_vv = (verbose_level >= 2);
886 int h;
887 int *Elt1;
888 int *Elt2;
889 int *Elt3;
891 int desired_sz;
892
893 if (f_v) {
894 cout << "quartic_curve_create::apply_transformations" << endl;
895 cout << "quartic_curve_create::apply_transformations verbose_level = " << verbose_level << endl;
896 }
897
898 A = PA->A;
899
900 Elt1 = NEW_int(A->elt_size_in_int);
901 Elt2 = NEW_int(A->elt_size_in_int);
902 Elt3 = NEW_int(A->elt_size_in_int);
903
904 if (f_semilinear) {
905 desired_sz = 10;
906 }
907 else {
908 desired_sz = 9;
909 }
910
911
912 if (transform_coeffs.size()) {
913
914 for (h = 0; h < transform_coeffs.size(); h++) {
915 int *transformation_coeffs;
916 int sz;
917 //int coeffs_out[15];
918
919 if (f_v) {
920 cout << "quartic_curve_create::apply_transformations "
921 "applying transformation " << h << " / "
922 << transform_coeffs.size() << ":" << endl;
923 }
924
925 Int_vec_scan(transform_coeffs[h], transformation_coeffs, sz);
926
927 if (sz != desired_sz) {
928 cout << "quartic_curve_create::apply_transformations "
929 "need exactly " << desired_sz
930 << " coefficients for the transformation" << endl;
931 cout << "transform_coeffs[h]=" << transform_coeffs[h] << endl;
932 cout << "sz=" << sz << endl;
933 exit(1);
934 }
935
936 A->make_element(Elt1, transformation_coeffs, verbose_level);
937
938 if (f_inverse_transform[h]) {
939 A->element_invert(Elt1, Elt2, 0 /*verbose_level*/);
940 }
941 else {
942 A->element_move(Elt1, Elt2, 0 /*verbose_level*/);
943 }
944
945 //A->element_transpose(Elt2, Elt3, 0 /*verbose_level*/);
946
947 A->element_invert(Elt2, Elt3, 0 /*verbose_level*/);
948
949 if (f_v) {
950 cout << "quartic_curve_create::apply_transformations "
951 "applying the transformation given by:" << endl;
952 cout << "$$" << endl;
953 A->print_quick(cout, Elt2);
954 cout << endl;
955 cout << "$$" << endl;
956 cout << "quartic_curve_create::apply_transformations "
957 "The inverse is:" << endl;
958 cout << "$$" << endl;
959 A->print_quick(cout, Elt3);
960 cout << endl;
961 cout << "$$" << endl;
962 }
963
964
965#if 0
966 // apply the transformation to the equation of the surface:
967
968 matrix_group *M;
969
970 M = A->G.matrix_grp;
972 SO->eqn, coeffs_out, Surf,
973 verbose_level - 1);
974
975 if (f_v) {
976 cout << "quartic_curve_create::apply_transformations "
977 "The equation of the transformed surface is:" << endl;
978 cout << "$$" << endl;
979 Surf->print_equation_tex(cout, coeffs_out);
980 cout << endl;
981 cout << "$$" << endl;
982 }
983
984 Orbiter->Int_vec.copy(coeffs_out, SO->eqn, 15);
985#endif
986
987
988 if (f_has_group) {
989
990 // apply the transformation to the set of generators:
991
993
995 if (f_v) {
996 cout << "quartic_curve_create::apply_transformations "
997 "before SG2->init_generators_for_the_conjugate_group_avGa" << endl;
998 }
999 SG2->init_generators_for_the_conjugate_group_avGa(Sg, Elt2, verbose_level);
1000
1001 if (f_v) {
1002 cout << "quartic_curve_create::apply_transformations "
1003 "after SG2->init_generators_for_the_conjugate_group_avGa" << endl;
1004 }
1005
1006 FREE_OBJECT(Sg);
1007 Sg = SG2;
1008
1010 // ToDo: need to conjugate nice_gens
1011 }
1012
1013#if 0
1014 if (f_vv) {
1015 cout << "quartic_curve_create::apply_transformations Lines = ";
1016 Orbiter->Lint_vec.print(cout, SO->Lines, SO->nb_lines);
1017 cout << endl;
1018 }
1019 int i;
1020
1021 // apply the transformation to the set of lines:
1022
1023
1024 for (i = 0; i < SO->nb_lines; i++) {
1025 if (f_vv) {
1026 cout << "line " << i << ":" << endl;
1027 Surf_A->Surf->P->Grass_lines->print_single_generator_matrix_tex(cout, SO->Lines[i]);
1028 }
1029 SO->Lines[i] = Surf_A->A2->element_image_of(SO->Lines[i], Elt2, 0 /*verbose_level*/);
1030 if (f_vv) {
1031 cout << "maps to " << endl;
1032 Surf_A->Surf->P->Grass_lines->print_single_generator_matrix_tex(cout, SO->Lines[i]);
1033 }
1034 }
1035
1036 // apply the transformation to the set of points:
1037
1038 for (i = 0; i < SO->nb_pts; i++) {
1039 if (f_vv) {
1040 cout << "point" << i << " = " << SO->Pts[i] << endl;
1041 }
1042 SO->Pts[i] = Surf_A->A->element_image_of(SO->Pts[i], Elt2, 0 /*verbose_level*/);
1043 if (f_vv) {
1044 cout << "maps to " << SO->Pts[i] << endl;
1045 }
1046 int a;
1047
1048 a = Surf->Poly3_4->evaluate_at_a_point_by_rank(coeffs_out, SO->Pts[i]);
1049 if (a) {
1050 cout << "quartic_curve_create::apply_transformations something is wrong, "
1051 "the image point does not lie on the transformed surface" << endl;
1052 exit(1);
1053 }
1054
1055 }
1056 sorting Sorting;
1057
1058 Sorting.lint_vec_heapsort(SO->Pts, SO->nb_pts);
1059
1060
1061 FREE_int(transformation_coeffs);
1062#endif
1063 } // next h
1064
1065 if (f_v) {
1066 cout << "quartic_curve_create::apply_transformations before QO->recompute_properties" << endl;
1067 }
1068 QO->recompute_properties(verbose_level - 3);
1069 if (f_v) {
1070 cout << "quartic_curve_create::apply_transformations after QO->recompute_properties" << endl;
1071 }
1072
1073
1074 }
1075 else {
1076 if (f_v) {
1077 cout << "quartic_curve_create::apply_transformations nothing to do" << endl;
1078 }
1079 }
1080
1081
1082 FREE_int(Elt1);
1083 FREE_int(Elt2);
1084 FREE_int(Elt3);
1085
1086 if (f_v) {
1087 cout << "quartic_curve_create::apply_transformations done" << endl;
1088 }
1089}
1090
1091
1094 int verbose_level)
1095{
1096 int f_v = (verbose_level >= 1);
1097 int i;
1098 long int a;
1099 actions::action *A;
1100 char str[1000];
1101
1102 if (f_v) {
1103 cout << "quartic_curve_create::compute_group" << endl;
1104 }
1105
1106#if 0
1107 A = PA->A;
1108
1109 projective_space_object_classifier_description *Descr;
1110 projective_space_object_classifier *Classifier;
1111
1112 Descr = NEW_OBJECT(projective_space_object_classifier_description);
1113 Classifier = NEW_OBJECT(projective_space_object_classifier);
1114
1115 Descr->f_input = TRUE;
1116 Descr->Data = NEW_OBJECT(data_input_stream_description);
1117 Descr->Data->input_type[Descr->Data->nb_inputs] = INPUT_TYPE_SET_OF_POINTS;
1118 Descr->Data->input_string[Descr->Data->nb_inputs].assign("");
1119 for (i = 0; i < QO->nb_pts; i++) {
1120 a = QO->Pts[i];
1121 sprintf(str, "%ld", a);
1122 Descr->Data->input_string[Descr->Data->nb_inputs].append(str);
1123 if (i < QO->nb_pts - 1) {
1124 Descr->Data->input_string[Descr->Data->nb_inputs].append(",");
1125 }
1126 }
1127 Descr->Data->input_string2[Descr->Data->nb_inputs].assign("");
1128 Descr->Data->nb_inputs++;
1129
1130 if (f_v) {
1131 cout << "quartic_curve_create::compute_group before Classifier->do_the_work" << endl;
1132 }
1133
1134#if 0
1135 Classifier->do_the_work(
1136 Descr,
1137 TRUE,
1138 PA,
1139 verbose_level);
1140#endif
1141
1142
1143 if (f_v) {
1144 cout << "quartic_curve_create::compute_group after Classifier->do_the_work" << endl;
1145 }
1146
1147 int idx;
1148 long int ago;
1149
1150 idx = Classifier->CB->type_of[Classifier->CB->n - 1];
1151
1152
1153 object_in_projective_space_with_action *OiPA;
1154
1155 OiPA = (object_in_projective_space_with_action *) Classifier->CB->Type_extra_data[idx];
1156
1157
1158#if 0
1159 {
1160 int *Kernel;
1161 int r, ns;
1162
1163 Kernel = NEW_int(SO->Surf->Poly3_4->get_nb_monomials() * SO->Surf->Poly3_4->get_nb_monomials());
1164
1165
1166
1167 SO->Surf->Poly3_4->vanishing_ideal(SO->Pts, SO->nb_pts,
1168 r, Kernel, 0 /*verbose_level */);
1169
1170 ns = SO->Surf->Poly3_4->get_nb_monomials() - r; // dimension of null space
1171 if (f_v) {
1172 cout << "quartic_curve_create::compute_group The system has rank " << r << endl;
1173 cout << "quartic_curve_create::compute_group The ideal has dimension " << ns << endl;
1174#if 1
1175 cout << "quartic_curve_create::compute_group The ideal is generated by:" << endl;
1176 Orbiter->Int_vec.matrix_print(Kernel, ns, SO->Surf->Poly3_4->get_nb_monomials());
1177 cout << "quartic_curve_create::compute_group Basis "
1178 "of polynomials:" << endl;
1179
1180 int h;
1181
1182 for (h = 0; h < ns; h++) {
1183 SO->Surf->Poly3_4->print_equation(cout, Kernel + h * SO->Surf->Poly3_4->get_nb_monomials());
1184 cout << endl;
1185 }
1186#endif
1187 }
1188
1189 FREE_int(Kernel);
1190 }
1191#endif
1192
1193 ago = OiPA->ago;
1194
1195 Sg = OiPA->Aut_gens;
1196
1197 Sg->A = A;
1198 f_has_group = TRUE;
1199
1200
1201 if (f_v) {
1202 cout << "quartic_curve_create::compute_group ago = " << ago << endl;
1203 }
1204
1205#endif
1206
1207 if (f_v) {
1208 cout << "quartic_curve_create::compute_group done" << endl;
1209 }
1210}
1211
1212
1213
1214
1215
1216}}}}
1217
1218
1219
a particular quartic curve in PG(2,q), given by its equation
void init_equation_and_bitangents_and_compute_properties(quartic_curve_domain *Dom, int *eqn15, long int *bitangents28, int verbose_level)
void init_equation_but_no_bitangents(quartic_curve_domain *Dom, int *eqn15, int verbose_level)
void copy(int *from, int *to, long int len)
Definition: int_vec.cpp:167
void print(std::ostream &ost, long int *v, int len)
Definition: lint_vec.cpp:246
functions related to strings and character arrays
void parse(syntax_tree *tree, std::string &program, int verbose_level)
int evaluate(std::map< std::string, std::string > &symbol_table, field_theory::finite_field *F, int verbose_level)
void export_graphviz(std::string &name, std::ostream &ost)
void split_by_monomials(ring_theory::homogeneous_polynomial_domain *Poly, syntax_tree_node **&Subtrees, int verbose_level)
Definition: syntax_tree.cpp:85
int is_homogeneous(int &degree, int verbose_level)
Definition: syntax_tree.cpp:61
provides access to pre-computed combinatorial data in encoded form
long int * quartic_curves_bitangents(int q, int i)
homogeneous polynomials of a given degree in a given number of variables over a finite field GF(q)
Definition: ring_theory.h:88
void init(field_theory::finite_field *F, int nb_vars, int degree, int f_init_incidence_structure, monomial_ordering_type Monomial_ordering_type, int verbose_level)
a permutation group in a fixed action.
Definition: actions.h:99
void print_quick(std::ostream &ost, void *elt)
Definition: action_cb.cpp:137
void element_invert(void *a, void *av, int verbose_level)
Definition: action_cb.cpp:322
void make_element(int *Elt, int *data, int verbose_level)
Definition: action.cpp:1875
void element_move(void *a, void *b, int verbose_level)
Definition: action_cb.cpp:335
void substitute_surface_equation(int *Elt, int *coeff_in, int *coeff_out, algebraic_geometry::surface_domain *Surf, int verbose_level)
a strong generating set for a permutation group with respect to a fixed action
Definition: groups.h:1703
void stabilizer_of_quartic_curve_from_catalogue(actions::action *A, field_theory::finite_field *F, int iso, int verbose_level)
void init_generators_for_the_conjugate_group_avGa(strong_generators *SG, int *Elt_a, int verbose_level)
void init_from_data_with_target_go_ascii(actions::action *A, int *data, int nb_elements, int elt_size, const char *ascii_target_go, data_structures_groups::vector_ge *&nice_gens, int verbose_level)
void init(quartic_curve_domain_with_action *DomA, algebraic_geometry::quartic_curve_object *QO, groups::strong_generators *Aut_gens, int verbose_level)
void init(quartic_curve_create_description *Descr, projective_geometry::projective_space_with_action *PA, quartic_curve_domain_with_action *QCDA, int verbose_level)
void apply_transformations(std::vector< std::string > &transform_coeffs, std::vector< int > &f_inverse_transform, int verbose_level)
void create_quartic_curve_by_equation(std::string &name_of_formula, std::string &name_of_formula_tex, std::string &managed_variables, std::string &equation_text, std::string &equation_parameters, std::string &equation_parameters_tex, int verbose_level)
void create_quartic_curve_from_catalogue(quartic_curve_domain_with_action *DomA, int iso, int verbose_level)
void init_with_data(quartic_curve_create_description *Descr, projective_geometry::projective_space_with_action *PA, quartic_curve_domain_with_action *QCDA, int verbose_level)
void create_quartic_curve_from_description(quartic_curve_domain_with_action *DomA, int verbose_level)
void override_group(std::string &group_order_text, int nb_gens, std::string &gens_text, int verbose_level)
void compute_group(projective_geometry::projective_space_with_action *PA, int verbose_level)
projective space PG(n,q) with automorphism group PGGL(n+1,q)
#define Lint_vec_copy(A, B, C)
Definition: foundations.h:694
#define Int_vec_scan(A, B, C)
Definition: foundations.h:716
#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 TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define ODD(x)
Definition: foundations.h:222
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
#define Int_vec_print(A, B, C)
Definition: foundations.h:685
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects