DeRhamComputation/elementary_covers_of_superelliptic_curves.ipynb

78 KiB
Raw Blame History

class superelliptic:
    
    def __init__(self, f, m):
        Rx = f.parent()
        x = Rx.gen()
        F = Rx.base()        
        Rx.<x> = PolynomialRing(F)
        Rxy.<x, y> = PolynomialRing(F, 2)
        Fxy = FractionField(Rxy)
        self.polynomial = Rx(f)
        self.exponent = m
        self.base_ring = F
        self.characteristic = F.characteristic()
        r = Rx(f).degree()
        delta = GCD(r, m)
        
    def __repr__(self):
        f = self.polynomial
        m = self.exponent
        F = self.base_ring
        return 'Superelliptic curve with the equation y^' + str(m) + ' = ' + str(f)+' over ' + str(F)

    
    def basis_holomorphic_differentials_degree(self):
        f = self.polynomial
        m = self.exponent
        r = f.degree()
        delta = GCD(r, m)
        F = self.base_ring
        Rx.<x> = PolynomialRing(F)
        Rxy.<x, y> = PolynomialRing(F, 2)
        Fxy = FractionField(Rxy)
        #########basis of holomorphic differentials and de Rham

        basis_holo = []
        degrees0 = {}
        k = 0

        for j in range(1, m):
            for i in range(1, r):
                if (r*j - m*i >= delta):
                    basis_holo += [superelliptic_form(self, Fxy(x^(i-1)/y^j))]
                    degrees0[k] = (i-1, j)
                    k = k+1

        return(basis_holo, degrees0)

    def holomorphic_differentials_basis(self):
        basis_holo, degrees0 = self.basis_holomorphic_differentials_degree()
        return basis_holo
        
    def degrees_holomorphic_differentials(self):
        basis_holo, degrees0 = self.basis_holomorphic_differentials_degree()
        return degrees0

    def basis_de_rham_degrees(self):
        f = self.polynomial
        m = self.exponent
        r = f.degree()
        delta = GCD(r, m)
        F = self.base_ring
        Rx.<x> = PolynomialRing(F)
        Rxy.<x, y> = PolynomialRing(F, 2)
        Fxy = FractionField(Rxy)
        basis_holo = self.holomorphic_differentials_basis()
        basis = []
        for k in range(0, len(basis_holo)):
            basis += [superelliptic_cech(self, basis_holo[k], superelliptic_function(self, 0))]

        ## non-holomorphic elts of H^1_dR
        t = len(basis)
        degrees0 = {}
        degrees1 = {}
        for j in range(1, m):
            for i in range(1, r):
                if (r*(m-j) - m*i >= delta): 
                    s = Rx(m-j)*Rx(x)*Rx(f.derivative()) - Rx(m)*Rx(i)*f
                    psi = Rx(cut(s, i))
                    basis += [superelliptic_cech(self, superelliptic_form(self, Fxy(psi/y^j)), superelliptic_function(self, Fxy(m*y^(m-j)/x^i)))]
                    degrees0[t] = (psi.degree(), j)
                    degrees1[t] = (-i, m-j)
                    t += 1
        return basis, degrees0, degrees1

    def de_rham_basis(self):
        basis, degrees0, degrees1 = self.basis_de_rham_degrees()
        return basis

    def degrees_de_rham0(self):
        basis, degrees0, degrees1 = self.basis_de_rham_degrees()
        return degrees0

    def degrees_de_rham1(self):
        basis, degrees0, degrees1 = self.basis_de_rham_degrees()
        return degrees1    
    
    def is_smooth(self):
        f = self.polynomial
        if f.discriminant() == 0:
            return 0
        return 1
    
    def genus(self):
        r = self.polynomial.degree()
        m = self.exponent
        delta = GCD(r, m)
        return 1/2*((r-1)*(m-1) - delta + 1)
    
    def verschiebung_matrix(self):
        basis = self.de_rham_basis()
        g = self.genus()
        p = self.characteristic
        F = self.base_ring
        M = matrix(F, 2*g, 2*g)
        for i in range(0, len(basis)):
            w = basis[i]
            v = w.verschiebung().coordinates()
            M[i, :] = v
        return M
    
    def frobenius_matrix(self):
        basis = self.de_rham_basis()
        g = self.genus()
        p = self.characteristic
        F = self.base_ring
        M = matrix(F, 2*g, 2*g)
        
        for i in range(0, len(basis)):
            w = basis[i]
            v = w.frobenius().coordinates()
            M[i, :] = v
        return M

    def cartier_matrix(self):
        basis = self.holomorphic_differentials_basis()
        g = self.genus()
        p = self.characteristic
        F = self.base_ring
        M = matrix(F, g, g)
        for i in range(0, len(basis)):
            w = basis[i]
            v = w.cartier().coordinates()
            M[i, :] = v
        return M     

#    def p_rank(self):
#        return self.cartier_matrix().rank()
    
    def a_number(self):
        g = C.genus()
        return g - self.cartier_matrix().rank()
    
    def final_type(self, test = 0):
        Fr = self.frobenius_matrix()
        V = self.verschiebung_matrix()
        p = self.characteristic
        return flag(Fr, V, p, test)
    
def reduction(C, g):
    p = C.characteristic
    F = C.base_ring
    Rxy.<x, y> = PolynomialRing(F, 2)
    Fxy = FractionField(Rxy)
    f = C.polynomial
    r = f.degree()
    m = C.exponent
    g = Fxy(g)
    g1 = g.numerator()
    g2 = g.denominator()
    
    Rx.<x> = PolynomialRing(F)
    Fx = FractionField(Rx)
    FxRy.<y> = PolynomialRing(Fx)    
    (A, B, C) = xgcd(FxRy(g2), FxRy(y^m - f))
    g = FxRy(g1*B/A)
    
    while(g.degree(Rxy(y)) >= m):
        d = g.degree(Rxy(y))
        G = coff(g, d)
        i = floor(d/m)
        g = g - G*y^d + f^i * y^(d%m) *G
    
    return(FxRy(g))

