DeRhamComputation/deRhamComputation.ipynb

17 KiB
Raw Blame History

Theory

Let $C : y^m = f(x)$. Then:

  • the basis of $H^0(C, \Omega_{C/k})$ is given by: $$x^{i-1} dx/y^j,$$ where $1 \le i \le r-1$, $1 \le j \le m-1$, $-mi + rj \ge \delta$ and $\delta := GCD(m, r)$, $r := \deg f$.

# The program computes the basis of holomorphic differentials of y^m = f(x) in char p.
# The coefficient j means that we compute the j-th eigenpart, i.e.
# forms y^j * f(x) dx. Output is [f(x), 0]

def baza_holo(m, f, j, p):
    R.<x> = PolynomialRing(GF(p))
    f = R(f)
    r = f.degree()
    delta = GCD(m, r)
    baza = {}
    k = 0
    for i in range(1, r):
        if (r*j - m*i >= delta):
            baza[k] = [x^(i-1), R(0)]
            k = k+1
    return baza
# The program computes the basis of de Rham cohomology of y^m = f(x) in char p.
# We treat them as pairs [omega, f], where omega is regular on the affine part
# and omega - df is regular on the second atlas.
# The coefficient j means that we compute the j-th eigenpart, i.e.
# [y^j * f(x) dx, g(x)/y^j]. Output is [f(x), g(x)]

def baza_dr(m, f, j, p):
    R.<x> = PolynomialRing(GF(p))
    f = R(f)    
    r = f.degree()
    delta = GCD(m, r)
    baza = {}
    holo = baza_holo(m, f, j, p)
    for k in range(0, len(holo)):
        baza[k] = holo[k]
    
    k = len(baza)
    
    for i in range(1, r):
        if (r*(m-j) - m*i >= delta):
            s = R(m-j)*R(x)*R(f.derivative()) - R(m)*R(i)*f
            psi = R(obciecie(s, i, p))
            baza[k] = [psi, R(m)/x^i]
            k = k+1
    return baza
#auxiliary programs
def stopnie_bazy_holo(m, f, j, p):
    baza = baza_holo(m, f, j, p)
    stopnie = {}
    for k in range(0, len(baza)):
        stopnie[k] = baza[k][0].degree()
    return stopnie

def stopnie_bazy_dr(m, f, j, p):
    baza = baza_dr(m, f, j, p)
    stopnie = {}
    for k in range(0, len(baza)):
        stopnie[k] = baza[k][0].degree()
    return stopnie

def stopnie_drugiej_wspolrzednej_bazy_dr(m, f, j, p):
    baza = baza_dr(m, f, j, p)
    stopnie = {}
    for k in range(0, len(baza)):
        if baza[k][1] != 0:
            stopnie[k] = baza[k][1].denominator().degree()
    return stopnie

def obciecie(f, i, p):
    R.<x> = PolynomialRing(GF(p))
    f = R(f)
    coeff = f.coefficients(sparse = false)
    return sum(x^(j-i-1) * coeff[j] for j in range(i+1, f.degree() + 1))


#Any element [f dx, g] is represented as a combination of the basis vectors.

