Keywords

1 Introduction

In the study of hypergeometric functions in several variables, one often considers the integral of the following form:

$$\begin{aligned} \langle \omega \rangle =\int _\varGamma h_{1}(x)^{-\gamma _1}\cdots h_{k}(x)^{-\gamma _k}x^{c}\omega , \end{aligned}$$
(1)

where \(h_l(x;z)=h_{l,z^{(l)}}(x)=\sum _{j=1}^{N_l}z_j^{(l)}x^{\mathbf{a}^{(l)}(j)}\) (\(l=1,\dots ,k\)) are Laurent polynomials in torus variables \(x=(x_1,\dots ,x_n)\), \({\mathbf{a}^{(l)}(j)} \in \mathbb {Z}^n\), \(\gamma _l\in \mathbb {C}\) and \(c={}^t(c_1,\dots ,c_n)\in \mathbb {C}^{n}\) are parameters, \(x^c=x_1^{c_1}\dots x_n^{c_n}\), \(\varGamma \) is a suitable integration cycle, and \(\omega \) is an algebraic n-form on \(V_z=\{ x\in \mathbb {C}^n\mid x_1\dots x_n h_1(x)\dots h_k(x)\ne 0\}\). As a function of the independent variable \(z=(z_j^{(l)})_{j,l}\), the integral (1) defines a hypergeometric function. We call the integral (1) the Euler integral.

We can naturally define the twisted de Rham cohomology group associated to the Euler integral (1). We set \(N=N_1+\dots +N_k\), \(\mathbb {G}_m^n=\mathrm{Specm}\;\mathbb {C}[x_1^\pm ,\dots ,x_n^\pm ]\), and \(\mathbb {A}^N=\mathrm{Specm}\;\mathbb {C}[z_j^{(l)}]\). For any \(z\in \mathbb {A}^N\), we can define an integrable connection \(\nabla _x=d_x-\sum _{l=1}^k\gamma _l\frac{d_xh_l}{h_l}\wedge +\sum _{i=1}^nc_i\frac{dx_i}{x_i}\wedge :\mathcal {O}_{V_z}\rightarrow \varOmega ^1_{V_z}\). The algebraic de Rham cohomology group \({{\,\mathrm{H}\,}}_\mathrm{dR}^*\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) \) is defined as the hypercohomology group

$$\begin{aligned} {{\,\mathrm{H}\,}}_\mathrm{dR}^*\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) =\mathbb {H}^*\left( V_z;(0\rightarrow \mathcal {O}_{V_z}\overset{\nabla _x}{\rightarrow }\varOmega _{V_z}^1\overset{\nabla _x}{\rightarrow }\cdots \overset{\nabla _x}{\rightarrow }\varOmega _{V_z}^n\rightarrow 0)\right) . \end{aligned}$$
(2)

Under a genericity assumption on the parameters \(\gamma _l\) and c, we have the vanishing result \({{\,\mathrm{H}\,}}_\mathrm{dR}^m\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) =0\) \((m\ne n)\). Moreover, we can define a perfect pairing \(\langle \bullet ,\bullet \rangle _{ch}:{{\,\mathrm{H}\,}}_\mathrm{dR}^n\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) \times {{\,\mathrm{H}\,}}_\mathrm{dR}^{n}\left( V_z;(\mathcal {O}_{V_z}^\vee ,\nabla _x^\vee )\right) \rightarrow \mathbb {C}\) which is called the cohomology intersection form. Here, \((\mathcal {O}_{V_z}^\vee ,\nabla _x^\vee )\) is the dual connection of \((\mathcal {O}_{V_z},\nabla _x)\).

The study of intersection numbers of twisted cohomology groups and twisted period relations for hypergeometric functions started with the celebrated work by K. Cho and K. Matsumoto [6]. They clarified that the cohomology intersection number appears naturally as a part of the quadratic relation, a class of functional relations of hypergeometric functions. They also developed a systematic method of computing the cohomology intersection number for 1-dimensional integrals. Since this work, several methods have been proposed to evaluate intersection numbers of twisted cohomology groups, see, e.g., [2, 3, 10, 11, 14, 17, 19] and references therein. All methods utilize comparison theorems of twisted cohomology groups and residue calculus.

When z belongs to a certain non-empty Zariski open subset of \(\mathbb {A}^N\) (the non-singular locus), we proposed a new method in the paper [16] to obtain cohomology intersection numbers by constructing a rational function solution of a system of linear partial differential equations. One weak point of the method was that it was not algorithmic to construct the Pfaffian system (the explicit form of the integrable connection) for a given basis of the twisted cohomology group. We will give a new algorithm to construct the Pfaffian system for a given basis in this paper (Algorithm 1). To our knowledge, algorithms to find the Pfaffian system (or equation) with respect to a given basis of twisted cohomology group do not appear in the literature except the twisted logarithmic cohomology caseFootnote 1. Our algorithm works for a more general class of twisted cohomology groups. Moreover, it is more efficient by utilizing Saito’s b-function [23] expressed in terms of facets of a polytope. The Sect. 2 is a brief overview of the paper [16]. The Sect. 3 is the main part and in the Sects. 4 and 5, we will give demonstrations of our implementation. As to the construction of rational function solutions, we utilize the algorithm and the implementation by M. Barkatou, T. Cluzeau, C. El Bacha, J.-A. Weil [5] (see also [4, 18] and their references).

2 General Results

2.1 The Cohomology Intersection Form

We denote by \({{\,\mathrm{H}\,}}^n_{dR,c}\left( V_z^{an};(\mathcal {O}_{V_z^{an}},\nabla _x^{an})\right) \) the analytic de Rham cohomology group with compact support. By Poincaré-Verdier duality, the bilinear pairing

(3)

