source: git/Tst/Old/m7ex.tst @ 7bb71fa

spielwiese
Last change on this file since 7bb71fa was 7bb71fa, checked in by Hans Schönemann <hannes@…>, 24 years ago
* hannes: execute git-svn-id: file:///usr/local/Singular/svn/trunk@4323 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.8 KB
Line 
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)+")";
69LIB "tst.lib";tst_status(1);$
Note: See TracBrowser for help on using the repository browser.