lalitkumarj / OMSCategory

Sage Category implementation of OMS
1 stars 1 forks source link

Random families aren't random #57

Open rpollack9974 opened 11 years ago

rpollack9974 commented 11 years ago

Now that the random function is working more or less without crashing, I went on to try to get the ordinary basis function working. However, it seems that the random symbols aren't so random. In this example, they all have positive valuation. This must be caused by the "shift" part of the code which I haven't understood yet.

sage: p = 3 sage: N = 5 sage: r = 0 sage: M = 6 sage: var_prec = M sage: DD = FamiliesOfOverconvergentDistributions(r, base_coeffs=ZpCA(p, M), prec_cap=[M,var_prec]) sage: MM = FamiliesOfOMS(N, r, coefficients=DD, sign=-1)

sage: MM.random_element().valuation() 1 sage: MM.random_element().valuation() 1 sage: MM.random_element().valuation() 1 sage: MM.random_element().valuation() 1 sage: MM.random_element().valuation() 1 sage: MM.random_element().valuation() 1

rharron commented 11 years ago

I see where the problem is: the valuation of mu is taken before lowering its precision (and gives -1) and upon lowering its precision its valuation goes up. mu is supposed to have valuation 0 in the end, but because of its valuation increase it no longer does. Add to that that mu is the only value for which the valuation was 0.

I'm working on a fix now. It will be a bit tedious.

rharron commented 11 years ago

So, I fixed it, but the code you posted is still returning valuation 1. But this is why:

sage: MM = FamiliesOfOMS(N, r, coefficients=DD, sign=0) sage: Phis = MM.random_element() sage: Phis.valuation() 0 sage: Phis.minus_part().valuation() 1 sage: Phis.plus_part().valuation() 0

So, question: in generating something with sign +/- 1 we first generate a symbol called ret of sign 0; do you want the valuation of the returned plus/minus part to be renormalized to have the same valuation as ret? Or, less randomly, do you want all returned values of random_element() to have valuation 0? (This latter option seem like breaking randomness quite a bit...).

rpollack9974 commented 10 years ago

I guess we need to renormalize the plus and minus parts to have valuation 0.

I need to get back into the weeds to remember how this all works, but the function won't be at all useful if every time one asks it for a random symbol of sign -1 it returns something with positive valuation.