lalitkumarj / OMSCategory

Sage Category implementation of OMS
1 stars 1 forks source link

Probably with accuracy in random OMS (i.e. not families) #54

Open rpollack9974 opened 11 years ago

rpollack9974 commented 11 years ago

The below code crashes. The problem appears to be that when the distribution err is created and coerced into CM the accuracy of the 1-st moment is lower than expected and so this coercion creates a distribution with too little accuracy.

sage: set_verbose(1) sage: D = OverconvergentDistributions(6,3,5) sage: MS = OverconvergentModularSymbols(11,coefficients=D) sage: Phi = MS.random_element() verbose 1 (134: modsym_OMS_space.py, random_element) There is a non-torsion generator verbose 1 (134: modsym_OMS_space.py, random_element) Working with precision 9 (M, p, k, gam_shift) = (5, 3, 6, 1) verbose 1 (134: modsym_OMS_space.py, random_element) M_in, new base ring R = 9, 3-adic Ring with capped absolute precision 9 verbose 1 (134: modsym_OMS_space.py, random_element) t after first random choices: (3^2 + 2_3^5 + 3^7 + 2_3^8 + O(3^9), 2 + 2_3 + 3^2 + 3^5 + 2_3^6 + 3^7 + O(3^8), 2 + 2_3 + 2_3^2 + 3^4 + 3^5 + O(3^7), 2 + 3 + 3^2 + 2_3^3 + 2_3^4 + 2_3^5 + O(3^6), 3 + 2_3^2 + 3^3 + 2_3^4 + O(3^5), 1 + 2_3 + 2_3^2 + 3^3 + O(3^4), 1 + 3^2 + O(3^3), 1 + O(3^2), 1 + O(3)) verbose 1 (134: modsym_OMS_space.py, random_element) err is: (O(3^8), 2 + 2_3^2 + 3^3 + 2_3^4 + 3^5 + O(3^7), O(3^6), O(3^5), O(3^4), O(3^3), O(3^2), O(3)) verbose 1 (134: modsym_OMS_space.py, random_element) The parent of this dist is Space of 3-adic distributions with k=6 action and precision cap 9 verbose 1 (134: modsym_OMS_space.py, random_element) Before adjusting: 0, (O(3^8), 2 + 2_3^3 + 3^4 + 2_3^5 + 3^6 + O(3^7), 1 + 2_3 + 3^4 + 2_3^5 + O(3^6), 2 + 3^2 + 3^3 + O(3^5), 1 + 3^3 + O(3^4), 2 + 3 + O(3^3), 1 + 2_3 + O(3^2), O(3)) verbose 1 (134: modsym_OMS_space.py, random_element) Shift before mu = 0 verbose 1 (134: modsym_OMS_space.py, random_element) About to solve diff_eqn with 0, (O(3^8), 2 + 2_3^3 + 3^4 + 2_3^5 + 3^6 + O(3^7), 1 + 2_3 + 3^4 + 2_3^5 + O(3^6), 2 + 3^2 + 3^3 + O(3^5), 1 + 3^3 + O(3^4), 2 + 3 + O(3^3)) verbose 1 (134: modsym_OMS_space.py, random_element) After normalize: About to solve diff_eqn with 0, (O(3^6), 2 + 2_3^3 + 3^4 + O(3^5), 1 + 2_3 + O(3^4), 2 + 3^2 + O(3^3), 1 + O(3^2), 2 + O(3)) verbose 1 (134: modsym_OMS_space.py, random_element) Check difference equation (right after): 3^4 * () verbose 1 (134: modsym_OMS_space.py, random_element) mu_val, mu_ordp, mu_moments and mu: 0, 0, (2 + 2_3^3 + O(3^4), 1 + 2_3 + 3^2 + O(3^3), 2 + 3 + O(3^2), 1 + O(3)), (2 + 2_3^3 + O(3^4), 1 + 2_3 + 3^2 + O(3^3), 2 + 3 + O(3^2), 1 + O(3)) verbose 1 (134: modsym_OMS_space.py, random_element) Desired M, mu's M: 5, 4

verbose 1 (134: modsym_OMS_space.py, random_element) mu.ordp, mu._moments and mu: 0, (2 + 2_3^3 + O(3^4), 1 + 2_3 + 3^2 + O(3^3), 2 + 3 + O(3^2), 1 + O(3)), (2 + 2_3^3 + O(3^4), 1 + 2_3 + 3^2 + O(3^3), 2 + 3 + O(3^2), 1 + O(3))

ValueError Traceback (most recent call last)

in () ----> 1 Phi = MS.random_element() /Applications/sage-5.7/local/lib/python2.7/site-packages/sage/modular/pollack_stevens/modsym_OMS_space.pyc in random_element(self, M) 277 verbose("Desired M, mu's M: %s, %s"%(M, mu.precision_relative())) 278 verbose("mu.ordp, mu._moments and mu: %s, %s, %s"%(mu.ordp, mu._moments, mu)) --> 279 mu = mu.reduce_precision_absolute(M) 280 mu.normalize() 281 verbose("Desired M, mu's M: %s, %s"%(M, mu.precision_relative())) /Applications/sage-5.7/local/lib/python2.7/site-packages/sage/modular/pollack_stevens/coeffmod_OMS_element.pyc in reduce_precision_absolute(self, new_prec) 740 #The other possible answer for the above example is 3 \* (2*3 + O(3^2), 2 + O(3)), but I don't think that's right since mu is indeed in Fil^2. 741 if new_prec > self.precision_absolute(): --> 742 raise ValueError("new_prec(=%s) must be less than absolute precision of self."%(new_prec)) 743 ordp = self.ordp 744 if new_prec - ordp <= 0: ValueError: new_prec(=5) must be less than absolute precision of self.
rpollack9974 commented 11 years ago

OK. I think I fixed this. I changed the line where t's precision is decreased by k_val + gam_shift to simply decreasing t's precision to _prec_for_solve_diff_eqn(M, p).

The above code works. Does this change seem okay?