On Wed, Jan 13, 2010 at 04:47:11PM -0500, Jason Bandlow wrote:
> I didn't find this.

Oops, there it is!

For the record, I added an old file about sf by the way.

> But in any case, would it make sense to put it on a wiki somewhere?

Until it actually is implemented, yes, sure.

> This raises the larger point that I'm still not very clear on an
> efficient way to browse the 'Category API'.  Suggestions?

That's a very good point. And I don't have a good experience in that
since I currently know the category code by heart (though I very much
hope that this will change soon!). My best suggestion would be:

        sage: C = ModulesWithBasis(QQ)
        sage: C.parent_class.<tab>
        sage: C.element_class.<tab>

But I very much welcome feedback on how this works in practice.

Hopefully, Sphinx will eventually be good enough to offer a good
synthesis (which in theory is possible; javadoc works well for
browsing the rather big hierarchies of Java's library; but there is an
extra difficulty here due to the dynamic creation of the hierarchy).

> Well, in the 'many monomials' the same monomial could be repeated
> multiple times.  And why would anyone care about polynomials that
> don't have non-negative integer coefficients? :-)

I have indeed never seen such a polynomial, except in miscalculations :-)

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/
The support of x is the set of all elements of the basis with a
non-zero coefficient. A monomial is an element of V with a unique
non-zero coefficient. A term is a monomial with coefficient 1. Many
methods below only make sense when x has finite support.

We will add the following to polylib when they are not already defined
properly at the global level. Any better suggestions for support and
variations are welcome.

F : freeModule
x in F
s : index


   F::coeffRing         -> F.base_ring 
   F::basis             -> F.basis      or  .basis()  

   F::basisIndices
   F::basis::keys       -> F.basis.keys?

   # the coefficient of x on the index s 
   coeff(x,s)           -> x.coefficient(s)

   # Associative container operations:
   
   nterms(x) :          -> len(x)  / x.__len__()
   support(x):          -> x.keys() = x.support() // returns a list or a 
combintorial class (sorted w.r.t the internal order which might or might not be 
something meaningful depending on the domain)

   for i in x.support(<Order>):
       ...

   x[s] = x.coefficient(s)
       
   coeff(x, <Order>) :           -> x.coefficients(<Order>) a list of all 
non-zero coefficients

   # List of terms and monomials       
   terms(x, <Order>)    -> x.terms(<Order>) (or .monomials!!!)
   monomials(x, <Order>)-> x.monomials(<Order>) (or .terms!!!)
   
   poly2list(x):        -> __iter__: returns an iterator over pairs [index, 
coeff] // reverse of MuPAD!!!

   Order is a term order; can be an identifier or a function BxB->DOM_BOOL

   support(x, Order): the support of x as a sorted list wrt Order
   terms(x, Order) :  the sorted list of all terms of x wrt Order
   coeff(x, Order) :  the sorted list of all non-zero coefficients wrt Order
   monomials(x) :     the sorted list of all monomials of x wrt Order

   degreevec/lsupport/monomial2exponent/lexponent ?

   lsupport(x):         The biggest element in the support of x
   lsupport(x, Order):  The biggest element in the support of x w.r.t Order
   lterm(x):            The first term of x
   lterm(x, Order):     ...
   lmonomial(x):
   lmonomial(x, Order):

   ground: constant term -> l.constant_coefficient()

   reductum(x) in Cat::MonRing should be renamed to lmonomial(x, Rem)

   x.support[i]

   // Not essential
   nthsupport(x,n):   the n-th element in the support of x
   nthmonomial(x,n) : the n-th monomial of x
   nthterm(x,n) :     the n-th term of x
   nthcoeff(x,n) :    the n-th coefficient of x

   Idem, with Order option

   content(x):        gcd of the numerators/lcm of denominators!
                      (to be made clear in the documentation)
   primpart(x):       x/content(x) : (needs to be made overloadable)

   mapcoeffs(x,f) :   f map elements of R to elements of R; 0->0
                      applies the function f to every coefficient in x,
                      Maybe add an option which certifies that f
                      will never be zero on a non-zero elements to skip
                      the tests. NoZeroCheck ?
   mapterms(x, f) :   f map a term to a valid term
                      applies the function f to all terms of x
   multcoeffs(x,c):   scalar multiplication
                      For non-commutative base rings, should this be
                      left or right multiplication ?
                      See also: smult(lambda, x) in Dom::FreeModule

   degree(x):         we assume that the basis as some degree method
                      returns the maximal degree in the support of x
   degreevec(x):      we assume that the basis as some degree method
                      returns the maximal degree in the support of x
   isMonomial(x,f):   (??? defined in Cat::MonRing)
                      not used anywhere and useless anyway


More specifically for polynomial domains:

   Type::Polynomial      -> Type::PolyOf should be extended to accept
                      all polynomial domains in the library
   Type::PolynomialDomain:
                      accept Cat::PolynomialDomain,
                      (polylib::Poly([x], Expr))::allEntries()

   constructor(x):    returns dom of x if x is not a DOM_POLY, and
                      polylib::Poly(variables(x), coeffRing(x))

   variables(x):      The list of the variables of x (should be overloadable)
                      <>indets: do not return the parameters
   variables(V):      The list of the variables of x

   map ?              semantic ?
   simplify ?