def reduction_form(C, g):
    F = C.base_ring
    Rxy.<x, y> = PolynomialRing(F, 2)
    Fxy = FractionField(Rxy)
    f = C.polynomial
    r = f.degree()
    m = C.exponent
    g = reduction(C, g)

    g1 = Rxy(0)
    Rx.<x> = PolynomialRing(F)
    Fx = FractionField(Rx)
    FxRy.<y> = PolynomialRing(Fx)
    
    g = FxRy(g)
    for j in range(0, m):
        if j==0:
            G = coff(g, 0)
            g1 += FxRy(G)
        else:
            G = coff(g, j)
            g1 += Fxy(y^(j-m)*f*G)
    return(g1)
        
class superelliptic_function:
    def __init__(self, C, g):
        F = C.base_ring
        Rxy.<x, y> = PolynomialRing(F, 2)
        Fxy = FractionField(Rxy)
        f = C.polynomial
        r = f.degree()
        m = C.exponent
        
        self.curve = C
        g = reduction(C, g)
        self.function = g
        
    def __repr__(self):
        return str(self.function)
    
    def jth_component(self, j):
        g = self.function
        C = self.curve
        F = C.base_ring
        Rx.<x> = PolynomialRing(F)
        Fx.<x> = FractionField(Rx)
        FxRy.<y> = PolynomialRing(Fx)
        g = FxRy(g)
        return coff(g, j)
    
    def __add__(self, other):
        C = self.curve
        g1 = self.function
        g2 = other.function
        g = reduction(C, g1 + g2)
        return superelliptic_function(C, g)
    
    def __sub__(self, other):
        C = self.curve
        g1 = self.function
        g2 = other.function
        g = reduction(C, g1 - g2)
        return superelliptic_function(C, g)
    
    def __mul__(self, other):
        C = self.curve
        g1 = self.function
        g2 = other.function
        g = reduction(C, g1 * g2)
        return superelliptic_function(C, g)
    
    def __truediv__(self, other):
        C = self.curve
        g1 = self.function
        g2 = other.function
        g = reduction(C, g1 / g2)
        return superelliptic_function(C, g)

    def diffn(self):
        C = self.curve
        f = C.polynomial
        m = C.exponent
        F = C.base_ring
        g = self.function
        Rxy.<x, y> = PolynomialRing(F, 2)
        Fxy = FractionField(Rxy)
        g = Fxy(g)
        A = g.derivative(x)
        B = g.derivative(y)*f.derivative(x)/(m*y^(m-1))
        return superelliptic_form(C, A+B)

    
    def expansion_at_infty(self, i = 0, prec=10):
        C = self.curve
        f = C.polynomial
        m = C.exponent
        F = C.base_ring
        Rx.<x> = PolynomialRing(F)
        f = Rx(f)
        Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
        RptW.<W> = PolynomialRing(Rt)
        RptWQ = FractionField(RptW)
        Rxy.<x, y> = PolynomialRing(F)
        RxyQ = FractionField(Rxy)
        fct = self.function
        fct = RxyQ(fct)
        r = f.degree()
        delta, a, b = xgcd(m, r)
        b = -b
        M = m/delta
        R = r/delta
        while a<0:
            a += R
            b += M
        
        g = (x^r*f(x = 1/x))
        gW = RptWQ(g(x = t^M * W^b)) - W^(delta)
        ww = naive_hensel(gW, F, start = root_of_unity(F, delta)^i, prec = prec)
        xx = Rt(1/(t^M*ww^b))
        yy = 1/(t^R*ww^a)
        return Rt(fct(x = Rt(xx), y = Rt(yy)))
    
def naive_hensel(fct, F, start = 1, prec=10):
    Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
    RtQ = FractionField(Rt)
    RptW.<W> = PolynomialRing(RtQ)
    RptWQ = FractionField(RptW)
    fct = RptWQ(fct)
    fct = RptW(numerator(fct))
    #return(fct)
    #while fct not in RptW:
    #    print(fct)
    #    fct *= W
    alpha = (fct.derivative())(W = start)
    w0 = Rt(start)
    i = 1
    while(i < prec):
        w0 = w0 - fct(W = w0)/alpha + O(t^(prec))
        i += 1
    return w0