is perfect. We say that the regularization condition is satisfied if the canonical morphism \({{\,\mathrm{H}\,}}^n_{dR,c}\left( V_z^{an};(\mathcal {O}_{V_z^{an}},\nabla _x^{an})\right) \rightarrow {{\,\mathrm{H}\,}}^n_{dR}\left( V_z^{an};(\mathcal {O}_{V_z^{an}},\nabla _x^{an})\right) \) is an isomorphism. In the following, we always assume that the regularization condition is satisfied. A criterion for this assumption is explained in Sect. 2.3. Since \((\mathcal {O}_{V_z},\nabla _x)\) is a regular connection, the canonical morphism \({{\,\mathrm{H}\,}}^n_{dR}\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) \) \(\rightarrow \) \({{\,\mathrm{H}\,}}^n_{dR}\left( V_z^{an};(\mathcal {O}_{V_z^{an}},\nabla _x^{an})\right) \) is always an isomorphism by Deligne-Grothendieck comparison theorem ( [7, Corollaire 6.3]). Therefore, we have a canonical isomorphism \(\mathrm{reg}:\) \({{\,\mathrm{H}\,}}^n_{dR}\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) \) \(\rightarrow \) \({{\,\mathrm{H}\,}}^n_{dR,c}\left( V_z^{an};(\mathcal {O}_{V_z^{an}},\nabla _x^{an})\right) \). Note that the Poincaré dual of the isomorphism \(\mathrm{reg}\) is called a regularization map in the theory of special functions ( [2, § 3.2]). Finally, we define the cohomology intersection form \(\langle \bullet ,\bullet \rangle _{ch}\) between algebraic de Rham cohomology groups by the formula

(4)

The value above is called the cohomology intersection number of \(\phi \) and \(\psi \).

2.2 The Secondary Equation

Now, we treat z as a variable. Let \(\pi :X=(\mathbb {G}_m)_x^n\times \mathbb {A}^N_z\setminus \bigcup _{l=1}^k\{ (x,z)\mid h_{l,z^{(l)}}(x)=0\}\rightarrow \mathbb {A}^N_z=Y\) be the natural projection where subscripts stand for coordinates. We define an \(\mathcal {O}_Y\)-module \(\mathcal {H}^n_{dR}\) by the hypercohomology group

$$\begin{aligned} \mathcal {H}^n_{dR}=\mathbb {H}^n\left( X;\left( 0\rightarrow \varOmega ^0_{X/Y}\overset{\nabla _x}{\rightarrow }\varOmega ^1_{X/Y}\overset{\nabla _x}{\rightarrow }\cdots \overset{\nabla _x}{\rightarrow }\varOmega ^n_{X/Y}\rightarrow 0\right) \right) . \end{aligned}$$
(5)

Here, \(\varOmega ^\bullet _{X/Y}\) denotes the sheaf of relative differential forms \(\oplus _{|I|=\bullet }\mathcal {O}_Xdx^{I}\) with respect to the morphism \(\pi \). Since Y is affine, \(\mathcal {H}_{dR}^n\) is also identified with the sheaf \(R^n\pi _*(\varOmega ^\bullet _{X/Y},\nabla _x)\). For any \(z\in Y\), there is a natural evaluation morphism \(\mathrm{ev}_z:\mathcal {H}_{dR}^n\rightarrow {{\,\mathrm{H}\,}}^n_{dR}\left( V_z;(\mathcal {O}_{V_z},\nabla _x)\right) \). We define the dual object \(\mathcal {H}_{dR}^{n\vee }\) by replacing \(\nabla _x\) by \(\nabla _x^\vee \) in the construction above. By the general theory of relative de Rham cohomology, there exists a non-empty Zariski open subset U of Y such that \(\mathcal {H}_{dR}^n\restriction _U\simeq \mathcal {O}_U^{\oplus r}\). Therefore, for any global sections \(\phi \) of \(\mathcal {H}_{dR}^n\restriction _U\) and \(\psi \) of \(\mathcal {H}_{dR}^{n\vee }\restriction _U\), we can define the cohomology intersection number \(\langle \phi ,\psi \rangle _{ch}\) as a function of \(z\in U\) by the formula \(U\ni z\mapsto \langle \mathrm{ev}_z(\phi ),\mathrm{ev}_z(\psi )\rangle _{ch}\in \mathbb {C}\). This actually defines a \(\mathcal {O}_U\)-bilinear map \(\langle \bullet ,\bullet \rangle _{ch}:\mathcal {H}_{dR}^n\restriction _U\times \mathcal {H}_{dR}^{n\vee }\restriction _U\rightarrow \mathcal {O}_U\).

We can equip \(\mathcal {H}_{dR}^n\) with a structure of a \(\mathcal {D}_Y\)-module. For this purpose, we only need to define a connection \(\nabla ^{GM}:\mathcal {H}_{dR}^n\rightarrow \varOmega ^1_Y(\mathcal {H}_{dR}^n):=\varOmega _Y^n \otimes \mathcal {H}_{dR}^n\). For any section \(\phi \in \mathcal {H}_{dR}^n\), we define

$$\begin{aligned} \nabla ^{GM}\phi =d_z\phi -\displaystyle \sum _{j,l}\gamma _l\frac{x^{\mathbf{a}^{(l)}(j)}}{h_{l,z^{(l)}}(x)}dz_j^{(l)}\wedge \phi . \end{aligned}$$
(6)

Here, the superscript GM stands for “Gauß-Manin”. The dual connection \(\nabla ^{\vee GM}:\mathcal {H}_{dR}^{n\vee }\rightarrow \varOmega ^1_Y(\mathcal {H}_{dR}^{n\vee })\) is defined by replacing \(\gamma _l\) by \(-\gamma _l\) in (6).

The \(\mathcal {D}_Y\)-module structures of \(\mathcal {H}_{dR}^n\) and \(\mathcal {H}_{dR}^{n\vee }\) are compatible with the cohomology intersection form. Namely, for any local sections \(\phi \) of \(\mathcal {H}_{dR}^n\restriction _U\) and \(\psi \) of \(\mathcal {H}_{dR}^{n\vee }\restriction _U\), we have

$$\begin{aligned} d_z\langle \phi ,\psi \rangle _{ch}=\langle \nabla ^{GM}\phi ,\psi \rangle _{ch}+\langle \phi ,\nabla ^{\vee GM}\psi \rangle _{ch}. \end{aligned}$$
(7)