==============================================================================
Constructors for free modules:
==============================

one
isone

zero
iszero

term ?
monomial ?
generate/generate1 ? Allows for extensions; see lib/DOMAINS/DOMAIN/FreeMod.mu

==============================================================================
Other standard entries for Free modules:
========================================

characteristic
rank/unrank of basis elements






















==============================================================================
Tools for constructing operators from simpler ones using various
properties (associativity, linearity, bilinearity, ...):
(Discussed with Stefan, Christopher, Klaus)

Define a new operators library, containing things like:
 - makeLinear(f, Zero=0, Support=support, Coeff=coeff, NTerms=nterms)
      option escape
   begin
          proc(x)
          begin
              if nterms(x)=0 then
                  zero
              else
                  _plus(f(t)*coeff(t,c) $ t in support(x))
              end_if;
          end;
      end;
    - makeBilinear (See Dom::FreeModule_Table)
    - makeMultilinear
    - makeAlgebraProduct (allow for the multiplication by the ground ring

    - makeAssociative (See Dom::FreeModule_Table & misc::genassop)
    - makeCommutativeAssociative (see Cat::Set)
    - makePower(mult, zero, inverse)  (obsoletes domains:repeatedSquaring)

   In a first implementation, just use the overloaded functions coeff,
   support and nterms. Allowing for user provided functions is not
   necessarily useful, and can be added later if needed. We should
   just pass down the zero of the image set, and the one for
   makeAssociative.

   Issue: type coercion, especially in makeAlgebraProduct. TODO.

==============================================================================
Design of domains such as free modules, and standardization with
existing polynomial domains:
(Discussed with Stephan, Christopher, Klaus)

In the following, V is a domain for a vector space of elements x
written in some basis B. For example, V can be

 - DOM_POLY                             B: integers or exponnent vectors
 - polylib::Poly([x], Expr)             B: integers
 - Dom::UnivariatePolynomial(q)         B: integers
 - Dom::DistributedPolynomial(q)
 - Series::Puiseux                      B: integers
 - Dom::FreeModule(...)
 - Dom::FreeModule_Table()
 - Cat::MonoidRing(R,S)
 - Cat::FiniteMonoidRing(R,S)
 - combinatorial algebras               B: some combinatorial structures
 - ...


------------------------------------------------------------------------------
Manipulation
============

makeIntegral ?
monic

normalfBasis ? normal form of a basis element

------------------------------------------------------------------------------
Conversions
===========

poly ? as a DOM_POLY
convert

TeX             (see Dom::DistributedPolynomial)
TeXident        (see Dom::DistributedPolynomial)
TeXTerm         (see Dom::DistributedPolynomial)
TeXCoeff        (see Dom::DistributedPolynomial)

print           (see Dom::DistributedPolynomial)
printMonomial   (see Dom::DistributedPolynomial)
printTerm       (see Dom::DistributedPolynomial)

------------------------------------------------------------------------------
Arithmetical operations
=======================

_mult

Problems:
=========

Should _mult be defined at the category level ?

intmult(x, i): scalar multiplication by an integer

_mult2, mult2 ? binary multiplication

makeBilinearProduct ?
makeEndomorphism
makeEndomorphismPermutation ?

------------------------------------------------------------------------------
linear algebra
==============

------------------------------------------------------------------------------
Basis
=====

straighten / straightenBasis
expr / exprBasis
mult2 / mult2Basis
one / oneBasis
in ModulesWithBasis?

 - About modules with several bases:
   upon pickling, should save the morphisms, so as to keep their cache

 - Defining a morphism by "structure coefficients"

 - Defining the inverse of a morphism by
   - triangularity
     ModulesWithBasis -> Hom -> Elements

     def inverse_by_triangularity(self, inverse_on_support = identity, 
order=operator.leq, cache):
         ...

   - grading / filtration / ...
     GradedModulesWithBasis -> Hom -> Elements (really about block morphisms)
     def inverse temporary in modules with basis

     def inverse_by_subspace(self, subdomain_basis_indices, 
subcodomain_basis_indices):
         """
         Let lambda a basis index of the codomain.
         subdomain_basis_indices(lambda) and subcodomain_basis_indices(lambda) 
should
         return two sets A and B of indices, such that f is invertible from
         <A> -> <B>
         """

     def inverse_by_grading(self):
         sub(co)domain_basis_indices obtained by asking respectively for
         domain.basis().subset(size = lambda.size()) # knowing that this is not 
yet implemented ...
         codomain.basis().subset(size = lambda.size())
         (and assert the two are the same size)

     def inverse_by_filtration(self):
         sub(co)domain_basis_indices obtained by asking respectively for
         domain.basis().subset(max_size = lambda.size())
         codomain.basis().subset(max_size = lambda.size())


 - Adding a new basis
    - morphism to some preexisting basis

 - Having the infrastructure take care of adding the inverse morphism
   use transitivity for all the other conversions

 - Refactor sf to use the Sage coercion model

 - 
-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.


Reply via email to