On Tue, Jan 12, 2010 at 03:58:32PM -0500, Jason Bandlow wrote:
> > phi is constructed from f, which itself can't be pickled:
> Thanks for your help on this!  

My pleasure :-)

> I now have a patch up at
> 
> http://trac.sagemath.org/sage_trac/ticket/7914
> 
> in case you want to see if I understood you. :)

Cooool! I'll look at this in detail soon.

In the mean time, here are a couple thoughts. Sorry, it would have
been best to raise them before your cleanup, but they came up while
browsing through the patch ...

 - do we want leading_term or lterm (less explicit, but used in most
   systems)? You might want to raise that on sage-devel.

 - self._monomial_coefficients is specific to the
   CombinatorialFreeModule implementation. But you can use directly
   x[k] to get the coefficient of k in an element x of a module with
   basis.

   By the way, at some point, we should have an
   ModulesWithBasis(...).example(), with a very minimal implementation
   to catch this kind of things in tests.

 - trailing_term could possibly be implemented in terms of leading_term(..., 
-cmp)
   (well, -cmp is not valid python but you see the idea)

 - trailing_term should return a term

   Now, we hit the question of what a term is, and what a monomial is.
   We currently use MuPAD's convention that x^3 is a term, while 2*x^3
   is a monomial. But other system use the reverse convention.

   It's kind of the last occasion we have to change that; it might
   actually be too late. Still, could you raise the issue on sage-devel?

 - a typical use case is:

   (support, coeff) = x.leading_blurb()

   It seems a waste to create a monomial as an element of the free
   module just to extract right after the support and coeff. Any idea
   on a good name for leading_blurb that would just return a pair?

   maybe x.leading_item, consistent with items/iteritems/... of dictionaries?

   Then, the other methods could be implemented in term of that low
   level function.

 - Suggestion: given how it is used, use an attribute self._upper set
   to True/False, rather than self.triangularity set to upper/lower.

   Alternative: handle the upper/lower logic once for all in the
   constructor by defining an attribute self._leading_term set to
   attrcall("leading_term", cmp) or attrcall("trailing_term", cmp).

 - move most of the code of _invert_on_basis into a public method
   self.preimage(x), and let _invert_on_basis(i) call 
self.preimage(codomain.term(i))

   This will open the door for later generalization to non injective
   triangular morphism, and partial preimages.

 - rename the private _invert_on_basis into a public method preimage

Thanks much!
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/
-- 
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