On May 27, 2007, at 2:21 PM, Michel wrote:

>> And I assume if you have a fraction a/b, where the system has
>> remembered some factorisation information about b, then if you compute
>> 1/(a/b) it throws that information away?
>>
> No it does not throw that information away. Internally elements of the
> ring
> are stored in "factored" form r_1^{e_1}...r_n^{e_n} (with a lazily
> evaluated
> cached product). This
> information is preserved under "mulltiplicative" operations.
> (multiplication, division, (mock)gcd, (mock)lcm). It is destroyed
> under additive operations.

Ah I see. That is quite interesting.

Well I have another idea, I'm not sure to what extent this is already 
implemented in your factor_cache.pyx, or to what extent it even makes 
sense. (I haven't actually looked at your code yet.)

It sounds like this factor caching thing actually has nothing to do 
with fraction fields as such. Rather it sounds like one could implement 
a wrapper around a generic ring which remembers factorisations of 
elements. I'm imagining something like

R = some ring
S = FactorCache(R)

So now S is a ring, whose elements are products of elements of R. 
Multiplication does the obvious thing, addition and subtraction I 
suppose checks for common factors and just expands the rest? (I suppose 
this is very much like the Factorization class already in SAGE, except 
it would support arithmetic. Or maybe the Factorization class already 
supports arithmetic, I don't know.)

Then you would just write

K = FractionField(S)

Would it even be necessary to write special code in the fraction field 
class if it was done this way? (Hmmm.... thinking aloud in public 
here....)

David


--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to