1 | int p=3; int n=3; int d=5; int k=2; |
---|
2 | ring rp = p,(x(1..n)),dp; |
---|
3 | int s = size(maxideal(d)); |
---|
4 | s; |
---|
5 | // create a dense homogeneous ideal m, all generators of degree d, with |
---|
6 | // generic (random) coefficients: |
---|
7 | ideal m = maxideal(d)*random(p,s,n-2); |
---|
8 | m; |
---|
9 | // look for zeroes on the torus by checking all points (with no component 0) |
---|
10 | // of the affine n-space over the field with p elements : |
---|
11 | ideal mt; |
---|
12 | int i(1..n); // initialize integers i(1),...,i(n) |
---|
13 | int l; |
---|
14 | s=0; |
---|
15 | for (i(1)=1;i(1)<p;i(1)=i(1)+1) |
---|
16 | { |
---|
17 | for (i(2)=1;i(2)<p;i(2)=i(2)+1) |
---|
18 | { |
---|
19 | for (i(3)=1;i(3)<p;i(3)=i(3)+1) |
---|
20 | { |
---|
21 | mt=m; |
---|
22 | for (l=1;l<=n;l=l+1) |
---|
23 | { |
---|
24 | mt=subst(mt,x(l),i(l)); |
---|
25 | } |
---|
26 | if (size(mt)==0) |
---|
27 | { |
---|
28 | "solution:",i(1..n); |
---|
29 | s=s+1; |
---|
30 | } |
---|
31 | } |
---|
32 | } |
---|
33 | } |
---|
34 | "//",s,"solutions over GF("+string(p)+")"; |
---|
35 | // Now go to the field with p^3 elements: |
---|
36 | // As long as there is no map from Z/p to the field with p^3 elements |
---|
37 | // implemented, use the folowing trick: convert the ideal to be maped |
---|
38 | // to the new ring to a string and then execute that string in the |
---|
39 | // new ring |
---|
40 | string ms="ideal m="+string(m)+";"; |
---|
41 | ms; |
---|
42 | // define a ring rpk with p^k elements, call the primitive element z. Hence |
---|
43 | // 'solution exponent: 0 1 5' means that (z^0,z^1,z^5) is a solution |
---|
44 | ring rpk=(p^k,z),(x(1..n)),dp; |
---|
45 | rpk; |
---|
46 | execute(ms); |
---|
47 | s=0; |
---|
48 | ideal mt; |
---|
49 | for (i(1)=0;i(1)<p^k-k;i(1)=i(1)+1) |
---|
50 | { |
---|
51 | for (i(2)=0;i(2)<p^k-k;i(2)=i(2)+1) |
---|
52 | { |
---|
53 | for (i(3)=0;i(3)<p^k-k;i(3)=i(3)+1) |
---|
54 | { |
---|
55 | mt=m; |
---|
56 | for (l=1;l<=n;l=l+1) |
---|
57 | { |
---|
58 | mt=subst(mt,x(l),z^i(l)); |
---|
59 | } |
---|
60 | if (size(mt)==0) |
---|
61 | { |
---|
62 | "solution exponent:",i(1..n); |
---|
63 | s=s+1; |
---|
64 | } |
---|
65 | } |
---|
66 | } |
---|
67 | } |
---|
68 | "//",s,"solutions over GF("+string(p^k)+")"; |
---|
69 | LIB "tst.lib";tst_status(1);$ |
---|