class superelliptic_form:
    def __init__(self, C, g):
        F = C.base_ring
        Rxy.<x, y> = PolynomialRing(F, 2)
        Fxy = FractionField(Rxy)
        g = Fxy(reduction_form(C, g))
        self.form = g
        self.curve = C      
        
    def __add__(self, other):
        C = self.curve
        g1 = self.form
        g2 = other.form
        g = reduction(C, g1 + g2)
        return superelliptic_form(C, g)
    
    def __sub__(self, other):
        C = self.curve
        g1 = self.form
        g2 = other.form
        g = reduction(C, g1 - g2)
        return superelliptic_form(C, g)
    
    def __repr__(self):
        g = self.form
        if len(str(g)) == 1:
            return str(g) + ' dx'
        return '('+str(g) + ') dx'

    def __rmul__(self, constant):
        C = self.curve
        omega = self.form
        return superelliptic_form(C, constant*omega)        
    
    def cartier(self):
        C = self.curve
        m = C.exponent
        p = C.characteristic
        f = C.polynomial
        F = C.base_ring
        Rx.<x> = PolynomialRing(F)
        Fx = FractionField(Rx)
        FxRy.<y> = PolynomialRing(Fx)
        Fxy = FractionField(FxRy)
        result = superelliptic_form(C, FxRy(0))
        mult_order = Integers(m)(p).multiplicative_order()
        M = Integer((p^(mult_order)-1)/m)
        
        for j in range(1, m):
            fct_j = self.jth_component(j)
            h = Rx(fct_j*f^(M*j))
            j1 = (p^(mult_order-1)*j)%m
            B = floor(p^(mult_order-1)*j/m)
            result += superelliptic_form(C, polynomial_part(p, h)/(f^B*y^(j1)))
        return result   
    
    def coordinates(self):
        C = self.curve
        F = C.base_ring
        m = C.exponent
        Rx.<x> = PolynomialRing(F)
        Fx = FractionField(Rx)
        FxRy.<y> = PolynomialRing(Fx)
        g = C.genus()
        degrees_holo = C.degrees_holomorphic_differentials()
        degrees_holo_inv = {b:a for a, b in degrees_holo.items()}
        basis = C.holomorphic_differentials_basis()
        
        for j in range(1, m):
            omega_j = Fx(self.jth_component(j))
            if omega_j != Fx(0):
                d = degree_of_rational_fctn(omega_j, F)
                index = degrees_holo_inv[(d, j)]
                a = coeff_of_rational_fctn(omega_j, F)
                a1 = coeff_of_rational_fctn(basis[index].jth_component(j), F)
                elt = self - (a/a1)*basis[index]
                return elt.coordinates() + a/a1*vector([F(i == index) for i in range(0, g)])
            
        return vector(g*[0])
    
    def jth_component(self, j):
        g = self.form
        C = self.curve
        F = C.base_ring
        Rx.<x> = PolynomialRing(F)
        Fx = FractionField(Rx)
        FxRy.<y> = PolynomialRing(Fx)
        Fxy = FractionField(FxRy)
        Ryinv.<y_inv> = PolynomialRing(Fx)
        g = Fxy(g)
        g = g(y = 1/y_inv)
        g = Ryinv(g)
        return coff(g, j)
    
    def is_regular_on_U0(self):
        C = self.curve
        F = C.base_ring
        m = C.exponent
        Rx.<x> = PolynomialRing(F)
        for j in range(1, m):
            if self.jth_component(j) not in Rx:
                return 0
        return 1
    
    def is_regular_on_Uinfty(self):
        C = self.curve
        F = C.base_ring
        m = C.exponent
        f = C.polynomial
        r = f.degree()
        delta = GCD(m, r)
        M = m/delta
        R = r/delta
        
        for j in range(1, m):
            A = self.jth_component(j)
            d = degree_of_rational_fctn(A, F)
            if(-d*M + j*R -(M+1)<0):
                return 0
        return 1

    def expansion_at_infty(self, i = 0, prec=10):
        g = self.form
        C = self.curve
        g = superelliptic_function(C, g)
        g = g.expansion_at_infty(i = i, prec=prec)
        x_series = superelliptic_function(C, x).expansion_at_infty(i = i, prec=prec)
        dx_series = x_series.derivative()
        return g*dx_series
            
class superelliptic_cech:
    def __init__(self, C, omega, fct):
        self.omega0 = omega
        self.omega8 = omega - fct.diffn()
        self.f = fct
        self.curve = C
        
    def __add__(self, other):
        C = self.curve
        return superelliptic_cech(C, self.omega0 + other.omega0, self.f + other.f)
    
    def __sub__(self, other):
        C = self.curve
        return superelliptic_cech(C, self.omega0 - other.omega0, self.f - other.f)

    def __rmul__(self, constant):
        C = self.curve
        w1 = self.omega0.form
        f1 = self.f.function
        w2 = superelliptic_form(C, constant*w1)
        f2 = superelliptic_function(C, constant*f1)
        return superelliptic_cech(C, w2, f2)    
    
    def __repr__(self):
        return "(" + str(self.omega0) + ", " + str(self.f) + ", " + str(self.omega8) + ")" 
    
    def verschiebung(self):
        C = self.curve
        omega = self.omega0
        F = C.base_ring
        Rx.<x> = PolynomialRing(F)
        return superelliptic_cech(C, omega.cartier(), superelliptic_function(C, Rx(0)))
    
    def frobenius(self):
        C = self.curve
        fct = self.f.function
        p = C.characteristic
        Rx.<x> = PolynomialRing(F)
        return superelliptic_cech(C, superelliptic_form(C, Rx(0)), superelliptic_function(C, fct^p))

    def coordinates(self):
        C = self.curve
        F = C.base_ring
        m = C.exponent
        Rx.<x> = PolynomialRing(F)
        Fx = FractionField(Rx)
        FxRy.<y> = PolynomialRing(Fx)
        g = C.genus()
        degrees_holo = C.degrees_holomorphic_differentials()
        degrees_holo_inv = {b:a for a, b in degrees_holo.items()}
        degrees0 = C.degrees_de_rham0()
        degrees0_inv = {b:a for a, b in degrees0.items()}
        degrees1 = C.degrees_de_rham1()
        degrees1_inv = {b:a for a, b in degrees1.items()}
        basis = C.de_rham_basis()
        
        omega = self.omega0
        fct = self.f
        
        if fct.function == Rx(0) and omega.form != Rx(0):
            for j in range(1, m):
                omega_j = Fx(omega.jth_component(j))
                if omega_j != Fx(0):
                    d = degree_of_rational_fctn(omega_j, F)
                    index = degrees_holo_inv[(d, j)]
                    a = coeff_of_rational_fctn(omega_j, F)
                    a1 = coeff_of_rational_fctn(basis[index].omega0.jth_component(j), F)
                    elt = self - (a/a1)*basis[index]
                    return elt.coordinates() + a/a1*vector([F(i == index) for i in range(0, 2*g)])
                    
        for j in range(1, m):
            fct_j = Fx(fct.jth_component(j))
            if (fct_j != Rx(0)):
                d = degree_of_rational_fctn(fct_j, p)
            
                if (d, j) in degrees1.values():
                    index = degrees1_inv[(d, j)]
                    a = coeff_of_rational_fctn(fct_j, F)
                    elt = self - (a/m)*basis[index]
                    return elt.coordinates() + a/m*vector([F(i == index) for i in range(0, 2*g)])
                
                if d<0:
                    a = coeff_of_rational_fctn(fct_j, F)
                    h = superelliptic_function(C, FxRy(a*y^j*x^d))
                    elt = superelliptic_cech(C, self.omega0, self.f - h)
                    return elt.coordinates()
            
                if (fct_j != Rx(0)):
                    G = superelliptic_function(C, y^j*x^d)
                    a = coeff_of_rational_fctn(fct_j, F)
                    elt =self - a*superelliptic_cech(C, diffn(G), G)
                    return elt.coordinates()

        return vector(2*g*[0])
    
    def is_cocycle(self):
        w0 = self.omega0
        w8 = self.omega8
        fct = self.f
        if not w0.is_regular_on_U0() and not w8.is_regular_on_Uinfty():
            return('w0 & w8')
        if not w0.is_regular_on_U0():
            return('w0')
        if not w8.is_regular_on_Uinfty():
            return('w8')
        if w0.is_regular_on_U0() and w8.is_regular_on_Uinfty():
            return 1
        return 0
        
