Sharedwww / TOM / tomOpen in CoCalc
Author: William A. Stein
1
// [email protected]
2
SetColumns(50);
3
//SetRows(20);
4
5
Q := Rationals();
6
7
P<r,s,t,u,v,w,
8
x01,x02,x03,x04,x05,x06,x07,x08,
9
x09,x10,x11,x12,x13,x14,x15,x16> := PolynomialRing(Q,22);
10
eqn := [];
11
for outer := 0 to 15 do
12
ul := outer mod 2;
13
ur := (outer div 2) mod 2;
14
ll := (outer div 4) mod 2;
15
lr := (outer div 8) mod 2;
16
outereqn := 0;
17
for inner := 0 to 3 do
18
innereqn := 1;
19
il := inner mod 2;
20
ir := (inner div 2) mod 2;
21
if ul eq il then
22
innereqn *:= 1-r;
23
else
24
innereqn *:= r;
25
end if;
26
if ll eq il then
27
innereqn *:= 1-s;
28
else
29
innereqn *:= s;
30
end if;
31
if il eq ir then
32
innereqn *:= 1-t;
33
else
34
innereqn *:= t;
35
end if;
36
if ur eq ir then
37
innereqn *:= 1-u;
38
else
39
innereqn *:= u;
40
end if;
41
if lr eq ir then
42
innereqn *:= 1-v;
43
else
44
innereqn *:= v;
45
end if;
46
outereqn +:= innereqn;
47
end for;
48
Append(~eqn,outereqn);
49
50
end for;
51
52
neweqn := [];
53
54
temp := x01 - w*eqn[1]; Append(~neweqn, temp);
55
temp := x02 - w*eqn[2]; Append(~neweqn, temp);
56
temp := x03 - w*eqn[3]; Append(~neweqn, temp);
57
temp := x04 - w*eqn[4]; Append(~neweqn, temp);
58
temp := x05 - w*eqn[5]; Append(~neweqn, temp);
59
temp := x06 - w*eqn[6]; Append(~neweqn, temp);
60
temp := x07 - w*eqn[7]; Append(~neweqn, temp);
61
temp := x08 - w*eqn[8]; Append(~neweqn, temp);
62
temp := x09 - (1-w)*eqn[9]; Append(~neweqn, temp);
63
temp := x10 - (1-w)*eqn[10]; Append(~neweqn, temp);
64
temp := x11 - (1-w)*eqn[11]; Append(~neweqn, temp);
65
temp := x12 - (1-w)*eqn[12]; Append(~neweqn, temp);
66
temp := x13 - (1-w)*eqn[13]; Append(~neweqn, temp);
67
temp := x14 - (1-w)*eqn[14]; Append(~neweqn, temp);
68
temp := x15 - (1-w)*eqn[15]; Append(~neweqn, temp);
69
temp := x16 - (1-w)*eqn[16]; Append(~neweqn, temp);
70
71
I := ideal<P|neweqn>;
72
I;
73
SetVerbose("Groebner",true);
74
B := GroebnerBasis(I);
75
B;
76