On May 2, 2009, at 8:42 PM, Alex Ghitza wrote:
>>>>> When an elliptic curve is created the code in the __init__
>>>>> function in
>>>>> ell_generic.py (lines 164-5) do cause a multivariate polynomial
>>>>> ring
>>>>> to be created. In this case it's a new ring each time as the base
>>>>> field is always a new field.
>>>
>>>> How is the multivariate polynomial ring created?
>>>
>>> First the projective plane is constructed, effectively by
>>> PP=ProjectiveSpace(2,K), and then the ring by PP.coordinate_ring(),
>>> which calls
>>> PolynomialRing(self.base_ring(),
>>> self.variable_names(),
>>> self.dimension_relative()+1)
>>> so in effect we call PolynomialRing(K).
>>>
>>> John
>>
>> Well, is there any way to avoid this? It seems like a bad thing to
>> waste a couple GB on rings that in the end aren't used any more once
>> the curve E is delete.
>>
>
> I can confirm (if there was any doubt) that one can try
>
> {{{
> for p in prime_range(upper):
> R.<x, y, z> = PolynomialRing(GF(p), 3)
> }}}
>
> and watch it eat 800MB of RAM.
>
> I can see good reasons why we want the current behaviour of
> "uniqueness of parents", and what we just saw here is a good reason
> why we might *not* want it. How can we reconcile this? Can we make
> it easy to turn off "uniqueness of parents" in some situations?
We can have uniqueness and collection--it's called weakrefs. I
suspect part of the problem is that the coercion model doesn't use
them enough (there's places I meant to go back to and add them in).
- Robert
--~--~---------~--~----~------------~-------~--~----~
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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---