Open loefflerd opened 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).
The fix is a bit more complicated than what the previous comment implied. I am starting a new Issue for it.
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.
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)...
I would have expected an element of a dist space that was zero to available precision to print as something like
but instead it prints as
which seems bizarre.