Forgive the self-reply.
Looking at factorization.py I was all ready to fix all the problems I
could see -- using Sequence to get a common universe for the bases on
construction, cache this base_ring, only allow operations between
factorizations with the same base_ring, and so on.
But then I saw what appeared to be a totally weird example:
sage: F = Factorization([(ZZ^3, 2), (ZZ^2, 5)], cr=True); F
(Ambient free module of rank 2 over the principal ideal
domain Integer Ring)^5 *
(Ambient free module of rank 3 over the principal ideal
domain Integer Ring)^2
This bears no relation at all to what I thought the Factorization
class was for. Doing a search_src showed that this is designed in to
support splitting of modular symbols spaces (and similar).
This leaves a question almost certainly for William: is it really
sensible to have one class serve both as the structure to hold "prime
factorizations" for UFDs and other rings, as well as to hold lists of
subspaces with multiplicities?
If so, perhaps we need to refactor this to have a base class which
just handles the basics, with (at least) 2 derived classes, one for
rings factorizations and one for additive decompositions?
John
# I have added this posting to trac#2460 too.
2008/8/22 John Cremona <[EMAIL PROTECTED]>:
> I just created ticket #3927 and added a couple of patches implementing
> a few functions for the Factorization class (division, gcd and lcm).
> These are orthogonal to the problems discussed at #2460, but I may
> have a go at resolving those issues as well.
>
> There are some more silly things I discovered: (1) you can multiply
> two factorizations even if they are from totally different rings. (2)
> you can add and subtract factorizations, but the result is not
> factored so this seems rather redundant. (e.g. factor(-6)+factor(81)
> returns 75).
>
> John
>
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---