Orbiter 2022
Combinatorial Objects
action_on_grassmannian.cpp
Go to the documentation of this file.
1// action_on_grassmannian.cpp
2//
3// Anton Betten
4// July 20, 2009
5
7#include "group_actions.h"
8
9using namespace std;
10
11
12namespace orbiter {
13namespace layer3_group_actions {
14namespace induced_actions {
15
16
18{
19 null();
20}
21
23{
24 free();
25}
26
28{
29 //M = NULL;
30 M1 = NULL;
31 M2 = NULL;
32 G = NULL;
33 GE = NULL;
34 subspace_basis = NULL;
35 subspace_basis2 = NULL;
37
39 print_function = NULL;
41
42}
43
45{
46 int f_v = FALSE;
47
48 if (M1) {
49 if (f_v) {
50 cout << "action_on_grassmannian::free "
51 "before free M1" << endl;
52 }
53 FREE_int(M1);
54 }
55 if (M2) {
56 if (f_v) {
57 cout << "action_on_grassmannian::free "
58 "before free M2" << endl;
59 }
60 FREE_int(M2);
61 }
62 if (GE) {
63 if (f_v) {
64 cout << "action_on_grassmannian::free "
65 "before free GE" << endl;
66 }
68 }
69 if (subspace_basis) {
70 if (f_v) {
71 cout << "action_on_grassmannian::free "
72 "before free subspace_basis" << endl;
73 }
75 }
76 if (subspace_basis2) {
77 if (f_v) {
78 cout << "action_on_grassmannian::free "
79 "before free subspace_basis2" << endl;
80 }
82 }
83 null();
84}
85
87 geometry::grassmann *G, int verbose_level)
88{
89 int f_v = (verbose_level >= 1);
92
93 if (f_v) {
94 cout << "action_on_grassmannian::init" << endl;
95 }
98 n = G->n;
99 k = G->k;
100 q = G->q;
101 F = G->F;
103
104
105 if (f_v) {
106 cout << "action_on_grassmannian::init" << endl;
107 cout << "n=" << n << endl;
108 cout << "k=" << k << endl;
109 cout << "q=" << q << endl;
110 }
111
112
113 M1 = NEW_int(k * n);
114 M2 = NEW_int(k * n);
115
116 if (!A.f_is_linear) {
117 cout << "action_on_grassmannian::init "
118 "action not of linear type" << endl;
119 exit(1);
120 }
121
122#if 0
123 if (A.type_G == matrix_group_t) {
124 M = A.G.matrix_grp;
125 }
126 else {
127 action *sub = A.subaction;
128 M = sub->G.matrix_grp;
129 }
130#endif
131
132 C.q_binomial(degree, n, k, q, 0);
134 if (f_v) {
135 cout << "degree = " << degree << endl;
136 cout << "max_string_length = " << max_string_length << endl;
137 cout << "low_level_point_size = " << low_level_point_size << endl;
138 }
139
140 if (f_v) {
141 cout << "action_on_grassmannian::init done" << endl;
142 }
143}
144
146 void (*print_function)(std::ostream &ost, long int a, void *data),
147 void *print_function_data,
148 int verbose_level)
149{
150 int f_v = (verbose_level >= 1);
151
152 if (f_v) {
153 cout << "action_on_grassmannian::add_print_function" << endl;
154 }
158}
159
160
162 int *ambient_space, int verbose_level)
163{
164 int f_v = (verbose_level >= 1);
165
166 if (f_v) {
167 cout << "action_on_grassmannian::init_embedding" << endl;
168 cout << "big_n=" << big_n << endl;
169 cout << "ambient space:" << endl;
170 Int_vec_print_integer_matrix_width(cout, ambient_space,
171 n, big_n, big_n, F->log10_of_q);
172 }
176 GE->init(big_n, n, G, ambient_space, verbose_level);
179}
180
181
182void action_on_grassmannian::unrank(long int i, int *v, int verbose_level)
183{
184 int f_v = (verbose_level >= 1);
185
186 if (f_v) {
187 cout << "action_on_grassmannian::unrank" << endl;
188 }
189 G->unrank_lint_here(v, i, verbose_level - 1);
190 if (f_v) {
191 cout << "action_on_grassmannian::unrank done" << endl;
192 }
193}
194
195long int action_on_grassmannian::rank(int *v, int verbose_level)
196{
197 int f_v = (verbose_level >= 1);
198 long int rk;
199
200 if (f_v) {
201 cout << "action_on_grassmannian::rank" << endl;
202 }
203 rk = G->rank_lint_here(v, verbose_level - 1);
204 if (f_v) {
205 cout << "action_on_grassmannian::rank done" << endl;
206 }
207 return rk;
208}
209
210
212 actions::action *A, int *Elt,
214 int verbose_level)
215{
216 int f_v = (verbose_level >= 1);
217 int f_vv = (verbose_level >= 2);
218 int h;
219
220 if (f_v) {
221 cout << "action_on_grassmannian::compute_image_longinteger "
222 "i = " << i << endl;
223 }
224 G->unrank_longinteger(i, 0/*verbose_level - 1*/);
225 if (f_vv) {
226 cout << "after G->unrank_longinteger" << endl;
228 G->k, G->n, G->n, F->log10_of_q);
229 }
230 for (h = 0; h < k; h++) {
232 M1 + h * n, Elt, verbose_level - 1);
233 }
234 //A->element_image_of_low_level(G->M, M1, Elt, verbose_level - 1);
235#if 0
236 F->mult_matrix_matrix(G->M, Elt, M1, k, n, n);
237
238 if (M->f_semilinear) {
239 f = Elt[n * n];
240 F->vector_frobenius_power_in_place(M1, k * n, f);
241 }
242#endif
243 if (f_vv) {
244 cout << "after element_image_of_low_level" << endl;
246 G->k, G->n, G->n, F->log10_of_q);
247 }
248
249 Int_vec_copy(M1, G->M, k * n);
250 G->rank_longinteger(j, 0/*verbose_level - 1*/);
251 if (f_v) {
252 cout << "action_on_grassmannian::compute_image_longinteger "
253 "image of " << i << " is " << j << endl;
254 }
255}
256
258 actions::action *A, int *Elt,
259 long int i, int verbose_level)
260{
261 if (f_embedding) {
262 return compute_image_int_embedded(A, Elt, i, verbose_level);
263 }
264 else {
265 return compute_image_int_ordinary(A, Elt, i, verbose_level);
266 }
267}
268
270 actions::action *A, int *Elt,
271 long int i, int verbose_level)
272{
273 int f_v = (verbose_level >= 1);
274 int f_vv = (verbose_level >= 2);
275 long int h, j;
276
277 if (f_v) {
278 cout << "action_on_grassmannian::compute_image_int_ordinary "
279 "i = " << i << endl;
280 cout << "A->low_level_point_size="
281 << A->low_level_point_size << endl;
282 cout << "using action " << A->label << endl;
283 }
284 G->unrank_lint(i, verbose_level - 1);
285 if (f_vv) {
286 cout << "action_on_grassmannian::compute_image_int_ordinary "
287 "after G->unrank_int" << endl;
289 G->k, G->n, G->n, 2/* M->GFq->log10_of_q*/);
290 }
291 for (h = 0; h < k; h++) {
293 M1 + h * n, Elt, verbose_level - 1);
294 }
295#if 0
296 F->mult_matrix_matrix(G->M, Elt, M1, k, n, n);
297
298 if (M->f_semilinear) {
299 f = Elt[n * n];
300 F->vector_frobenius_power_in_place(M1, k * n, f);
301 }
302#endif
303
304 Int_vec_copy(M1, G->M, k * n);
305 j = G->rank_lint(verbose_level - 1);
306 if (f_v) {
307 cout << "action_on_grassmannian::compute_image_int_ordinary "
308 "image of " << i << " is " << j << endl;
309 }
310 return j;
311}
312
314 actions::action *A, int *Elt,
315 long int i, int verbose_level)
316{
317 int f_v = (verbose_level >= 1);
318 int f_vv = (verbose_level >= 2);
319 long int j, h;
320
321 if (f_v) {
322 cout << "action_on_grassmannian::compute_image_int_embedded "
323 "i = " << i << endl;
324 cout << "calling GE->unrank_int" << endl;
325 }
326 GE->unrank_lint(subspace_basis, i, 0 /*verbose_level - 1*/);
327 if (f_vv) {
328 cout << "action_on_grassmannian::compute_image_int_embedded "
329 "subspace_basis:" << endl;
330 cout << "k=" << k << endl;
331 cout << "big_n=" << big_n << endl;
333 k, big_n, big_n, F->log10_of_q);
334 }
335 for (h = 0; h < k; h++) {
337 subspace_basis + h * big_n,
339 Elt, verbose_level - 1);
340 }
341
342 //A->element_image_of_low_level(subspace_basis,
343 // subspace_basis2, Elt, verbose_level - 1);
344#if 0
345 F->mult_matrix_matrix(subspace_basis, Elt,
347 if (f_vv) {
348 cout << "action_on_grassmannian::compute_image_int_embedded "
349 "after mult_matrix_matrix:" << endl;
350 print_integer_matrix_width(cout, subspace_basis2,
351 k, big_n, big_n, F->log10_of_q);
352 }
353
354 if (M->f_semilinear) {
355 f = Elt[big_n * big_n];
356 if (f_v) {
357 cout << "f_semilinear is TRUE, f=" << f << endl;
358 }
359 F->vector_frobenius_power_in_place(subspace_basis2, k * big_n, f);
360 }
361#endif
362
363 if (f_vv) {
364 cout << "action_on_grassmannian::compute_image_int_embedded "
365 "subspace_basis after the action:" << endl;
367 k, big_n, big_n, F->log10_of_q);
368 }
370 0 /*verbose_level - 1 */);
371 if (f_v) {
372 cout << "action_on_grassmannian::compute_image_int_embedded "
373 "image of " << i << " is " << j << endl;
374 }
375 return j;
376}
377
378void action_on_grassmannian::print_point(long int a, std::ostream &ost)
379{
380 //cout << "action_on_grassmannian::print_point k=" << G->k << " n=" << G->n << endl;
381 G->unrank_lint(a, 0);
382#if 0
383 print_integer_matrix_width(ost, G->M,
384 G->k, G->n, G->n, 2 /*M->GFq->log10_of_q*/);
385#else
387
388 ost << "\\left[" << endl;
390 G->M, G->k, G->n);
391 ost << "\\right]_{" << a << "}" << endl;
392
395 }
396
397
398#endif
399
400}
401
402}}}
403
void q_binomial(ring_theory::longinteger_object &a, int n, int k, int q, int verbose_level)
void unrank_lint(int *subspace_basis, long int rk, int verbose_level)
void init(int big_n, int n, grassmann *G, int *M, int verbose_level)
long int rank_lint(int *subspace_basis, int verbose_level)
to rank and unrank subspaces of a fixed dimension in F_q^n
Definition: geometry.h:892
void unrank_longinteger(ring_theory::longinteger_object &rk, int verbose_level)
Definition: grassmann.cpp:627
void unrank_lint(long int rk, int verbose_level)
Definition: grassmann.cpp:343
void rank_longinteger(ring_theory::longinteger_object &r, int verbose_level)
Definition: grassmann.cpp:764
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 print_integer_matrix_tex(std::ostream &ost, int *p, int m, int n)
a class to represent arbitrary precision integers
Definition: ring_theory.h:366
a permutation group in a fixed action.
Definition: actions.h:99
void element_image_of_low_level(int *input, int *output, void *elt, int verbose_level)
Definition: action_cb.cpp:209
void(* print_function)(std::ostream &ost, long int a, void *data)
long int compute_image_int(actions::action *A, int *Elt, long int i, int verbose_level)
void add_print_function(void(*print_function)(std::ostream &ost, long int a, void *data), void *print_function_data, int verbose_level)
void init_embedding(int big_n, int *ambient_space, int verbose_level)
long int compute_image_int_embedded(actions::action *A, int *Elt, long int i, int verbose_level)
void init(actions::action &A, geometry::grassmann *G, int verbose_level)
void compute_image_longinteger(actions::action *A, int *Elt, ring_theory::longinteger_object &i, ring_theory::longinteger_object &j, int verbose_level)
long int compute_image_int_ordinary(actions::action *A, int *Elt, long int i, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define NEW_OBJECT(type)
Definition: foundations.h:638
#define FREE_OBJECT(p)
Definition: foundations.h:651
#define NEW_int(n)
Definition: foundations.h:625
#define Int_vec_print_integer_matrix_width(A, B, C, D, E, F)
Definition: foundations.h:691
#define TRUE
Definition: foundations.h:231
#define FALSE
Definition: foundations.h:234
#define Int_vec_copy(A, B, C)
Definition: foundations.h:693
the orbiter library for the classification of combinatorial objects