We call (7) the secondary equation. Let us rewrite it in terms of local frames. Let \(\{ \phi _i\}_{i=1}^r\) (resp. \(\{\psi _i\}_{i=1}^r\)) be a free basis of \(\mathcal {H}_{dR}^n\restriction _U\) (resp. \(\mathcal {H}_{dR}^{n\vee }\restriction _U\)). We set \(I=I_{ch}=(\langle \phi _i,\psi _j\rangle _{ch})_{i,j}\) and call it the cohomology intersection matrix. On the other hand, there is a \(r\times r\) matrix \(\varOmega \) (resp. \(\varOmega ^\vee \)) with values in 1-forms on U such that the connection \(\nabla ^{GM}\) (resp. \(\nabla ^{\vee GM}\)) is trivialized as \(d_z+\varOmega \wedge \) (resp. \(d_z+\varOmega ^\vee \wedge \)). Then, the secondary equation is equivalent to the system

$$\begin{aligned} d_zI={}^t\varOmega I+I\varOmega ^\vee . \end{aligned}$$
(8)

We also call (8) the secondary equation. The theorem which our algorithm is based on is the following

Theorem 1

[16]. Under the regularization condition, all the entries of the cohomology intersection matrix \(I_{ch}\) are rational functions. Moreover, any rational function solution I of the secondary equation (8) is, up to a scalar multiplication, equal to \(I_{ch}\).

2.3 GKZ System Behind

In [16], it is discussed that Theorem 1 is true for more general direct image \(\mathcal {D}\)-modules. However, by employing the combinatorial structure behind our integrable connection \(\mathcal {H}_{dR}^n\restriction _U\), we can show that the cohomology intersection number in question has a rational expression with respect to z and \(\delta \).

Let us recall the definition of GKZ system [8]. For a given \(d\times N\) (\(d<N\)) integer matrix \(A=(\mathbf{a}(1)|\cdots |\mathbf{a}(N))\) and a parameter vector \(\delta \in \mathbb {C}^{d}\), GKZ system \(M_A(\delta )\) is defined as a system of partial differential equations on \(\mathbb {C}^N\) given by

