16namespace layer5_applications {
17namespace applications_in_algebraic_geometry {
18namespace quartic_curves {
71 int f_v = (verbose_level >= 1);
76 cout <<
"quartic_curve_create::init_with_data" << endl;
96 cout <<
"quartic_curve_create::init_with_data "
97 "Descr->q != F->q" << endl;
102 cout <<
"quartic_curve_create::init_with_data "
103 "before create_surface_from_description" << endl;
107 cout <<
"quartic_curve_create::init_with_data "
108 "after create_surface_from_description" << endl;
112 cout <<
"quartic_curve_create::init_with_data "
124 int f_v = (verbose_level >= 1);
129 cout <<
"quartic_curve_create::init" << endl;
134 cout <<
"quartic_curve_create::init !Descr->f_q" << endl;
139 cout <<
"quartic_curve_create::init q = " <<
q << endl;
147 cout <<
"quartic_curve_create::init q = " <<
q << endl;
163 cout <<
"quartic_curve_create::init before create_surface_from_description" << endl;
167 cout <<
"quartic_curve_create::init after create_surface_from_description" << endl;
172 cout <<
"quartic_curve_create::init done" << endl;
178 int f_v = (verbose_level >= 1);
182 cout <<
"quartic_curve_create::create_quartic_curve_from_description" << endl;
221 cout <<
"quartic_curve_create::create_quartic_curve_from_description we do not "
222 "recognize the type of surface" << endl;
236 cout <<
"quartic_curve_create::create_quartic_curve_from_description coeffs = ";
242 cout <<
"quartic_curve_create::create_quartic_curve_from_description bitangents = ";
250 cout <<
"quartic_curve_create::create_quartic_curve_from_description the stabilizer is:" << endl;
254 cout <<
"quartic_curve_create::create_quartic_curve_from_description "
255 "The surface has no group computed" << endl;
262 cout <<
"quartic_curve_create::create_quartic_curve_from_description before Surf_A->test_group" << endl;
264 Surf_A->test_group(
this, verbose_level);
266 cout <<
"quartic_curve_create::create_quartic_curve_from_description after Surf_A->test_group" << endl;
272 cout <<
"quartic_curve_create::create_quartic_curve_from_description done" << endl;
277 int nb_gens, std::string &gens_text,
int verbose_level)
279 int f_v = (verbose_level >= 1);
284 cout <<
"quartic_curve_create::override_group "
285 "group_order=" << group_order_text
286 <<
" nb_gens=" << nb_gens << endl;
291 cout <<
"quartic_curve_create::override_group before Sg->stabilizer_of_cubic_surface_from_catalogue" << endl;
296 cout <<
"quartic_curve_create::override_group sz != Surf_A->A->make_element_size * nb_gens" << endl;
313 cout <<
"quartic_curve_create::override_group done" << endl;
320 int f_v = (verbose_level >= 1);
323 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficients" << endl;
327 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficients surface is given "
328 "by the coefficients" << endl;
332 int *coeff_list, nb_coeff_list;
335 Int_vec_scan(coefficients_text, coeff_list, nb_coeff_list);
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;
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) {
349 number_theory_domain NT;
354 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficients "
355 "coefficient out of range" << endl;
359 if (b < 0 || b >= 15) {
360 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficients "
361 "variable index out of range" << endl;
367 if (nb_coeff_list != 15) {
368 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficients number of "
369 "terms must be 15" << endl;
372 for (i = 0; i < nb_coeff_list; i++) {
373 coeffs15[i] = coeff_list[i];
382 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector "
383 "before QO->init_equation_but_no_bitangents" << endl;
389 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector "
390 "after QO->init_equation_but_no_bitangents" << endl;
399 sprintf(str_q,
"%d",
F->
q);
402 prefix.assign(
"by_coefficients_q");
408 label_tex.assign(
"by\\_coefficients\\_q");
412 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficients done" << endl;
420 int f_v = (verbose_level >= 1);
423 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector" << endl;
427 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector surface is given "
428 "by the coefficients" << endl;
436 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector "
437 "before QO->init_equation_but_no_bitangents" << endl;
443 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector "
444 "after QO->init_equation_but_no_bitangents" << endl;
455 cout <<
"quartic_curve_create::create_quartic_curve_by_coefficient_vector done" << endl;
465 int f_v = (verbose_level >= 1);
468 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue" << endl;
471 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue surface from catalogue" << endl;
477 long int *p_bitangents;
478 long int bitangents28[28];
484 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue iso >= nb_iso, "
485 "this cubic surface does not exist" << endl;
495 cout <<
"bitangents28:";
506 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue before QO->init_equation_and_bitangents" << endl;
513 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue after QO->init_equation_and_bitangents" << endl;
519 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue before Sg->stabilizer_of_cubic_surface_from_catalogue" << endl;
527 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue after Sg->stabilizer_of_cubic_surface_from_catalogue" << endl;
541 sprintf(str_q,
"%d",
F->
q);
542 sprintf(str_a,
"%d", iso);
546 prefix.assign(
"catalogue_q");
561 cout <<
"quartic_curve_create::create_quartic_curve_from_catalogue done" << endl;
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,
575 int f_v = (verbose_level >= 1);
578 cout <<
"quartic_curve_create::create_quartic_curve_by_equation" << endl;
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;
598 const char *p = managed_variables.c_str();
609 cout <<
"quartic_curve_create::create_quartic_curve_by_equation adding managed variable " << var << endl;
622 cout <<
"quartic_curve_create::create_quartic_curve_by_equation Managed variables: " << endl;
623 for (i = 0; i < nb_vars; i++) {
630 cout <<
"quartic_curve_create::create_quartic_curve_by_equation Starting to parse " << name_of_formula << endl;
632 Parser.
parse(tree, equation_text, 0);
634 cout <<
"Parsing " << name_of_formula <<
" finished" << endl;
639 cout <<
"quartic_curve_create::create_quartic_curve_by_equation Syntax tree:" << endl;
644 fname.assign(name_of_formula);
648 std::ofstream ost(fname);
654 cout <<
"quartic_curve_create::create_quartic_curve_by_equation before is_homogeneous" << endl;
658 cout <<
"quartic_curve_create::create_quartic_curve_by_equation after is_homogeneous" << endl;
661 cout <<
"quartic_curve_create::create_quartic_curve_by_equation The given equation is not homogeneous" << endl;
665 cout <<
"quartic_curve_create::create_quartic_curve_by_equation homogeneous of degree " << degree << endl;
669 cout <<
"quartic_curve_create::create_quartic_curve_by_equation The given equation is homogeneous, but not of degree 3" << endl;
678 cout <<
"quartic_curve_create::create_quartic_curve_by_equation before Poly->init" << endl;
686 cout <<
"quartic_curve_create::create_quartic_curve_by_equation after Poly->init" << endl;
695 if (nb_monomials != 15) {
696 cout <<
"quartic_curve_create::create_quartic_curve_by_equation nb_monomials != 15" << endl;
701 cout <<
"quartic_curve_create::create_quartic_curve_by_equation before tree->split_by_monomials" << endl;
705 cout <<
"quartic_curve_create::create_quartic_curve_by_equation after tree->split_by_monomials" << endl;
709 for (i = 0; i < nb_monomials; i++) {
710 cout <<
"quartic_curve_create::create_quartic_curve_by_equation Monomial " << i <<
" : ";
718 cout <<
"quartic_curve_create::create_quartic_curve_by_equation no subtree" << endl;
724 cout <<
"quartic_curve_create::create_quartic_curve_by_equation before evaluate" << endl;
727 p = equation_parameters.c_str();
730 std::map<std::string, std::string> symbol_table;
741 assignment.assign(str);
746 found = assignment.find(
'=');
747 if (found == std::string::npos) {
748 cout <<
"did not find '=' in variable assignment" << endl;
751 std::string symb = assignment.substr (0, found);
752 std::string val = assignment.substr (found + 1, len - found - 1);
757 cout <<
"quartic_curve_create::create_quartic_curve_by_equation adding symbol " << symb <<
" = " << val << endl;
760 symbol_table[symb] = val;
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;
774 for (i = 0; i < nb_monomials; i++) {
776 cout <<
"quartic_curve_create::create_quartic_curve_by_equation Monomial " << i <<
" : ";
780 a = Subtrees[i]->
evaluate(symbol_table,
F, 0);
783 cout <<
"quartic_curve_create::create_quartic_curve_by_equation Monomial " << i <<
" : ";
791 cout <<
"quartic_curve_create::create_quartic_curve_by_equation no subtree" << endl;
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] <<
" * ";
803 cout <<
"quartic_curve_create::create_quartic_curve_by_equation coefficient vector: ";
822 cout <<
"quartic_curve_create::create_quartic_curve_by_equation before QO->init_equation_but_no_bitangents" << endl;
829 cout <<
"quartic_curve_create::create_quartic_curve_by_equation after QO->init_equation_but_no_bitangents" << endl;
838 sprintf(str_q,
"%d",
F->
q);
841 prefix.assign(
"equation_");
842 prefix.append(name_of_formula);
854 string my_parameters_tex;
856 my_parameters_tex.assign(equation_parameters_tex);
866 cout <<
"prefix = " <<
prefix << endl;
867 cout <<
"label_txt = " <<
label_txt << endl;
868 cout <<
"label_tex = " <<
label_tex << endl;
874 cout <<
"quartic_curve_create::create_quartic_curve_by_equation done" << endl;
880 std::vector<std::string> &transform_coeffs,
881 std::vector<int> &f_inverse_transform,
884 int f_v = (verbose_level >= 1);
894 cout <<
"quartic_curve_create::apply_transformations" << endl;
895 cout <<
"quartic_curve_create::apply_transformations verbose_level = " << verbose_level << endl;
912 if (transform_coeffs.size()) {
914 for (h = 0; h < transform_coeffs.size(); h++) {
915 int *transformation_coeffs;
920 cout <<
"quartic_curve_create::apply_transformations "
921 "applying transformation " << h <<
" / "
922 << transform_coeffs.size() <<
":" << endl;
925 Int_vec_scan(transform_coeffs[h], transformation_coeffs, sz);
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;
936 A->
make_element(Elt1, transformation_coeffs, verbose_level);
938 if (f_inverse_transform[h]) {
950 cout <<
"quartic_curve_create::apply_transformations "
951 "applying the transformation given by:" << endl;
952 cout <<
"$$" << endl;
955 cout <<
"$$" << endl;
956 cout <<
"quartic_curve_create::apply_transformations "
957 "The inverse is:" << endl;
958 cout <<
"$$" << endl;
961 cout <<
"$$" << endl;
972 SO->eqn, coeffs_out, Surf,
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);
981 cout <<
"$$" << endl;
996 cout <<
"quartic_curve_create::apply_transformations "
997 "before SG2->init_generators_for_the_conjugate_group_avGa" << endl;
1002 cout <<
"quartic_curve_create::apply_transformations "
1003 "after SG2->init_generators_for_the_conjugate_group_avGa" << endl;
1015 cout <<
"quartic_curve_create::apply_transformations Lines = ";
1024 for (i = 0; i < SO->nb_lines; i++) {
1026 cout <<
"line " << i <<
":" << endl;
1027 Surf_A->Surf->P->Grass_lines->print_single_generator_matrix_tex(cout, SO->Lines[i]);
1029 SO->Lines[i] = Surf_A->A2->element_image_of(SO->Lines[i], Elt2, 0 );
1031 cout <<
"maps to " << endl;
1032 Surf_A->Surf->P->Grass_lines->print_single_generator_matrix_tex(cout, SO->Lines[i]);
1038 for (i = 0; i < SO->nb_pts; i++) {
1040 cout <<
"point" << i <<
" = " << SO->Pts[i] << endl;
1042 SO->Pts[i] = Surf_A->A->element_image_of(SO->Pts[i], Elt2, 0 );
1044 cout <<
"maps to " << SO->Pts[i] << endl;
1048 a = Surf->Poly3_4->evaluate_at_a_point_by_rank(coeffs_out, SO->Pts[i]);
1050 cout <<
"quartic_curve_create::apply_transformations something is wrong, "
1051 "the image point does not lie on the transformed surface" << endl;
1058 Sorting.lint_vec_heapsort(SO->Pts, SO->nb_pts);
1066 cout <<
"quartic_curve_create::apply_transformations before QO->recompute_properties" << endl;
1070 cout <<
"quartic_curve_create::apply_transformations after QO->recompute_properties" << endl;
1077 cout <<
"quartic_curve_create::apply_transformations nothing to do" << endl;
1087 cout <<
"quartic_curve_create::apply_transformations done" << endl;
1096 int f_v = (verbose_level >= 1);
1103 cout <<
"quartic_curve_create::compute_group" << endl;
1109 projective_space_object_classifier_description *
Descr;
1110 projective_space_object_classifier *Classifier;
1113 Classifier =
NEW_OBJECT(projective_space_object_classifier);
1117 Descr->Data->input_type[
Descr->Data->nb_inputs] = INPUT_TYPE_SET_OF_POINTS;
1118 Descr->Data->input_string[
Descr->Data->nb_inputs].assign(
"");
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(
",");
1127 Descr->Data->input_string2[
Descr->Data->nb_inputs].assign(
"");
1128 Descr->Data->nb_inputs++;
1131 cout <<
"quartic_curve_create::compute_group before Classifier->do_the_work" << endl;
1135 Classifier->do_the_work(
1144 cout <<
"quartic_curve_create::compute_group after Classifier->do_the_work" << endl;
1150 idx = Classifier->CB->type_of[Classifier->CB->n - 1];
1153 object_in_projective_space_with_action *OiPA;
1155 OiPA = (object_in_projective_space_with_action *) Classifier->CB->Type_extra_data[idx];
1163 Kernel =
NEW_int(SO->Surf->Poly3_4->get_nb_monomials() * SO->Surf->Poly3_4->get_nb_monomials());
1167 SO->Surf->Poly3_4->vanishing_ideal(SO->Pts, SO->nb_pts,
1170 ns = SO->Surf->Poly3_4->get_nb_monomials() - r;
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;
1175 cout <<
"quartic_curve_create::compute_group The ideal is generated by:" << endl;
1177 cout <<
"quartic_curve_create::compute_group Basis "
1178 "of polynomials:" << endl;
1182 for (h = 0; h < ns; h++) {
1183 SO->Surf->Poly3_4->print_equation(cout, Kernel + h * SO->Surf->Poly3_4->get_nb_monomials());
1195 Sg = OiPA->Aut_gens;
1202 cout <<
"quartic_curve_create::compute_group ago = " << ago << endl;
1208 cout <<
"quartic_curve_create::compute_group done" << endl;
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)
long int bitangents28[28]
void init_equation_but_no_bitangents(quartic_curve_domain *Dom, int *eqn15, int verbose_level)
void recompute_properties(int verbose_level)
void zero(int *v, long int len)
void matrix_print(int *p, int m, int n)
void copy(int *from, int *to, long int len)
void print(std::ostream &ost, long int *v, int len)
class to parse expressions
void parse(syntax_tree *tree, std::string &program, int verbose_level)
interior node in a syntax tree
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 print_expression(std::ostream &ost)
the syntax tree of an expression
void split_by_monomials(ring_theory::homogeneous_polynomial_domain *Poly, syntax_tree_node **&Subtrees, int verbose_level)
int is_homogeneous(int °ree, int verbose_level)
std::vector< std::string > managed_variables
int f_has_managed_variables
provides access to pre-computed combinatorial data in encoded form
int quartic_curves_nb_reps(int q)
long int * quartic_curves_bitangents(int q, int i)
int * quartic_curves_representative(int q, int i)
basic number theoretic functions
data_structures::lint_vec * Lint_vec
data_structures::int_vec * Int_vec
homogeneous polynomials of a given degree in a given number of variables over a finite field GF(q)
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)
void print_monomial(std::ostream &ost, int i)
a permutation group in a fixed action.
void print_quick(std::ostream &ost, void *elt)
void element_invert(void *a, void *av, int verbose_level)
void make_element(int *Elt, int *data, int verbose_level)
void element_move(void *a, void *b, int verbose_level)
to hold a vector of group elements
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
void print_generators_tex()
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)
an instance of a quartic curve together with its stabilizer
void init(quartic_curve_domain_with_action *DomA, algebraic_geometry::quartic_curve_object *QO, groups::strong_generators *Aut_gens, int verbose_level)
to describe a quartic curve from the command line
std::string equation_name_of_formula
std::string coefficients_text
std::string override_group_gens
int override_group_nb_gens
std::string override_group_order
std::string equation_managed_variables
std::string equation_parameters
std::string equation_name_of_formula_tex
std::string equation_parameters_tex
std::string equation_text
void init(quartic_curve_create_description *Descr, projective_geometry::projective_space_with_action *PA, quartic_curve_domain_with_action *QCDA, int verbose_level)
projective_geometry::projective_space_with_action * PA
void create_quartic_curve_by_coefficient_vector(int *eqn15, int verbose_level)
void apply_transformations(std::vector< std::string > &transform_coeffs, std::vector< int > &f_inverse_transform, int verbose_level)
quartic_curve_object_with_action * QOA
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)
data_structures_groups::vector_ge * nice_gens
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 create_quartic_curve_by_coefficients(std::string &coefficients_text, int verbose_level)
groups::strong_generators * Sg
field_theory::finite_field * F
algebraic_geometry::quartic_curve_object * QO
void override_group(std::string &group_order_text, int nb_gens, std::string &gens_text, int verbose_level)
quartic_curve_create_description * Descr
void compute_group(projective_geometry::projective_space_with_action *PA, int verbose_level)
quartic_curve_domain_with_action * QCDA
a domain for quartic curves in projective space with group action
algebraic_geometry::quartic_curve_domain * Dom
projective space PG(n,q) with automorphism group PGGL(n+1,q)
field_theory::finite_field * F
#define Lint_vec_copy(A, B, C)
#define Int_vec_scan(A, B, C)
#define Lint_vec_print(A, B, C)
#define Int_vec_copy(A, B, C)
#define Int_vec_print(A, B, C)
orbiter_kernel_system::orbiter_session * Orbiter
global Orbiter session
the orbiter library for the classification of combinatorial objects
groups::matrix_group * matrix_grp