Singular Manual: coeffs

  | ### 5.1.12 coeffs `Syntax:` `coeffs (` poly_expression `,` ring_variable `)` `coeffs (` ideal_expression`,` ring_variable `)` `coeffs (` vector_expression`,` ring_variable `)` `coeffs (` module_expression`,` ring_variable `)` `coeffs (` poly_expression`,` ring_variable`,` matrix_name `)` `coeffs (` ideal_expression`,` ring_variable`,` matrix_name `)` `coeffs (` vector_expression`,` ring_variable`,` matrix_name `)` `coeffs (` module_expression`,` ring_variable`,` matrix_name `)` `Type:` matrix `Syntax:` `coeffs (` ring_expression `)` `Type:` cring `Purpose:` develops each polynomial of the first argument J as a univariate polynomial in the given ring_variable z, and returns the coefficients as a matrix M. With e denoting the maximal z-degree occurring in the polynomials of J, and d:=e+1, M = 103#103satisfies the following conditions: (i) If J is a single polynomial f, then M is a 104#104-matrix and 105#105,is the coefficient of 106#106in f. (ii) If J is an ideal with generators 107#107then M is a 108#108-matrix and 109#109,is the coefficient of 106#106in 110#110. (iii) If J is a k-dimensional vector with entries 107#107then M is a 111#111-matrix and 112#112,is the coefficient of 106#106in 110#110. (iV) If J is a module generated by s vectors 113#113of dimension k then M is a 114#114-matrix and 115#115,is the coefficient of 106#106in the j-th entry of 116#116. The optional third argument T can be used to return the matrix of powers of z such that matrix(J) = T*M holds in each of the previous four cases. `Note:` `coeffs` returns the coefficient 0 at the appropriate matrix entry if a monomial is not present, while `coef` considers only monomials which actually occur in the given expression. `Example:`
        ring r;
        poly f = (x+y)^3;
        poly g = xyz+z10y4;
        ideal i = f, g;
        matrix M = coeffs(i, y);
        print(M);
      ==> x3, 0,
      ==> 3x2,xz,
      ==> 3x, 0,
      ==> 1,  0,
      ==> 0,  z10
        vector v = [f, g];
        M = coeffs(v, y);
        print(M);
      ==> x3,
      ==> 3x2,
      ==> 3x,
      ==> 1,
      ==> 0,
      ==> 0,
      ==> xz,
      ==> 0,
      ==> 0,
      ==> z10
  `Syntax:` `coeffs (` ideal_expression`,` ideal_expression `)` `coeffs (` module_expression`,` module_expression `)` `coeffs (` ideal_expression`,` ideal_expression`,` product_of_ringvars `)` `coeffs (` module_expression`,` module_expression`,` product_of_ringvars `)` `Type:` matrix `Purpose:` expresses each polynomial of the first argument M as a sum 117#117,where the 118#118come from a specified set of monomials, the 119#119are from the underlying coefficient ring (or field), and the 120#120are powers of a specified ring variable x. The second parameter K provides the set of monomials which should be sufficient to generate all entries of M. Both M and K can be thought of as the matrices obtained by matrix(M) and matrix(K), respectively. (If M and K are given by ideals, then this matrix has just one row.) The optional parameter product_of_ringvars determines the variable x: It is expected to be either the product of all ring variables (then x is 1, and each polynomial will be expressed as 121#121,or product_of_ringvars is the product of all ring variables except one variable (which then determines x). If product_of_ringvars is omitted then x = 1 as default. If K contains all monomials that are necessary to express the entries of M, then the returned matrix A satisfies 122#122.Otherwise only a subset of entries of 123#123and M will coincide. In this case, the valid entries start at M[1,1] and run from left to right, top to bottom. `Note:` Note that in general not all entries of K*A and M will coincide, depending on the set of monomials provided by K. `Example:`
        ring r=32003,(x,y,z),dp;
        module M = [y3+x2z, xy], [-xy, y2+x2z];
        print(M);
      ==> y3+x2z,-xy,
      ==> xy,    x2z+y2
        module K = [x2, xy], [y3, xy], [xy, x];
        print(K);
      ==> x2,y3,xy,
      ==> xy,xy,x
        matrix A = coeffs(M, K, xy);   // leaving z as variable of interest
        print(A);   // attention: only the first row of M is reproduced by K*A
      ==> z,0,
      ==> 1,0,
      ==> 0,-1
  `Syntax:` `coeffs (` ring_expression `)` `Type:` cring `Purpose:` return the coefficient ring of the argument `Example:`
        ring R=QQ,x,dp;
        coeffs(R);
      ==> QQ
See coef; kbase.

User manual for Singular version 4.4.1, 2025, generated by texi2html.