def zapis_w_bazie_dr(elt, m, f, j, p):
    print(elt)
    R.<x> = PolynomialRing(GF(p))
    f = R(f)
    r = f.degree()
    delta = GCD(m, r)
    baza = baza_dr(m, f, j, p)
    wymiar = len(baza)
    zapis = vector([GF(p)(0) for i in baza])
    stopnie = stopnie_bazy_dr(m, f, j, p)
    inv_stopnie = {v: k for k, v in stopnie.items()}
    stopnie_holo = stopnie_bazy_holo(m, f, j, p)
    inv_stopnie_holo = {v: k for k, v in stopnie_holo.items()}    
    
    ## zmiana
    if elt[0]== 0 and elt[1] == 0:
        print('p1')
        return zapis
    
    if elt[1] == 0:
        print('p2')
        elt[0] = R(elt[0])
        d = elt[0].degree()
        a = elt[0].coefficients(sparse = false)[d]
        k = inv_stopnie_holo[d] #ktory element bazy jest stopnia d? ten o indeksie k
    
        a1 = baza[k][0].coefficients(sparse = false)[d]
        elt1 = [R(0),R(0)]
        elt1[0] = elt[0] - a/a1 * baza[k][0]
        elt1[1] = R(0)
        return zapis_w_bazie_dr(elt1, m, f, j, p) + vector([a/a1*GF(p)(i == k) for i in range(0, len(baza))])

    g = elt[1]
    g1 = R(elt[1].numerator())
    g2 = R(elt[1].denominator())
    d1 = g1.degree()
    d2 = g2.degree()
    a1 = g1.coefficients(sparse = false)[d1]
    a2 = g2.coefficients(sparse = false)[d2]
    a = a1/a2
    d = d2 - d1
    
    if (d*m - (m-j)*r >= 0):
        print('p3')
        elt1 = [R(0), R(0)]
        elt1[0] = elt[0]
        return zapis_w_bazie_dr(elt1, m, f, j, p)
    
    print('p4')
    stopnie2 = stopnie_drugiej_wspolrzednej_bazy_dr(m, f, j, p)
    inv_stopnie2 = {v: k for k, v in stopnie2.items()}  
    k = inv_stopnie2[d]
    elt1 = [R(0), R(0)]
    elt1[0] = elt[0] - a*baza[k][0]
    elt1[1] = elt[1] - a*baza[k][1]
    return zapis_w_bazie_dr(elt1, m, f, j, p) + vector([a*GF(p)(i == k) for i in range(0, len(baza))])
    
    
def zapis_w_bazie_holo(elt, m, f, j, p):
    R.<x> = PolynomialRing(GF(p))
    f = R(f)    
    r = f.degree()
    delta = GCD(m, r)
    baza = baza_holo(m, f, j, p)
    wymiar = len(baza)
    zapis = vector([GF(p)(0) for i in baza])
    stopnie = stopnie_bazy_holo(m, f, j, p)
    inv_stopnie = {v: k for k, v in stopnie.items()}
    
    if elt[0] == 0:
        return zapis
    
    d = elt[0].degree()
    a = elt[0].coefficients(sparse = false)[d]
    
    k = inv_stopnie[d] #ktory element bazy jest stopnia d? ten o indeksie k
    
    a1 = baza[k][0].coefficients(sparse = false)[d]
    elt1 = [R(0),R(0)]
    elt1[0] = elt[0] - a/a1 * baza[k][0]
    
    return zapis_w_bazie_holo(elt1, m, f, j, p) + vector([a/a1 * GF(p)(i == k) for i in range(0, len(baza))])

We have: $V(\omega, f) = (C(\omega), 0)$ and $F(\omega, f) = (0, f^p)$, where C denotes the Cartier operator. Moreover:

let $t = multord_m(p)$, $M := (p^t - 1)/m$. Then: $y^{p^t - 1} = f(x)^M$ and $1/y = f(x)^M/y^{p^t}$. Thus:

$$ C(P(x) , dx / y^j) = C(P(x) , f(x)^{M \cdot j} , dx /y^{p^t \cdot j}) = \frac{1}{y^{p^{t - 1} \cdot j}} C(P(x) , f(x)^{M \cdot j} , dx) = \frac{1}{y^{(p^{t - 1} \cdot j) , mod , m}} \cdot \frac{1}{f(x)^{[p^{t - 1} \cdot j/m]}} \cdot C(P(x) , f(x)^{M \cdot j} , dx)$$

def czesc_wielomianu(p, h):
    R.<x> = PolynomialRing(GF(p))
    h = R(h)
    wynik = R(0)
    for i in range(0, h.degree()+1):
        if (i%p) == p-1:
            potega = Integer((i-(p-1))/p)
            wynik = wynik + Integer(h[i]) * x^(potega)    
    return wynik

