Changeset 9173792 in git for Singular/LIB/zeroset.lib


Ignore:
Timestamp:
Feb 19, 2001, 3:17:50 PM (23 years ago)
Author:
Christoph Lossen <lossen@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
25c431d26faee1a17b854e49114f755c02aaf1ef
Parents:
584d1f1ad4878b9855984324f19d6383aa60632c
Message:
* westenb:  help strings edited, typos corrected


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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/zeroset.lib

    r584d1f1 r9173792  
    1 // Last change 10.12.2000
    2 ///////////////////////////////////////////////////////////////////////////////
    3 
    4 version="$Id: zeroset.lib,v 1.6 2001-01-16 13:48:47 Singular Exp $";
     1// Last change 12.02.2001 (Eric Westenberger)
     2///////////////////////////////////////////////////////////////////////////////
     3version="$Id: zeroset.lib,v 1.7 2001-02-19 14:17:50 lossen Exp $";
    54category="Symbolic-numerical solving";
    65info="
     
    1110
    1211OVERVIEW:
    13  Algorithms for finding the zero-set of a zero-dim. ideal in Q(a)[x_1,..x_n],
     12 Algorithms for finding the zero-set of a zero-dim. ideal in Q(a)[x_1,..,x_n],
    1413 Roots and Factorization of univariate polynomials over Q(a)[t]
    1514 where a is an algebric number. Written in the frame of the
    1615 diploma thesis (advisor: Prof. Gert-Martin Greuel) 'Computations of moduli
    17  spaces of semiquasihomogenous singularities and an implementation in Singular'
     16 spaces of semiquasihomogenous singularities and an implementation in Singular'.
    1817 This library is meant as a preliminary extension of the functionality
    1918 of Singular for univariate factorization of polynomials over simple algebraic
     
    2625 EGCD(f, g)    gcd over an algebraic extension field of Q
    2726 Factor(f)    factorization of f over an algebraic extension field
    28  InvertNumber(c)  inverts an element of an algenraic extension field
    29  LinearZeroSet(I)  find the linear (partial) solution of I
    3027 Quotient(f, g)    quotient q  of f w.r.t. g (in f = q*g + remainder)
    3128 Remainder(f,g)    remainder of the division of f by g
     
    3734 EGCDMain(f, g)    gcd over an algebraic extension field of Q
    3835 FactorMain(f)    factorization of f over an algebraic extension field
    39  InvertNumberMain(c)  inverts an element of an algenraic extension field
     36 InvertNumberMain(c)  inverts an element of an algebraic extension field
    4037 QuotientMain(f, g)  quotient of f w.r.t. g
    4138 RemainderMain(f,g)  remainder of the division of f by g
     
    4441 ContainedQ(data, f)  f in data ?
    4542 SameQ(a, b)    a == b (list a,b)
    46  TransferRing()    create a new basering (to use ...Main())
    47  NewBaseRing()    create a new basering (return from  ...Main())
    48  SimplifyData(data)  reduces entries of data w.r.t. mpoly
    49  SimplifyPoly(f)  reduces coefficients of f w.r.t. mpoly
    50  SimplifySolution(sol)  reduces the entries of sol w.r.t. the ideal mpoly
    5143";
    5244
     
    6860// Improvement :
    6961// a main problem is the growth of the coefficients. Try Roots(x7 - 1)
    70 // retrurn ideal mpoly !
     62// return ideal mpoly !
    7163// mpoly is not monic, comes from primitive_extra
    7264
     
    8678
    8779proc Roots(poly f)
    88 "USAGE:   Roots(f); poly f
    89 PUROPSE: compute all roots of f in a finite extension of the groundfield
     80"USAGE:   Roots(f); where f is a polynomial
     81PURPOSE: compute all roots of f in a finite extension of the ground field
    9082         without multiplicities.
    9183RETURN:  ring, a polynomial ring over an extension field of the ground field,
    92          containing a list 'roots', poly 'newA', poly 'f':
    93          - 'roots' is the list of roots of the polynomial f (no multiplicities)
    94          - if the groundfield is Q(a') and the extension field is Q(a), then
    95          'newA' is the representation of a' in Q(a). If the basering
    96          contains a parameter 'a' and the minpoly remains unchanged then
    97          'newA' = 'a'. If the basering does not contain a parameter then
    98          'newA' = 'a' (default).
    99          - 'f' is the polynomial f in  Q(a) (a' being substituted by newA)
     84         containing a list 'roots' and polynomials 'newA' and 'f':
     85  @format
     86  - 'roots' is the list of roots of the polynomial f (no multiplicities)
     87  - if the groundfield is Q(a') and the extension field is Q(a), then
     88    'newA' is the representation of a' in Q(a).
     89    If the basering contains a parameter 'a' and the minpoly remains unchanged
     90    then 'newA' = 'a'.
     91    If the basering does not contain a parameter then 'newA' = 'a' (default).
     92  - 'f' is the polynomial f in Q(a) (a' being substituted by 'newA')
     93  @end format
    10094ASSUME:  ground field to be Q or a simple extension of Q given by a minpoly
    10195EXAMPLE: example  Roots; shows an example
     
    164158
    165159proc RootsMain(poly f)
    166 "USAGE:   RootsMain(f); poly f
    167 PURPOSE: compute all roots of f in a finite extension of the groundfield
     160"USAGE:   RootsMain(f); where f is a polynomial
     161PURPOSE: compute all roots of f in a finite extension of the ground field
    168162         without multiplicities.
    169163RETURN:  list, all entries are polynomials
    170          _[1] = roots of f, each entry is a polynomial
    171          _[2] = 'newA'  - if the groundfield is Q(a') and the extension field
    172                 is Q(a), then 'newA' is the representation of a' in Q(a)
    173          _[3] = minpoly of the algebraic extension of the groundfield
    174 ASSUME:  basering = Q[x,a] ideal mpoly must be defined, it might be 0 !
     164  @format
     165  _[1] = roots of f, each entry is a polynomial
     166  _[2] = 'newA' - if the groundfield is Q(a') and the extension field
     167         is Q(a), then 'newA' is the representation of a' in Q(a)
     168  _[3] = minpoly of the algebraic extension of the groundfield
     169  @end format
     170ASSUME:  basering = Q[x,a] ideal mpoly must be defined, it might be 0!
    175171NOTE:    might change the ideal mpoly !!
    176172EXAMPLE: example  Roots; shows an example
     
    304300
    305301proc ZeroSet(ideal I, list #)
    306 "USAGE:   ZeroSetMain(ideal I [, int opt]); ideal I, int opt
    307 PUROPSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
     302"USAGE:   ZeroSet(I [,opt] ); I=ideal, opt=integer
     303PURPOSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
    308304         of the groundfield.
    309305RETURN:  ring, a polynomial ring over an extension field of the ground field,
    310          containing a list 'zeroset', a polynomial 'newA', and an ideal 'id'.
    311          - 'zeroset'  is list of the zeros of the ideal 'I', each zero is
    312            an ideal.
    313          - if the groundfield is Q(a') and the extension field is Q(a), then
    314          'newA' is the representation of a' in Q(a).  If the basering
    315          contains a parameter 'a' and the minpoly remains unchanged then
    316          'newA' = 'a'. If the basering does not contain a parameter then
    317          'newA' = 'a' (default).
    318          - 'id' is the ideal 'I'  in Q(a)[x_1,...] (a' substituted by 'newA')
     306         containing a list 'zeroset', a polynomial 'newA', and an
     307         ideal 'id':
     308  @format
     309  - 'zeroset' is the list of the zeros of the ideal I, each zero is an ideal.
     310  - if the groundfield is Q(a') and the extension field is Q(a), then
     311    'newA' is the representation of a' in Q(a).
     312    If the basering contains a parameter 'a' and the minpoly remains unchanged
     313    then 'newA' = 'a'.
     314    If the basering does not contain a parameter then 'newA' = 'a' (default).   
     315  - 'id' is the ideal I in Q(a)[x_1,...] (a' substituted by 'newA')
     316  @end format
    319317ASSUME:  dim(I) = 0, and ground field to be Q or a simple extension of Q given
    320318         by a minpoly.
     
    406404
    407405proc InvertNumberMain(poly f)
    408 "USAGE:   InvertNumberMain(f); poly f
     406"USAGE:   InvertNumberMain(f); where f is a polynomial
    409407PURPOSE: compute 1/f if f is a number in Q(a) i.e., f is represented by a
    410408         polynomial in Q[a].
    411409RETURN:  poly 1/f
    412 ASSUME:  basering = Q[x_1,...,x_n,a], ideal 'mpoly' must be defined and != 0 !
     410ASSUME:  basering = Q[x_1,...,x_n,a], ideal mpoly must be defined and != 0 !
    413411"
    414412{
     
    449447proc LeadTerm(poly f, int i)
    450448"USAGE:   LeadTerm(f); poly f, int i
    451 PUROPSE: compute the leading coef and term of f w.r.t var(i), where the last
     449PURPOSE: compute the leading coef and term of f w.r.t var(i), where the last
    452450         ring variable is treated as a parameter.
    453451RETURN:  list of polynomials
     
    469467
    470468proc Quotient(poly f, poly g)
    471 "USAGE:   Quotient(f, g); poly f, g;
    472 PUROPSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < g
     469"USAGE:   Quotient(f, g); where f,g are polynomials;
     470PURPOSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < deg(g)
    473471RETURN:  list of polynomials
    474          _[1] = quotient  q
    475          _[2] = remainder r
     472  @format
     473  _[1] = quotient  q
     474  _[2] = remainder r
     475  @end format
    476476ASSUME:  basering = Q[x] or Q(a)[x]
    477477EXAMPLE: example  Quotient; shows an example
     
    503503
    504504proc QuotientMain(poly f, poly g)
    505 "USAGE:   QuotientMain(f, g); poly f, g
    506 PUROPSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < g
     505"USAGE:   QuotientMain(f, g); where f,g are polynomials
     506PURPOSE: compute the quotient q and remainder r s.t. f = g*q + r, deg(r) < deg(g)
    507507RETURN:  list of polynomials
    508          _[1] = quotient  q
    509          _[2] = remainder r
    510 ASSUME:  basering = Q[x,a] and ideal 'mpoly' is defined (it might be 0),
    511          this represents the ring Q(a)[x] together with 'minpoly'.
     508  @format
     509  _[1] = quotient  q
     510  _[2] = remainder r
     511  @end format
     512ASSUME:  basering = Q[x,a] and ideal mpoly is defined (it might be 0),
     513         this represents the ring Q(a)[x] together with its minimal polynomial.
    512514EXAMPLE: example  Quotient; shows an example
    513515"
     
    527529
    528530proc Remainder(poly f, poly g)
    529 "USAGE:   Remainder(f, g); poly f, g
    530 PUROPSE: compute the remainder of the division of f by g, i.e. a polynomial r
    531          s.t. f = g*q + r, deg(r) < g.
     531"USAGE:   Remainder(f, g); where f,g are polynomials
     532PURPOSE: compute the remainder of the division of f by g, i.e. a polynomial r
     533         s.t. f = g*q + r, deg(r) < deg(g).
    532534RETURN:  poly
    533535ASSUME:  basering = Q[x] or Q(a)[x]
     
    557559
    558560proc RemainderMain(poly f, poly g)
    559 "USAGE:   RemainderMain(f, g); poly f, g
    560 PUROPSE: compute the remainder r s.t. f = g*q + r, deg(r) < g
     561"USAGE:   RemainderMain(f, g); where f,g are polynomials
     562PURPOSE: compute the remainder r s.t. f = g*q + r, deg(r) < deg(g)
    561563RETURN:  poly
    562 ASSUME:  basering = Q[x,a] and ideal 'mpoly' is defined (it might be 0),
    563          this represents the ring Q(a)[x] together with 'minpoly'.
     564ASSUME:  basering = Q[x,a] and ideal mpoly is defined (it might be 0),
     565         this represents the ring Q(a)[x] together with its minimal polynomial.
    564566"
    565567{
     
    579581
    580582proc EGCD(poly f, poly g)
    581 "USAGE:   EGCDMain(f, g); poly f, g
    582 PUROPSE: compute the polynomial gcd of f and g over Q(a)[x]
    583 RETURN:  poly h s.t. h is a greatest common divisor of f and g (not nec. monic)
     583"USAGE:   EGCD(f, g); where f,g are polynomials
     584PURPOSE: compute the polynomial gcd of f and g over Q(a)[x]
     585RETURN:  polynomial h s.t. h is a greatest common divisor of f and g (not nec.
     586         monic)
    584587ASSUME:  basering = Q(a)[t]
    585588EXAMPLE: example  EGCD; shows an example
     
    609612
    610613proc EGCDMain(poly f, poly g)
    611 "USAGE:   EGCDMain(f, g); poly f, g
    612 PUROPSE: compute the polynomial gcd of f and g over Q(a)[x]
     614"USAGE:   EGCDMain(f, g); where f,g are polynomials
     615PURPOSE: compute the polynomial gcd of f and g over Q(a)[x]
    613616RETURN:  poly
    614 ASSUME:  basering = Q[x,a] and ideal 'mpoly' is defined (it might be 0),
    615          this represents the ring Q(a)[x] together with 'minpoly'.
     617ASSUME:  basering = Q[x,a] and ideal mpoly is defined (it might be 0),
     618         this represents the ring Q(a)[x] together with its minimal polynomial.
    616619EXAMPLE: example EGCD; shows an example
    617620"
     
    636639proc MEGCD(poly f, poly g, int varIndex)
    637640"USAGE:   MEGCD(f, g, i); poly f, g; int i
    638 PUROPSE: compute  the polynomial gcd of f and g in the i'th variable
     641PURPOSE: compute  the polynomial gcd of f and g in the i'th variable
    639642RETURN:  poly
    640643ASSUME:  f, g are polynomials in var(i), last variable is the algebraic number
     
    670673
    671674proc SQFRNorm(poly f)
    672 "USAGE:   SQFRNorm(f); poly f
    673 PUROPSE: compute the norm of the squarefree polynomial f in Q(a)[x].
    674 RETURN:  list
    675          _[1] = squarefree norm of g (poly)
    676          _[2] = g (= f(x - s*a)) (poly)
    677          _[3] = s (int)
     675"USAGE:   SQFRNorm(f); where f is a polynomial
     676PURPOSE: compute the norm of the squarefree polynomial f in Q(a)[x].
     677RETURN:  list with 3 entries
     678  @format
     679  _[1] = squarefree norm of g (poly)
     680  _[2] = g (= f(x - s*a)) (poly)
     681  _[3] = s (int)
     682  @end format
    678683ASSUME:  f must be squarefree, basering = Q(a)[x] and minpoly != 0.
    679684NOTE:    the norm is an element of Q[x]
     
    702707
    703708proc SQFRNormMain(poly f)
    704 "USAGE:   SQFRNorm(f); poly f
    705 PUROPSE: compute the norm of the squarefree polynomial f in Q(a)[x].
    706 RETURN:  list
    707          _[1] = squarefree norm of g (poly)
    708          _[2] = g (= f(x - s*a)) (poly)
    709          _[3] = s (int)
    710 ASSUME:  f must be squarefree, basering = Q[x,a] and ideal 'mpoly' is equal to
     709"USAGE:   SQFRNorm(f); where f is a polynomial
     710PURPOSE: compute the norm of the squarefree polynomial f in Q(a)[x].
     711RETURN:  list with 3 entries
     712  @format
     713  _[1] = squarefree norm of g (poly)
     714  _[2] = g (= f(x - s*a)) (poly)
     715  _[3] = s (int)
     716  @end format
     717ASSUME:  f must be squarefree, basering = Q[x,a] and ideal mpoly is equal to
    711718         'minpoly',this represents the ring Q(a)[x] together with 'minpoly'.
    712719NOTE:   the norm is an element of Q[x]
     
    752759
    753760proc Factor(poly f)
    754 "USAGE:   Factor(f); poly f
    755 PUROPSE: compute the factorization of the squarefree poly f over Q(a)[t], minpoly  = p(a).
    756 RETURN:  list
    757          _[1] = factors (monic), first entry is the leading coefficient
    758          _[2] = multiplicities (not yet)
    759 ASSUME:  basering must be the univariate polynomial ring over a field which
     761"USAGE:   Factor(f); where f is a polynomial
     762PURPOSE: compute the factorization of the squarefree poly f over Q(a)[t]
     763RETURN:  list with two entries
     764  @format
     765  _[1] = factors (monic), first entry is the leading coefficient
     766  _[2] = multiplicities (not yet implemented)
     767  @end format
     768ASSUME:  basering must be the univariate polynomial ring over a field, which
    760769         is Q or a simple extension of Q given by a minpoly.
    761 NOTE:    if basering = Q[t] then this is the built-in 'factorize'.
     770NOTE:    if basering = Q[t] then this is the built-in @code{factorize}
    762771EXAMPLE: example  Factor; shows an example
    763772"
     
    788797
    789798proc FactorMain(poly f)
    790 "USAGE:   FactorMain(f); poly f
    791 PUROPSE: compute the factorization of the squarefree poly f over Q(a)[t],
     799"USAGE:   FactorMain(f); where f is a polynomial
     800PURPOSE: compute the factorization of the squarefree poly f over Q(a)[t],
    792801         minpoly  = p(a).
    793 RETURN:  list
    794          _[1] = factors, first is a constant
    795          _[2] = multiplicities (not yet)
    796 ASSUME:  basering = Q[x,a], represents Q(a)[x] and minpoly.
    797          ideal mpoly must be defined, it might be 0 !
     802RETURN:  list with 2 entries
     803  @format
     804  _[1] = factors, first is a constant
     805  _[2] = multiplicities (not yet implemented)
     806  @end format
     807ASSUME:  basering = Q[x,a], representing Q(a)[x]. An ideal mpoly must
     808         be defined, representing the minimal polynomial (it might be 0!).
    798809EXAMPLE: example  Factor; shows an example
    799810"
     
    845856proc ZeroSetMain(ideal I, int primDecQ)
    846857"USAGE:   ZeroSetMain(ideal I, int opt); ideal I, int opt
    847 PUROPSE: compute the zero-set of the zero-dim. ideal I, in a simple extension
     858PURPOSE: compute the zero-set of the zero-dim. ideal I, in a simple extension
    848859         of the groundfield.
    849860RETURN:  list
     
    934945proc ZeroSetMainWork(ideal id, intvec wt, int sVars)
    935946"USAGE:   ZeroSetMainWork(I, wt, sVars);
    936 PUROPSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
     947PURPOSE: compute the zero-set of the zero-dim. ideal I, in a finite extension
    937948         of the groundfield (without multiplicities).
    938949RETURN:  list, all entries are polynomials
     
    942953         _[4] = name of algebraic number (default = 'a')
    943954ASSUME:  basering = Q[x_1,x_2,...,x_n,a]
    944          ideal mpoly must be defined, it might be 0 !
     955         ideal mpoly must be defined, it might be 0!
    945956NOTE:    might change 'mpoly' !!
    946957EXAMPLE: example  IdealSolve; shows an example
     
    10981109proc NonLinearZeroSetMain(ideal I, intvec wt)
    10991110"USAGE:   ZeroSetMainWork(I, wt, sVars);
    1100 PUROPSE: solves the (nonlinear) univariate polynomials in I
     1111PURPOSE: solves the (nonlinear) univariate polynomials in I
    11011112         of the groundfield (without multiplicities).
    11021113RETURN:  list, all entries are polynomials
     
    11861197static proc ExtendSolutions(list solutions, list newSolutions)
    11871198"USAGE:   ExtendSolutions(sols, newSols); list sols, newSols;
    1188 PUROPSE: extend the entries of 'sols' by the entries of 'newSols',
     1199PURPOSE: extend the entries of 'sols' by the entries of 'newSols',
    11891200         each entry of 'newSols' is a number.
    11901201RETURN:  list
     
    12451256static proc SubsMapIdeal(list sol, list index, int opt)
    12461257"USAGE:   SubsMapIdeal(sol,index,opt); list sol, index; int opt;
    1247 PUROPSE: built an ideal I as follows.
     1258PURPOSE: built an ideal I as follows.
    12481259         if i is contained in 'index' then set I[i] = sol[i]
    12491260         if i is not contained in 'index' then
     
    12751286proc SimplifyZeroset(data)
    12761287"USAGE:   SimplifyZeroset(data); list data
    1277 PUROPSE: reduce the entries of the elements of 'data' w.r.t. the ideal 'mpoly'
     1288PURPOSE: reduce the entries of the elements of 'data' w.r.t. the ideal 'mpoly'
    12781289         'data' is a list of ideals/lists.
    12791290RETURN:  list
     
    12961307proc Variables(poly f, int n)
    12971308"USAGE:   Variables(f,n); poly f; int n;
    1298 PUROPSE: list of variables among var(1),...,var(n) which occur in f.
     1309PURPOSE: list of variables among var(1),...,var(n) which occur in f.
    12991310RETURN:  list
    13001311ASSUME:  n <= nvars(basering)
     
    13141325
    13151326proc ContainedQ(data, f, list #)
    1316 "USAGE:    ContainedQ(data, f [, opt]); list data; f is of any type, int opt
    1317 PUROPSE:  test if 'f' is an element of 'data'.
     1327"USAGE:    ContainedQ(data, f [, opt]); data=list; f=any type, opt=integer
     1328PURPOSE:  test if f is an element of data.
    13181329RETURN:   int
    1319           0 if 'f' not contained in 'data'
    1320           1 if 'f' contained in 'data'
    1321 OPTIONS:  opt = 0 : use '==' for comparing f with elements from data
    1322           opt = 1 : use 'SameQ' for comparing f with elements from data
     1330          0 if f not contained in data
     1331          1 if f contained in data
     1332OPTIONS:  opt = 0 : use '==' for comparing f with elements from data@*
     1333          opt = 1 : use @code{SameQ} for comparing f with elements from data
    13231334"
    13241335{
     
    13451356
    13461357proc SameQ(a, b)
    1347 "USAGE:    SameQ(a, b); list/intvec a, b;
    1348 PUROPSE:  test a == b elementwise, i.e., a[i] = b[i].
     1358"USAGE:    SameQ(a, b); a,b=list/intvec
     1359PURPOSE:  test a == b elementwise, i.e., a[i] = b[i].
    13491360RETURN:   int
    13501361          0 if a != b
     
    13741385static proc SimplifyPoly(poly f)
    13751386"USAGE:   SimplifyPoly(f); poly f
    1376 PUROPSE: reduces the coefficients of f w.r.t. the ideal 'moly' if they contain
     1387PURPOSE: reduces the coefficients of f w.r.t. the ideal 'moly' if they contain
    13771388         the algebraic number 'a'.
    13781389RETURN:  poly
     
    13991410static proc SimplifyData(data)
    14001411"USAGE:   SimplifyData(data); ideal/list data;
    1401 PUROPSE: reduces the entries of 'data' w.r.t. the ideal 'mpoly' if they contain
     1412PURPOSE: reduces the entries of 'data' w.r.t. the ideal 'mpoly' if they contain
    14021413         the algebraic number 'a'
    14031414RETURN:  ideal/list
     
    14231434static proc TransferRing(R)
    14241435"USAGE:   TransferRing(R);
    1425 PUROPSE: creates a new ring containing the same variables as R, but without
     1436PURPOSE: creates a new ring containing the same variables as R, but without
    14261437         parameters. If R contains a parameter then this parameter is added
    14271438         as the last variable and 'minpoly' is represented by the ideal 'mpoly'
     
    14571468static proc NewBaseRing()
    14581469"USAGE:   NewBaseRing();
    1459 PUROPSE: creates a new ring, the last variable is added as a parameter.
     1470PURPOSE: creates a new ring, the last variable is added as a parameter.
    14601471         minpoly is set to mpoly[1].
    14611472RETURN:  ring
Note: See TracChangeset for help on using the changeset viewer.