def degree_of_rational_fctn(f, F):
    Rx.<x> = PolynomialRing(F)
    Fx = FractionField(Rx)
    f = Fx(f)
    f1 = f.numerator()
    f2 = f.denominator()
    d1 = f1.degree()
    d2 = f2.degree()
    return(d1 - d2)

def coeff_of_rational_fctn(f, F):
    Rx.<x> = PolynomialRing(F)
    Fx = FractionField(Rx)
    f = Fx(f)
    if f == Rx(0):
        return 0
    f1 = f.numerator()
    f2 = f.denominator()
    d1 = f1.degree()
    d2 = f2.degree()
    a1 = f1.coefficients(sparse = false)[d1]
    a2 = f2.coefficients(sparse = false)[d2]
    return(a1/a2)

def coff(f, d):
    lista = f.coefficients(sparse = false)
    if len(lista) <= d:
        return 0
    return lista[d]

def cut(f, i):
    R = f.parent()
    coeff = f.coefficients(sparse = false)
    return sum(R(x^(j-i-1)) * coeff[j] for j in range(i+1, f.degree() + 1))

def polynomial_part(p, h):
    F = GF(p)
    Rx.<x> = PolynomialRing(F)
    h = Rx(h)
    result = Rx(0)
    for i in range(0, h.degree()+1):
        if (i%p) == p-1:
            power = Integer((i-(p-1))/p)
            result += Integer(h[i]) * x^(power)    
    return result

#Find delta-th root of unity in field F
def root_of_unity(F, delta):
    Rx.<x> = PolynomialRing(F)
    cyclotomic = x^(delta) - 1
    for root, a in cyclotomic.roots():
        powers = [root^d for d in delta.divisors() if d!= delta]
        if 1 not in powers:
            return root
        
def preimage(U, V, M): #preimage of subspace U under M
    basis_preimage = M.right_kernel().basis()
    imageU = U.intersection(M.transpose().image())
    basis = imageU.basis()
    for v in basis:
        w = M.solve_right(v)
        basis_preimage = basis_preimage + [w]
    return V.subspace(basis_preimage)

def image(U, V, M):
    basis = U.basis()
    basis_image = []
    for v in basis:
        basis_image += [M*v]
    return V.subspace(basis_image)

def flag(F, V, p, test = 0):
    dim = F.dimensions()[0]
    space = VectorSpace(GF(p), dim)
    flag_subspaces = (dim+1)*[0]
    flag_used = (dim+1)*[0]
    final_type = (dim+1)*['?']
    
    flag_subspaces[dim] = space
    flag_used[dim] = 1
   
    
    while 1 in flag_used:
        index = flag_used.index(1)
        flag_used[index] = 0
        U = flag_subspaces[index]
        U_im = image(U, space, V)
        d_im = U_im.dimension()
        final_type[index] = d_im
        U_pre = preimage(U, space, F)
        d_pre = U_pre.dimension()
        
        if flag_subspaces[d_im] == 0:
            flag_subspaces[d_im] = U_im
            flag_used[d_im] = 1
        
        if flag_subspaces[d_pre] == 0:
            flag_subspaces[d_pre] = U_pre
            flag_used[d_pre] = 1
    
    if test == 1:
        print('(', final_type, ')')
    
    for i in range(0, dim+1):
        if final_type[i] == '?' and final_type[dim - i] != '?':
            i1 = dim - i
            final_type[i] = final_type[i1] - i1 + dim/2
    
    final_type[0] = 0
    
    for i in range(1, dim+1):
        if final_type[i] == '?':
            prev = final_type[i-1]
            if prev != '?' and prev in final_type[i+1:]:
                final_type[i] = prev
                
    for i in range(1, dim+1):
        if final_type[i] == '?':
            final_type[i] = min(final_type[i-1] + 1, dim/2)
    
    if is_final(final_type, dim/2):
        return final_type[1:dim/2 + 1]
    print('error:', final_type[1:dim/2 + 1])
    
def is_final(final_type, dim):
    n = len(final_type)
    if final_type[0] != 0:
        return 0
    
    if final_type[n-1] != dim:
        return 0
    
    for i in range(1, n):
        if final_type[i] != final_type[i - 1] and final_type[i] != final_type[i - 1] + 1:
            return 0
    return 1
