source: git/Tst/Short/invar_lib.tst @ 4b56a8

spielwiese
Last change on this file since 4b56a8 was 4b56a8, checked in by Hans Schoenemann <hannes@…>, 4 years ago
fix: avoid warning in invar.lib
  • Property mode set to 100644
File size: 5.3 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4////////////////////////////////////////////////////////////////////////////////
5// Examples
6// FFT (First Fundamental Theorem, not: Fast Fourier Transform)
7////////////////////////////////////////////////////////////////////////////////
8
9
10LIB "matrix.lib";
11LIB "invar.lib";
12
13"EXAMPLE 1:";
14SL(2);                          // Take the group SL_2
15matrix m=dsum(SLrep,SLrep,SLrep,SLrep);
16                                // 4 copies of the standard representation
17invar(m);                       // empirical evidence for FFT
18setring Invar::polyring;
19// The reynolds operator is computed using the Omega process.
20Invar::reynolds(x(1)*x(4));
21
22setring Invar::group;                 
23
24"EXAMPLE 2:";
25SL(3);                          // Take the group SL_3
26matrix m=dsum(SLrep,SLrep,SLrep,SLrep);
27                                // 4 copies of the standard representation
28invar(m);                       // more empirical evidence for FFT
29
30//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
31// Examples
32// some arbitrary SL_2 example
33////////////////////////////////////////////////////////////////////////////////
34
35
36SL(2);
37
38matrix m=dsum(sympower(SLrep,2),SLrep,SLrep);
39                                // binary forms of degree 2, plus 2 copies
40                                // of the standard representation
41invar(m);
42/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
43// Examples
44// Tori
45////////////////////////////////////////////////////////////////////////////////
46
47"EXAMPLE 1:";
48
49torus(1);                       // Take the 1-dimensional torus, the
50                                // multiplicative group.
51list weights=-2,-3,7;           // 3-dimensial action with weights -2,-3,7
52matrix m=torusrep(weights);     // compute the matrix of the representation
53invar(m);                       // compute the invariant ring
54
55"EXAMPLE 2:";
56
57setring Invar::group;                 
58weights=-4,-3,-2,1,1,2,3,4;     // a harder example
59matrix m=torusrep(weights);
60invar(m);
61
62"EXAMPLE 3:";
63
64torus(2);                       // 2-dimensional torus
65intvec w1=1,2;                  // (inspired by the jumping of a knight
66intvec w2=-1,2;                 // on a chess board)
67intvec w3=1,-2;                 // it takes some time
68intvec w4=-1,-2;
69intvec w5=2,1;
70intvec w6=2,-1;
71intvec w7=-2,1;
72intvec w8=2,-1;
73list weights=w1,w2,w3,w4,w5,w6,w7,w8;
74matrix m=torusrep(weights);
75invar(m);
76                                // The invariant x(2)^3*x(4)^5*x(5)^4 says that
77                                // 3*(-1,2)+4*(2,1)+5*(-1,-2)=(0,0)
78                                // All invariants define cyclic knight-paths.
79
80
81/////////////////////////////////////////////
82////////////////////////////////////////////////////////////////////////////////
83// Examples
84// Finite groups
85////////////////////////////////////////////////////////////////////////////////
86
87"EXAMPLE 1:";
88finite(6);                              // The symmetric group S_3
89matrix id=unitmat(3);                   // identity matrix
90matrix m3[3][3]=0,1,0,0,0,1,1,0,0;      // corresponds with (1 2 3)
91matrix m2[3][3]=0,1,0,1,0,0,0,0,1;      // corresponds with (1 2)
92list a=id,m3,m3*m3,m2,m2*m3,m2*m3*m3;   // all elements of S_3
93matrix rep=finiterep(a);                // compute matrix of standard repr.
94invar(rep);                             // compute the invariant ring
95
96"EXAMPLE 2:";
97finite(4);                              // Cyclic group of order 4
98matrix id=unitmat(4);                   
99matrix m4[4][4]=0,1,0,0,0,0,1,0,0,0,0,1,1,0,0,0;
100                                        // matrix of (1 2 3 4)
101list a=id,m4,m4*m4,m4*m4*m4;            // all elements of the cyclic group
102matrix rep=finiterep(a);                // compute matrix of regular repr.
103invar(rep);                             // compute the invariant ring
104
105
106/////////////////////////////////
107
108
109////////////////////////////////////////////////////////////////////////////////
110// Examples
111// Binary forms
112////////////////////////////////////////////////////////////////////////////////
113
114"EXAMPLE 1:";
115SL(2);                          // set the current group to SL_2
116invar(SLrep);                   // invariants of the standard representation
117                                // (of course there are no invariants)
118
119"EXAMPLE 2:";
120setring Invar::group;           // 'invar' changed the basering into 'polyring'
121                                // now we need the ring 'group' again (because
122                                // SLrep is defined there)
123matrix bin2=sympower(SLrep,2);  // Let m be the matrix of the second symmetric
124                                // power of the standard representation
125                                // (binary forms of degree 2)
126invar(bin2);                    // compute the invariant(s)
127                                // (only one: the discriminant)
128                                // OK, let's try some more binary forms:
129
130"EXAMPLE 3:";
131setring Invar::group;
132matrix bin3=sympower(SLrep,3);
133invar(bin3);
134
135"EXAMPLE 4:";
136setring Invar::group;
137matrix bin4=sympower(SLrep,4);
138invar(bin4);
139
140                                // for binary forms of degree 5 you'll need
141                                // a day or so ...
142
143
144///////////////////////////////////////
145tst_status(1);$
146
Note: See TracBrowser for help on using the repository browser.