diff --git a/superelliptic/superelliptic_class.sage b/superelliptic/superelliptic_class.sage index 8ecb44f..2a4bc54 100644 --- a/superelliptic/superelliptic_class.sage +++ b/superelliptic/superelliptic_class.sage @@ -288,7 +288,7 @@ def reduction_form(C, g): g = FxRy(g(x = x1, y=y1)) for j in range(0, m): if j==0: - G = Rx(coff(g, 0)) + G = Fx(coff(g, 0)) g1 += FxRy(G) else: G = coff(g, j) diff --git a/superelliptic/superelliptic_form_class.sage b/superelliptic/superelliptic_form_class.sage index 4332557..c6bb9b2 100644 --- a/superelliptic/superelliptic_form_class.sage +++ b/superelliptic/superelliptic_form_class.sage @@ -37,10 +37,13 @@ class superelliptic_form: return str(g) + ' dx' return '('+str(g) + ') dx' - def __rmul__(self, constant): + def __rmul__(self, other): C = self.curve + F = C.base_ring omega = self.form - return superelliptic_form(C, constant*omega) + if other in F: + return superelliptic_form(C, other*omega) + return superelliptic_form(C, other.function*omega) def cartier(self): '''Computes Cartier operator on the form. Idea: y^m = f(x) -> y^(p^r - 1) = f(x)^M, where r = ord_p(m), @@ -175,7 +178,7 @@ class superelliptic_form: fct = reduction(C, Fxy(y^m*fct)) return superelliptic_form(C, fct/y^m) - def int(self): + def integral(self): '''Computes an "integral" of a form dg. Idea: y^m = f(x) -> y^(p^r - 1) = f(x)^M, where r = ord_p(m), M = (p^r - 1)/m. Thus h(x)/y^j dx = h(x) f(x)^(M*j)/y^(p^r * j) dx. Thus int(h(x)/y^j dx) = 1/y^(p^(r-1)*j) int(h(x) f(x)^(M*j) dx).''' C = self.curve diff --git a/superelliptic/superelliptic_function_class.sage b/superelliptic/superelliptic_function_class.sage index 570fb53..47f50b9 100644 --- a/superelliptic/superelliptic_function_class.sage +++ b/superelliptic/superelliptic_function_class.sage @@ -52,12 +52,13 @@ class superelliptic_function: def __mul__(self, other): C = self.curve - try: + F = C.base_ring + if isinstance(other, superelliptic_function): g1 = self.function g2 = other.function g = reduction(C, g1 * g2) return superelliptic_function(C, g) - except: + if isinstance(other, superelliptic_form): g1 = self.function g2 = other.form g = reduction(C, g1 * g2) diff --git a/superelliptic_drw/regular_form.sage b/superelliptic_drw/regular_form.sage index 193fd29..9766e67 100644 --- a/superelliptic_drw/regular_form.sage +++ b/superelliptic_drw/regular_form.sage @@ -15,7 +15,7 @@ class superelliptic_regular_form: C = self.curve return self.dx*C.dx + self.dy*C.y.diffn() - def int(self): + def integral(self): '''Regular integral. Works only for hyperelliptics.''' C = self.curve f = C.polynomial @@ -23,15 +23,18 @@ class superelliptic_regular_form: raise ValueError("Works only for hyperelliptics.") F = C.base_ring Rx. = PolynomialRing(F) + Fx = FractionField(Rx) Fxy, Rxy, x, y = C.fct_field if self.dx == 0*C.x and self.dy == 0*C.x: return 0*C.x #which = random.choice([0, 1]) - P = self.dx.function - Q = self.dy.function + RxRy. = PolynomialRing(Rx) + P = RxRy(self.dx.function) + Q = RxRy(self.dy.function) Py, Px = P.quo_rem(y) #P = y*Py + Px Qy, Qx = Q.quo_rem(y) - result = superelliptic_function(C, Rx(Px + 1/2*Qy*f.derivative()).integral()) + Py, Px, Qy, Qx, f = Rx(Py), Rx(Px), Rx(Qy), Rx(Qx), Rx(f) + result = superelliptic_function(C, Rx(Px + F(1/2)*Qy*f.derivative()).integral()) numerator = Rx(2*f*Py + f.derivative()*Qx) # Now numerator = 2W' f + W f'. We are looking for W. Then result is W*y. W = Rx(0) diff --git a/superelliptic_drw/superelliptic_drw_auxilliaries.sage b/superelliptic_drw/superelliptic_drw_auxilliaries.sage index 3f084d4..c6dafc7 100644 --- a/superelliptic_drw/superelliptic_drw_auxilliaries.sage +++ b/superelliptic_drw/superelliptic_drw_auxilliaries.sage @@ -5,7 +5,7 @@ def decomposition_g0_pth_power(fct): return (fct, 0*C.x) '''Decompose fct as g0 + A^p, if possible. Output: (g0, A).''' omega = fct.diffn().regular_form() - g0 = omega.int() + g0 = omega.integral() A = (fct - g0).pth_root() return (g0, A) @@ -25,7 +25,7 @@ def decomposition_omega0_hpdh(omega): return (omega, 0*C.x) omega1 = omega.cartier().cartier() omega1 = omega1.inv_cartier().inv_cartier() - fct = (omega.cartier() - omega1.cartier()).int() + fct = (omega.cartier() - omega1.cartier()).integral() return (omega1, fct) def decomposition_omega8_hpdh(omega, prec = 50): @@ -47,7 +47,7 @@ def decomposition_omega8_hpdh(omega, prec = 50): omega_analytic = superelliptic_function(C, omega_analytic)*Cv.diffn() omega8 = omega - omega_analytic dh = omega.cartier() - omega8.cartier() - h = dh.int() + h = dh.integral() return (omega8, h) def decomposition_g8_pth_power(fct, prec = 50): diff --git a/superelliptic_drw/superelliptic_witt.sage b/superelliptic_drw/superelliptic_witt.sage index 786ac8f..02e8d2f 100644 --- a/superelliptic_drw/superelliptic_witt.sage +++ b/superelliptic_drw/superelliptic_witt.sage @@ -135,8 +135,8 @@ def auxilliary_derivative(P): C = P.curve F = C.base_ring Rx. = PolynomialRing(F) - P0 = Rx(P0) - P1 = Rx(P1) + P0 = Rx(P0.numerator()) + P1 = Rx(P1.numerator()) if P0 == 0: return superelliptic_drw_form(0*C.x, 0*C.dx, P.f) M = P0.monomials()[0] diff --git a/superelliptic_drw/tests/decomposition_into_g0_g8_tests.sage b/superelliptic_drw/tests/decomposition_into_g0_g8_tests.sage index 9963f4a..59544e1 100644 --- a/superelliptic_drw/tests/decomposition_into_g0_g8_tests.sage +++ b/superelliptic_drw/tests/decomposition_into_g0_g8_tests.sage @@ -6,6 +6,8 @@ f = x^3 - x C = superelliptic(f, m) Rxy. = PolynomialRing(F, 2) omega = (((2*C.x^18 + 2*C.x^16 + 2*C.x^14 + 2*C.x^10 + 2*C.x^8 + 2*C.x^4 + 2*C.x^2 + 2*C.one)/(C.x^13 + C.x^11 + C.x^9))*C.y) * C.dx -print(decomposition_omega0_omega8(aux.omega)[0] - decomposition_omega0_omega8(aux.omega)[1] == omega and decomposition_omega0_omega8(aux.omega)[0].is_regular_on_U0() and decomposition_omega0_omega8(aux.omega)[1].is_regular_on_Uinfty()) +print(decomposition_omega0_omega8(omega)[0] - decomposition_omega0_omega8(omega)[1] == omega and decomposition_omega0_omega8(omega)[0].is_regular_on_U0() and decomposition_omega0_omega8(omega)[1].is_regular_on_Uinfty()) + h = ((C.x^10 + C.x^8 + C.x^6 + 2*C.x^4 + 2*C.x^2 + 2*C.one)/C.x^6)*C.y +print(decomposition_g0_g8(h)) print(decomposition_g0_g8(h)[0] - decomposition_g0_g8(h)[1] + decomposition_g0_g8(h)[2] == h and decomposition_g0_g8(h)[0].function in Rxy and decomposition_g0_g8(h)[1].expansion_at_infty().valuation() >= 0) \ No newline at end of file diff --git a/tests.sage b/tests.sage index 74cb3a1..6dd5760 100644 --- a/tests.sage +++ b/tests.sage @@ -9,23 +9,29 @@ #load('superelliptic/tests/p_rank_test.sage') #print("a-number test:") #load('superelliptic/tests/a_number_test.sage') -print("as_cover_test:") -load('as_covers/tests/as_cover_test.sage') -print("group_action_matrices_test:") -load('as_covers/tests/group_action_matrices_test.sage') -print("dual_element_test:") -load('as_covers/tests/dual_element_test.sage') -print("ith_component_test:") -load('as_covers/tests/ith_component_test.sage') -print("ith ramification group test:") -load('as_covers/tests/ith_ramification_gp_test.sage') -print("uniformizer test:") -load('as_covers/tests/uniformizer_test.sage') -print("ramification jumps test:") -load('as_covers/tests/ramification_jumps_test.sage') -print("diffn_test:") -load('as_covers/tests/diffn_test.sage') -print("Cartier test:") -load('as_covers/tests/cartier_test.sage') +#print("as_cover_test:") +#load('as_covers/tests/as_cover_test.sage') +#print("group_action_matrices_test:") +#load('as_covers/tests/group_action_matrices_test.sage') +#print("dual_element_test:") +#load('as_covers/tests/dual_element_test.sage') +#print("ith_component_test:") +#load('as_covers/tests/ith_component_test.sage') +#print("ith ramification group test:") +#load('as_covers/tests/ith_ramification_gp_test.sage') +#print("uniformizer test:") +#load('as_covers/tests/uniformizer_test.sage') +#print("ramification jumps test:") +#load('as_covers/tests/ramification_jumps_test.sage') +#print("diffn_test:") +#load('as_covers/tests/diffn_test.sage') +#print("Cartier test:") +#load('as_covers/tests/cartier_test.sage') print("Decomposition into g0, g8/ omega0, omega8 test:") -load('superelliptic_drw/tests/decomposition_into_g0_g8_tests.sage') \ No newline at end of file +load('superelliptic_drw/tests/decomposition_into_g0_g8_tests.sage') +print("Auxilliary decomposition test:") +load('superelliptic_drw/tests/auxilliary_decompositions_test.sage') +print("Superelliptic de Rham-Witt test:") +load('superelliptic_drw/tests/superelliptic_drw_tests.sage') + +