class as_cover:
    def __init__(self, C, list_of_fcts, prec = 10):
        self.quotient = C
        self.functions = list_of_fcts
        self.height = len(list_of_fcts)
        p = C.characteristic
        self.characteristic = p
        self.prec = prec
        f = C.polynomial
        m = C.exponent
        r = f.degree()
        delta = GCD(m, r)
        self.nb_of_pts_at_infty = delta
        Rxy.<x, y> = PolynomialRing(GF(p), 2)
        Rt.<t> = LaurentSeriesRing(GF(p), default_prec=prec)

        all_x_series = []
        all_y_series = []
        all_z_series = []
        all_dx_series = []
        all_jumps = []

        for i in range(delta):
            x_series = superelliptic_function(C, x).expansion_at_infty(i = i, prec=prec)
            y_series = superelliptic_function(C, y).expansion_at_infty(i = i, prec=prec)
            z_series = []
            jumps = []
            n = len(list_of_fcts)
            list_of_power_series = [g.expansion_at_infty(i = i, prec=prec) for g in list_of_fcts]
            for i in range(n):
                power_series = list_of_power_series[i]
                jump, correction, t_old, z = artin_schreier_transform(power_series, prec = prec)
                x_series = x_series(t = t_old)
                y_series = y_series(t = t_old)
                z_series = [zi(t = t_old) for zi in z_series]
                z_series += [z]
                jumps += [jump]
                list_of_power_series = [g(t = t_old) for g in list_of_power_series]
            
            all_jumps += [jumps]
            all_x_series += [x_series]
            all_y_series += [y_series]
            all_z_series += [z_series]
            all_dx_series += [x_series.derivative()]
        self.jumps = all_jumps
        self.x = all_x_series
        self.y = all_y_series
        self.z = all_z_series
        self.dx = all_dx_series
        
    def __repr__(self):
        n = self.height
        p = self.characteristic
        if n==1:
            return "(Z/p)-cover of " + str(self.quotient)+" with the equation:\n z^" + str(p) + " - z = " + str(self.functions[0])
        
        result = "(Z/p)^"+str(self.height)+ "-cover of " + str(self.quotient)+" with the equations:\n"
        for i in range(n):
            result += 'z' + str(i) + "^" + str(p) + " - z" + str(i) + " = " + str(self.functions[i]) + "\n"
        return result
        
    def genus(self):
        jumps = self.jumps
        gY = self.quotient.genus()
        n = self.height
        delta = self.nb_of_pts_at_infty
        return p*gY + (p^n - 1)*(delta - 1) + sum(p^(n-j-1)*(jumps[i][j]-1)*(p-1)/2 for j in range(n) for i in range(delta))
    
    def exponent_of_different(self, i = 0):
        jumps = self.jumps
        n = self.height
        delta = self.nb_of_pts_at_infty
        return sum(p^(n-j-1)*(jumps[i][j]+1)*(p-1) for j in range(n))

    def holomorphic_differentials_basis(self):
        from itertools import product
        x_series = self.x
        y_series = self.y
        z_series = self.z
        dx_series = self.dx
        delta = self.nb_of_pts_at_infty
        p = self.characteristic
        n = self.height
        prec = self.prec
        C = self.quotient
        m = C.exponent
        r = C.polynomial.degree()
        variable_names = 'x, y'
        for i in range(n):
            variable_names += ', z' + str(i)
        Rxyz = PolynomialRing(GF(p), n+2, variable_names)
        x, y = Rxyz.gens()[:2]
        z = Rxyz.gens()[2:]
        RxyzQ = FractionField(Rxyz)
        Rt.<t> = LaurentSeriesRing(GF(p), default_prec=prec)
        #Tworzymy zbiór S form z^i x^j y^k dx/y o waluacji >= waluacja z^(p-1)*dx/y
        S = []
        RQxyz = FractionField(Rxyz)
        pr = [list(GF(p)) for _ in range(n)]
        for i in range(0, 3*r):
            for j in range(0, m):
                for k in product(*pr):
                    eta = as_form(self, x^i * prod(z[i1]^(k[i1]) for i1 in range(n))/y^j)
                    eta_exp = eta.expansion_at_infty()
                    S += [(eta, eta_exp)]

        forms = holomorphic_combinations(S)
        
        for i in range(1, delta):
            forms = [(omega, omega.expansion_at_infty(i = i)) for omega in forms]
            forms = holomorphic_combinations(forms)
        
        if len(forms) < self.genus():
            print("I haven't found all forms.")
        return forms

#given a set S of (form, corresponding Laurent series at some pt), find their combinations holomorphic at that pt
def holomorphic_combinations(S):
    C_AS = S[0][0].curve
    p = C_AS.characteristic
    F = GF(p)
    prec = C_AS.prec
    Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
    RtQ = FractionField(Rt)
    minimal_valuation = min([g[1].valuation() for g in S])
    if minimal_valuation >= 0:
        return [s[0] for s in S]
    list_of_lists = [] #to będzie lista złożona z list współczynników część nieholomorficznych rozwinięcia form z S
    for eta, eta_exp in S:
        a = -minimal_valuation + eta_exp.valuation()
        list_coeffs = a*[0] + eta_exp.list() + (-minimal_valuation)*[0]
        list_coeffs = list_coeffs[:-minimal_valuation]
        list_of_lists += [list_coeffs]
    M = matrix(GF(p), list_of_lists)
    V = M.kernel() #chcemy wyzerować części nieholomorficzne, biorąc kombinacje form z S


    # Sprawdzamy, jakim formom odpowiadają elementy V.
    forms = []
    for vec in V.basis():
        forma_holo = as_form(C_AS, 0)
        forma_holo_power_series = Rt(0)
        for vec_wspolrzedna, elt_S in zip(vec, S):
            eta = elt_S[0]
            #eta_exp = elt_S[1]
            forma_holo += vec_wspolrzedna*eta
            #forma_holo_power_series += vec_wspolrzedna*eta_exp
        forms += [forma_holo]
    return forms

