Changeset 0132b0 in git for Singular/LIB/primitiv.lib
- Timestamp:
- Apr 23, 1998, 3:23:27 PM (26 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- e36ae54f25a40adf73b0e8d8180c361742db9def
- Parents:
- e35965573370ae0d1c2c96e458eb1e3bde28c946
- 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 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: primitiv.lib,v 1.4 1998-04-23 13:23:27 obachman Exp $"; 5 6 info=" 6 7 LIBRARY: primitiv.lib PROCEDURES FOR FINDING A PRIMITIVE ELEMENT 7 8 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 13 12 "; 14 13 14 /////////////////////////////////////////////////////////////////////////////// 15 15 LIB "random.lib"; 16 16 /////////////////////////////////////////////////////////////////////////////// … … 21 21 a sum of it with a linear random combination of the other 22 22 variables 23 NOTE:24 23 EXAMPLE: example randomLast; shows an example 25 24 { … … 40 39 /////////////////////////////////////////////////////////////////////////////// 41 40 42 proc primitiv E(ideal i)43 USAGE: primitiv E(i); i ideal of the following form:41 proc primitive(ideal i) 42 USAGE: primitive(i); i ideal of the following form: 44 43 Let k be the ground field of your basering, a_1,...,a_n algebraic over k, 45 44 m_1(x1), m_2(x_1,x_2),...,m_n(x_1,...,x_n) polynomials in k such that … … 48 47 Then i has to be generated by m_1,...,m_n. 49 48 50 RETURN: ideal j in k[x_n] such that49 RETURN: ideal j in k[x_n] such that 51 50 j[1] is minimal polynomial for a primitive element b of k(a_1,...,a_n)=k(b) 52 51 over k 53 52 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 of55 given algebraic elements (and minimal polynomials)56 EXAMPLE: example primitivE; shows an example53 NOTE: the number of variables in the basering has to be exactly the number n 54 of given algebraic elements (and minimal polynomials) 55 EXAMPLE: example primitive; shows an example 57 56 { 58 57 def altring=basering; … … 111 110 ring exring=0,(x,y),dp; 112 111 ideal i=x2+1,y2-x; // compute Q(i,i^(1/2))=:L 113 ideal j=primitiv E(i); // -> we have L=Q(a):112 ideal j=primitive(i); // -> we have L=Q(a): 114 113 "minimal polynomial of a:",j[1]; // => a=(-1)^(1/4) 115 114 "polynomial for i: ",j[2]; // => i=a^2 116 115 "polynomial for i^(1/2): ",j[3]; // => i^(1/2)=a 117 116 // ==> the 2nd element was already primitive! 118 j=primitiv E(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)) 119 118 "minimal polynomial:",j[1]; 120 119 "polynomial p s.t. p(a)=sqrt(2):",j[2]; … … 130 129 ACTION: defines a ring with name R, in which f is reducible, and changes to it 131 130 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. 135 135 The names of variables and orderings are not affected. 136 136 … … 138 138 will be REPLACED by the new ring (with the same name as the old ring). 139 139 140 RETURN s: list L mapped into the new ring R, if L is given; else nothing141 ASSUME : the active ring must be bivariate andallow an algebraic extension140 RETURN: list L mapped into the new ring R, if L is given; else nothing 141 ASSUME: the active ring must allow an algebraic extension 142 142 (e.g. it cannot be a transcendent ring extension of Q or Z/p) 143 143 EXAMPLE: example splitring; shows an example … … 162 162 string varnames=varstr(altring); 163 163 string algname; 164 int i; 165 int anzvar=size(maxideal(1)); 164 166 //--------------- Fall 1: Bisheriger Ring hatte kein Minimalpolynom ---------- 165 167 if (minp=="0") { 166 168 if (find(varnames,"a")==0) { algname="a";} 167 169 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 } 170 180 } 171 181 //-- erzeuge einen String, der das Minimalpolynom des neuen Rings enthaelt: -- 172 182 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; 174 186 execute("poly mipol="+string(nach_splt1(f))+";"); 175 187 string Rminp=string(mipol); … … 198 210 execute("ring splt3="+charakt+",("+algname+","+varnames+"),dp;"); 199 211 poly f=imap(altring,f); 200 //-------------- Vorbereitung des Aufrufes von primitiv E: --------------------212 //-------------- Vorbereitung des Aufrufes von primitive: -------------------- 201 213 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; 203 217 map nach_splt1_2=splt2,x; 204 218 ideal maxid=nach_splt1_2(mipol),nach_splt1_3(f); 205 ideal primit=primitiv E(maxid);219 ideal primit=primitive(maxid); 206 220 "new minimal polynomial:",primit[1]; 207 221 //-- erzeuge einen String, der das Minimalpolynom des neuen Rings enthaelt: -- … … 210 224 minp=string(nach_splt2(primit)[1]); 211 225 //--------------------- definiere den neuen Ring: ---------------------------- 212 execute("ring "+@R+" = ("+charakt+","+algname+"),("+varnames+"),("+ordstr(altring)+");"); 226 execute("ring "+@R+" = ("+charakt+","+algname+"),("+varnames+"),(" 227 +ordstr(altring)+");"); 213 228 execute("minpoly="+minp+";"); 214 229 execute("export "+@R+";"); … … 225 240 map nach_splt3_1=splt1,0,var(1); // x->0, y->a 226 241 //----- 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; 228 245 zwi=convert(zwi); 229 246 setring neuring;
Note: See TracChangeset
for help on using the changeset viewer.