Sharedfrobenius-hausdorff2018.ipynbOpen in CoCalc

Frobenius structures on hypergeometric equations: computational methods

Kiran S. Kedlaya, Department of Mathematics, University of California, San Diego; [email protected]
Picard-Fuchs Equations and Hypergeometric Motives, Hausdorff Research Institute for Mathematics (Bonn)
March 28, 2018
About this file

This file is a Jupyter notebook hosted on CoCalc (formerly SageMathCloud). The embedded code is to be run using the standard SageMath 8.1 kernel; see below for discussion of hypergeometric motives in Sage.

To retrieve this file, see my web site ( and click on "Talks".


Thanks to Fernando Rodriguez Villegas for helpful discussions. The author was supported by NSF grant DMS-1501214 and the UCSD Department of Mathematics (Stefan E. Warschawski Chair).

  • [BCH]: F. Beukers, H. Cohen, and A. Mellit, Finite hypergeometric functions, arXiv:1505.02900.
  • [Dw]: B. Dwork, Generalized Hypergeometric Functions, Clarendon Press, Oxford, 1990.
  • [BH]: F. Beukers and G. Heckman, Monodromy for the hypergeometric function nFn1{}_nF_{n-1}, Inventiones Mathematicae 95 (1989), 325-354.
  • [Ka]: N.M. Katz, Exponential Sums and Differential Equations, Annals of Math. Studies 124, Princeton Univ. Press, Princeton, 1990.
  • [Sh1]: I. Shapiro, Frobenius map for quintic threefolds, International Mathematics Research Notices (2009), 2519-2545.
  • [Sh2]: I. Shapiro, Frobenius map and the pp-adic Gamma function, Journal of Number Theory 132 (2012), 1770-1779.

See also my slides and Jupyter notebook from ICTP, September 2017 (on my web site; see above).

1. Hypergeometric differential equations

Throughout this talk, by a (hypergeometric) datum we will mean two tuples α=(α1,,αn)\underline{\alpha} = (\alpha_1,\dots,\alpha_n) and β=(β1,,βn)\underline{\beta} = (\beta_1,\dots,\beta_n) of the same length nn such that:

  • αi,βjQ[0,1)\alpha_i,\beta_j \in \mathbb{Q} \cap [0,1) for i,j=1,,ni,j=1,\dots,n;
  • α\underline{\alpha} and β\underline{\beta} are disjoint: αiβj\alpha_i \neq \beta_j for i,j=1,,ni,j=1,\dots,n. (However, there may be repeats within α\underline{\alpha} or β\underline{\beta}.)

We say that this datum is Galois-stable if:

  • in each of α\underline{\alpha} and β\underline{\beta}, for any r,r,sZr,r',s \in \mathbb{Z} with s>0,0r,r<s,gcd(r,s)=gcd(r,s)=1, s > 0, \quad 0 \leq r,r' < s, \quad \gcd(r,s) = \gcd(r',s) = 1, the fractions rs\frac{r}{s} and rs\frac{r'}{s} occur with the same multiplicity.

We consider the generalized hypergeometric equation with parameters α,β\underline{\alpha}, \underline{\beta} using the normalization of [BH]: (t(D+α1)(D+αn)(D+β11)(D+βn1))(y)=0D=tddt.\left( t(D + \alpha_1) \cdots (D + \alpha_n) - (D+\beta_1-1)\cdots(D+\beta_n-1) \right)(y) = 0 \qquad D = t \frac{d}{dt}. For i=1,,ni=1,\dots,n, we have a (formal) solution at t=0t=0 of the form y=t1βinFn1(α1βi+1,,αnβi+1β1βi+1,,βiβi+1^,,βnβi+1t) y = t^{1-\beta_i} {}_nF_{n-1} \left( \left. \genfrac{}{}{0pt}{}{\alpha_1-\beta_i+1, \dots, \alpha_n-\beta_i+1}{\beta_1-\beta_i+1, \dots, \widehat{\beta_i - \beta_i + 1},\dots,\beta_n - \beta_i + 1} \right| t \right) expressed in terms of the Clausen-Thomae hypergeometric series nFn1(α1,,αnβ1,,βn1t):=k=0(α1)k(αn)k(β1)k(βn1)ktkk!. {}_nF_{n-1} \left( \left. \genfrac{}{}{0pt}{}{\alpha_1,\dots,\alpha_n}{\beta_1,\dots,\beta_{n-1}} \right| t \right) := \sum_{k=0}^\infty \frac{(\alpha_1)_k \cdots (\alpha_n)_k}{(\beta_1)_k \cdots (\beta_{n-1})_k} \frac{t^k}{k!}.

2. Hypergeometric motives in Sage

As described in [Ka], to any Galois-stable datum α,β\underline{\alpha}, \underline{\beta} one can (modulo formal difficulties with the definition of motives) associate a family of hypergeometric motives over PQ1{0,1,}\mathbf{P}^1_{\mathbb{Q}} - \{0,1,\infty\} whose associated variation of Hodge structures has Picard-Fuchs equation (for a suitable choice of period) equal to the hypergeometric equation with parameters α,β\underline{\alpha}, \underline{\beta}.

Starting with version 8.1, Sage includes a partial port of the Magma hypergeometric motives package; this is joint work with Frédéric Chapoton. At present, this is limited to basic combinatorial functions plus the hypergeometric trace formula for good primes; see Sage's trac server for running discussion.

Warning: there is a normalization discrepancy between Magma and Sage; the parameter value tt in Sage corresponds to 1/t1/t in Magma. (The convention in Sage is the one compatible with [BH].)

from sage.modular.hypergeometric_motive import HypergeometricData as HGData
H = HGData(alpha_beta = ([1/6,5/6,1/8,3/8,5/8,7/8],[0,1/2,1/12,5/12,7/12,11/12]))
Hypergeometric data for [1/8, 1/6, 3/8, 5/8, 5/6, 7/8] and [0, 1/12, 5/12, 1/2, 7/12, 11/12]

The degree of this Hodge structure is the integer nn.

n =; n

The minimal weight ww and the Hodge numbers are computed using the "zigzag function": Z(x):=#{k:αkx}#{k:βkx}. Z(x) := \#\{k: \alpha_k \leq x\} - \#\{k: \beta_k \leq x\}. To wit, the Hodge vector has ii-th component #{j{1,,n}:Z(βj)mink{Z(βk)}=i} \#\{j \in \{1,\dots,n\}: Z(\beta_j)-\min_k\{Z(\beta_k)\} = i\} and ww is the largest ii for which this component is nonzero. (Note: nwnw is always even.)

w = H.weight(); w
[2, 2, 2]

For tt in a number field KK, the LL-function of the hypergeometric motive (without completion by archimedean factors) has the form pLp(Norm(p)s)1\prod_{\mathfrak{p}} L_{\mathfrak{p}}(\mathrm{Norm}(\mathfrak{p})^{-s})^{-1} where for each finite place p\mathfrak{p} of KK, Lp(T)L_{\mathfrak{p}}(T) is some polynomial of degree at most nn. We say that p\mathfrak{p} is good if:

  • p\mathfrak{p} does not divide the denominator of some member of α\underline{\alpha} or β\underline{\beta} (otherwise p\mathfrak{p} is wild);
  • vp(t)=vp(t1)=0v_{\mathfrak{p}}(t) = v_{\mathfrak{p}}(t-1) = 0 (otherwise p\mathfrak{p} is tame unless it is wild).

For p\mathfrak{p} good of absolute norm qq, the polynomial Lp(T)L_{\mathfrak{p}}(T) has the following properties.

  • The degree of Lp(T)L_{\mathfrak{p}}(T) is exactly nn.
  • The Hodge numbers, interpreted as slope multiplicities, give a lower bound on the Newton polygon of Lp(T)L_{\mathfrak{p}}(T) which is "usually" sharp. (This occurs when p\mathfrak{p} is an ordinary prime for this motive.)
  • There is a functional equation of the form Lp(T)=±Tnqnw/2Lp(qwT1) L_{\mathfrak{p}}(T) = \pm T^n q^{nw/2} L_{\mathfrak{p}}(q^{-w} T^{-1}) where the sign is given by an explicit formula (and it is always ++ if ww is odd).
  • Lp(T)L_{\mathfrak{p}}(T) is pure of weight ww: its roots in C\mathbb{C} all lie on the circle T=qw/2|T| = q^{-w/2}.
t0 = 3
p = 17
P.<T> = PolynomialRing(QQ)
Lp = H.euler_factor(t0, p)(T)
24137569T6+668168T553465T47752T3185T2+8T+124137569 T^{6} + 668168 T^{5} - 53465 T^{4} - 7752 T^{3} - 185 T^{2} + 8 T + 1
24137569T6+668168T553465T47752T3185T2+8T+124137569 T^{6} + 668168 T^{5} - 53465 T^{4} - 7752 T^{3} - 185 T^{2} + 8 T + 1
[(-0.0509543817618668 - 0.0293914714113240*I, 1), (-0.0509543817618668 + 0.0293914714113240*I, 1), (-0.0214702716789809 - 0.0547652722670809*I, 1), (-0.0214702716789809 + 0.0547652722670809*I, 1), (0.0585838229910207 - 0.00530502556200247*I, 1), (0.0585838229910207 + 0.00530502556200247*I, 1)]
print([i.abs()^(-2) for i,_ in Lp.roots(CC)])
[289.000000000000, 289.000000000000, 289.000000000000, 289.000000000000, 289.000000000000, 289.000000000000]

The computation of Lp(T)L_p(T) in Sage or Magma uses a certain trace formula which we now describe briefly.

3. Trace formulas for hypergeometric motives

For p\mathfrak{p} good, lying over the rational prime pp, we can interpret Lp(T)=det(1TFp) L_{\mathfrak{p}}(T) = \det(1 - T F_{\mathfrak{p}}) where FpF_{\mathfrak{p}} is an endomorphism of a certain nn-dimensional vector space VV over a field of characteristic 0. To compute Lp(T)L_{\mathfrak{p}}(T), it would be equivalent to compute Trace(Fpi)\mathrm{Trace}(F_{\mathfrak{p}}^i) for i=1,,n/2i=1,\dots,\lfloor n/2 \rfloor (and then use the functional equation). For q=Norm(p)iq = \mathrm{Norm}(\mathfrak{p})^i, denote this trace by Hq(α,βt)H_q(\underline{\alpha}, \underline{\beta}|t).

In [BCM], an explicit formula for Hq(α,βt)H_q(\underline{\alpha}, \underline{\beta}|t) is given in terms of Gauss sums; we will not recall the details here. Using the Gross-Koblitz formula, one can convert this into a formula in terms of the pp-adic Gamma function Γp\Gamma_p; this formula is used for the computation of Lp(T)L_{\mathfrak{p}}(T) in both Magma and Sage. See the Magma documentation or Mark Watkins's writeup for further details (with caution about normalizations; see above).

One key feature of the formula in question is that it involves a sum over q1q-1 terms. This becomes prohibitive for nn large. (Magma's implementation is noticeably more efficient than Sage, but the general point applies either way.)

4. Frobenius structures and L-functions

A possible alternative to the hypergeometric trace formula is to compute the Frobenius structure on the hypergeometric equation induced by the motivic construction. This approach has previously been used (notably by Lauder) in the computation of zeta functions of algebraic varieties over finite fields, where it is commonly known as the deformation method. However, for a given family of varieties, the complexity of the method depends strongly on the number of singularities of the associated Picard-Fuchs equation; thus hypergeometric motives provide a particularly favorable scenario for this approach.

As noted earlier, Lp(T)L_{\mathfrak{p}}(T) can be interpreted as det(1TFp)\det(1 - T F_{\mathfrak{p}}) where FpF_{\mathfrak{p}} is a certain endomorphism of a certain finite-dimensional vector space VV over a certain field KK of characteristic 0. There are in fact multiple natural constructions that give rise to such data (known as Weil cohomology theories).

  • The most widely known is étale cohomology, in which KK may be taken to be Q\mathbb{Q}_{\ell} for any prime p\ell \neq p.
  • However, there are also several related constructions of pp-adic Weil cohomology in which KK is either Qp\mathbb{Q}_p or an unramified extension thereof; these include Dwork cohomology and (rational) crystalline cohomology. (The latter is a special case of rigid cohomology, which also includes Monsky-Washnitzer cohomology as another special case.)

While étale cohomology is often favored over pp-adic cohomology because its foundations are somewhat more developed, this gap has closed dramatically in recent years. Moreover, for computational applications it is generally much easier to work with pp-adic cohomology.

The approach we describe for computing Lp(T)L_{\mathfrak{p}}(T) involves computing (to suitable pp-adic precision) the matrix of action of FpF_{\mathfrak{p}} on a particular basis of pp-adic cohomology. We exploit the fact that this matrix arises by specialization from a pp-adic analytic family of matrices closely related to the hypergeometric equation; this is the Frobenius structure in the title.

5. Frobenius structures on hypergeometric equations

In order to describe Frobenius structures on a hypergeometric differential equation 0=1t1(ti=1n(D+αi)i=1n(D+βi1))(y)=Dn+a0Dn1++an1 0 = \frac{1}{t-1}\left( t \prod_{i=1}^n (D + \alpha_i) - \prod_{i=1}^n (D + \beta_i - 1) \right) (y) = D^n + a_0 D^{n-1} + \cdots + a_{n-1} we introduce the companion matrix N=(010000000001a0a1an2an1). N = \begin{pmatrix} 0 & -1 & \cdots & 0 & 0 \\ 0 & 0 & & 0 & 0 \\ \vdots & & \ddots & & \vdots \\ 0 & 0 & & 0 & -1 \\ a_0 & a_1 & \cdots & a_{n-2} & a_{n-1} \end{pmatrix}.

def companion_matrix(l):
    n = len(l)
    matlist = [[0 for j in range(n)] for i in range(n)]
    for i in range(n-1): matlist[i][i+1] = -1
    for i in range(n): matlist[n-1][i] = l[i]
alpha, beta = H.alpha_beta()
show(alpha, beta)
[18,16,38,58,56,78][0,112,512,12,712,1112]\left[\frac{1}{8}, \frac{1}{6}, \frac{3}{8}, \frac{5}{8}, \frac{5}{6}, \frac{7}{8}\right] \left[0, \frac{1}{12}, \frac{5}{12}, \frac{1}{2}, \frac{7}{12}, \frac{11}{12}\right]
R.<t> = PolynomialRing(QQ)
pol2.<D> = PolynomialRing(R.fraction_field())
diffop = (t*prod(D+a for a in alpha) - prod(D+b-1 for b in beta))/(t-1)
N = companion_matrix(diffop.list()[:-1])
(01000000100000010000001000000117549152t38541472t1270536864t+259313824t12049736864t2400120736t1283144t+475144t11003288t34772t13t+72t1)\left(\begin{array}{rrrrrr} 0 & -1 & 0 & 0 & 0 & 0 \\ 0 & 0 & -1 & 0 & 0 & 0 \\ 0 & 0 & 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & 0 & -1 & 0 \\ 0 & 0 & 0 & 0 & 0 & -1 \\ \frac{\frac{175}{49152} t - \frac{385}{41472}}{t - 1} & \frac{\frac{2705}{36864} t + \frac{2593}{13824}}{t - 1} & \frac{\frac{20497}{36864} t - \frac{24001}{20736}}{t - 1} & \frac{\frac{283}{144} t + \frac{475}{144}}{t - 1} & \frac{\frac{1003}{288} t - \frac{347}{72}}{t - 1} & \frac{3 t + \frac{7}{2}}{t - 1} \end{array}\right)

For a Galois-stable datum, a Frobenius structure on NN is an n×nn \times n matrix FF satisfying NFpFσ(N)+D(F)=0 NF - pF \sigma(N) + D(F) = 0 where σ\sigma is the substitution ttpt \mapsto t^p. Geometrically, this amounts to giving an isomorphism of the connection associated to NN with its σ\sigma-pullback.

The catch is that the entries of FF will not be in Q(t)\mathbb{Q}(t); rather, they will be rigid analytic functions on a certain subspace of PQp1\mathbf{P}^1_{\mathbb{Q}_p}. More precisely:

  • FF is holomorphic away from the residue discs containing 0,1,0,1,\infty;
  • FF is meromorphic at 00 and \infty, with no further singularities in those discs;
  • in the residue disc at 1, FF is holomorphic away from a certain subdisc containing the pp-th roots of 1.

For the purpose of representing a pp-adic approximation of FF to suitable accuracy, we may use a rational function with poles at 0,μp,0,\mu_p,\infty.

In the general case, we must modify this definition slightly to assert that NFpFσ(N)+D(F)=0 N'F - pF \sigma(N) + D(F) = 0 where NN' is the companion matrix associated to the datum pα(mod1),pβ(mod1)p\underline{\alpha} \pmod{1}, p\underline{\beta} \pmod{1}.

Such a Frobenius structure always exists and is unique up to a Qp\mathbb{Q}_p-scalar. In the Galois-stable case, there is a unique normalization with the following property: for tt in the unramified extension Qpk\mathbb{Q}_{p^k}, the matrix of FpF_{\mathfrak{p}} on a suitable basis is given by i=0k1F([t]pi) \prod_{i=0}^{k-1} F([\overline{t}]^{p^{i}}) where t\overline{t} is the reduction mod pp and [t][\overline{t}] is the Teichmüller lift. In particular, if K=QK = \mathbb{Q} then the matrix we want is simply F([t])F([\overline{t}]). (But even if KQK \neq \mathbb{Q}, the computation of FF takes place over Qp\mathbb{Q}_p.)

By results of [Dw], there exists a Frobenius structure which is locally analytic in α,β\underline{\alpha}, \underline{\beta} (with analyticity on mod-pp residue classes), and again this is unique up to normalization. However, I have not confirmed that there is a choice of normalization which specializes to the geometric normalization in all Galois-stable cases.

7. Computing the Frobenius structure: multiplicity-free case

The commutation relation between FF and NN amounts to a differential equation on the entries of FF, which we can solve using the known solutions of the hypergeometric equation plus an initial condition. Let us demonstrate this in the case where the original datum is Galois-stable and β\underline{\beta} is multiplicity-free, i.e., β1,,βn\beta_1,\dots,\beta_n are pairwise distinct.

In this case, we obtain a full basis (t1βiyi:i=1,,n)(t^{1-\beta_i} y_i: i=1,\dots,n) of solutions of the hypergeometric equation in the Puiseux field by taking yi:=j=1n(αjβi)+(βjβi)+nFn1(α1βi+1,,αnβi+1β1βi+1,,βiβi+1^,,βn1βi+1t) y_i := \prod_{j=1}^n \frac{(\alpha_j - \beta_i)^+}{(\beta_j - \beta_i)^+} {}_nF_{n-1}\left( \left. \genfrac{}{}{0pt}{}{\alpha_1-\beta_i+1,\dots,\alpha_n-\beta_i+1}{\beta_1-\beta_i+1,\dots,\widehat{\beta_i - \beta_i + 1}, \dots, \beta_{n-1}-\beta_i+1} \right| t \right) where for x(1,1)x \in (-1,1) we write We then form the formal solution matrix UU by setting Uij:=(D+1βi)j1(yi)(i,j=1,,n); U_{ij} := (D+1-\beta_i)^{j-1}(y_i) \qquad (i,j=1,\dots,n); this will satisfy U1NU+U1D(U)=N0,N0:=Diag(β11,,βn1). U^{-1} N U + U^{-1} D(U) = N_0, \qquad N_0 := \mathrm{Diag}(\beta_1-1, \dots, \beta_n - 1).

def formal_solution_matrix(H, R, tprec, K=None):
    if K is None:
        K = R.base_ring()
    alpha, beta = H.alpha_beta()
    d =
    l = []
    for b in beta:
        tmp = [K(prod(a2-b for a2 in alpha if a2>b)/prod(b2-b for b2 in beta if b2>b))]
        for i in range(1,tprec):
            tmp.append(tmp[-1] * prod(a2-b+i for a2 in alpha)/prod(b2-b+i for b2 in beta))
    matlist = [l] # These are the modified solution functions
    t = R.gen()
    for _ in range(d-1):
        matlist.append([(1-beta[j])*matlist[-1][j] + (matlist[-1][j]<<1).derivative() for j in range(d)])

To compute FF, we first identify the matrix F0:=U1Fσ(U)F_0 := U^{-1} F \sigma(U), which satisfies N0F0pF0σ(N0)+D(F0)=0. N_0F_0 - pF_0 \sigma(N_0) + D(F_0) = 0. This equation has the following consequence: the (i,j)(i,j) entry of F0F_0 can only be nonzero when βipβj(mod1)\beta_i \equiv p \beta_j \pmod{1}, and in this case it must equal tp+1+pβjt^{-p+1+\lfloor p\beta_j \rfloor} times some scalar in Qp\mathbb{Q}_p.

Conjecture: that scalar equals pZ(βj)mink{Z(βk)}(1)1+Z(βi)k=1nΓp((αkβi)mod1)/Γp(αk)Γp((βkβi)mod1)/Γp(βk), p^{Z(\beta_j)-\min_k\{Z(\beta_k)\}} (-1)^{1+Z(\beta_i)} \prod_{k=1}^n \frac{\Gamma_p((\alpha_k - \beta_i) \mod{1})/ \Gamma_p(\alpha_k)}{\Gamma_p((\beta_k - \beta_i) \mod{1})/\Gamma_p(\beta_k)}, where ZZ again denotes the zigzag function. Note that the powers of pp correspond to the Hodge numbers.

def initial_Frobenius_matrix(H,t,p,pprec=20):
    alpha, beta = H.alpha_beta()
    d =
    gamma_prods = {}
    K = Qp(p,prec=pprec)
    perm = [beta.index(frac(p*b)) for b in beta]
    m = min(H.zigzag(b) for b in beta)
    for j in range(d):
        i = perm[j]
        u = K((-1)^(1+H.zigzag(beta[i])))
        u *= p^(H.zigzag(beta[j])-m)
        u *= prod(K(frac(a-beta[i])).gamma()/K(a).gamma() for a in alpha)
        u /= prod(K(frac(b-beta[i])).gamma()/K(b).gamma() for b in beta)
        gamma_prods[i,j] = u*t^(-p+1+floor(p*beta[j]))
    return matrix(gamma_prods)

Given F0F_0 (i.e., assuming the conjecture), we compute F=UF0σ(U)1F = U F_0 \sigma(U)^{-1} as a Laurent series. Note that UU and U1U^{-1} converge to holomorphic functions on the open unit disc, but do not extend toany larger region (because their coefficients are unbounded); by contrast, FF does have bounded coefficients and does admit a meromorphic continuation to a suitable subspace of PQp1\mathbf{P}^1_{\mathbb{Q}_p}; this observation can itself be used to compute F0F_0 (compare the lecture by van Straten).

from itertools import izip, repeat, chain

def sigma(y,p,tprec):
    R = y.parent()
    l = izip(y, *repeat(repeat(0), p-1)) # Interpose p-1 zeroes between elements of y
    return(R(list(chain.from_iterable(l)), p*y.valuation()).add_bigoh(tprec))
def frobenius_structure(H, R, p, tprec, pprec):
    t = R.gen()
    U = formal_solution_matrix(H,R,tprec+p)
    F0 = initial_Frobenius_matrix(H,t,p,pprec)
    Utrunc = U.apply_map(lambda x: x.add_bigoh(tprec//p+1))
    Uinvsig = (~Utrunc).apply_map(lambda x: sigma(x,p,tprec+p))
    F = U * F0 * Uinvsig

To extract Lp(T)L_{\mathfrak{p}}(T) for a particular parameter value t0t_0, we must evaluate at t=[t0]t = [\overline{t}_0]. The power series converges for t<1|t| < 1, so we cannot plug in the value directly; instead, we must reduce modulo some power of pp, multiply by a suitable power of tp1t^p-1 to clear denominators, resolve to a polynomial, evaluate, then divide by the evaluation of the same power of tp1t^p-1.

Warning: doing this correctly and efficiently involves making some extra analysis to work out the levels of tt-adic and pp-adic precision and the pole order in the reduction. For this demonstration, we are eyeballing all of this.

def euler_factor(H,t0,p,pprec=None,tprec=None,e=None):
    d =
    alpha,beta = H.alpha_beta()
    if len(set(beta)) < d:
        raise ValueError("Repeated values in beta not allowed")
    if any(x.valuation(p) < 0 for x in alpha+beta):
        raise ValueError("Wild primes not allowed")
    if t0.valuation(p) < 0 or t0%p in (0,1):
        raise ValueError("Tame primes not allowed")

    w = H.weight()
    if e is None: e=max(5, ceil(d*w/2) + ceil(d/2)*ceil(log(d,p)))
    if tprec is None: tprec=(e+3)*p
    if pprec is None: pprec=ceil(2*e*(1+3/log(p)))

    K = Qp(p, pprec)
    R.<t> = LaurentSeriesRing(K, tprec+p)
    F = frobenius_structure(H, R, p, tprec, pprec)
    u = t^p - 1
    s = e + 1
    arg = K.teichmuller(t0)
    F1 = F.apply_map(lambda x: (x*u^s).truncate(tprec)(arg)/u(arg)^s)
    l = [IntegerModRing(p^e)(x).lift_centered() for x in reversed(list(F1.charpoly()))]
Hypergeometric data for [1/8, 1/6, 3/8, 5/8, 5/6, 7/8] and [0, 1/12, 5/12, 1/2, 7/12, 11/12]

show(H.euler_factor(t0, p))
24137569T6+668168T553465T47752T3185T2+8T+124137569T^{6} + 668168T^{5} - 53465T^{4} - 7752T^{3} - 185T^{2} + 8T + 1

show(euler_factor(H, t0, p)) # Takes longer, but should give the same answer
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-20-ad26551453b3> in <module>() ----> 1 show(euler_factor(H, t0, p)) # Takes longer, but should give the same answer <ipython-input-17-0d98919d0dfa> in euler_factor(H, t0, p, pprec, tprec, e) 16 K = Qp(p, pprec) 17 R = LaurentSeriesRing(K, tprec+p, names=('t',)); (t,) = R._first_ngens(1) ---> 18 F = frobenius_structure(H, R, p, tprec, pprec) 19 u = t**p - Integer(1) 20 s = e + Integer(1) <ipython-input-16-34c4ea810d6a> in frobenius_structure(H, R, p, tprec, pprec) 4 F0 = initial_Frobenius_matrix(H,t,p,pprec) 5 Utrunc = U.apply_map(lambda x: x.add_bigoh(tprec//p+Integer(1))) ----> 6 Uinvsig = (~Utrunc).apply_map(lambda x: sigma(x,p,tprec+p)) 7 F = U * F0 * Uinvsig 8 return(F) /ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/matrix/matrix0.pyx in sage.matrix.matrix0.Matrix.__invert__ (build/cythonized/sage/matrix/matrix0.c:37188)() 5303 5304 A = self.augment(self.parent().identity_matrix()) -> 5305 A.echelonize() 5306 5307 # Now we want to make sure that B is of the form [I|X], in /ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/matrix/matrix2.pyx in sage.matrix.matrix2.Matrix.echelonize (build/cythonized/sage/matrix/matrix2.c:52993)() 6722 if self.base_ring().is_field(): 6723 if algorithm in ['classical', 'partial_pivoting', 'scaled_partial_pivoting']: -> 6724 self._echelon_in_place(algorithm) 6725 elif algorithm == 'strassen': 6726 self._echelon_strassen(cutoff) /ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/matrix/matrix2.pyx in sage.matrix.matrix2.Matrix._echelon_in_place (build/cythonized/sage/matrix/matrix2.c:54956)() 7001 scale_factor = 0 7002 for c in range(nc): -> 7003 abs_val = A.get_unsafe(r, c).abs() 7004 if abs_val > scale_factor: 7005 scale_factor = abs_val /ext/sage/sage-8.3_1804/local/lib/python2.7/site-packages/sage/structure/element.pyx in sage.structure.element.RingElement.abs (build/cythonized/sage/structure/element.c:19373)() 2715 ArithmeticError: absolute valued not defined on integers modulo n. 2716 """ -> 2717 return abs(self) 2718 2719 def is_prime(self): TypeError: bad operand type for abs(): 'sage.rings.laurent_series_ring_element.LaurentSeries'

We have tested the conjecture (and the code) extensively on random hypergeometric data of degree at most 6, by computing the resulting Euler factors and comparing against the trace formula. Here is a small example. (This test runs 10 times; I have run it several thousand times with no failures, though one occasionally sees a discrepancy due to too little pp-adic precision in the calculation.)

from sage.modular.hypergeometric_motive import possible_hypergeometric_data as possible

poss = []
for d in range(3,7):
    for H in possible(d):
        alpha,beta = H.alpha_beta()
        if len(set(beta))==d:
        if len(set(alpha))==d:
            H = H.swap_alpha_beta()
import random

for _ in range(10):
    H = random.choice(random.choice(poss))
    p = random_prime(50, lbound=3)
    alpha, beta = H.alpha_beta()
    if any(x.valuation(p) < 0 for x in alpha+beta):
    t0 = ZZ.random_element(p-2) + 2
        P = euler_factor(H, t0, p)
        Q = H.euler_factor(t0, p)
        if P != Q:
            print("Discrepancy", H.alpha_beta(), p, t0, P, Q)
    except ValueError:
        print("Fail", H.alpha_beta(), p, t0)

print("All tests completed")

For fun, here is a larger example that demonstrates the crossover between computing the trace formula and computing the Frobenius structure when the degree gets large enough. (I wasn't able to get a timing using Sage's built-in function because it is so much slower than Magma; it was still running after 6 hours.)

H = HGData(alpha_beta=([0 for _ in range(12)],[i/13 for i in range(1,13)]))
t0 = 3
p = 17
P = euler_factor(H, t0, p)
# Answer from Sage (this code) on a reference machine which also runs Magma. Time: 9m 30s
sage: euler_factor(H, 3, 17)
1620424537653706124163623118049428940979124903532013480548031299441192142935188769*T^12 + 231918100755787659275118586119206936199658025307666859614931289170335335008*T^11 + 20182957687062258732203903537758608256143309713376397469047940582564*T^10 - 1469752788755235821167098334539748493356928081725386845464463*T^9 - 37690568343169351781454593977180880184163410197085525*T^8 + 263732308274784474538180871697652950211073891878*T^7 + 32544845073122731262663959685250016598757*T^6 + 7695293715511338589329322411765766*T^5 - 32089017196595110093924725*T^4 - 36511517823836880799*T^3 + 14629593842084*T^2 + 4905056*T + 1
# Answer from Magma on the reference machine. Time: 47m 7s
> H := HypergeometricData([1,1,1,1,1,1,1,1,1,1,1,1],[13]);
> time EulerFactor(H, 1/3, 17);
1620424537653706124163623118049428940979124903532013480548031299441192142935188769*$.1^12 + 231918100755787659275118586119206936199658025307666859614931289170335335008*$.1^11 + 20182957687062258732203903537758608256143309713376397469047940582564*$.1^10 - 1469752788755235821167098334539748493356928081725386845464463*$.1^9 - 37690568343169351781454593977180880184163410197085525*$.1^8 + 263732308274784474538180871697652950211073891878*$.1^7 + 32544845073122731262663959685250016598757*$.1^6 + 7695293715511338589329322411765766*$.1^5 - 32089017196595110093924725*$.1^4 - 36511517823836880799*$.1^3 + 14629593842084*$.1^2 + 4905056*$.1 + 1
# Check that the answer is pure of the correct weight.
[i.abs()^(-2) for i,_ in P.roots(ComplexField(200))]

8. Unresolved issues

Non-Galois data: In some sense, this conjecture should remain valid for non-Galois data. The tricky part is to specify a "geometric" normalization, i.e., to nail down the construction of a family of hypergeometric motives (no longer with coefficients in Q\mathbb{Q}).

Repeated parameters: It would obviously be desirable to be able to treat the case where β\underline{\beta} is not multiplicity-free. We have not done any computations in this case yet, but let me indicate conceptually what should be done.

Suppose that βi=βi+1==βi+h\beta_i = \beta_{i+1} = \cdots = \beta_{i+h} for some h>0h>0 (and that this value does not repeat elsewhere). We formally introduce a "positive" power series variable ϵ\epsilon and consider what happens when βi+j=βi+j1+ϵ(j=1,,h). \beta_{i+j} = \beta_{i+j-1} + \epsilon \qquad (j=1,\dots,h). For j,j{i,,i+h}j,j' \in \{i,\dots,i+h\}, we formally have Using the functional equation for Γp\Gamma_p and the consideration that ϵ\epsilon should be considered to be divisible by pp, we formally have

This should yield an expression for FF without poles; at this point, setting ϵ=0\epsilon = 0 should give a correct conjectural formula for the Frobenius structure. Note that this will naturally produce derivatives of Γp\Gamma_p of order up to hh.

This is consistent with a result of Shapiro [Sh1, Sh2] (see also the earlier lecture by van Straten): in the case α=(15,25,35,45),β=(0,0,0,0)\underline{\alpha} = (\frac{1}{5}, \frac{2}{5}, \frac{3}{5}, \frac{4}{5}), \underline{\beta} = (0,0,0,0) corresponding to the Dwork pencil of quintic threefolds, the matrix F0F_0 has a unique off-diagonal entry which can be expressed in terms of ζp(3)\zeta_p(3), or equivalently in terms of Γp(i)(0)\Gamma_p^{(i)}(0) for i=0,1,2,3i=0,1,2,3.

Generalization to GKZ hypergeometrics, and proving the conjecture: It may be possible to handle both of these using the methods of [Dw] and/or the unpublished work of Adolphson mentioned in the earlier lecture by Horja.

Recovering information from the Frobenius structure: It should be possible to recover the trace formula from this description of the Frobenius structure. Can one also recover some supercongruences and/or identify new ones?