class as_function:
    def __init__(self, C, g):
        self.curve = C
        n = C.height
        variable_names = 'x, y'
        for i in range(n):
            variable_names += ', z' + str(i)
        Rxyz = PolynomialRing(GF(p), n+2, variable_names)
        x, y = Rxyz.gens()[:2]
        z = Rxyz.gens()[2:]
        RxyzQ = FractionField(Rxyz)
        self.function = RxyzQ(g)
        
        
class as_form:
    def __init__(self, C, g):
        self.curve = C
        n = C.height
        variable_names = 'x, y'
        for i in range(n):
            variable_names += ', z' + str(i)
        Rxyz = PolynomialRing(GF(p), n+2, variable_names)
        x, y = Rxyz.gens()[:2]
        z = Rxyz.gens()[2:]
        RxyzQ = FractionField(Rxyz)
        self.form = RxyzQ(g)
        
    def __repr__(self):
        return "(" + str(self.form)+") * dx"
    
    def expansion_at_infty(self, i = 0):
        C = self.curve
        delta = C.nb_of_pts_at_infty
        x_series = C.x[i]
        y_series = C.y[i]
        z_series = C.z[i]
        dx_series = C.dx[i]
        n = C.height
        variable_names = 'x, y'
        for j in range(n):
            variable_names += ', z' + str(j)
        Rxyz = PolynomialRing(GF(p), n+2, variable_names)
        x, y = Rxyz.gens()[:2]
        z = Rxyz.gens()[2:]
        RxyzQ = FractionField(Rxyz)
        prec = C.prec
        Rt.<t> = LaurentSeriesRing(GF(p), default_prec=prec)
        g = self.form
        sub_list = {x : x_series, y : y_series} | {z[j] : z_series[j] for j in range(n)}
        return g.substitute(sub_list)*dx_series
    
    def __add__(self, other):
        C = self.curve
        g1 = self.form
        g2 = other.form
        return as_form(C, g1 + g2)
    
    def __sub__(self, other):
        C = self.curve
        g1 = self.form
        g2 = other.form
        return as_form(C, g1 - g2)
    
    def __rmul__(self, constant):
        C = self.curve
        omega = self.form
        return as_form(C, constant*omega)

    def group_action(self, ZN_tuple):
        C = self.curve
        n = C.height
        variable_names = 'x, y'
        for j in range(n):
            variable_names += ', z' + str(j)
        Rxyz = PolynomialRing(GF(p), n+2, variable_names)
        x, y = Rxyz.gens()[:2]
        z = Rxyz.gens()[2:]
        RxyzQ = FractionField(Rxyz)
        sub_list = {x : x, y : y} | {z[j] : z[j]+ZN_tuple[j] for j in range(n)}
        g = self.form
        return as_form(C, g.substitute(sub_list))
    
    def coordinates(self):
        C = self.curve
        n = C.height
        gC = C.genus()
        holo = C.holomorphic_differentials_basis()
        nb_of_coeffs = 2*gC
        holo_exp = [omega.expansion_at_infty() for omega in holo]
        list_of_coeffs = []
        for omega in holo_exp:
            a = omega.valuation()
            added_list = list(omega)[:nb_of_coeffs]
            added_list = a*[0] + added_list
            added_list = added_list[:nb_of_coeffs]
            list_of_coeffs += [added_list]
        M = matrix(GF(p), list_of_coeffs)
        M = M.transpose()
        omega = self.expansion_at_infty()
        a = omega.valuation()
        v = list(omega)[:nb_of_coeffs]
        v = a*[0] + v
        v = v[:nb_of_coeffs]
        v = vector(v)
        v1 = M.solve_right(v)
        return v1

def val_magical(C_AS):
    n = C_AS.height
    variable_names = 'x, y'
    for i in range(n):
        variable_names += ', z' + str(i)
    Rxyz = PolynomialRing(GF(p), n+2, variable_names)
    x, y = Rxyz.gens()[:2]
    z = Rxyz.gens()[2:]
    RxyzQ = FractionField(Rxyz)
    C = C_AS.quotient
    forms = C.holomorphic_differentials_basis()
    z_mag = prod(z[i]^(p-1) for i in range(n))
    forms_list = [z_mag*RxyzQ(omega.form) for omega in forms]
    forms_list = [as_form(C_AS, omega) for omega in forms_list]
    forms_list = [omega.expansion_at_infty() for omega in forms_list]
    forms_list = [omega.valuation() for omega in forms_list]
    return min(forms_list)



# Given power_series, find its reverse (g with g \circ power_series = id) with given precision

def new_reverse(power_series, prec = 10):
    F = power_series.parent().base()
    Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
    RtQ = FractionField(Rt)
    power_series = RtQ(power_series)
    a = power_series.list()[0]
    g = 1/a*t
    n = 2
    while(n <= prec):
        aux = power_series(t = g) - t
        if aux.valuation() > n:
            b = 0
        else:
            b = aux.list()[0]
        g = g - b/a*t^n
        n += 1
    return g

# Given a power_series, find correction such that power_series - (correction)^p +correction has valuation
# -jump non divisible by p. Also, express t (the variable) in terms of the uniformizer at infty on the curve
# z^p - z = power_series, where z = 1/t_new^(jump) and express z in terms of the new uniformizer.

def artin_schreier_transform(power_series, prec = 10):
    correction = 0
    F = power_series.parent().base()
    Rt.<t> = LaurentSeriesRing(F, default_prec=prec)
    RtQ = FractionField(Rt)
    power_series = RtQ(power_series)
    if power_series.valuation() == +Infinity:
        return(0,0,t,0)
    while(power_series.valuation() % p == 0 and power_series.valuation() < 0):
        M = -power_series.valuation()/p
        coeff = power_series.list()[0]   #wspolczynnik a_(-p) w f_AS
        correction += coeff*t^(-M)
        power_series = power_series - coeff*(t^(-p*M) - t^(-M))
    jump = max(-(power_series.valuation()), 0)
    try:
        T = ((power_series)^(-1)).nth_root(jump) #T is defined by power_series = 1/T^m
    except:
        print("no ", str(jump), "-th root; divide by", power_series.list()[0])
        return (jump, power_series.list()[0])
    T_rev = new_reverse(T, prec = prec)
    t_old = T_rev(t^p/(1 - t^((p-1)*jump)).nth_root(jump))
    z = 1/t^(jump) + Rt(correction)(t = t_old)
    return(jump, correction, t_old, z)