$$\begin{aligned} {M_A(\delta ):} \left\{ \begin{array}{lll} E_i\cdot f(z)=0 &{} \quad (i=1,\dots , d) &{} \quad (a) \\ \Box _u\cdot f(z) = 0 &{} \quad \left( u\in {{\,\mathrm{Ker}\,}}(A\times :\mathbb {Z}^{N\times 1}\rightarrow \mathbb {Z}^{d\times 1})\right) , &{} \quad (b) \end{array}\right. \end{aligned}$$
(9)

where \(E_i\) and \(\Box _u\) for \(u={}^t(u_1,\dots ,u_{N})\) are differential operators defined by

$$\begin{aligned} E_i=\sum _{j=1}^{N}a_{ij}z_j\frac{\partial }{\partial z_j}+\delta _i,\;\;\; \Box _u=\prod _{u_j>0}\left( \frac{\partial }{\partial z_j}\right) ^{u_j}-\prod _{u_j<0}\left( \frac{\partial }{\partial z_j}\right) ^{-u_j}. \end{aligned}$$
(10)

For convenience, we assume an additional condition \(\mathbb {Z}A\overset{def}{=}\mathbb {Z}\mathbf{a}(1)+\dots +\mathbb {Z}\mathbf{a}(N)=\mathbb {Z}^{d}\). In our setting, we put \(A_l=(\mathbf{a}^{(l)}(1)|\dots |\mathbf{a}^{(l)}(N_l))\), \(d=n+k\), \(N=N_1+\dots +N_k\). We define an \((n+k)\times N\) matrix A by

$$\begin{aligned} A = \left( \begin{array}{ccc|ccc|c|ccc} 1&{}\cdots &{}1&{}0&{}\cdots &{}0&{}\cdots &{}0&{}\cdots &{}0\\ \hline 0&{}\cdots &{}0&{}1&{}\cdots &{}1&{}\cdots &{}0&{}\cdots &{}0\\ \hline &{}\vdots &{} &{} &{}\vdots &{} &{}\ddots &{} &{}\vdots &{} \\ \hline 0&{}\cdots &{}0&{}0&{}\cdots &{}0&{}\cdots &{}1&{}\cdots &{}1\\ \hline &{}A_1&{} &{} &{}A_2&{} &{}\cdots &{} &{}A_k&{} \end{array} \right) . \end{aligned}$$
(11)

We put \(\delta =\begin{pmatrix}\gamma \\ c\end{pmatrix}\). By abuse of notation, we also denote by \(M_A(\delta )\) the quotient \(\mathcal {D}_Y\)-module \(\mathcal {D}_Y/J\) where J is the left ideal of \(\mathcal {D}_Y\) generated by the operators (10). It is known that GKZ system \(M_A(\delta )\) is holonomic ( [1]). We say that the parameter \(\delta \) is non-resonant if it does not belong to any \(\mathbb {C}\varGamma +\mathbb {Z}^d\) where \(\varGamma \) is any facet of the cone \(\sum _{j=1}^N\mathbb {R}_{\ge 0}{} \mathbf{a}(j)\). \(\mathcal {H}_{dR}^n\) (resp. \(\mathcal {H}_{dR}^{n\vee }\)) is isomorphic to GKZ system \(M_A(\delta )\) (resp. \(M_A(-\delta )\)) and the regularization condition is true when the parameter vector \(\delta \) is non-resonant and \(\gamma _l\notin \mathbb {Z}\) (see [9, 2.9] and [15, Theorem 2.12]). We set \(\frac{dx}{x}=\frac{dx_1}{x_1}\wedge \dots \wedge \frac{dx_n}{x_n}\). The isomorphism \(M_A(\delta )\simeq \mathcal {H}_{dR}^n\) is given by the correspondence \([1]\mapsto [\frac{dx}{x}]\). Thus, any section \(\phi \) of \(\mathcal {H}_{dR}^n\) can be written as \(\phi =P\cdot [\frac{dx}{x}]\) for some linear differential operator \(P\in \mathcal {D}_Y\). We define the field \(\mathbb {Q}(\delta )\) as the field extension \(\mathbb {Q}(\gamma _1,\dots ,\gamma _k,c_1,\dots ,c_n)\) of \(\mathbb {Q}\).

Theorem 2

[16]. Suppose that A as in (11) admits a unimodular regular triangulation T and \(\delta \) is non-resonant and \(\gamma _l\notin \mathbb {Z}\). Then, for any \(P_1,P_2\in \mathbb {Q}(\delta )\langle z,\partial _z\rangle \), the cohomology intersection number \(\frac{\langle P_1\cdot \frac{dx}{x},P_2\cdot \frac{dx}{x}\rangle _{ch}}{(2\pi \sqrt{-1})^n}\) belongs to the field \(\mathbb {Q}(\delta )(z)\).

3 An Algorithm of Finding the Pfaffian System for a Given Basis

In this section, we set \(\beta :=-\delta \). With this notation, we put \(H_A(\beta ):=M_A(\delta )\). This is because we use some results from [12] and [23] where the hypergeometric ideal is denoted by \(H_A(\beta )\) while our main references [15, 16] denote it by \(M_A(\delta )\).

Let \(\omega _{q}\) be the differential form

$$\begin{aligned} \prod _{l=1}^k h_l^{-q'_l} x^{q''} \frac{dx}{x}, \quad q=(q',q'') \in \mathbb {Z}^{k} \times \mathbb {Z}^n . \end{aligned}$$
(12)

It is known that there exists a basis of the twisted cohomology group of which elements are of the form \(\omega _{q}\) when \(\delta \) is generic (see, e.g., [13, Th 2]). Let \(\{ \omega _{q} \,|\, q \in Q \}\) be a basis of the twisted cohomology group. We will give an algorithm to find the Pfaffian system \( \frac{\partial }{\partial z_i} \omega = P_i \omega \) with respect to this basis \(\omega = ( \omega _{q}\,|\, q \in Q)^T\). Note that algorithms to translate a given holonomic ideal to a Pfaffian system are well known (see, e.g., [12, Chap 6]). However, as long as we know, algorithms to find the Pfaffian system with respect to a given basis of twisted cohomology group do not appear in the literature. Note that the pairing of the twisted homology and cohomology groups is perfect under our assumption. Then, the Pfaffian equation of the fundamental solution matrix of solutions of the GKZ system can be regarded as a relation of the twisted cycles.

Put \(\partial _{i} = \frac{\partial }{\partial z_i}\). In this subsection, we use \(\bullet \) to denote the action to avoid a confusion with the multiplication. The function \(\langle \omega _q \rangle \) is a solution of the hypergeometric system \(H_A(\beta -q)\). The main point of our method is of use of the following contiguity relation

$$\begin{aligned} \frac{1}{\mathbf{a}'_i \cdot (\beta -q)} \partial _{i} \bullet \langle \omega _{q} \rangle = \langle \omega _{q'} \rangle , \quad q' = q + \mathbf{a}_i \end{aligned}$$
(13)

where \(\mathbf{a}_i{= \mathbf{a(i)}}\) is the i-th column vector of A and \(\mathbf{a}'_i\) is the column vector that the first k elements are equal to those of \(\mathbf{a}_i\) and the last n elements are 0. For example, \(\mathbf{a}'_1 = (1, 0, \ldots , 0)\), \(\mathbf{a}'_2 = (1, 0, \ldots , 0)\), \(\ldots \), \(\mathbf{a}'_{N_1+1} = (0,1,0, \ldots ,0)^T\), \(\ldots \), \(\mathbf{a}'_N = (0,\ldots ,0,1)^T\). The relation (13) can be proved by differentiating \(\langle \omega _q \rangle = \int _\varGamma h_{1}^{-\gamma _1-q'_1}\cdots h_{k}^{-\gamma _k-q'_k}x^{c+q''} \frac{dx}{x},\) with respect to \(z_i\) where we have \(\beta -q = (-\gamma _1-q'_1, \ldots , -\gamma _k-q'_k,-c_1-q_1'', \ldots , -c_n-q_n'')^T\).

In [23, Algorithm 3.2], an algorithm to obtain an operator \(C_i\) satisfying

$$\begin{aligned} C_i \partial _{i} - b_i(\beta ) = 0 \quad \mathrm{mod}\ H_A(\beta ) \end{aligned}$$
(14)

is given. The polynomial \(b_i\) is a b-function in the direction i [23, Th 3.2]. Note that the algorithm outputs the operator \(C_i\) in \(\mathbb {C}\langle z_1, \ldots , z_N, \partial _{1}, \ldots , \partial _{N} \rangle \), which does not depend on the parameter \(\beta \). Since \(\langle \omega _{q} \rangle \) is a solution of \(H_A(\beta -q)\), we have the following inverse contiguity relation

$$\begin{aligned} \frac{\mathbf{a}_i' \cdot (\beta -q'')}{b_i(\beta -q'')}C_i \bullet \langle \omega _{q} \rangle = \langle \omega _{q''} \rangle , \quad q'' = q - \mathbf{a}_i . \end{aligned}$$
(15)

Example 1

(Gauss hypergeometric function \({}_2F_1\).) Put

$$\begin{aligned} A = \left( \begin{array}{cc|cc} 1 &{} 1 &{} 0 &{} 0 \\ \hline 0 &{} 0 &{} 1 &{} 1 \\ \hline 0 &{} 1 &{} 0 &{} 1 \\ \end{array} \right) \end{aligned}$$
(16)

Then, \(h_1 = z_1 + z_2 x\), \(h_2 = z_3 + z_4 x\). We have

$$\begin{aligned} \langle \omega _{(1,0,0)} \rangle = \int _\varGamma h_1^{-\gamma _1} h_2^{-\gamma _2} x^c \frac{1}{h_1} \frac{dx}{x}. \end{aligned}$$
(17)

We can show that \(\{ \omega _{(1,0,0)}, \omega _{(1,0,0)}-\omega _{(0,1,0)} \}\) is a basis of the twisted cohomolgy group. This A is normal and the b-function \(b_4(s) \in \mathbb {Q}[s_1,s_2,s_3]\) for the direction \(z_4\) is \( b_4(s) = s_2 s_3\). Then, \(C_4 = z_2 z_3 \partial _{1} + (\theta _2 + \theta _3 + \theta _4)z_4\) where \(\theta _i = z_i \partial _{i}\) by reducing \((\theta _3+\theta _4)(\theta _2+\theta _4)\) by the toric ideal \(I_A=\langle \underline{\partial _{2}\partial _{3}}-\partial _{1}\partial _{4} \rangle \) (see Algorithm 3.2 of [23]).

Our algorithm to find a Pfaffian system with respect to a given basis of the twisted cohomology group is as follows.

Algorithm 1

Input: \(\{ \omega _q \,|\, q \in Q\}\), a basis of the twisted cohomology group. A direction (index) i.

Output: \(P_i\), the coefficient matrix of the Pfaffian system \(\partial _{i}-P_i\).

  1. 1.

    Compute a Gröbner basis G of \(H_A(\beta )\) in the ring of differential operators with rational function coefficients. Let S be a column vector of the standard monomials with respect to G.

  2. 2.

    Put

    $$\begin{aligned} F(Q) = (F(q) \,|\, q \in Q)^T, \quad F(q) = \prod _{r_i < 0} C_i^{-r_i} \prod _{r_i > 0} \partial _{i}^{r_i} \frac{1}{BB'}, \quad q = \sum _{i=1}^{N} r_i \mathbf{a}_i \end{aligned}$$
    (18)

    It is a vector with entries in the ring of differential operators and the order of the product is \( i = N, N-1, \ldots , 3, 2, 1\). In other words, we apply operators from \(\partial _{1}\). The polynomial B is derived from the coefficient of the contiguity relation (15) and is equal to

    $$\begin{aligned} B= & {} \prod _{j=1, r_j<0}^{N} \frac{b_j(\beta _j'+\mathbf{a}_j)}{\mathbf{a}'_j \cdot (\beta _j'+\mathbf{a}_j)} \frac{ b_j(\beta _j'+2\mathbf{a}_j)}{\mathbf{a}'_j \cdot (\beta _j'+2\mathbf{a}_j)} \cdots \frac{b_j(\beta _j'+(-r_j)\mathbf{a}_j)}{\mathbf{a}'_j \cdot (\beta _j'+(-r_j)\mathbf{a}_j)}, \end{aligned}$$
    (19)
    $$\begin{aligned} \beta _j'= & {} \beta -\sum _{r_l>0} r_l \mathbf{a}_l + \sum _{l=1, r_l<0}^{j-1} (-r_l) \mathbf{a}_l . \end{aligned}$$
    (20)

    The polynomial \(B'\) comes from the denominator of the contiguity relation (13) and is equal to

    $$\begin{aligned} B'= & {} \prod _{j=1, r_j>0}^{N} \left( \mathbf{a}'_j \cdot (\beta _j') \right) \left( \mathbf{a}'_j \cdot (\beta _j'-\mathbf{a}_j)\right) \cdots \left( \mathbf{a}'_j \cdot (\beta _j'-(r_j-1) \mathbf{a}_j) \right) , \end{aligned}$$
    (21)
    $$\begin{aligned} \beta _j'= & {} \beta -\sum _{r_l>0, l < j} r_l \mathbf{a}_l . \end{aligned}$$
    (22)
  3. 3.

    Compute the normal form of the vectors \(\partial _{i} F(Q)\) and F(Q). Write the normal forms of them as \(P'S\) and \(P''S\) respectively where \(P'\) and \(P''\) are matrices with rational function entries.

  4. 4.

    Output \(P_i = P'(P'')^{-1}\).

The matrix \(P''\) is invertible if and only if the given set of differential forms \(\{ \omega _q \}\) is a basis of the twisted cohomology group.

We show the correctness of the algorithm. Take an element \(q \in Q\). We express \(\langle \omega _q \rangle \) in terms of \(\langle \omega _0 \rangle \), which is a solution of \(H_A(\beta )\), by the contiguity relations (13) and (15). Note that the contiguity relations for functions \(\langle \omega _q \rangle \) give the contiguity relations for cohomology classes \([\omega _q]\) by virtue of the perfectness of the pairing between the twisted homology and the twisted cohomology groups. The point of the correctness is the following identity

$$\begin{aligned} F(q) \bullet \omega _0 = \omega _q. \end{aligned}$$
(23)

Let us illustrate how to prove (23) by examples. We assume that \(q = 2 \mathbf{a}_1 + \mathbf{a_2}\) and \(N_1 \ge 2\). Then \(\omega _q\) can be obtained by applying (13) with \(i=1\) for two times and that with \(i=2\). We have

$$\begin{aligned} \omega _{\mathbf{a}_1}= & {} \frac{1}{\mathbf{a}'_1 \cdot \beta } \partial _{1} \bullet \omega _0 ,\end{aligned}$$
(24)
$$\begin{aligned} \omega _{2\mathbf{a}_1}= & {} \frac{1}{\mathbf{a}'_1 \cdot (\beta -\mathbf{a}_1)} \partial _{1} \bullet \omega _{\mathbf{a}_1} , \end{aligned}$$
(25)
$$\begin{aligned} \omega _{2\mathbf{a}_1+\mathbf{a}_2}= & {} \frac{1}{\mathbf{a}'_2 \cdot (\beta -2\mathbf{a}_1)} \partial _{2} \bullet \omega _{2\mathbf{a}_1} . \end{aligned}$$
(26)

Thus, we obtain the numbers (21) and then (23). Let us consider the case that \(q = -2 \mathbf{a}_1 - \mathbf{a_2}\) and \(N_1 \ge 2\). Then \(\omega _q\) can be obtained by applying (15) with \(i=1\) for two times and that with \(i=2\). Since \(\langle \omega _{-\mathbf{a}_1} \rangle \) is a solution of \(H_A(\beta +\mathbf{a}_1)\), we have

$$\begin{aligned}{}[ c_1 \partial _{1} - b_1(\beta +\mathbf{a}_1) ] \bullet \omega _{-\mathbf{a}_1} = 0 \end{aligned}$$
(27)

from [23]. Then, we have

$$\begin{aligned} \omega _{-\mathbf{a}_1}= & {} \frac{\mathbf{a}'_1 \cdot (\beta +\mathbf{a}_1)}{b_1(\beta +\mathbf{a}_1)} c_1 \bullet \omega _0 ,\end{aligned}$$
(28)
$$\begin{aligned} \omega _{-2\mathbf{a}_1}= & {} \frac{\mathbf{a}'_1 \cdot (\beta +2\mathbf{a}_1)}{b_1(\beta +2\mathbf{a}_1)} c_1 \bullet \omega _{-\mathbf{a}_1} , \end{aligned}$$
(29)
$$\begin{aligned} \omega _{-2\mathbf{a}_1-\mathbf{a}_2}= & {} \frac{\mathbf{a}'_2 \cdot (\beta +2\mathbf{a}_1+\mathbf{a}_2)}{b_2(\beta +2\mathbf{a}_1+\mathbf{a}_2)} c_2 \bullet \omega _{-2\mathbf{a}_1} . \end{aligned}$$
(30)

Thus, we obtain the numbers (19) and then (23). The general case can be shown by repeating these procedures. When the normal form F(q) with respect to the Gröbner basis G is \( \sum p''_i s_i \) where \(S=(s_i)\) and \(p''_i\) is a rational function in z and \(\beta \), we have \(\omega _q = F(q) \bullet \omega _0 = \sum p''_i s_i \bullet \omega _0\). The correctness of the last two steps follows from this fact.

Example 2

This is a continuation of Example 1. We have \((1,0,0)^T = \mathbf{a_1}\) and \((0,1,0)^T = \mathbf{a_3}\). Then, the basis of the twisted cohomology group F(Q) is expressed as \( F(Q) = (\partial _{1}/\beta _1,\partial _{1}/\beta _1-\partial _{3}/\beta _2)^T\) and \(\partial _{4} F(Q) = (\partial _{4}\partial _{1}/\beta _1,\partial _{4}\partial _{1}/\beta _1-\partial _{4}\partial _{3}/\beta _2)^T\). We can obtain a Gröbner basis whose set of the standard monomials is \(\{ \partial _{4}, 1 \}\) by the graded reverse lexicographic order such that \(\partial _{i} > \partial _{i+1}\). We multiply \(\beta _1 \beta _2\) to F(Q) and \(\partial _{4} F(Q)\) in order to avoid rational polynomial arithmetic. Then, the normal form, for example, of \(\beta _2 \partial _{1}\) is \(\frac{1}{z_1 z_4-z_2 z_3} \left( (\beta _1(\beta _1+\beta _2) z_4)\partial _{4}-\beta _2^2 \beta _3\right) \). By computing the other normal forms, we obtain the matrix

$$\begin{aligned} P_4= \left( \begin{array}{cc} \frac{ - {\beta }_{2} ( {z}_{3}- {z}_{1})}{ {z}_{1} {z}_{4}- {z}_{2} {z}_{3}}&{} \frac{ {\beta }_{2} {z}_{3}}{ {z}_{1} {z}_{4}- {z}_{2} {z}_{3}} \\ \frac{ - ( ( {\beta }_{2} {z}_{3}+ ( - {\beta }_{2}+ {\beta }_{3}) {z}_{1}) {z}_{4}+ ( {\beta }_{1}- {\beta }_{3}) {z}_{2} {z}_{3}- {\beta }_{1} {z}_{1} {z}_{2})}{ {z}_{4} ( {z}_{1} {z}_{4}- {z}_{2} {z}_{3})}&{} \frac{ ( {\beta }_{2} {z}_{3}+ {\beta }_{3} {z}_{1}) {z}_{4}+ ( {\beta }_{1}- {\beta }_{3}) {z}_{2} {z}_{3}}{ {z}_{4} ( {z}_{1} {z}_{4}- {z}_{2} {z}_{3})} \\ \end{array} \right) . \end{aligned}$$
(31)

4 Implementation and Examples

We implemented our algorithms on the computer algebra system Risa/Asir [21] with a Polymake interface. Polymake (see, e.g., [20, 22]) is a system for polyhedral geometry and it is used for an efficient computation of contiguity relations ( [23, Algorithm 3.2]). Here is an inputFootnote 2 to find the coefficient matrix \(P_4\) for Example 1 with respect to the variable \(z_4\) when \(z_1=z_2=z_3=1\) (note that in our implementation x is used instead of z).

figure a

It outputs the following coefficient matrix

$$\begin{aligned} P_4= \left( \begin{array}{cc} 0&{} \frac{ - {\gamma }_{2}}{ {x}_{4}- 1} \\ \frac{ {c}}{ {x}_{4}}&{} \frac{ ( - {c}- {\gamma }_{2}) {x}_{4}+ {c}- {\gamma }_{1}}{ ( {x}_{4} - 1 ) {x}_{4}} \\ \end{array} \right) \end{aligned}$$
(32)

Example 3

(\({}_3F_2\), see, e.g., [24, p.224], [19].) Let \(A = \left( \begin{array}{cc|cc|cc} 1&{} 1&{} 0&{} 0&{} 0&{} 0 \\ \hline 0&{} 0&{} 1&{} 1&{} 0&{} 0 \\ \hline 0&{} 0&{} 0&{} 0&{} 1&{} 1 \\ \hline 1&{} 0&{} 0&{} 1&{} 0&{} 0 \\ 0&{} 0&{} 1&{} 0&{} 0&{} 1 \\ \end{array} \right) \). The integrals are

$$\begin{aligned} \int _\varGamma (z_1 x_1 + z_2)^{-\gamma _1} (z_3 x_2 + z_4 x_1)^{-\gamma _2} (z_5 + z_6 x_2)^{-\gamma _3} x_1^{c_1} x_2^{c_2} \omega _i \end{aligned}$$
(33)

where

$$\begin{aligned} \omega _1 = \frac{dx_1 dx_2}{(z_1 x_1 + z_2)x_1 x_2}, \omega _2 = \frac{dx_1 dx_2}{(z_5 + z_6 x_2)x_1 x_2}, \omega _3 = \frac{dx_1 dx_2}{(z_3 x_2 + z_4 x_1)x_1 x_2} \end{aligned}$$
(34)

When \(z_2=-1, z_3=z_4=z_5=z_6=1\), the coefficient matrix for \(z_1\) for the basis \((\langle \omega _1 \rangle ,\langle \omega _2 \rangle ,\langle \omega _3 \rangle )^T\) is

$$\begin{aligned} P_1= \left( \begin{array}{ccc} \frac{ {\beta }_{4} {z}_{1}+ {\beta }_{2}+ {\beta }_{3}+ {\beta }_{4}+ {\beta }_{5}}{ {z}_{1} ( {z}_{1}- 1)}&{} \frac{ {\beta }_{3} ( \beta _{4} - {\beta }_{1}- {\beta }_{2}) }{ {\beta }_{1} {z}_{1} ( {z}_{1}- 1)}&{} \frac{ ( -{\beta }_{4}+ 1) {\beta }_{2} ( - {\beta }_{2}+ {\beta }_{4}+ {\beta }_{5}+ 1)}{ {\beta }_{4} {\beta }_{1} {z}_{1} ( {z}_{1}- 1)} \\ \frac{ ( {\beta }_{2}+ {\beta }_{3}- {\beta }_{5}) {\beta }_{1}}{ {\beta }_{3} ( {z}_{1}- 1)}&{} \frac{ {\beta }_{1} {z}_{1}+ {\beta }_{2}- {\beta }_{4}}{ {z}_{1} ( {z}_{1}- 1)}&{} \frac{ ( -{\beta }_{4}+ 1) {\beta }_{2} ( - {\beta }_{2}+ {\beta }_{4}+ {\beta }_{5}+ 1)}{ {\beta }_{4} {\beta }_{3} {z}_{1} ( {z}_{1}- 1)} \\ \frac{ {\beta }_{4} ( {\beta }_{2}+ {\beta }_{3}- {\beta }_{5}) {\beta }_{1}}{ ( -{\beta }_{4}+ 1) {\beta }_{2} ( {z}_{1}- 1)}&{} \frac{ {\beta }_{4} {\beta }_{3} ( {\beta }_{1}+ {\beta }_{2}- {\beta }_{4})}{ ( -{\beta }_{4}+ 1) {\beta }_{2} ( {z}_{1}- 1)}&{} \frac{ ( -{\beta }_{2}+ {\beta }_{4}+ {\beta }_{5}+ 1)}{ {z}_{1}- 1} \\ \end{array} \right) \end{aligned}$$
(35)

The result can be obtained in a few seconds.

5 An Algorithm of Finding the Cohomology Intersection Matrix

Theorem 3

[16]. Given a matrix \(A=(a_{ij})\) as in (11) admitting a unimodular regular triangulation T. When parameters are non-resonant, \(\gamma _l\notin \mathbb {Z}\) and moreover the set of series solutions by T is linearly independent, the intersection matrix of the twisted cohomology group of the GKZ system associated to the matrix A can be algorithmically determined.

We denote by \(\varOmega _i\) the coefficient matrix of \(\varOmega \) with respect to the 1-form \(dz_i\). The algorithm we propose is summarized as follows.

Algorithm 2

(A modified version of the algorithm in [16]).

Input: Free bases \(\{\phi _j\}_j\subset \mathcal {H}_{dR}^n\restriction _U\), \(\{\psi _j\}_j\subset \mathcal {H}_{dR}^{n\vee }\restriction _U\) which are expressed as (12).

Output: The secondary equation (8) and the cohomology intersection matrix \(I_{ch}=(\langle \phi _i,\psi _j\rangle _{ch})_{i,j}\).

  1. 1.

    Obtain a Pfaffian system with respect to the given bases \(\{\phi _j\}_j\) and \(\{\psi _j\}_j\), i.e., obtain matrices \(\varOmega _i=(\omega _{ijk})\) and \(\varOmega _i^\vee =(\omega ^\vee _{ijk})\) so that the equalities

    $$\begin{aligned} \partial _{i}\phi _j=\sum _k\omega _{ikj}\phi _k,\ \ \ \partial _{i}\psi _j=\sum _k\omega ^\vee _{ikj}\psi _k \end{aligned}$$
    (36)

    hold by Algorithm 1.

  2. 2.

    Find a non-zero rational function solution I of the secondary equation

    $$\begin{aligned} \partial _{i} I - {}^t\varOmega _i I - I \varOmega _i^\vee =0, \quad i=1, \ldots , N. \end{aligned}$$
    (37)

    To be more precise, see, e.g., [4, 5, 18] and references therein.

  3. 3.

    Determine the scalar multiple of I by [15, Theorem 8.1].

Example 4

This is a continuation of Example 3. We want to evaluate the cohomology intersection matrix \(I_{ch}=(\langle \omega _i,\omega _j\rangle _{ch})_{i,j=1}^3\). By solving the secondary equation (for example, using [5]), we can verify that (1, 1),  (1, 2),  (2, 1),  (2, 2) entries of \(I_{ch}\) are all independent of \(z_1\). Therefore, we can obtain the exact values of these entries by taking a unimodular regular triangulation \(T=\{ 23456,12456,12346\}\) and substituting \(z_1=0\) in [15, Theorem 8.1]. Thus, we get a correct normalization of \(I_{ch}\) and the matrix \(\frac{I_{ch}}{(2\pi \sqrt{-1})^2}\) is given by

$$\begin{aligned} \left[ \begin{array}{cc} r_{11}&{} \frac{ {\beta }_{4}+ {\beta }_{5}}{ {\beta }_{5} {\beta }_{4} ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5})} \\ \frac{ {\beta }_{4}+ {\beta }_{5}}{ {\beta }_{5} {\beta }_{4} ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5})}&{} r_{22} \\ \frac{ {\beta }_{4} ({\beta }_{1}+ {\beta }_{2}- {\beta }_{4} - {\beta }_{5}) {z}_{1}- {\beta }_{5} {\beta }_{3}}{ {\beta }_{5} ( {\beta }_{4}- 1) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}- 1)}&{} \frac{ - {\beta }_{4} {\beta }_{1} {z}_{1}+ {\beta }_{5} ( {\beta }_{2}+ {\beta }_{3}- {\beta }_{4}- {\beta }_{5})}{ {\beta }_{5} ( {\beta }_{4}- 1) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}- 1)} \\ \end{array} \right. \nonumber \\ \left. \begin{array}{c} \frac{ {\beta }_{4} ( {\beta }_{1}+ {\beta }_{2}- {\beta }_{4} - {\beta }_{4}) {z}_{1}- {\beta }_{5} {\beta }_{3}}{ {\beta }_{5} ( {\beta }_{4}+ 1) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}+ 1)}\\ \frac{ - ( {\beta }_{4} {\beta }_{1} {z}_{1}- {\beta }_{5} {\beta }_{2}- {\beta }_{5} {\beta }_{3}+ {\beta }_{5} {\beta }_{4}+ {\beta }_{5}^{ 2} )}{ {\beta }_{5} ( {\beta }_{4}+ 1) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}) ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}+ 1)}\\ r_{33} \end{array} \right] \end{aligned}$$
(38)

where

$$\begin{aligned} r_{11} = -\frac{ ( {\beta }_{4} {\beta }_{2}+ ( {\beta }_{4}+ {\beta }_{5}) {\beta }_{3}) {\beta }_{1}+ {\beta }_{4} {\beta }_{2}^{ 2} + ( {\beta }_{4} {\beta }_{3}- {\beta }_{4}^{ 2} - {\beta }_{5} {\beta }_{4}) {\beta }_{2}+ ( - {\beta }_{4}^{ 2} - {\beta }_{5} {\beta }_{4}) {\beta }_{3}}{ {\beta }_{5} {\beta }_{4} {\beta }_{1}( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}) ( {\beta }_{2}+ {\beta }_{3}- {\beta }_{5}) } \end{aligned}$$
(39)
$$\begin{aligned} r_{22}= - \frac{ ( {\beta }_{5} {\beta }_{2}+ ( {\beta }_{4}+ {\beta }_{5}) {\beta }_{3}- {\beta }_{5} {\beta }_{4}- {\beta }_{5}^{ 2} ) {\beta }_{1}+ {\beta }_{5} {\beta }_{2}^{ 2} + ( {\beta }_{5} {\beta }_{3}- {\beta }_{5} {\beta }_{4}- {\beta }_{5}^{ 2} ) {\beta }_{2}}{ {\beta }_{5} {\beta }_{4} {\beta }_{3} ( {\beta }_{2}- {\beta }_{4}- {\beta }_{5}) ( {\beta }_{1}+ {\beta }_{2}- {\beta }_{4})} \end{aligned}$$
(40)
(41)
$$\begin{aligned} a_0=({\beta _1}\beta _2-{\beta _1}\beta _5+{\beta _2}^{2}-\beta _2{\beta _4}-2{\beta }_2{\beta }_5+{\beta _4}\beta _5+{\beta _5}^{2})\beta _1\beta _4 \end{aligned}$$
(42)
$$\begin{aligned} a_2=({\beta _2}^{2}+\beta _2{\beta _3}-2{\beta _2}{\beta _4}-\beta _2{\beta _5}-{\beta _3}\beta _4+{\beta _4}^{2}+\beta _4\beta _5)\beta _3\beta _5 \end{aligned}$$
(43)

Example 5

Let \( A = \left( \begin{array}{ccccc} 1&{} 1&{} 1&{} 1&{} 1 \\ \hline 0&{} 1&{} 0&{} 2&{} 0 \\ 0&{} 0&{} 1&{} 0&{} 2 \\ \end{array}\right) \). The integrals are

$$\begin{aligned} \int _\varGamma h_1^{-\gamma _1} x_1^{c_1} x_2^{c_2} \omega _i, \quad h_1 = z_1 + z_2 x_1 + z_3 x_2 + x_4 x_1^2 + z_5 x_2^2 \end{aligned}$$
(44)

where

$$\begin{aligned} \omega _1 = \frac{dx_1 dx_2}{x_1 x_2}, \omega _2 = x_1 \omega _1 = \frac{dx_1 dx_2}{x_2}, \omega _3 = x_2^2 \omega _1 = \frac{x_2 dx_1 dx_2}{x_1}, \omega _4 = x_1 x_2 \omega _1 = dx_1 dx_2. \end{aligned}$$
(45)

Note that this A is not normal. When \(z_1 = z_4 = z_5 =1\), we have obtained the coefficient matrices \(P_2\) and \(P_3\) in about 9 h 45 min on a machine with Intel(R) Xeon(R) CPU E5-4650 2.70 GHz and 256 GB memory. The (1, 1) element of \(P_2\) is

$$\begin{aligned} \frac{ ( ( {b}_{2} {z}_{2}^{ 2} + b_{123}) {z}_{3}^{ 2} + {b}_{2} {z}_{2}^{ 4} + b_{132} {z}_{2}^{ 2} - 32 {b}_{1}+ 16 {b}_{2}+ 16 {b}_{3}- 16)}{ {z}_{2} ( {z}_{2}- 2) ( {z}_{2}+ 2) ( {z}_{3}^{ 2} + {z}_{2}^{ 2} - 4)} \end{aligned}$$
(46)

where \(b_1 = -\gamma _1\), \(b_2 = -c_1\), \(b_3=-c_2\) and \(b_{ijk} = 8 {b}_{i}- 4 {b}_{j}- 8 {b}_{k}+ 4\). A complete data of \(P_2\) and \(P_3\) is at [25]. The intersection matrix can be obtained by [5] in a few seconds when we specialize \(b_i\)’s to rational numbers. See [25] as to Maple inputs for it.