Affine
******

Definitions for Affine
======================

 -- Function: FAST_LINSOLVE (eqns,variables)
     Solves the linear system of equations EQNS for the variables VARIABLES  and returns a result suitable to SUBLIS.  The function is faster than linsolve for system of equations which are sparse.

 -- Function: GROBNER_BASIS (eqns)
     Takes as argument a macsyma list of equations and returns a grobner basis for them.  The function POLYSIMP may now be used to simplify other functions relative to the equations.

     GROBNER_BASIS([3*X^2+1,Y*X])$

     POLYSIMP(Y^2*X+X^3*9+2)==> -3*x+2

     Polysimp(f)==> 0 if and only if f is in the ideal generated by the EQNS  ie. if and only if f is a polynomial combination of the elements of EQNS.

 -- Function: SET_UP_DOT_SIMPLIFICATIONS (eqns,[check-thru-degree])
     The eqns are polynomial equations in non commutative variables. The value of CURRENT_VARIABLES is the list of variables used for computing degrees.  The equations must be homogeneous, in order for the procedure to terminate.

     If you have checked overlapping simplifications in DOT_SIMPLIFICATIONS above the degree of f, then the following is true: DOTSIMP(f)==> 0 if and only if f is in the ideal generated by the EQNS  ie. if and only if f is a polynomial combination of the elements of EQNS.

     The degree is that returned by NC_DEGREE.   This in turn is influenced by the weights of individual variables.

 -- Function: DECLARE_WEIGHT (var1,wt1,var2,wt2,...)
     Assigns VAR1 weight WT1, VAR2 weight wt2.. These are the weights used in computing NC_DEGREE.

 -- Function: NC_DEGREE (poly)
     Degree of a non commutative polynomial.  See DECLARE_WEIGHTS.

 -- Function: DOTSIMP (f)
     ==> 0 if and only if f is in the ideal generated by the EQNS  ie. if and only if f is a polynomial combination of the elements of EQNS.

 -- Function: FAST_CENTRAL_ELEMENTS (variables,degree)
     if SET_UP_DOT_SIMPLIFICATIONS has been previously done, finds the central polynomials in the variables in the given degree, For example:

          set_up_dot_simplifications([y.x+x.y],3);
          fast_central_elements([x,y],2);
          [y.y,x.x];

 -- Function: CHECK_OVERLAPS (degree,add-to-simps)
     checks the overlaps thru degree, making sure that you have sufficient simplification rules in each degree, for dotsimp to work correctly.  This process can be speeded up if you know before hand what the dimension of the space of monomials is. If it is of finite global dimension, then HILBERT should be used.  If you don't know the monomial dimensions, do not specify a RANK_FUNCTIION. An optional third argument RESET, false says don't bother to query about resetting things.

 -- Function: MONO (vari,n)
     VARI is a list of variables.   Returns the list of independent monomials relative to the current dot_simplifications, in degree N

 -- Function: MONOMIAL_DIMENSIONS (n)

     Compute the hilbert series through degreen n for the current algebra.

 -- Function: EXTRACT_LINEAR_EQUATIONS (List_nc_polys,monoms)

     Makes a list of the coefficients of the polynomials in list_nc_polys
     of the monoms.  MONOMS is a list of noncommutative monomials.   The
     coefficients should be scalars.   Use LIST_NC_MONOMIALS to build the list of
     monoms.

 -- Function: LIST_NC_MONOMIALS (polys_or_list)

     returns a list of the non commutative monomials occurring in a polynomial or a collection of polynomials.

 -- Function: PCOEFF (poly monom [variables-to-exclude-from-cof (list-variables monom)])

     This function is called from lisp level, and uses internal poly format.

          CL-MAXIMA>>(setq me (st-rat #$x^2*u+y+1$))
          (#:Y 1 1 0 (#:X 2 (#:U 1 1) 0 1))

          CL-MAXIMA>>(pcoeff me (st-rat #$x^2$))
          (#:U 1 1)

     Rule: if a variable appears in monom it must be to the exact power, and if it is in variables to exclude it may not appear unless it was in monom to the exact power.  (pcoeff pol 1 ..) will exclude variables like substituting them to be zero.

 -- Function: NEW-DISREP (poly)

     From lisp this returns the general maxima format for an arg which is in st-rat form:

          (displa(new-disrep (setq me (st-rat #$x^2*u+y+1$))))

                 2
          Y + U X  + 1

 -- Function: CREATE_LIST (form,var1,list1,var2,list2,...)

     Create a list by evaluating FORM with VAR1 bound to each element of LIST1, and for each such binding bind VAR2 to each element of LIST2,... The number of elements in the result will be length(list1)*length(list2)*... Each VARn must actually be a symbol--it will not be evaluated. The LISTn args will be evaluated once at the beginning of the iteration.

          (C82) create_list1(x^i,i,[1,3,7]);
          (D82) [X,X^3,X^7]

     With a double iteration:

          (C79) create_list([i,j],i,[a,b],j,[e,f,h]);
          (D79) [[A,E],[A,F],[A,H],[B,E],[B,F],[B,H]]

     Instead of LISTn two args maybe supplied each of which should evaluate to a number.   These will be the inclusive lower and upper bounds for the iteration.

          (C81) create_list([i,j],i,[1,2,3],j,1,i);
          (D81) [[1,1],[2,1],[2,2],[3,1],[3,2],[3,3]]

     Note that the limits or list for the j variable can depend on the current value of i.

 -- Variable: ALL_DOTSIMP_DENOMS

     if its value is FALSE the denominators encountered in getting dotsimps will not be collected.   To collect the denoms

          ALL_DOTSIMP_DENOMS:[];

     and they will be nconc'd onto the end of the list.