source: git/Tst/Short/bug_qring2.tst @ 1427f62

spielwiese
Last change on this file since 1427f62 was 75214e, checked in by Hans Schoenemann <hannes@…>, 8 years ago
fix: normalizing in qrings + better error detecting in ring creation
  • Property mode set to 100644
File size: 6.0 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4/************************************************************************************
5Env.sing        First step in creating non-magma calculations
6
711/29/15        Got quotient ring created, basic options set.
8                Using reverse lexicographic order (or weighted rev.)
901/04/16        First step in constructing computations.
10
11************************************************************************************/
12//        do not print all the "redefined" warnings when we load the LIBraries.
13option(noredefine) ;
14//        load the stuff we need.
15LIB "poly.lib" ;
16LIB "nctools.lib" ;
17LIB "ncalg.lib" ;
18
19//        reduce all ideals and Groebner bases
20option(redSB) ;                 option(redTail) ;
21//        simplify all expressions in any quotient ring - i.e. put in normal form
22option(qringNF) ;
23
24//        start with the least value of nu; check higher ones later.
25int nu = 2 ;
26
27//        int N = 5 ;
28//        cycle through come calculable values for N
29for (int N=3; N<=11; N=N+1)
30{
31
32//        N can't divide nu^2
33if ( nu^2 mod N == 0 ) { newline, "Skipping N = ", N, newline ;  N= N+1 ; continue ; }
34
35//        r is the order of q^nu
36int r = lcm( N, nu^2 ) div nu^2 ;
37
38//        Create the commutative ring over the coefficients of augmented Q
39//        ring QN = (0,w), (a,b,x,y), lp ;                         // lexicographic order violates ordering condition
40//        ring QN = (0,w), (a,b,x,y), rp ;                         // reverse lexicographic allows really unbalanced a & b powers.
41//        ring QN = (0,w), (a,b,x,y), Dp ;                         // degree lexicographic violates ordering condition
42ring QN = (0,w), (a,b,x,y), wp(1,1,N,N) ;        // keeps a & b exponents closer.
43
44//        extend Q by Nth root of unity
45minpoly = rootofUnity(N) ;
46
47//        q is what we use in all the formulas
48number q = w^nu ;
49
50//        display all exponents with a '^' symbol;
51//        must be done whenever a new ring gets declared if results are going to be printed
52short = 0 ;
53
54//        Procedure to get (k)q_nu as defined in the Radford paper.
55proc subq_nu (int k)
56{
57        number retval = 1;
58        for (int m=1; m<k; m=m+1)  { retval = retval + q^m ; }
59        return( retval ) ;
60}
61//        G is the value of a loop
62poly G = b^(nu)  ;        newline, "Loop value =", G ;
63
64newline, "N =", N, "before creating the G-algebra." ;        //        debug info
65
66//        Create a pair of 4x4 zero matrices and populate according to the specs for G-algebras.
67matrix C[4][4] ;        C[1,2] = 1 ;        C[1,3] = q ;        C[1,4] = q^(-1) ;
68                                                C[2,3] = q^(-1) ;        C[2,4] = q ;
69                                                                        C[3,4] = q^(-nu) ;
70matrix D[4][4] ;                                                        D[3,4] = a^(2*nu) - 1 ;
71
72newline, "Matrix C:" ;                print (C) ;
73newline, "Matrix D:" ;         print (D) ;
74newline;
75
76//        Create the basic non-commutative G-algebra, without the "exotic" relations.
77def U = nc_algebra(C,D) ;                setring U ;
78"The N =", N, " G-algebra has:" ;
79U ;
80
81//        display all exponents with a '^' symbol;
82//        must be done whenever a new ring gets declared if results are going to be printed
83short = 0 ;
84
85matrix C = fetch( QN, C ) ;                //        Convert matrices to current ring
86matrix D = fetch( QN, D ) ;
87
88newline, "Matrix C:" ;          print (C) ;
89newline, "Matrix D:" ;         print (D) ;
90newline, "N =", N, "before nilpotent and order relations." ;        //        debug info
91
92for (int m = 1; m<=N; m= m+1)
93{
94        newline, "(x*a)^", m, " = ", (x*a)^m, "                (y*a)^", m, " = ", (y*a)^m ;
95        newline, "(y*x)^", m, " = ", (y*x)^m ;
96        newline, "(y*x*a)^", m," = ", (y*x*a)^m ;
97        newline, "(y*x*a)^", m, "-- (y*x)^", m, " = ", (y*x*a)^m - (y*x)^m ;
98}
99newline;
100
101/*        Create the ideal of the remaining relations, get the reduced basis,
102and mod out to get the quotient ring we want.                */
103
104ideal i =         x^r, y^r, a^N-1, a*b-1 ;
105qring U_q_nu = twostd(i) ;                setring U_q_nu ;
106"The N =", N, " U_q_nu algebra has:" ;
107U_q_nu ;
108
109//        display all exponents with a '^' symbol;
110//        must be done whenever a new ring gets declared if results are going to be printed
111short = 0 ;
112
113matrix C = fetch( U, C ) ;                //        Convert matrices to current ring
114matrix D = fetch( U, D ) ;
115number q = w^nu ;                        //        Need to reassign since it's a parameter.
116
117//        Either of the next two lines gives a segmentation fault - see last lines before *** END N=...
118//        Can't "fetch" it ---
119//        poly G = fetch( QN, G ) ;        newline, "Loop value =", G ;
120//        Can't redefine it ---
121//        poly G = b^(nu) ;         newline, "Loop value =", G ;
122
123newline, "Matrix C:" ;
124print (C) ;
125newline, "Matrix D:" ;
126print (D) ;
127newline, "N =", N, "after nilpotent and order relations." ;        //        debug info
128if ( r != N ) { "Note that N =", N, "but r =", r ; }
129
130for (int m = 1; m<=N; m= m+1)
131{
132        newline, "(x*a)^", m, " = ", (x*a)^m, "                (y*a)^", m, " = ", (y*a)^m ;
133        newline, "(y*x)^", m, " = ", (y*x)^m ;
134        newline, "(y*x*a)^", m, " = ", (y*x*a)^m ;
135        newline, "(y*x*a)^", m, "-- (y*x)^", m, " = ", (y*x*a)^m - (y*x)^m ;
136}
137
138newline, newline, "a^2*x^3*y^4 + b^3*y^4*x^4 =", a^2*x^3*y^4 + b^3*y^4*x^4 ;
139newline, newline, "(a^2*x^3*y^4 + b^3*y^4*x^4)^2 - (a^2*x^3*y^4 + b^3*y^4*x^4) =",
140        ( a^2*x^3*y^4 + b^3*y^4*x^4 )^2 - ( a^2*x^3*y^4 + b^3*y^4*x^4) ;
141newline;
142
143//        Next line crashes Singular with a segmentation fault; notice it's the same one as that printed above.
144//        As a matter of fact, *any* polynomial declaration does.
145
146poly h = a^2*x^3*y^4 + b^3*y^4*x^4;  h^2 - h;
147poly k = h^2 - h ; k;
148
149"******************************************  END N =", N, " ******************************************" ;
150"*************************************************************************************************" ;
151}
152
153tst_status(1);$
Note: See TracBrowser for help on using the repository browser.