def cartier_dr(p, m, f, elt, j): #Cartier na y^m = f dla elt = [forma rozniczkowa, fkcja]
    R.<x> = PolynomialRing(GF(p))
    f = R(f)
    r = f.degree()
    delta = GCD(m, r)
    rzad = Integers(m)(p).multiplicative_order()
    M = Integer((p^(rzad)-1)/m)
    W = R(elt[0])
    h = R(W*f^(M*j))
    B = floor(p^(rzad-1)*j/m)
    g = czesc_wielomianu(p, h)/f^B
    jj = (p^(rzad-1)*j)%m
    #jj = Integers(m)(j/p)
    return [g, 0] #jest to w czesci indeksowanej jj

def macierz_cartier_dr(p, m, f, j):
    baza = baza_dr(m, f, j, p)
    A = matrix(GF(p), len(baza), len(baza))
    for k in range(0, len(baza)):
        cart = cartier_dr(p, m, f, baza[k], j)
        v = zapis_w_bazie_dr(cart, m, f, j, p)
        A[k, :] = matrix(v)
    return A.transpose()

$F((\omega, P(x) \cdot y^j)) = (0, P(x)^p \cdot y^{p \cdot j}) = (0, P(x)^p \cdot f(x)^{[p \cdot j/m]} \cdot y^{(p \cdot j) , mod , m})$

def frobenius_dr(p, m, f, elt, j): #Cartier na y^m = f dla elt = [forma rozniczkowa, fkcja]
    R.<x> = PolynomialRing(GF(p))
    RR = FractionField(R)
    f = R(f)
    M = floor(j*p/m)
    return [0, f^M * RR(elt[1])^p] #eigenspace = j*p mod m

def macierz_frob_dr(p, m, f, j):
    baza = baza_dr(m, f, j, p)
    A = matrix(GF(p), len(baza), len(baza))
    for k in range(0, len(baza)):
        frob = frobenius_dr(p, m, f, baza[k], j)
        v = zapis_w_bazie_dr(frob, m, f, j, p)
        A[k, :] = matrix(v)
    return A.transpose()
m = 2
j = 1
p = 5
f = x^3 + x+3
baza_dr(m, f, j, p)
#macierz_frob_dr(p, m, f, j)
{0: [1, 0], 1: [x, 2/x]}
frobenius_dr(p, m, f, [x, 2/x], j)
[0, (2*x^6 + 4*x^4 + 2*x^3 + 2*x^2 + 2*x + 3)/x^5]
zapis_w_bazie_dr([0, (2*x^6 + 4*x^4 + 2*x^3 + 2*x^2 + 2*x + 3)/x^5], m, f, j, p)
[0, (2*x^6 + 4*x^4 + 2*x^3 + 2*x^2 + 2*x + 3)/x^5]
p4
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-97-b5994066838e> in <module>()
----> 1 zapis_w_bazie_dr([Integer(0), (Integer(2)*x**Integer(6) + Integer(4)*x**Integer(4) + Integer(2)*x**Integer(3) + Integer(2)*x**Integer(2) + Integer(2)*x + Integer(3))/x**Integer(5)], m, f, j, p)

<ipython-input-92-50e115077f5c> in zapis_w_bazie_dr(elt, m, f, j, p)
     82     stopnie2 = stopnie_drugiej_wspolrzednej_bazy_dr(m, f, j, p)
     83     inv_stopnie2 = {v: k for k, v in stopnie2.items()}
---> 84     k = inv_stopnie2[d]
     85     elt1 = [R(Integer(0)), R(Integer(0))]
     86     elt1[Integer(0)] = elt[Integer(0)] - a*baza[k][Integer(0)]

KeyError: -1
h = sum(i*x^i for i in range(0, p^2))
czesc_wielomianu(p, h)
4*x^4 + 4*x^3 + 4*x^2 + 4*x + 4
m = 5
j = 1
p = 5
f = x^4 + x+2
baza_dr(m, f, j, p)
{0: [x^2, 0], 1: [x, 0], 2: [1, 0]}
macierz_frob_dr(p, m, f, j)
[0 0 0]
[0 0 0]
[0 0 0]