Changeset 0132b0 in git for Singular/LIB/primitiv.lib


Ignore:
Timestamp:
Apr 23, 1998, 3:23:27 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
e36ae54f25a40adf73b0e8d8180c361742db9def
Parents:
e35965573370ae0d1c2c96e458eb1e3bde28c946
Message:
* incoporated new versions from Martin


git-svn-id: file:///usr/local/Singular/svn/trunk@1437 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primitiv.lib

    re35965 r0132b0  
    1 // $Id: primitiv.lib,v 1.3 1998-04-03 22:47:11 krueger Exp $
    2 // This library requires Singular 1.0
    3 
    4 version="$Id: primitiv.lib,v 1.3 1998-04-03 22:47:11 krueger Exp $";
     1// $Id: primitiv.lib,v 1.4 1998-04-23 13:23:27 obachman Exp $
     2// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
     3// last change:           11.3.98
     4///////////////////////////////////////////////////////////////////////////////
     5version="$Id: primitiv.lib,v 1.4 1998-04-23 13:23:27 obachman Exp $";
    56info="
    67LIBRARY:    primitiv.lib    PROCEDURES FOR FINDING A PRIMITIVE ELEMENT
    78
    8  primitivE(ideal i); finds minimal polynomial for a primitive element
    9 
    10  splitring(poly f,string R[,list L]);  define ring extension with name R
    11                                        and switch to it
    12  randomLast(int b);       random transformation of the last variable
     9 primitive(ideal i);   finds minimal polynomial for a primitive element
     10 splitring(f,R[,L]);   define ring extension with name R and switch to it
     11 randomLast(b);        random transformation of the last variable
    1312";
    1413
     14///////////////////////////////////////////////////////////////////////////////
    1515LIB "random.lib";
    1616///////////////////////////////////////////////////////////////////////////////
     
    2121         a sum of it with a linear random combination of the other
    2222         variables
    23 NOTE:   
    2423EXAMPLE: example randomLast; shows an example
    2524{
     
    4039///////////////////////////////////////////////////////////////////////////////
    4140
    42 proc primitivE(ideal i)
    43 USAGE:  primitivE(i); i ideal of the following form:
     41proc primitive(ideal i)
     42USAGE:  primitive(i); i ideal of the following form:
    4443 Let k be the ground field of your basering, a_1,...,a_n algebraic over k,
    4544 m_1(x1), m_2(x_1,x_2),...,m_n(x_1,...,x_n) polynomials in k such that
     
    4847 Then i has to be generated by m_1,...,m_n.
    4948
    50 RETURN: ideal j in k[x_n] such that
     49RETURN:  ideal j in k[x_n] such that
    5150 j[1] is minimal polynomial for a primitive element b of k(a_1,...,a_n)=k(b)
    5251         over k
    5352 j[2],...,j[n+1] polynomials in k[x_n] : j[i+1](b)=a_i for i=1,...,n
    54 NOTE: the number of variables in the basering has to be exactly the number n of
    55       given algebraic elements (and minimal polynomials)
    56 EXAMPLE:    example primitivE;  shows an example
     53NOTE:    the number of variables in the basering has to be exactly the number n
     54         of given algebraic elements (and minimal polynomials)
     55EXAMPLE: example primitive;  shows an example
    5756{
    5857 def altring=basering;
     
    111110 ring exring=0,(x,y),dp;
    112111 ideal i=x2+1,y2-x;                  // compute Q(i,i^(1/2))=:L
    113  ideal j=primitivE(i);               // -> we have L=Q(a):
     112 ideal j=primitive(i);               // -> we have L=Q(a):
    114113 "minimal polynomial of a:",j[1];    // => a=(-1)^(1/4)
    115114 "polynomial for i:       ",j[2];    // => i=a^2
    116115 "polynomial for i^(1/2): ",j[3];    // => i^(1/2)=a
    117116 // ==> the 2nd element was already primitive!
    118  j=primitivE(ideal(x2-2,y2-3));      // compute Q(sqrt(2),sqrt(3))
     117 j=primitive(ideal(x2-2,y2-3));      // compute Q(sqrt(2),sqrt(3))
    119118 "minimal polynomial:",j[1];
    120119 "polynomial p s.t. p(a)=sqrt(2):",j[2];
     
    130129ACTION: defines a ring with name R, in which f is reducible, and changes to it
    131130        If the old ring has no parameter, the name 'a' is chosen for the
    132         parameter of R (if a is no variable; if it is, the proc takes 'b'; if
    133         this is also impossible, then 'c'), otherwise the name of the parameter
    134         is kept and only the minimal polynomial is changed.
     131        parameter of R (if a is no variable; if it is, the proc takes 'b',
     132        etc.; if a,b,c,o are variables of the ring, produce an error message),
     133        otherwise the name of the parameter is kept and only the
     134        minimal polynomial is changed.
    135135        The names of variables and orderings are not affected.
    136136
     
    138138        will be REPLACED by the new ring (with the same name as the old ring).
    139139
    140 RETURNs: list L mapped into the new ring R, if L is given; else nothing
    141 ASSUME : the active ring must be bivariate and allow an algebraic extension
     140RETURN: list L mapped into the new ring R, if L is given; else nothing
     141ASSUME: the active ring must allow an algebraic extension
    142142         (e.g. it cannot be a transcendent ring extension of Q or Z/p)
    143143EXAMPLE: example splitring;  shows an example
     
    162162 string varnames=varstr(altring);
    163163 string algname;
     164 int i;
     165 int anzvar=size(maxideal(1));
    164166 //--------------- Fall 1: Bisheriger Ring hatte kein Minimalpolynom ----------
    165167 if (minp=="0") {
    166168  if (find(varnames,"a")==0)        { algname="a";}
    167169  else { if (find(varnames,"b")==0) { algname="b";}
    168          else                       { algname="c";}
    169  //----------- nur ZWEI Variablen erlaubt ==> c ist kein Variablenname --------
     170         else { if (find(varnames,"c")==0)
     171                                    { algname="c";}
     172         else { if (find(varnames,"o")==0)
     173                                    { algname="o";}
     174         else {
     175           "** Sorry -- could not find a free name for the primitive element.";
     176           "** Try e.g. a ring without 'a' or 'b' as variable.";
     177           return();
     178         }}
     179       }
    170180  }
    171181 //-- erzeuge einen String, der das Minimalpolynom des neuen Rings enthaelt: --
    172182  execute("ring splt1="+charakt+","+algname+",dp;");
    173   map nach_splt1=altring,var(1),var(1);
     183  ideal abbnach=var(1);
     184  for (i=1; i<anzvar; i++) { abbnach=abbnach,var(1); }
     185  map nach_splt1=altring,abbnach;
    174186  execute("poly mipol="+string(nach_splt1(f))+";");
    175187  string Rminp=string(mipol);
     
    198210  execute("ring splt3="+charakt+",("+algname+","+varnames+"),dp;");
    199211  poly f=imap(altring,f);
    200  //-------------- Vorbereitung des Aufrufes von primitivE: --------------------
     212 //-------------- Vorbereitung des Aufrufes von primitive: --------------------
    201213  execute("ring splt1="+charakt+",(x,y),dp;");
    202   map nach_splt1_3=splt3,x,y,y;
     214  ideal abbnach=x;
     215  for (i=1; i<=anzvar; i++) { abbnach=abbnach,y; }
     216  map nach_splt1_3=splt3,abbnach;
    203217  map nach_splt1_2=splt2,x;
    204218  ideal maxid=nach_splt1_2(mipol),nach_splt1_3(f);
    205   ideal primit=primitivE(maxid);
     219  ideal primit=primitive(maxid);
    206220  "new minimal polynomial:",primit[1];
    207221 //-- erzeuge einen String, der das Minimalpolynom des neuen Rings enthaelt: --
     
    210224  minp=string(nach_splt2(primit)[1]);
    211225 //--------------------- definiere den neuen Ring: ----------------------------
    212   execute("ring "+@R+" = ("+charakt+","+algname+"),("+varnames+"),("+ordstr(altring)+");");
     226  execute("ring "+@R+" = ("+charakt+","+algname+"),("+varnames+"),("
     227          +ordstr(altring)+");");
    213228  execute("minpoly="+minp+";");
    214229  execute("export "+@R+";");
     
    225240    map nach_splt3_1=splt1,0,var(1);  // x->0, y->a
    226241 //----- rechne das primitive Element von altring in das von neuring um: ------
    227     map convert=splt3,nach_splt3_1(primit)[2],var(2),var(3);
     242    ideal convid=maxideal(1);
     243    convid[1]=nach_splt3_1(primit)[2];
     244    map convert=splt3,convid;
    228245    zwi=convert(zwi);
    229246    setring neuring;
Note: See TracChangeset for help on using the changeset viewer.