roed314 / OMS

Converting Rob Pollack's overconvergent modular symbols .sage code to .py and putting it in Sage
4 stars 4 forks source link

Print representation of zero distribution is weird #30

Open loefflerd opened 11 years ago

loefflerd commented 11 years ago

I would have expected an element of a dist space that was zero to available precision to print as something like

(O(5^4), O(5^3), O(5^2), O(5))

but instead it prints as

5^4 * ()

which seems bizarre.

mmasdeu commented 11 years ago

I think I can solve the problem. The last line in approx_module (distributions.py) should be:

    return self.base_ring()**max([M,1 + self.weight()])

I will push this change later (hopefully today), after I test that everything else is alright...

Oh, the rationale for this is that the first k+1 moments should be always kept (this is an issue badly explained in the papers I've seen written on the subject: athough technically what is done in the paper is correct, the filtration explained there is not suitable for computation. I can elaborate on this if what I just wrote makes no sense at all).

mmasdeu commented 11 years ago

The fix is a bit more complicated than what the previous comment implied. I am starting a new Issue for it.

loefflerd commented 11 years ago

I think this issue here is actually orthogonal to the other (far more important!) issue you've raised. This one here is not about how we store and calculate distributions, but just about how we print them; it's entirely an interface bug.

mmasdeu commented 11 years ago

You are right, that's why I ended up starting another issue. It all has to do with the normalize method that gets called in repr. Note that the repr method changes the value of self! (I think we should avoid Heisenberg's uncertainty coming up in Python/Sage)...