def are_forms_linearly_dependent(set_of_forms):
    from sage.rings.polynomial.toy_variety import is_linearly_dependent
    C = set_of_forms[0].curve
    n = C.height
    variable_names = 'x, y'
    for i in range(n):
        variable_names += ', z' + str(i)
    Rxyz = PolynomialRing(GF(p), n+2, variable_names)
    denominators = prod(denominator(omega.form) for omega in set_of_forms)
    return is_linearly_dependent([Rxyz(denominators*omega.form) for omega in set_of_forms])

def group_action_matrices(C_AS):
    holo = C_AS.holomorphic_differentials_basis()
    n = C_AS.height
    A = [[] for i in range(n)]
    for omega in holo:
        for i in range(n):
            ei = n*[0]
            ei[i] = 1
            omega1 = omega.group_action(ei)
            v1 = omega1.coordinates()
            A[i] += [v1]
    for i in range(n):
        A[i] = matrix(GF(p), A[i])
        A[i] = A[i].transpose()
    return A

Testy

p = 5
m = 2
Rx.<x> = PolynomialRing(GF(p))
f = x^3 + x^2 + 1
C_super = superelliptic(f, m)
Rxy.<x, y> = PolynomialRing(GF(p), 2)
fArS1 = superelliptic_function(C_super, y*x)
fArS2 = superelliptic_function(C_super, y*x^2)
fArS3 = superelliptic_function(C_super, y)
AS1 = as_cover(C_super, [fArS1, fArS2, fArS3], prec=500)
print(AS1.genus())
AS2 = as_cover(C_super, [fArS2, fArS3, fArS1], prec=500)
print(AS2.genus())
325
325
p = 5
m = 2
Rx.<x> = PolynomialRing(GF(p))
f = x^3 + x^2 + 1
C_super = superelliptic(f, m)
Rxy.<x, y> = PolynomialRing(GF(p), 2)
fArS1 = superelliptic_function(C_super, y*x)
fArS2 = superelliptic_function(C_super, y*x^2)
fArS3 = superelliptic_function(C_super, y)
AS1 = as_cover(C_super, [fArS1, fArS2, fArS3], prec=1000)
print(AS1.exponent_of_different())
omega = as_form(AS1, 1/y)
print(omega.expansion_at_infty())

Brudnopis

p = 11
m = 2
Rx.<x> = PolynomialRing(GF(p))
f = x^7 + x^2 + 1
C_super = superelliptic(f, m)
print(C_super.genus())
3
Rxy.<x, y> = PolynomialRing(GF(p))
fArS1 = superelliptic_function(C_super, y*x^2)
AS = as_cover(C_super, [fArS1], prec=300)
print(AS.genus())
omega = C_super.holomorphic_differentials_basis()[2]
magical_for_a_form(omega, AS)
33
[(x^2/y) * dx, (x^2*z0/y) * dx, ((x^2*z0^2 - x^3)/y) * dx]
AS.genus()
33
p = 11
m = 2
Rx.<x> = PolynomialRing(GF(p))
f = x^7 + x^2 + 1
C_super = superelliptic(f, m)
print(C_super.genus())
Rxy.<x, y> = PolynomialRing(GF(p))

for a in GF(p):
    for b in GF(p):
        for c in GF(p):
            if (b != GF(p)(0) or a!=GF(p)(0)):
                f1 = superelliptic_function(C_super, y*x^2)
                f2 = superelliptic_function(C_super, a*y+b*x+c*x^2)
                try:
                    AS = as_cover(C_super, [f1, f2], prec=500)
                    if AS.jumps[1] >0 and AS.jumps[1] < 67:
                        print(a, b, c, AS.jumps, AS.genus())
                except:
                    pass
3
0 0 2 [1, 34] 198
0 0 6 [1, 34] 198
0 0 7 [1, 34] 198
0 0 8 [1, 34] 198
0 0 10 [1, 34] 198
0 1 0 [1, 12] 88
0 1 6 [1, 34] 198
0 1 7 [1, 34] 198
0 1 8 [1, 34] 198
0 1 10 [1, 34] 198
0 2 2 [1, 34] 198
0 2 6 [1, 34] 198
0 2 7 [1, 34] 198
0 3 2 [1, 34] 198
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
Input In [22], in <cell line: 9>()
     10 for b in GF(p):
     11     for c in GF(p):
---> 12         f1 = superelliptic_function(C_super, y*x**Integer(2))
     13         f2 = superelliptic_function(C_super, a*y+b*x+c*x**Integer(2))
     14         try:

Input In [2], in superelliptic_function.__init__(self, C, g)
    209 class superelliptic_function:
--> 210     def __init__(self, C, g):
    211         F = C.base_ring
    212         Rxy = PolynomialRing(F, Integer(2), names=('x', 'y',)); (x, y,) = Rxy._first_ngens(2)

File src/cysignals/signals.pyx:310, in cysignals.signals.python_check_interrupt()

KeyboardInterrupt: 
Rt.<t> = LaurentSeriesRing(GF(p))
p = 5
m = 1
Rx.<x> = PolynomialRing(GF(p))
f = x
C_super = superelliptic(f, m)
print(C_super.genus())
0
Rxy.<x, y> = PolynomialRing(GF(p), 2)
f1 = superelliptic_function(C_super, x^3)
AS = as_cover(C_super, [f1], prec=200)
AS.jumps
[[3]]
AS.holomorphic_differentials_basis()
[(1) * dx, (z0) * dx, (z0^2) * dx, (x) * dx]
len(AS.holomorphic_differentials_basis())
9
p = 3
m = 2
Rx.<x> = PolynomialRing(GF(p))
f = x^m + 1
C_super = superelliptic(f, m)

Rxy.<x, y> = PolynomialRing(GF(p), 2)
f1 = superelliptic_function(C_super, x)
f2 = superelliptic_function(C_super, x^2)
AS = as_cover(C_super, [f1, f2], prec=300)
print(AS.jumps)
print(AS.holomorphic_differentials_basis())
[[1, 4], [1, 4]]
[(1) * dx, (-z0^2 + z1) * dx, (z0) * dx, (1/y) * dx, (z1/y) * dx, (z1^2/y) * dx, (z0/y) * dx, (z0*z1/y) * dx, ((-x*z0^2 + z0*z1^2)/y) * dx, (z0^2/y) * dx, (z0^2*z1/y) * dx, (x/y) * dx, ((-x*z0^2 + x*z1)/y) * dx, (x*z0/y) * dx]
AS.genus()
14
AS.genus()
2
AS.holomorphic_differentials_basis()
[(1/y) * dx,
 (z0/y) * dx,
 ((-x^2 + z0^2)/y) * dx,
 ((2*x^3 + 2*x^2*z0 + z0^3)/y) * dx,
 ((2*x^4 - 2*x^3*z0 - x^2*z0^2 + z0^4)/y) * dx,
 (x/y) * dx,
 ((-x^2 + x*z0)/y) * dx,
 ((x^3 - 2*x^2*z0 + x*z0^2)/y) * dx,
 ((-x^4 - 2*x^3*z0 + 2*x^2*z0^2 + x*z0^3)/y) * dx]
p = 3
m = 2
Rx.<x> = PolynomialRing(GF(p))
for a in GF(p):
    for b in GF(p):
        for c in GF(p):
            if (a, b, c) != (0, 0, 0):
                f = x^2 + 1
                C_super = superelliptic(f, m)
                print(C_super.genus())

                Rxy.<x, y> = PolynomialRing(GF(p), 2)
                f1 = superelliptic_function(C_super, x)
                f2 = superelliptic_function(C_super, )
                try:
                    AS = as_cover(C_super, [f1, f2], prec=500)
                except:
                    pass
                print(a, b, c, AS.jumps)
0
no  4 -th root; divide by 2
0 0 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
0 0 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
0 1 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
0 1 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
0 1 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
0 2 0 [[1, 4], [1, 4]]
0
0 2 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
0 2 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 0 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 0 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 0 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 1 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 1 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 1 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 2 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 2 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
1 2 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 0 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 0 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 0 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 1 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 1 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 1 2 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 2 0 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 2 1 [[1, 4], [1, 4]]
0
no  4 -th root; divide by 2
2 2 2 [[1, 4], [1, 4]]
A, B = group_action_matrices(AS)
print(A, B)
[1 2 1 0 0 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0 0 0 0 0]
[0 1 1 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 1 0 0 1 0 0 1 0 0 0 0]
[0 0 0 0 1 0 0 1 0 0 1 0 0 0]
[0 0 0 0 0 1 0 0 1 0 0 0 0 0]
[0 0 0 0 0 0 1 0 0 2 0 0 0 0]
[0 0 0 0 0 0 0 1 0 0 2 0 0 0]
[0 0 0 0 0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0 2 0 0 1 2 1]
[0 0 0 0 0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 1 0 0 0 1 1] [1 1 0 0 0 0 0 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 1 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 1 1 1 0 0 0 0 0 0 0 0]
[0 0 0 0 1 2 0 0 0 0 0 0 0 0]
[0 0 0 0 0 1 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 1 1 1 0 0 0 0 0]
[0 0 0 0 0 0 0 1 2 0 0 0 0 0]
[0 0 0 0 0 0 0 0 1 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 1 1 0 0 0]
[0 0 0 0 0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 1 1 0]
[0 0 0 0 0 0 0 0 0 0 0 0 1 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 1]
pretty_print(A.jordan_form().str())
\(\displaystyle \begin{array}{l} \verb"[1"\verb" "\verb"1"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"1"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb|[-----+-----+-----+-----+---]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|1"\verb" "\verb"1"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"1"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb|[-----+-----+-----+-----+---]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|1"\verb" "\verb"1"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"1"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb|[-----+-----+-----+-----+---]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|1"\verb" "\verb"1"\verb" "\verb"0|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"1"\verb" "\verb"1|0"\verb" "\verb"0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"1|0"\verb" "\verb"0]"\\\\ \verb|[-----+-----+-----+-----+---]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|1"\verb" "\verb"1]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"1]" \end{array}\)
pretty_print(B.jordan_form().str())
\(\displaystyle \begin{array}{l} \verb"[1"\verb" "\verb"1"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb"[0"\verb" "\verb"1"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"1|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb|[-----+-----+---+---+---+-+-]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|1"\verb" "\verb"1"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"1"\verb" "\verb"1|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"1|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb|[-----+-----+---+---+---+-+-]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|1"\verb" "\verb"1|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"1|0"\verb" "\verb"0|0"\verb" "\verb"0|0|0]"\\\\ \verb|[-----+-----+---+---+---+-+-]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|1"\verb" "\verb"1|0"\verb" "\verb"0|0|0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"1|0"\verb" "\verb"0|0|0]"\\\\ \verb|[-----+-----+---+---+---+-+-]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|1"\verb" "\verb"1|0|0]"\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"1|0|0]"\\\\ \verb|[-----+-----+---+---+---+-+-]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|1|0]"\\\\ \verb|[-----+-----+---+---+---+-+-]|\\\\ \verb"[0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0"\verb" "\verb"0|0|1]" \end{array}\)