# Effective homology and periods of complex projective hypersurfaces

Pierre Lairez, Eric Pichon-Pharabod, Pierre Vanhove

► To cite this version:

Pierre Lairez, Eric Pichon-Pharabod, Pierre Vanhove. Effective homology and periods of complex projective hypersurfaces. 2024. hal-04144264

HAL Id: hal-04144264

https://hal.science/hal-04144264

Preprint submitted on 10 Jan 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Effective homology and periods of complex projective hypersurfaces

Pierre Lairez, Eric Pichon-Pharabod, Pierre Vanhove

► To cite this version:

Pierre Lairez, Eric Pichon-Pharabod, Pierre Vanhove. Effective homology and periods of complex projective hypersurfaces. Mathematics of Computation, 2024, 93, pp.2985-3025. 10.1090/mcom/3947. hal-04144264v2

HAL Id: hal-04144264

https://hal.science/hal-04144264v2

Submitted on 6 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
EFFECTIVE HOMOLOGY AND PERIODS
OF COMPLEX PROJECTIVE HYPERSURFACES

PIERRE LAIREZ, ERIC PICHON-PHARABOD, AND PIERRE VANHOVE

ABSTRACT. We introduce a new algorithm for computing the periods of a smooth complex projective hypersurface. The algorithm intertwine with a new method for computing an explicit basis of the singular homology of the hypersurface. It is based on Picard–Lefschetz theory and relies on the computation of the monodromy action induced by a one-parameter family of hyperplane sections on the homology of a given section.

We provide a SageMath implementation. For example, on a laptop, it makes it possible to compute the periods of a smooth complex quartic surface with hundreds of digits of precision in typically an hour.

# 1. INTRODUCTION

The $k$-th period matrix of a smooth complex variety $X$ is the matrix of the De Rham duality $H_k(X) \times H_{DR}^k(X) \to \mathbb{C}$

$$ (1) \quad ([\gamma], [\omega]) \mapsto \int_{\gamma} \omega, $$

between singular homology and (algebraic) De Rham cohomology. When $H_{DR}^k(X)$ is endowed with additional structure coming from Hodge theory, we obtain a remarkable continuous invariant of $X$ reflecting an interplay between the complex algebraic structure and the topological one (Griffiths, 1968; Carlson et al., 2017). In experimental mathematics, the numerical computation of periods is a useful tool to investigate some algebraic invariants (Chudnovsky & Chudnovsky, 1989). Periods linearise some aspects of algebraic varieties, at the cost of introducing transcendental functions, with the integral sign. This transcendental nature makes it difficult to compute exactly with periods, but large precision (typically hundreds or thousands of decimal digits) may allow to recover exact invariants.

For curves, the numerical computation of periods gives access to an approximate representation of the Jacobian, which in turn leads to interesting invariants. This has been used to compute some of the data related to genus 2 curves in the LMFDB (Booker et al., 2016), such as the endomorphism rings (Costa et al., 2019) or the Sato–Tate groups (Fité et al., 2012), which can be obtained by recovering integer relations between the periods. For surfaces, periods also lead to interesting invariants that are hard to compute by other means. For example, for an algebraic surface $X$, Lefschetz’s (1, 1)-theorem (Griffiths & Harris, 1978, p. 163) relates the integer relations between the periods of $X$ with the algebraic curves lying on $X$. Integer relations can be recovered from numerical approximations of the periods thanks to lattice reduction algorithms (Lenstra et al., 1982). This leads to a practical algorithm for computing, heuristically, the Néron–Severi group

<footnote>Date: January 10, 2024.</footnote>

<footnote n="2020">2020 Mathematics Subject Classification. Primary 14Q15; Secondary 32G20, 14D05.</footnote>

<footnote>This work has been supported by the Agence nationale de la recherche (ANR), grant agreement ANR-19-CE40-0018 (De Rerum Natura), grant agreement ANR-20-CE40-0026-01 (Symmetries and moduli spaces in algebraic geometry and physics); and the European Research Council (ERC) under the European Union’s Horizon Europe research and innovation programme, grant agreement 101040794 (10000 DIGITS).</footnote>
EFFECTIVE HOMOLOGY AND PERIODS
OF COMPLEX PROJECTIVE HYPERSURFACES

PIERRE LAIREZ, ERIC PICHON-PHARABOD, AND PIERRE VANHOVE

ABSTRACT. We introduce a new algorithm for computing the periods of a smooth complex projective hypersurface. The algorithm intertwine with a new method for computing an explicit basis of the singular homology of the hypersurface. It is based on Picard–Lefschetz theory and relies on the computation of the monodromy action induced by a one-parameter family of hyperplane sections on the homology of a given section.

We provide a SageMath implementation. For example, on a laptop, it makes it possible to compute the periods of a smooth complex quartic surface with hundreds of digits of precision in typically an hour.

# 1. INTRODUCTION

The k-th period matrix of a smooth complex variety X is the matrix of the De Rham dual-
ity $H_k(X) \times H_{\mathrm{DR}}^k(X) \to \mathbb{C}$

$$
(1) \quad ([\gamma], [\omega]) \mapsto \int_{\gamma} \omega,
$$

between singular homology and (algebraic) De Rham cohomology. When $H_{\mathrm{DR}}^k(X)$ is endowed with additional structure coming from Hodge theory, we obtain a remarkable continuous invariant of $X$ reflecting an interplay between the complex algebraic structure and the topological one (Griffiths, 1968; Carlson et al., 2017). In experimental mathematics, the numerical computation of periods is a useful tool to investigate some algebraic invariants (Chudnovsky & Chudnovsky, 1989). Periods linearise some aspects of algebraic varieties, at the cost of introducing transcendental functions, with the integral sign. This transcendental nature makes it difficult to compute exactly with periods, but large precision (typically hundreds or thousands of decimal digits) may allow to recover exact invariants.

For curves, the numerical computation of periods gives access to an approximate representation
of the Jacobian, which in turn leads to interesting invariants. This has been used to compute
some of the data related to genus 2 curves in the LMFDB (Booker et al., 2016), such as the
endomorphism rings (Costa et al., 2019) or the Sato–Tate groups (Fité et al., 2012), which can
be obtained by recovering integer relations between the periods. For surfaces, periods also lead
to interesting invariants that are hard to compute by other means. For example, for an algebraic
surface X, Lefschetz’s (1, 1)-theorem (Griffiths & Harris, 1978, p. 163) relates the integer relations
between the periods of X with the algebraic curves lying on X. Integer relations can be recovered
from numerical approximations of the periods thanks to lattice reduction algorithms (Lenstra et al.,
1982). This leads to a practical algorithm for computing, heuristically, the Néron–Severi group

<footnote>Date: January 6, 2025.</footnote>

<footnote n="2020">2020 Mathematics Subject Classification. Primary 14Q15; Secondary 32G20, 14D05.</footnote>

<footnote>This work has been supported by the Agence nationale de la recherche (ANR), grant agreement ANR-19-CE40-0018 (De Rerum Natura), grant agreement ANR-20-CE40-0026-01 (Symmetries and moduli spaces in algebraic geometry and physics); and the European Research Council (ERC) under the European Union’s Horizon Europe research and innovation programme, grant agreement 101040794 (10000 DIGITS).</footnote>
of a surface in $\mathbb{P}^3(\mathbb{C})$ (Lairez & Sertöz, 2019). The appearance of explicit algebraic varieties in various fields of mathematics, such as Diophantine approximation (Beukers & Peters, 1984) or mathematical physics (Bloch et al., 2015), is a strong incentive for developing automatic methods to compute algebraic invariants.

**1.1. Contributions.** We focus on the case of projective hypersurfaces, although most of the ideas that we present apply in more generality. Let $X \subset \mathbb{P}^n(\mathbb{C})$ be a complex projective hypersurface defined by a polynomial $F(x_0, \dots, x_n) \in \mathbb{C}[x_0, \dots, x_n]$. A major obstacle in the computation of the period matrices for $X$ is the lack of algorithms for computing an explicit description of the singular homology of $X$. By “explicit”, we mean explicit enough to integrate numerically over a basis of cycles. We describe an algorithm for computing at the same time:

(1) an explicit basis of the singular homology of $X$;

(2) a numerical approximation, with rigorous error bounds, of the period matrix of $X$ with respect to this homology basis, and the Griffiths–Dwork cohomology basis.

With respect to precision only, the complexity of the algorithm is quasilinear: computing twice as much digits takes roughly twice as much time. Note that, as a specificity of projective complete intersections, only the $n$-th period matrix of $X$ is interesting, the other ones are trivial (1 × 1 or 0 × 0 matrices).

The algorithm relies on the study of a one-parameter family of hyperplane sections $X \cap H_t$, following the principles of Picard–Lefschetz theory (Lefschetz, 1924; Lamotke, 1981). An important step of the algorithm is the computation of the monodromy action induced by this family of sections on the homology $H_{n-1}(X \cap H_b)$ of one section (above a chosen basepoint $b \in \mathbb{P}^1$). We perform this computation through duality with De Rham cohomology, using the period matrix of $X \cap H_b$, obtained by induction on dimension.

To perform the numerical integration, we reduce to one-variable complex integrals of rational multiples of the periods of $H_{n-1}(X \cap H_b)$. Since these periods are solutions of a Picard–Fuchs differential equation, which we can compute explicitly, we can perform the integration using general algorithms for integration of *differentially finite functions* (van der Hoeven, 1999; Mezzarobba, 2010). These algorithms provide rigorous error bounds with quasilinear complexity with respect to precision.

On the practical side, we have implemented the above algorithm in Sagemath (The Sage Developers, 2023), together with the computation of related invariants (Picard rank, Néron–Severi group, endomorphism ring). This implementation can be found in the package *lefschetz-family*<fnref n="1" />. We are able to compute the periods of the holomorphic form of a smooth quartic surface in $\mathbb{P}^3(\mathbb{C})$ defined over $\mathbb{Q}$ in, typically, about an hour on a laptop, with 300 decimal digits of precision. Naturally, the actual running time depends on many parameters, including the bitsize of the coefficients of the defining equation, and the conditioning of some numerical steps, see Section 6 for concrete examples. Such a computation was not feasible in reasonable time with the previously known algorithm (Sertöz, 2019), except for some quartic surfaces defined by sparse polynomials.

At the moment, our algorithm only applies to smooth projective hypersurfaces but the methodology has a wider scope. To illustrate it, we explain the computation of the periods of a $K3$ surface described as the desingularisation of a nodal quartic surface, using some *ad hoc* ingredients (Section 6.3).

**1.2. Related works.** Algorithms for computing period matrices of curves (also known as Riemann matrices) are well established, with work by Deconinck and van Hoeij (2001), Swierczewski (2017), Bruin et al. (2019), Molin and Neurohr (2019), and Neurohr (2018), to name a few. The papers by Cynk and van Straten (2019) and Elsenhans and Jahnel (2022) are the first to tackle higher

<footnote n="1">¹https://gitlab.inria.fr/epichonp/lefschetz-family</footnote>
of a surface in $\mathbb{P}^3(\mathbb{C})$ (Lairez & Sertöz, 2019). The appearance of explicit algebraic varieties in various fields of mathematics, such as Diophantine approximation (Beukers & Peters, 1984) or mathematical physics (Bloch et al., 2015), is a strong incentive for developing automatic methods to compute algebraic invariants.

**1.1. Contributions.** We focus on the case of projective hypersurfaces, although most of the ideas that we present apply in more generality. Let $X \subset \mathbb{P}^n(\mathbb{C})$ be a complex projective hypersurface defined by a polynomial $F(x_0, \dots, x_n) \in \mathbb{C}[x_0, \dots, x_n]$. A major obstacle in the computation of the period matrices for $X$ is the lack of algorithms for computing an explicit description of the singular homology of $X$. By “explicit”, we mean explicit enough to integrate numerically over a basis of cycles. We describe an algorithm for computing at the same time:

(1) an explicit basis of the singular homology of $X$;

(2) a numerical approximation, with rigorous error bounds, of the period matrix of $X$ with respect to this homology basis, and the Griffiths–Dwork cohomology basis.

With respect to precision only, the complexity of the algorithm is quasilinear: computing twice as much digits takes roughly twice as much time. Note that, as a specificity of projective complete intersections, only the $n$-th period matrix of $X$ is interesting, the other ones are trivial ($1 \times 1$ or $0 \times 0$ matrices).

The algorithm relies on the study of a one-parameter family of hyperplane sections $X \cap H_t$, following the principles of Picard–Lefschetz theory (Lefschetz, 1924; Lamotke, 1981). An important step of the algorithm is the computation of the monodromy action induced by this family of sections on the homology $H_{n-1}(X \cap H_b)$ of one section (above a chosen basepoint $b \in \mathbb{P}^1$). We perform this computation through duality with De Rham cohomology, using the period matrix of $X \cap H_b$, obtained by induction on dimension.

To perform the numerical integration, we reduce to one-variable complex integrals of rational multiples of the periods of $H_{n-1}(X \cap H_b)$. Since these periods are solutions of a Picard–Fuchs differential equation, which we can compute explicitly, we can perform the integration using general algorithms for integration of *differentially finite functions* (van der Hoeven, 1999; Mezzarobba, 2010). These algorithms provide rigorous error bounds with quasilinear complexity with respect to precision.

On the practical side, we have implemented the above algorithm in Sagemath (The Sage Developers, 2023), together with the computation of related invariants (Picard rank, Néron–Severi group, endomorphism ring). This implementation can be found in the package *lefschetz-family*<fnref n="1" />. We are able to compute the periods of the holomorphic form of a smooth quartic surface in $\mathbb{P}^3(\mathbb{C})$ defined over $\mathbb{Q}$ in, typically, about an hour on a laptop, with 300 decimal digits of precision. Naturally, the actual running time depends on many parameters, including the bitsize of the coefficients of the defining equation, and the conditioning of some numerical steps, see Section 6 for concrete examples. Such a computation was not feasible in reasonable time with the previously known algorithm (Sertöz, 2019), except for some quartic surfaces defined by sparse polynomials.

At the moment, our algorithm only applies to smooth projective hypersurfaces but the methodology has a wider scope. To illustrate it, we explain the computation of the periods of a $K3$ surface described as the desingularisation of a nodal quartic surface, using some *ad hoc* ingredients (Section 6.3).

**1.2. Related works.** Algorithms for computing period matrices of curves (also known as Riemann matrices) are well established, with work by Deconinck and van Hoeij (2001), Swierczewski (2017), Bruin et al. (2019), Molin and Neurohr (2019), and Neurohr (2018), to name a few. The papers by Cynk and van Straten (2019) and Elsenhans and Jahnel (2022) are the first to tackle higher

<footnote n="1">¹https://gitlab.inria.fr/epichonp/lefschetz-family</footnote>
dimensions in some particular cases: double covers of $\mathbb{P}^3(\mathbb{C})$ ramified along 8 planes, and double covers of $\mathbb{P}^2(\mathbb{C})$ ramified along 6 lines, respectively. The algorithm by Sertöz (2019) is the first and only algorithm to tackle the case of smooth hypersurfaces in any dimension. It proceeds by global deformation from the hypersurface $X \subset \mathbb{P}^n(\mathbb{C})$ to the Fermat hypersurface defined by $\sum_{i=0}^n x_i^d = 0$, with $d$ equal to the degree of $X$. In a nutshell, our method is more efficient, in most cases, because the Picard–Fuchs equation associated to this global deformation is generally much larger than the Picard–Fuchs differential equation associated to a family of hyperplane sections. Moreover, Sertöz’ method requires a *base point*, a hypersurface of which we know the periods *a priori*. Our method is more intrinsic, which gives it the potential to study varieties beyond smooth projective hypersurfaces.

Computing a period matrix of an algebraic variety requires to address, in one way or another, three computational problems reflecting the very definition of a period matrix: first, compute a basis of the homology, second, compute a basis of the cohomology, and, third, compute the coefficients of the pairing of (1) by numerical integration. Each of these problems is related to a different research field.

**1.2.1. Singular homology.** Computing a basis of the singular homology is a major obstacle. While there are algorithms for computing the homology of submanifolds of $\mathbb{R}^n$ from sample points (Niyogi et al., 2008; Cucker et al., 2018) they seem challenging to implement and exploit. A complex surface in $\mathbb{P}^3(\mathbb{C})$ is already a 4-dimensional real manifold in a 6-dimensional ambient space. Recent experiments suggest that the number of samples required to compute rigorously the homology is rather large (Di Rocco et al., 2020) compared to the Betti numbers. Furthermore, we do not know how to use such a data structure (homology computed from sample points) to efficiently compute periods.

In the case of curves, the problem reduces to computing the monodromy action on the roots of a univariate polynomial depending on a parameter (Tretkoff & Tretkoff, 1984). In the case of projective hypersurfaces, Sertöz’ algorithm deals with the problem indirectly and only need a description of the homology of Fermat hypersurface, which has been worked out by (Pham, 1965).

**1.2.2. De Rham cohomology.** The algebraic De Rham cohomology, in the case of projective hypersurfaces, is well described by the Griffiths–Dwork reduction (Griffiths, 1969), both theoretically and computationally (see Section 3.2). There are also algorithms for the affine case (Oaku & Takayama, 1999), but we are not aware of any algorithm for the general case of a projective variety (not to mention that there are also projective varieties that are not naturally embedded in a projective space, like multiprojective varieties, or fibrations). This is the main reason for restricting our focus to projective hypersurfaces.

**1.2.3. Numerical integration.** For the integration step, a direct approach seems possible. If the homology basis is sufficiently explicit, and if we can numerically evaluate the differential forms defining the cohomology basis at any given point, we can certainly compute the pairing of Equation (1).

However we aim for high precision, so all finite-order quadrature methods (like Simpson’s rule or Monte-Carlo algorithms) are ruled out because they have exponential complexity with respect to precision. The periods are $n$-dimensional integrals of algebraic functions, where $n$ is the complex dimension of $X$. Assuming that we can formulate them as integrals over a $n$-simplex, or $[0, 1]^n$, we can compute them with the Gauss–Lengendre quadrature formula. We expect a $p^{n+1+o(1)}$ complexity with respect to the precision $p$. For computing the periods of curves, this is a $p^{2+o(1)}$ complexity and this method is the most commonly used. In our method, we use numerical analytic continuation of differentially finite functions to compute integrals. The complexity is quasilinear with respect to precision, $p^{1+o(1)}$, thanks to binary splitting. Numerical analytic continuation is also what we use to compute monodromy actions, so it is natural to use it for integration as well.
dimensions in some particular cases: double covers of $\mathbb{P}^3(\mathbb{C})$ ramified along 8 planes, and double covers of $\mathbb{P}^2(\mathbb{C})$ ramified along 6 lines, respectively. The algorithm by Sertöz (2019) is the first and only algorithm to tackle the case of smooth hypersurfaces in any dimension. It proceeds by global deformation from the hypersurface $X \subset \mathbb{P}^n(\mathbb{C})$ to the Fermat hypersurface defined by $\sum_{i=0}^n x_i^d = 0$, with $d$ equal to the degree of $X$. In a nutshell, our method is more efficient, in most cases, because the Picard–Fuchs equation associated to this global deformation is generally much larger than the Picard–Fuchs differential equation associated to a family of hyperplane sections. Moreover, Sertöz’ method requires a *base point*, a hypersurface of which we know the periods *a priori*. Our method is more intrinsic, which gives it the potential to study varieties beyond smooth projective hypersurfaces.

Computing a period matrix of an algebraic variety requires to address, in one way or another, three computational problems reflecting the very definition of a period matrix: first, compute a basis of the homology, second, compute a basis of the cohomology, and, third, compute the coefficients of the pairing of (1) by numerical integration. Each of these problems is related to a different research field.

### 1.2.1. Singular homology.
Computing a basis of the singular homology is a major obstacle. While there are algorithms for computing the homology of submanifolds of $\mathbb{R}^n$ from sample points (Niyogi et al., 2008; Cucker et al., 2018) they seem challenging to implement and exploit. A complex surface in $\mathbb{P}^3(\mathbb{C})$ is already a 4-dimensional real manifold in a 6-dimensional ambient space. Recent experiments suggest that the number of samples required to compute rigorously the homology is rather large (Di Rocco et al., 2022) compared to the Betti numbers. Furthermore, we do not know how to use such a data structure (homology computed from sample points) to efficiently compute periods.

In the case of curves, the problem reduces to computing the monodromy action on the roots of a univariate polynomial depending on a parameter (Tretkoff & Tretkoff, 1984). In the case of projective hypersurfaces, Sertöz’ algorithm deals with the problem indirectly and only need a description of the homology of Fermat hypersurface, which has been worked out by (Pham, 1965).

### 1.2.2. De Rham cohomology.
The algebraic De Rham cohomology, in the case of projective hypersurfaces, is well described by the Griffiths–Dwork reduction (Griffiths, 1969), both theoretically and computationally (see Section 3.2). There are also algorithms for the affine case (Oaku & Takayama, 1999), but we are not aware of any algorithm for the general case of a projective variety (not to mention that there are also projective varieties that are not naturally embedded in a projective space, like multiprojective varieties, or fibrations). This is the main reason for restricting our focus to projective hypersurfaces.

### 1.2.3. Numerical integration.
For the integration step, a direct approach seems possible. If the homology basis is sufficiently explicit, and if we can numerically evaluate the differential forms defining the cohomology basis at any given point, we can certainly compute the pairing of Equation (1).

However we aim for high precision, so all finite-order quadrature methods (like Simpson’s rule or Monte-Carlo algorithms) are ruled out because they have exponential complexity with respect to precision. The periods are $n$-dimensional integrals of algebraic functions, where $n$ is the complex dimension of $X$. Assuming that we can formulate them as integrals over a $n$-simplex, or $[0, 1]^n$, we can compute them with the Gauss–Lengendre quadrature formula. We expect a $p^{n+1+o(1)}$ complexity with respect to the precision $p$. For computing the periods of curves, this is a $p^{2+o(1)}$ complexity and this method is the most commonly used. In our method, we use numerical analytic continuation of differentially finite functions to compute integrals. The complexity is quasilinear with respect to precision, $p^{1+o(1)}$, thanks to binary splitting. Numerical analytic continuation is also what we use to compute monodromy actions, so it is natural to use it for integration as well.
Note however that, in our typical computations (involving large degree differential operators and large but not extreme precision), we are far from the threshold where binary splitting gets better than $p^{2+o(1)}$ methods.

### 1.3. Content.
Let $X \subset \mathbb{P}^n(\mathbb{C})$ be a smooth hypersurface variety. Let $(H_t)_{t \in \mathbb{P}^1}$ be a generic pencil of hyperplanes. Up to a change of coordinates, we may assume that $H_t = V(x_n - tx_0)$. Let $b \in \mathbb{P}^1$ be a generic base point. Let $\Sigma \subset \mathbb{P}^1$ be the set of all $t$ such that $X \cap H_t$ is singular. The pencil induces an action of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $H_{n-1}(X \cap H_b)$. In Section 2, we show, mostly following Lamotke (1981), how this monodromy action determines the homology of $X$ in an explicit way. Section 3 describes the main algorithm. Section 4 details the example of a quartic surface. Section 5 deals with the computation of the intersection product on $H_2(X)$, when $X$ is a smooth surface in $\mathbb{P}^3$. Section 6 reports on benchmarks and applications.

### 1.4. Acknowledgments.
We thank Marc Mezzarobba for his help with interfacing with the `ore_algebra` package. The examples of Sections 6.2.1 and 6.2.2, the random search of Section 6.2.4 and the comparisons of Section 6.1.2 were run on the Infinity Cluster hosted by Institut d'Astrophysique de Paris. We thank Stephane Rouberol for running smoothly this cluster for us. We thank Xavier Roulleau for bringing the works of Keiji Oguiso to our attention. We also thank Alice Garbagnati, Erik Panzer and Emre Sertöz for interesting and enlightening discussions and comments. Finally, we thank the referees for their careful reading of the manuscript, and their valuable comments and suggestions.

## 2. PICARD-LEFSCHETZ THEORY

### 2.1. Lefschetz fibrations and Lefschetz' main lemma.
Following Lamotke (1981), we recall a few elements of Picard-Lefschetz theory that are important to our study.

#### 2.1.1. Lefschetz fibrations.
Let $\mathbb{P}^N$ denote the $N$-dimensional complex projective space. Let $A \subset \mathbb{P}^N$ be an $N-2$-dimensional projective subspace. The pencil of axis $A$ is the one-dimensional family of hyperplanes of $\mathbb{P}^N$ that contain $A$. It is parametrised by $\mathbb{P}^1$. Concretely, if $A$ is the vanishing locus of two linear forms $\lambda$ and $\mu$, then for $t \in \mathbb{P}^1$, we define $H_t = V(\lambda - t\mu)$ (and $H_\infty = V(\mu)$).

We consider an irreducible, closed complex projective variety $X \subset \mathbb{P}^N$, with dimension $\dim X = n$. We aim at studying the topology of $X$ through the intersections of $X$ with the hyperplanes $H_t$. For $t \in \mathbb{P}^1$, let

$$ (2) \qquad X_t \stackrel{\text{def}}{=} X \cap H_t. $$

For any $x \in X \setminus A$, there is a unique $t \in \mathbb{P}^1$ such that $x \in H_t$. This defines a rational map $X \dashrightarrow \mathbb{P}^1$. It is useful to consider a modification $Y$ of $X$:

$$ (3) \qquad Y \stackrel{\text{def}}{=} \{(x, t) \in X \times \mathbb{P}^1 \mid x \in H_t\}. $$

The projection on the first coordinate induces a proper map $\pi: Y \to X$, which is an isomorphism above $X \setminus A$. The projection on the second coordinate induces a regular map $f: Y \to \mathbb{P}^1$ which resolves the indeterminacies of the map $X \dashrightarrow \mathbb{P}^1$. The map $\pi$ is the blowup of $X$ at the base locus $X' \stackrel{\text{def}}{=} X \cap A$ of $X \dashrightarrow \mathbb{P}^1$. The fibre $f^{-1}(t)$ above some $t \in \mathbb{P}^1$ is isomorphic to $X_t$. Indeed, by definition, $f^{-1}(t) = \{x \in X \mid x \in H_t\} = X \cap H_t$.

Let $\Sigma \stackrel{\text{def}}{=} \{f(x) \mid x \in Y \text{ and } df = 0\}$ be the set of critical values. It is also the set of all $t \in \mathbb{P}^1$ such that $X_t$ is singular. It is well known that $\Sigma$ is finite (since $f$ is locally constant on the subvariety $\{df = 0\} \subseteq Y$). If the critical points of $f$ are all nondegenerate (meaning the Hessian matrix at the critical point is nonsingular) and the critical values associated to different critical points are distinct, this is a *Lefschetz fibration*. We will work under this hypothesis, which is satisfied as long as $A$ is generic (Lamotke, 1981, §1.6).
Note however that, in our typical computations (involving large degree differential operators and large but not extreme precision), we are far from the threshold where binary splitting gets better than $p^{2+o(1)}$ methods.

### 1.3. Content.
Let $X \subset \mathbb{P}^n(\mathbb{C})$ be a smooth hypersurface variety. Let $(H_t)_{t \in \mathbb{P}^1}$ be a generic pencil of hyperplanes. Up to a change of coordinates, we may assume that $H_t = V(x_n - tx_0)$. Let $b \in \mathbb{P}^1$ be a generic base point. Let $\Sigma \subset \mathbb{P}^1$ be the set of all $t$ such that $X \cap H_t$ is singular. The pencil induces an action of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $H_{n-1}(X \cap H_b)$. In Section 2, we show, mostly following Lamotke (1981), how this monodromy action determines the homology of $X$ in an explicit way. Section 3 describes the main algorithm. Section 4 details the example of a quartic surface. Section 5 deals with the computation of the intersection product on $H_2(X)$, when $X$ is a smooth surface in $\mathbb{P}^3$. Section 6 reports on benchmarks and applications.

### 1.4. Acknowledgments.
We thank Marc Mezzarobba for his help with interfacing with the `ore_algebra` package. The examples of Sections 6.2.1 and 6.2.2, the random search of Section 6.2.4 and the comparisons of Section 6.1.2 were run on the Infinity Cluster hosted by Institut d'Astrophysique de Paris. We thank Stephane Rouberol for running smoothly this cluster for us. We thank Xavier Roulleau for bringing the works of Keiji Oguiso to our attention. We also thank Alice Garbagnati, Erik Panzer and Emre Sertöz for interesting and enlightening discussions and comments. Finally, we thank the referees for their careful reading of the manuscript, and their valuable comments and suggestions.

## 2. PICARD-LEFSCHETZ THEORY

### 2.1. Lefschetz fibrations and Lefschetz' main lemma.
Following Lamotke (1981), we recall a few elements of Picard-Lefschetz theory that are important to our study.

#### 2.1.1. Lefschetz fibrations.
Let $\mathbb{P}^N$ denote the $N$-dimensional complex projective space. Let $A \subset \mathbb{P}^N$ be an $N-2$-dimensional projective subspace. The pencil of axis $A$ is the one-dimensional family of hyperplanes of $\mathbb{P}^N$ that contain $A$. It is parametrised by $\mathbb{P}^1$. Concretely, if $A$ is the vanishing locus of two linear forms $\lambda$ and $\mu$, then for $t \in \mathbb{P}^1$, we define $H_t = V(\lambda - t\mu)$ (and $H_\infty = V(\mu)$).

We consider an irreducible, closed complex projective variety $X \subset \mathbb{P}^N$, with dimension $\dim X = n$. We aim at studying the topology of $X$ through the intersections of $X$ with the hyperplanes $H_t$. For $t \in \mathbb{P}^1$, let

$$ (2) \quad X_t \stackrel{\text{def}}{=} X \cap H_t. $$

For any $x \in X \setminus A$, there is a unique $t \in \mathbb{P}^1$ such that $x \in H_t$. This defines a rational map $X \dashrightarrow \mathbb{P}^1$. It is useful to consider a modification $Y$ of $X$:

$$ (3) \quad Y \stackrel{\text{def}}{=} \{(x, t) \in X \times \mathbb{P}^1 \mid x \in H_t\}. $$

The projection on the first coordinate induces a proper map $\pi: Y \to X$, which is an isomorphism above $X \setminus A$. The projection on the second coordinate induces a regular map $f: Y \to \mathbb{P}^1$ which resolves the indeterminacies of the map $X \dashrightarrow \mathbb{P}^1$. The map $\pi$ is the blowup of $X$ at the base locus $X' \stackrel{\text{def}}{=} X \cap A$ of $X \dashrightarrow \mathbb{P}^1$. The fibre $f^{-1}(t)$ above some $t \in \mathbb{P}^1$ is isomorphic to $X_t$. Indeed, by definition, $f^{-1}(t) = \{x \in X \mid x \in H_t\} = X \cap H_t$.

Let $\Sigma \stackrel{\text{def}}{=} \{f(x) \mid x \in Y \text{ and } df = 0\}$ be the set of critical values. It is also the set of all $t \in \mathbb{P}^1$ such that $X_t$ is singular. It is well known that $\Sigma$ is finite (since $f$ is locally constant on the subvariety $\{df = 0\} \subseteq Y$). If the critical points of $f$ are all nondegenerate (meaning the Hessian matrix at the critical point is nonsingular) and the critical values associated to different critical points are distinct, this is a *Lefschetz fibration*. We will work under this hypothesis, which is satisfied as long as $A$ is generic (Lamotke, 1981, §1.6).
<figure><img src="image_2.png" /><figcaption>**Figure 1.** The monodromy and extensions of a cycle $\gamma$ along two composable paths $\ell$ and $\ell'$. The extension of $\gamma$ along $\ell\ell'$ is the sum of the extensions of $\gamma$ along $\ell$ and of $\ell_*\gamma$ along $\ell'$. As stated in (7), the border of $\tau_\ell(\gamma)$ is $\ell_*\gamma - \gamma$.</figcaption></figure>

2.1.2. *Monodromy and extensions.* We recall the concepts of monodromy and extensions (see Lamotke, 1981, §6.4). By Ehresmann's theorem, the restriction of $f$ to $f^{-1}(\mathbb{P}^1 \setminus \Sigma)$ is a smooth fibre bundle: for any simply connected open set $U \subset \mathbb{P}^1 \setminus \Sigma$ and any $b \in U$, there is a diffeomorphism $\Phi_U : f^{-1}(U) \to X_b \times U$ with the compatibility $\text{pr}_2 \circ \Phi_U = f|_{f^{-1}(U)}$ and $\text{pr}_1 \circ \Phi_U|_{X_b} = \text{id}_{X_b}$.

In particular, for any continuous path $\ell : [0, 1] \to \mathbb{P}^1 \setminus \Sigma$ without self intersection from a point $b = \ell(0)$ to another $b' = \ell(1)$, we obtain a continuous deformation of $X_b$ into $X_{b'}$. Namely, we pick a simply connected neighbourhood $U$ of $\ell([0, 1])$ and we have the induced diffeomorphism

$$X_b \to X_{b'}, \quad x \mapsto \Phi_U^{-1}(x, b').$$

This diffeomorphism is uniquely determined up to homotopy so it induces a uniquely determined isomorphism $\ell_* : H_q(X_b) \to H_q(X_{b'})$, for any $q$. This map depends only on the homotopy class of $\ell$ in $\mathbb{P}^1 \setminus \Sigma$. This is the *action of monodromy along $\ell$ on homology*. To extend this notion to self-intersecting paths, we cut the paths into non-self-intersecting pieces and compose the actions of each piece. For any paths $\ell$ and $\ell'$, with $\ell(1) = \ell'(0)$, let $\ell'\ell$ denote the composition (go through $\ell$ then $\ell'$). Then $(\ell'\ell)_* = \ell'_*\ell_*$. This defines the monodromy action of $\pi(\mathbb{P}^1 \setminus \Sigma)$ on $H_q(X_b)$.

In the same setting, given a $q$-chain $A$ in $X_b$, we may consider the $q+1$-chain $A \times [0, 1]$ in $X_b \times [0, 1]$ and its image $\Phi_U(A \times [0, 1])$ in $Y$. Given any open set $V$ containing $f^{-1}(U)$, this induces a map

$$(4) \quad \tau_{\ell} : H_q(X_b) \to H_{q+1}(V, X_b \cup X_{b'})$$

called the *extension along $\ell$*. (This map also follows from the Künneth formula for the pairs $(X_b, \emptyset)$ and $([0, 1], \{0, 1\})$ since $f^{-1}(\ell([0, 1])) \simeq X_b \times [0, 1]$.) The map $\tau_\ell$ depends only on the homotopy class of $\ell$. Given two paths $\ell$ and $\ell'$ with $\ell(1) = \ell'(0)$ we have (Fig. 1)

$$(5) \quad \tau_{\ell'\ell} = \tau_{\ell} + \tau_{\ell'} \circ \ell_*.$$

Using this composition rule one may define extensions along paths with self intersections. When the path $\ell$ is a loop from $b$ to $b$, we obtain a map

$$(6) \quad \tau_\ell : H_q(X_b) \to H_{q+1}(V, X_b),$$

for any neighbourhood $V \subseteq Y$ of $f^{-1}(\ell([0, 1]))$.

These two concepts, extension and monodromy, are related by the formula

$$(7) \quad (-1)^{n-1} \partial \circ \tau_\ell = \ell_* - \text{id},$$
<figure><img src="image_2.png" /><figcaption>**Figure 1.** The monodromy and extensions of a cycle $\gamma$ along two composable paths $\ell$ and $\ell'$. The extension of $\gamma$ along $\ell\ell'$ is the sum of the extensions of $\gamma$ along $\ell$ and of $\ell_*\gamma$ along $\ell'$. As stated in (7), the border of $\tau_\ell(\gamma)$ is $\ell_*\gamma - \gamma$.</figcaption></figure>

2.1.2. *Monodromy and extensions.* We recall the concepts of monodromy and extensions (see Lamotke, 1981, §6.4). By Ehresmann's theorem, the restriction of $f$ to $f^{-1}(\mathbb{P}^1 \setminus \Sigma)$ is a smooth fibre bundle: for any simply connected open set $U \subset \mathbb{P}^1 \setminus \Sigma$ and any $b \in U$, there is a diffeomorphism $\Phi_U : f^{-1}(U) \to X_b \times U$ with the compatibility $\text{pr}_2 \circ \Phi_U = f|_{f^{-1}(U)}$ and $\text{pr}_1 \circ \Phi_U|_{X_b} = \text{id}_{X_b}$.

In particular, for any continuous path $\ell : [0, 1] \to \mathbb{P}^1 \setminus \Sigma$ without self intersection from a point $b = \ell(0)$ to another $b' = \ell(1)$, we obtain a continuous deformation of $X_b$ into $X_{b'}$. Namely, we pick a simply connected neighbourhood $U$ of $\ell([0, 1])$ and we have the induced diffeomorphism

$$X_b \to X_{b'}, \quad x \mapsto \Phi_U^{-1}(x, b').$$

This diffeomorphism is uniquely determined up to homotopy so it induces a uniquely determined isomorphism $\ell_* : H_q(X_b) \to H_q(X_{b'})$, for any $q$. This map depends only on the homotopy class of $\ell$ in $\mathbb{P}^1 \setminus \Sigma$. This is the *action of monodromy along $\ell$ on homology*. To extend this notion to self-intersecting paths, we cut the paths into non-self-intersecting pieces and compose the actions of each piece. For any paths $\ell$ and $\ell'$, with $\ell(1) = \ell'(0)$, let $\ell'\ell$ denote the composition (go through $\ell$ then $\ell'$). Then $(\ell'\ell)_* = \ell'_*\ell_*$. This defines the monodromy action of $\pi(\mathbb{P}^1 \setminus \Sigma)$ on $H_q(X_b)$.

In the same setting, given a $q$-chain $A$ in $X_b$, we may consider the $q+1$-chain $A \times [0, 1]$ in $X_b \times [0, 1]$ and its image $\Phi_U(A \times [0, 1])$ in $Y$. Given any open set $V$ containing $f^{-1}(U)$, this induces a map

$$(4) \quad \tau_{\ell} : H_{q}(X_{b}) \to H_{q+1}(V, X_{b} \cup X_{b'})$$

called the *extension along $\ell$*. (This map also follows from the Künneth formula for the pairs $(X_b, \emptyset)$ and $([0, 1], \{0, 1\})$ since $f^{-1}(\ell([0, 1])) \simeq X_b \times [0, 1]$.) The map $\tau_\ell$ depends only on the homotopy class of $\ell$. Given two paths $\ell$ and $\ell'$ with $\ell(1) = \ell'(0)$ we have (Fig. 1)

$$(5) \quad \tau_{\ell'\ell} = \tau_{\ell} + \tau_{\ell'} \circ \ell_*.$$

Using this composition rule one may define extensions along paths with self intersections. When the path $\ell$ is a loop from $b$ to $b$, we obtain a map

$$(6) \quad \tau_{\ell} : H_{q}(X_{b}) \to H_{q+1}(V, X_{b}),$$

for any neighbourhood $V \subseteq Y$ of $f^{-1}(\ell([0, 1]))$.

These two concepts, extension and monodromy, are related by the formula

$$(7) \quad (-1)^{n-1} \partial \circ \tau_{\ell} = \ell_{*} - \text{id},$$
<figure><img src="image_3.png" /><figcaption>**Figure 2.** The simple loops $\ell_i$'s around the critical points represent a basis of the homotopy group $\pi_1(\mathbb{C} \setminus \Sigma, b)$.</figcaption></figure>

where $\partial : H_q(Y, X_b \cup X_b') \to H_{q-1}(X_b) \oplus H_{q-1}(X_{b'})$ is the border map (Lamotke, 1981, §6.4.6).

**2.1.3. Vanishing cycles.** We assume that $\infty \in \mathbb{P}^1$ is a regular value (i.e. not a critical value) of $f : Y \to \mathbb{P}^1$ and consider $\mathbb{C} = \mathbb{P}^1 \setminus \{\infty\}$. A basis of $\pi_1(\mathbb{C} \setminus \Sigma, b)$, the fundamental group of $\mathbb{C} \setminus \Sigma$ pointed at $b$, is given by loops $(\ell_1, \dots, \ell_r)$ around the elements $t_1, \dots, t_r$ of $\Sigma$ (Fig. 2). Under the hypothesis that $f$ is a Lefschetz fibration, the monodromy action on $H_{n-1}(X_b)$ along these paths are described by the Picard–Lefschetz formula (Lamotke, 1981, §6.3.3): for $1 \le i \le r$,

$$ (8) \qquad \ell_{i*}(\eta) = \eta + (-1)^{n(n+1)/2} \langle \eta, \delta_i \rangle \delta_i $$

where $\langle \cdot, \cdot \rangle$ is the intersection product on $H_{n-1}(X_b)$ and $\delta_i$ is a cycle in $H_{n-1}(X_b)$, called the vanishing cycle at $t_i$, determined up to sign. Note that the vanishing cycle not only depends on $t_i$, but also on the choice of the homotopy class of $\ell_i$. Note also, as a consequence of (8), that the map $\ell_{i*} - \text{id}$ is of rank 1, and its image is generated by $\delta_i$.

**2.1.4. Thimbles.** Decompose the Riemann spere $\mathbb{P}^1$ in two closed hemispheres $D_+$ and $D_-$, such that all critical values of $f : Y \to \mathbb{P}^1$ lie in the interior of $D_+$. We pick a base point $b$ on the equator $S^1 = D_+ \cap D_-$. Finally we denote $Y_+ = f^{-1}(D_+)$, $Y_0 = f^{-1}(S^1)$ and $X_b = f^{-1}(b)$, so that

$$ (9) \qquad X_b \subset Y_0 \subset Y_+ \subset Y. $$

For each of the elementary paths $\ell_i$ (Fig. 2), we consider the map $\tau_{\ell_i} : H_{n-1}(X_b) \to H_n(Y_+, X_b)$ defined in Section 2.1.2. Then $\tau_{\ell_i}$ has rank one and there is a uniquely determined element $\Delta_i \in H_n(Y_+, X_b)$, the Lefschetz thimble associated to the critical value $t_i$, such that (Lamotke, 1981, (6.7.1))

$$ (10) \qquad \tau_{\ell_i} \eta = -(-1)^{\frac{n(n-1)}{2}} \langle \eta, \delta_i \rangle \Delta_i \in H_n(Y_+, X_b), $$

which combined with (7) gives back the Picard–Lefschetz formula (8).

The thimble $\Delta_i$ is dependent on the choice of the homotopy class of $\ell_i$. By definition, it can be obtained as the extension $\tau_{\ell_i}(p_i)$ of some cycle $p_i \in H_{n-1}(X_b)$. It is the generator of $H_n(f^{-1}(V), X_b)$, for $V$ a simply connected neighbourhood of $\ell_i$ that does not contain any critical value other than $t_i$. It also can be constructed as the extension of $\delta_i$ along a path from $b$ to the singular value $t_i$ (Fig. 3). In particular, note that

$$ (11) \qquad \partial \Delta_i = \delta_i. $$
<figure><img src="image_3.png" /><figcaption>**Figure 2.** The simple loops $\ell_i$'s around the critical points represent a basis of the homotopy group $\pi_1(\mathbb{C} \setminus \Sigma, b)$.</figcaption></figure>

where $\partial : H_q(Y, X_b \cup X_b') \to H_{q-1}(X_b) \oplus H_{q-1}(X_{b'})$ is the border map (Lamotke, 1981, §6.4.6).

**2.1.3. Vanishing cycles.** We assume that $\infty \in \mathbb{P}^1$ is a regular value (i.e. not a critical value) of $f : Y \to \mathbb{P}^1$ and consider $\mathbb{C} = \mathbb{P}^1 \setminus \{\infty\}$. A basis of $\pi_1(\mathbb{C} \setminus \Sigma, b)$, the fundamental group of $\mathbb{C} \setminus \Sigma$ pointed at $b$, is given by loops $(\ell_1, \dots, \ell_r)$ around the elements $t_1, \dots, t_r$ of $\Sigma$ (Fig. 2). Under the hypothesis that $f$ is a Lefschetz fibration, the monodromy action on $H_{n-1}(X_b)$ along these paths are described by the Picard–Lefschetz formula (Lamotke, 1981, §6.3.3): for $1 \le i \le r$,

$$ (8) \qquad \ell_{i*}(\eta) = \eta + (-1)^{n(n+1)/2} \langle \eta, \delta_i \rangle \delta_i $$

where $\langle \cdot, \cdot \rangle$ is the intersection product on $H_{n-1}(X_b)$ and $\delta_i$ is a cycle in $H_{n-1}(X_b)$, called the vanishing cycle at $t_i$, determined up to sign. Note that the vanishing cycle not only depends on $t_i$, but also on the choice of the homotopy class of $\ell_i$. Note also, as a consequence of (8), that the map $\ell_{i*} - \text{id}$ is of rank 1, and its image is generated by $\delta_i$.

**2.1.4. Thimbles.** Decompose the Riemann spere $\mathbb{P}^1$ in two closed hemispheres $D_+$ and $D_-$, such that all critical values of $f : Y \to \mathbb{P}^1$ lie in the interior of $D_+$. We pick a base point $b$ on the equator $S^1 = D_+ \cap D_-$. Finally we denote $Y_+ = f^{-1}(D_+)$, $Y_0 = f^{-1}(S^1)$ and $X_b = f^{-1}(b)$, so that

$$ (9) \qquad X_b \subset Y_0 \subset Y_+ \subset Y. $$

For each of the elementary paths $\ell_i$ (Fig. 2), we consider the map $\tau_{\ell_i} : H_{n-1}(X_b) \to H_n(Y_+, X_b)$ defined in Section 2.1.2. Then $\tau_{\ell_i}$ has rank one and there is a uniquely determined element $\Delta_i \in H_n(Y_+, X_b)$, the Lefschetz thimble associated to the critical value $t_i$, such that (Lamotke, 1981, (6.7.1))

$$ (10) \qquad \tau_{\ell_i} \eta = -(-1)^{\frac{n(n-1)}{2}} \langle \eta, \delta_i \rangle \Delta_i \in H_n(Y_+, X_b), $$

which combined with (7) gives back the Picard–Lefschetz formula (8).

The thimble $\Delta_i$ is dependent on the choice of the homotopy class of $\ell_i$. By definition, it can be obtained as the extension $\tau_{\ell_i}(p_i)$ of some cycle $p_i \in H_{n-1}(X_b)$. It is the generator of $H_n(f^{-1}(V), X_b)$, for $V$ a simply connected neighbourhood of $\ell_i$ that does not contain any critical value other than $t_i$. It also can be constructed as the extension of $\delta_i$ along a path from $b$ to the singular value $t_i$ (Fig. 3). In particular, note that

$$ (11) \qquad \partial \Delta_i = \delta_i. $$
<figure><img src="image_4.png" /></figure>

(a) There is a unique cycle $\Delta_i \in H_n(Y^+, X_b)$ stemming from extensions along the simple loop $\ell_i$ around $t_i$. It is called the Lefschetz thimble at $t_i$. It is dependant on the homotopy class of $\ell_i$.

(b) The border $\delta_i = \ell_{i*}p_i - p_i$ of $\Delta_i$ is the vanishing cycle at $t_i$. This name comes from the fact that the geometric representative of $\delta_i$ collapses when deforming towards $t_i$. $\Delta_i$ is the extension of $\delta_i$ along a path connecting b to $t_i$.

<caption>**Figure 3.** Thimbles and vanishing cycles.</caption>

**2.2. Reconstructing homology.** In order to study the homology of $Y$, we start from the explicit description of the relative homology group $H_n(Y_+, X_b)$ in terms of the Lefschetz thimbles.

**Lemma 1** (Main lemma, Lamotke, 1981, §5). With the notations above,

(i) $H_q(Y_+, X_b) = 0$ if $q \neq n$;

(ii) $H_n(Y_+, X_b)$ is free of rank $r$ and $\Delta_1, \dots, \Delta_r$ is a basis.

To retrieve $H_n(Y)$ from the thimbles, the main object is

$$ (12) \quad \mathcal{T}(Y) \stackrel{\text{def}}{=} \frac{\ker (\partial : H_n(Y_+, X_b) \to H_{n-1}(X_b))}{\operatorname{im}(\tau_\infty : H_{n-1}(X_b) \to H_n(Y_+, X_b))}, $$

where $\tau_\infty$ is the extension map along the equator. Let us describe informally the nature of it. By Lemma 1, elements of $H_n(Y_+, X_b)$ are linear combinations of thimbles. Thimbles have boundary in $X_b$ (Fig. 3), but the boundary of a linear combination of thimbles may be homologically 0 in $X_b$. These linear combinations form a subspace which is exactly $\ker(\partial : H_n(Y_+, X_b) \to H_{n-1}(X_b))$. Let $C$ be such a linear combination. By definition, $\partial C$ is homologically 0 in $X_b$, so we can add a $n$-chain $C'$ in $X_b$ such that $\partial(C + C') = 0$. Then, the $n$-chain $C + C'$ is a $n$-cycle in $Y$. Since $C'$ is determined only up to $n$-cycles in $X_b$, we obtain a well defined element in $H_n(Y)/\iota_*H_n(X_b)$, where $\iota : X_b \to Y$ is the inclusion.

Combinations of thimbles produced by the extension map $\tau_\infty : H_{n-1}(X_b) \to H_n(Y_+, X_b)$ are irrelevant, because the equator is contractible in $\mathbb{P}^1 \setminus \Sigma$, so these extensions are homologically zero in $Y$. This explains why we have a map

$$ (13) \quad \mathcal{T}(Y) \to \frac{H_n(Y)}{\iota_* H_n(X_b)}. $$

By composing with $\pi_* : H_n(Y) \to H_n(X)$, we also obtain a map

$$ (14) \quad \mathcal{T}(Y) \to \frac{H_n(X)}{\iota_* H_n(X_b)}. $$

**Theorem 2.** We have an exact sequence

$$ 0 \to \mathcal{T}(Y) \to \frac{H_n(Y)}{\iota_* H_n(X_b)} \to H_{n-2}(X_b) \to 0, $$
<figure><img src="image_4.png" /></figure>

(a) There is a unique cycle $\Delta_i \in H_n(Y^+, X_b)$ stemming from extensions along the simple loop $\ell_i$ around $t_i$. It is called the Lefschetz thimble at $t_i$. It is dependent on the homotopy class of $\ell_i$.

(b) The border $\delta_i = \ell_{i*}p_i - p_i$ of $\Delta_i$ is the vanishing cycle at $t_i$. This name comes from the fact that the geometric representative of $\delta_i$ collapses when deforming towards $t_i$. $\Delta_i$ is the extension of $\delta_i$ along a path connecting b to $t_i$.

<caption>**Figure 3.** Thimbles and vanishing cycles.</caption>

**2.2. Reconstructing homology.** In order to study the homology of $Y$, we start from the explicit description of the relative homology group $H_n(Y_+, X_b)$ in terms of the Lefschetz thimbles.

**Lemma 1** (Main lemma, Lamotke, 1981, §5). With the notations above,

(i) $H_q(Y_+, X_b) = 0$ if $q \neq n$;

(ii) $H_n(Y_+, X_b)$ is free of rank $r$ and $\Delta_1, \dots, \Delta_r$ is a basis.

To retrieve $H_n(Y)$ from the thimbles, the main object is

$$ (12) \quad \mathcal{T}(Y) \stackrel{\text{def}}{=} \frac{\ker (\partial : H_n(Y_+, X_b) \to H_{n-1}(X_b))}{\operatorname{im}(\tau_\infty : H_{n-1}(X_b) \to H_n(Y_+, X_b))}, $$

where $\tau_\infty$ is the extension map along the equator. Let us describe informally the nature of it. By Lemma 1, elements of $H_n(Y_+, X_b)$ are linear combinations of thimbles. Thimbles have boundary in $X_b$ (Fig. 3), but the boundary of a linear combination of thimbles may be homologically 0 in $X_b$. These linear combinations form a subspace which is exactly $\ker(\partial : H_n(Y_+, X_b) \to H_{n-1}(X_b))$. Let $C$ be such a linear combination. By definition, $\partial C$ is homologically 0 in $X_b$, so we can add a $n$-chain $C'$ in $X_b$ such that $\partial(C + C') = 0$. Then, the $n$-chain $C + C'$ is a $n$-cycle in $Y$. Since $C'$ is determined only up to $n$-cycles in $X_b$, we obtain a well defined element in $H_n(Y)/\iota_*H_n(X_b)$, where $\iota : X_b \to Y$ is the inclusion.

Combinations of thimbles produced by the extension map $\tau_\infty : H_{n-1}(X_b) \to H_n(Y_+, X_b)$ are irrelevant, because the equator is contractible in $\mathbb{P}^1 \setminus \Sigma$, so these extensions are homologically zero in $Y$. This explains why we have a map

$$ (13) \quad \mathcal{T}(Y) \to \frac{H_n(Y)}{\iota_* H_n(X_b)}. $$

By composing with $\pi_* : H_n(Y) \to H_n(X)$, we also obtain a map

$$ (14) \quad \mathcal{T}(Y) \to \frac{H_n(X)}{\iota_* H_n(X_b)}. $$

**Theorem 2.** We have an exact sequence

$$ 0 \to \mathcal{T}(Y) \to \frac{H_n(Y)}{\iota_* H_n(X_b)} \to H_{n-2}(X_b) \to 0, $$
where the arrow from $\mathcal{T}(Y)$ is (13), and the arrow to $H_{n-2}(X_b)$ is given by intersecting with $X_b$.

Moreover, let $K$ be the kernel of the map $H_{n-2}(X') \to H_{n-2}(X_b)$ induced by inclusion. We have an exact sequence

$$0 \to K \to \mathcal{T}(Y) \to \frac{H_n(X)}{\iota_* H_n(X_b)} \to 0.$$

*Proof.* First, we have an isomorphism

$$(15) \qquad H_q(Y, Y_+) \simeq H_{q-2}(X_b),$$

for any $q$ (Lamotke, 1981, (3.3.1)). This is given by excision: $(Y, Y_+) \simeq (Y_-, Y_0)$ and the fact that $f: Y_- \to D_-$ is a trivial fibration since $D_-$ does not contain critical values. The map $H_q(Y, Y_+) \to H_{q-2}(X_b)$ is the intersection with $X_b$.

Next, consider the commutative diagram

$$\begin{tikzcd}[column sep=2.8em, row sep=2.8em]
    & H_n(X_b) & \\
    0 \arrow[r] & H_{n-2}(X') \arrow[r, "\iota_*"'] & H_n(Y) \arrow[r, "\pi_*"'] & H_n(X) \arrow[r] & 0 \\
    H_{n-1}(X_b) \arrow[r, "\tau_\infty"'] & H_n(Y_+, X_b) \arrow[r] & H_n(Y, X_b) \arrow[r] & H_{n-2}(X_b) \arrow[r] & 0 \\
    & H_{n-1}(X_b) & \\
    & & \arrow[uur, "\partial"] \arrow[ur, "\partial"]
\end{tikzcd},$$

where:

* The first line comes from Lamotke (1981, (3.1.2)).

* The second line is the long exact sequence of the triple $(Y, Y_+, X_b)$ where $H_q(Y, Y_+)$ is identified to $H_{n-2}(X_b)$ using 15. The last term is 0 because of Lemma 1.

* The column is the long exact sequence of the pair $(Y, X_b)$.

* The dashed arrow is induced by inclusion. Indeed, let $A$ be a closed $n-2$-chain in $H_{n-2}(X')$. It is sent to $A \times \mathbb{P}^1$ in $H_n(Y)$, which is then included in $H_n(Y, X_b)$ and then $H_n(Y, Y_+) \cap H_{n-2}(X_b)$, where the identification is given by intersecting with $X_b$, which yields $A$ again.

Importantly, the dashed arrow $H_{n-2}(X') \to H_{n-2}(X_b)$ is surjective, by Lefschetz' hyperplane theorem, since $X'$ is a hyperplane section of $X_b$. Now, the two exact sequences to prove follow from diagram chasing in (16). $\square$

**2.3. Projective complete intersections.** From now on, we assume that $X \subseteq \mathbb{P}^N$ is a complete intersection. In particular, all the homology groups that appear are free, so the exact sequences split, due to the following lemma which gathers some well known facts.

**Lemma 3.** Let $V$ be a $n$-dimensional smooth complete intersection of $\mathbb{P}^N$.

(i) For $k < n$, the inclusion $V \hookrightarrow \mathbb{P}^N$ induces isomorphism $H_k(V) \simeq H_k(\mathbb{P}^N)$ and $H^k(V) \simeq H^k(\mathbb{P}^N)$.

(ii) All the homology groups $H_k(V, \mathbb{Z})$ are free.

(iii) For $k < n$ even, $H_k(V)$ is generated by the homology class $\frac{1}{\deg V}[V \cap L]$ where $L$ is a projective subspace of complex codimension $n - \frac{k}{2}$.

(iv) For $n < k \le 2n$ even, $H_k(V)$ is generated by the homology class $[V \cap L]$ where $L$ is a projective subspace of complex codimension $n - \frac{k}{2}$.

*Proof.* The first point is a consequence of Lefschetz's hyperplane theorem. Poincaré duality implies $H_k(V) \simeq H_{2N-2n+k}(\mathbb{P}^N)$ for $k > n$. In particular, $H_k(V)$ is free for any $k \ne n$. For the
where the arrow from $\mathcal{T}(Y)$ is (13), and the arrow to $H_{n-2}(X_b)$ is given by intersecting with $X_b$.
Moreover, let $K$ be the kernel of the map $H_{n-2}(X') \to H_{n-2}(X_b)$ induced by inclusion. We have an exact sequence

$$0 \to K \to \mathcal{T}(Y) \to \frac{H_n(X)}{\iota_* H_n(X_b)} \to 0.$$

*Proof.* First, we have an isomorphism

$$(15) \qquad H_q(Y, Y_+) \simeq H_{q-2}(X_b),$$

for any $q$ (Lamotke, 1981, (3.3.1)). This is given by excision: $(Y, Y_+) \simeq (Y_-, Y_0)$ and the fact that $f: Y_- \to D_-$ is a trivial fibration since $D_-$ does not contain critical values. The map $H_q(Y, Y_+) \to H_{q-2}(X_b)$ is the intersection with $X_b$.

Next, consider the commutative diagram

<figure><img src="image_5.png" /></figure>

where:

* The first line comes from Lamotke (1981, (3.1.2)).

* The second line is the long exact sequence of the triple $(Y, Y_+, X_b)$ where $H_q(Y, Y_+)$ is identified to $H_{n-2}(X_b)$ using 15. The last term is 0 because of Lemma 1.

* The column is the long exact sequence of the pair $(Y, X_b)$.

* The dashed arrow is induced by inclusion. Indeed, let $A$ be a closed $n-2$-chain in $H_{n-2}(X')$. It is sent to $A \times \mathbb{P}^1$ in $H_n(Y)$, which is then included in $H_n(Y, X_b)$ and then $H_n(Y, Y_+) \cap H_{n-2}(X_b)$, where the identification is given by intersecting with $X_b$, which yields $A$ again.

Importantly, the dashed arrow $H_{n-2}(X') \to H_{n-2}(X_b)$ is surjective, by Lefschetz' hyperplane theorem, since $X'$ is a hyperplane section of $X_b$. Now, the two exact sequences to prove follow from diagram chasing in (16). $\square$

**2.3. Projective complete intersections.** From now on, we assume that $X \subseteq \mathbb{P}^N$ is a complete intersection. In particular, all the homology groups that appear are free, so the exact sequences split, due to the following lemma which gathers some well known facts.

**Lemma 3.** Let $V$ be a $n$-dimensional smooth complete intersection of $\mathbb{P}^N$.

(i) For $k < n$, the inclusion $V \hookrightarrow \mathbb{P}^N$ induces isomorphism $H_k(V) \simeq H_k(\mathbb{P}^N)$ and $H^k(V) \simeq H^k(\mathbb{P}^N)$.

(ii) All the homology groups $H_k(V, \mathbb{Z})$ are free.

(iii) For $k < n$ even, $H_k(V)$ is generated by the homology class $\frac{1}{\deg V}[V \cap L]$ where $L$ is a projective subspace of complex codimension $n - \frac{k}{2}$.

(iv) For $n < k \le 2n$ even, $H_k(V)$ is generated by the homology class $[V \cap L]$ where $L$ is a projective subspace of complex codimension $n - \frac{k}{2}$.

*Proof.* The first point is a consequence of Lefschetz's hyperplane theorem. Poincaré duality implies $H_k(V) \simeq H_{2N-2n+k}(\mathbb{P}^N)$ for $k > n$. In particular, $H_k(V)$ is free for any $k \ne n$. For the
second point, see Hirzebruch (1956, §2.2). For convenience, we recall the main line of the argument. By the first point and Poincaré duality, it only remains to check that $H_n(V)$ is free. By the universal coefficient theorem (Hatcher, 2002, Corollary 3.3), we have

$$ (17) \quad H_n(V) \simeq H^n(V) \simeq \mathrm{Free}(H_n(V)) \oplus \mathrm{Tor}(H_{n-1}(V)) = \mathrm{Free}(H_n(V)), $$

where Free denotes the free part and Tor the torsion part.

For the third point, consider the inclusion $V \hookrightarrow \mathbb{P}^N$, which, by the first point, induces an isomorphism $H_k(V) \simeq H_k(\mathbb{P}^N)$. It maps a linear section of $V$ by a projective subspace $L^{n-\frac{k}{2}}$ of codimension $n - \frac{k}{2}$ to the class of $V \cap L$ in $\mathbb{P}^N$. But in $\mathbb{P}^N$, $V$ is homologous to $\deg(V)L^{N-n}$ so $[V \cap L]$ is homologous to $\deg(V)L^{N-\frac{k}{2}}$. So in $H_k(V)$, $[V \cap L]$ is divisible by $\deg(V)$ and the quotient is a generator.

For the last point, we consider the *umkehr* homorphism $i_! : H_{2N-2n+k}(\mathbb{P}^N) \to H_k(V)$ obtained by Poincaré duality from the morphism $H^{2n-k}(\mathbb{P}^N) \to H^{2n-k}(V)$ induced by inclusion. As the latter is an isomorphism by the first point, $i_!$ is an isomorphism too. We check easily that it maps a projective subspace $L^{n-\frac{k}{2}}$, which generates $H_{2N-2n+k}(\mathbb{P}^N)$, to the linear section $V \cap L^{n-\frac{k}{2}}$ of $V$. $\square$

In the case of complete intersections, it is convenient to study the homology of $X$ without the part coming from the homology of $\mathbb{P}^N$. In particular, when $n$ is even, the homology group $H_n(X)$ contains the class of a linear section $h$ of $X$ by a codimension $\frac{n}{2}$ linear space. So we define the primitive homology

$$ (18) \quad PH_n(X) = \begin{cases} H_n(X)/\mathbb{Z}h & \text{if } n \text{ is even} \\ H_n(X) & \text{if } n \text{ is odd.} \end{cases} $$

In the case where $n$ is odd, we define $h = 0 \in H_n(X)$.

Since $X_b$ is a $n-1$-dimensional complete intersection, the space $H_n(X_b)$ is generated by a linear section (or zero if $n$ is odd), which we also denote by $h$. In particular, the second exact sequence in Theorem 2 now reads

$$ (19) \quad 0 \to K \to \mathcal{T}(Y) \to PH_n(X) \to 0. $$

We can also be slightly more precise about $H_n(Y)$ and obtain a decomposition into a direct sum. The decomposition is not canonical but when we will study the intersection product, natural choices will appear.

**Theorem 4.** If $X \subseteq \mathbb{P}^N$ is a complete intersection, then the middle homology of the modification $Y$ is given (noncanonically) by

$$ H_n(Y) \simeq \mathcal{T}(Y) \oplus H_n(X_b) \oplus H_{n-2}(X_b). $$

*Proof.* Since $H_{n-2}(X_b)$ is free, the first exact sequence in Theorem 2 splits. Moreover, the map $i: H_n(X_b) \to H_n(Y)$ is injective (because after composition with $\pi_*$, we obtain the inclusion map $H_n(X_b) \to H_n(X)$ which is injective since it maps a linear section to a linear section). As all these groups are free, we obtain the claim. $\square$

### 3. COMPUTATION OF PERIODS

Let $n \ge 1$ and let $X \subseteq \mathbb{P}^{n+1}$ be a smooth hypersurface defined by a homogeneous polynomial $P \in \mathbb{C}[x_0, \dots, x_{n+1}]$ of degree $d$. In this section we describe an algorithm for computing the period matrix of $X$. When $n$ is even, the homology group $H_n(X)$ contains the class of a linear section of $X$ by a codimension $\frac{n}{2}$ linear space, which we deal with separately, and similarly in cohomology.

We consider the *primitive De Rham cohomology*, denoted $PH_{\mathrm{DR}}^n(X)$, which is a subspace of $H_{\mathrm{DR}}^n(X)$ (with coefficients in $\mathbb{C}$) isomorphic to $H_{\mathrm{DR}}^{n+1}(\mathbb{P}^{n+1} \setminus X)$, and the *primitive homology*,
second point, see Hirzebruch (1956, §2.2). For convenience, we recall the main line of the argument. By the first point and Poincaré duality, it only remains to check that $H_n(V)$ is free. By the universal coefficient theorem (Hatcher, 2002, Corollary 3.3), we have

$$ (17) \quad H_n(V) \simeq H^n(V) \simeq \mathrm{Free}(H_n(V)) \oplus \mathrm{Tor}(H_{n-1}(V)) = \mathrm{Free}(H_n(V)), $$

where Free denotes the free part and Tor the torsion part.

For the third point, consider the inclusion $V \hookrightarrow \mathbb{P}^N$, which, by the first point, induces an isomorphism $H_k(V) \simeq H_k(\mathbb{P}^N)$. It maps a linear section of $V$ by a projective subspace $L^{n-\frac{k}{2}}$ of codimension $n - \frac{k}{2}$ to the class of $V \cap L$ in $\mathbb{P}^N$. But in $\mathbb{P}^N$, $V$ is homologous to $\deg(V)L^{N-n}$ so $[V \cap L]$ is homologous to $\deg(V)L^{N-\frac{k}{2}}$. So in $H_k(V)$, $[V \cap L]$ is divisible by $\deg(V)$ and the quotient is a generator.

For the last point, we consider the *umkehr* homorphism $i_! : H_{2N-2n+k}(\mathbb{P}^N) \to H_k(V)$ obtained by Poincaré duality from the morphism $H^{2n-k}(\mathbb{P}^N) \to H^{2n-k}(V)$ induced by inclusion. As the latter is an isomorphism by the first point, $i_!$ is an isomorphism too. We check easily that it maps a projective subspace $L^{n-\frac{k}{2}}$, which generates $H_{2N-2n+k}(\mathbb{P}^N)$, to the linear section $V \cap L^{n-\frac{k}{2}}$ of $V$. $\square$

In the case of complete intersections, it is convenient to study the homology of $X$ without the part coming from the homology of $\mathbb{P}^N$. In particular, when $n$ is even, the homology group $H_n(X)$ contains the class of a linear section $h$ of $X$ by a codimension $\frac{n}{2}$ linear space. So we define the primitive homology

$$ (18) \quad PH_n(X) = \begin{cases} H_n(X)/\mathbb{Z}h & \text{if } n \text{ is even} \\ H_n(X) & \text{if } n \text{ is odd.} \end{cases} $$

In the case where $n$ is odd, we define $h = 0 \in H_n(X)$.

Since $X_b$ is a $n-1$-dimensional complete intersection, the space $H_n(X_b)$ is generated by a linear section (or zero if $n$ is odd), which we also denote by $h$. In particular, the second exact sequence in Theorem 2 now reads

$$ (19) \quad 0 \to K \to \mathcal{T}(Y) \to PH_n(X) \to 0. $$

We can also be slightly more precise about $H_n(Y)$ and obtain a decomposition into a direct sum. The decomposition is not canonical but when we will study the intersection product, natural choices will appear.

**Theorem 4.** If $X \subseteq \mathbb{P}^N$ is a complete intersection, then the middle homology of the modification $Y$ is given (noncanonically) by

$$ H_n(Y) \simeq \mathcal{T}(Y) \oplus H_n(X_b) \oplus H_{n-2}(X_b). $$

*Proof.* Since $H_{n-2}(X_b)$ is free, the first exact sequence in Theorem 2 splits. Moreover, the map $i: H_n(X_b) \to H_n(Y)$ is injective (because after composition with $\pi_*$, we obtain the inclusion map $H_n(X_b) \to H_n(X)$ which is injective since it maps a linear section to a linear section). As all these groups are free, we obtain the claim. $\square$

### 3. COMPUTATION OF PERIODS

Let $n \ge 1$ and let $X \subseteq \mathbb{P}^{n+1}$ be a smooth hypersurface defined by a homogeneous polynomial $P \in \mathbb{C}[x_0, \dots, x_{n+1}]$ of degree $d$. In this section we describe an algorithm for computing the period matrix of $X$. When $n$ is even, the homology group $H_n(X)$ contains the class of a linear section of $X$ by a codimension $\frac{n}{2}$ linear space, which we deal with separately, and similarly in cohomology.

We consider the *primitive De Rham cohomology*, denoted $PH_{\mathrm{DR}}^n(X)$, which is a subspace of $H_{\mathrm{DR}}^n(X)$ (with coefficients in $\mathbb{C}$) isomorphic to $H_{\mathrm{DR}}^{n+1}(\mathbb{P}^{n+1} \setminus X)$, and the *primitive homology*,
denoted $PH_n(X)$, defined in (18). When $n$ is odd, we have $H_{DR}^n(X) = PH_{DR}^n(X)$ and $H_n(X) = PH_n(X)$. When $n$ is even, $PH_{DR}^n(X)$ is a codimension 1 subspace of $H_{DR}^n(X)$, which is explicitly described by Griffiths-Dwork reduction, and $PH_n(X)$ is the quotient space $H_n(X)/Zh$, where $h$ is the homology class of a linear section of $X$. A primitive period matrix for $X$ is the matrix of the pairing $PH_n(X) \times PH_{DR}^n(X) \to \mathbb{C}$, induced by integration, with a given explicit $\mathbb{C}$-basis of $PH_{DR}^n(X)$ and some implicit $\mathbb{Z}$-basis of $PH_n(X)$. We show this pairing is well defined in Section 3.2.

The algorithm proceeds by induction on the dimension of $X$. Let $H \subseteq \mathbb{P}^{n+1}$ be a generic hyperplane. A primitive period matrix of $X$ is computed from a primitive period matrix of $X \cap H$ (as an hypersurface in $H \simeq \mathbb{P}^n$). To this end, we choose a pencil of hyperplanes $\{H_t\}_{t \in \mathbb{P}^1}$ and a base point $b$ such that $H_b = H$ and which induces a Lefschetz fibration, as defined in Section 2.1.1.

Up to a change of coordinates, we may assume that the pencil is given by $H_t = V(x_{n+1} - tx_0)$. As in the previous sections, we consider the rational map $f: X \to \mathbb{P}^1$ given by $[\mathbf{x}] \mapsto [x_0: x_{n+1}]$. We consider the blowup $\pi: Y \to X$ of $X$ along the base locus $X' = X \cap V(x_0, x_1)$ of the pencil. The composition $f \circ \pi: Y \to \mathbb{P}^1$ extends to a regular map on $Y$, also denoted $f$. The fibre $X_t \stackrel{\text{def}}{=} f^{-1}(t)$ is isomorphic to the intersection $X \cap H_t$. The set of critical values is denoted $\Sigma$, it is the set of all $t$ such that $X_t$ is singular.

The main steps of the algorithms are:

(1) derive the action of monodromy of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $H_{n-1}(X_b)$ from the primitive period matrix of $X_b$, see Section 3.5;

(2) compute a basis of homology of $H_n(Y)$ from the action of monodromy, see Section 3.7;

(3) compute a primitive period matrix of $X$ by integrating the varying periods of $X_t$ in an appropriate way, see Section 3.7.

<figure><img src="image_5.png" /></figure>

The starting point of this induction is the case of 0-dimensional varieties, where a description of homology and the effective period matrix can be obtained directly. This case is treated in Section 3.4. From then on, steps (1), (2), (3) allow to recover the effective period matrix of a curve, another iteration the one of surfaces, and so on.

**3.1. Numerical analytic continuation.** To begin with, we briefly present the algorithms underlying our numerical computations. Consider a linear differential system, in the complex plane, with rational coefficients – that is an equation

$$ (20) \quad Y'(t) = A(t)Y(t), $$

where $A(t) \in \mathbb{C}(t)^{r \times r}$, and $Y$ is a unknown vector or matrix of functions. A point $t \in \mathbb{C}$ is *ordinary* if $A$ is continuous at $t$ and *singular* otherwise. At any ordinary point $b \in \mathbb{C}$, there is a uniquely determined $r \times r$ solution matrix $Y_b$ with $Y_b(b) = I_r$ (Haraoka, 2020, Theorem 3.1). Let us call it the *fundamental solution at b*. Any other solution matrix $\tilde{Y}$ of (20) in a neighbourhood of $b$ can be written as $\tilde{Y}(t) = Y_b(t)U$ for some constant matrix $U$.

Consider a continuous path $\gamma: [0, 1] \to \mathbb{C}$ which avoids singular values. From the computational point of view, we assume that $\gamma$ is polygonal with ordinary vertices in $\mathbb{Q}[i]$ (results in the more general setting where the vertices are singular points or given numerically exist, but we will not need them). The analytic continuation along $\gamma$ of the fundamental solution at $\gamma(0)$ gives a new solution, denoted $\gamma_*Y$ in the neighbourhood of $\gamma(1)$ (Haraoka, 2020, Theorem 3.2). In particular, there is a unique matrix $\Lambda_\gamma \in \mathbb{C}^{r \times r}$, the *transition matrix along* $\gamma$, such that

$$ (21) \quad \gamma_* Y = Y_{\gamma(1)} \Lambda_\gamma. $$
denoted $PH_n(X)$, defined in (18). When $n$ is odd, we have $H_{DR}^n(X) = PH_{DR}^n(X)$ and $H_n(X) = PH_n(X)$. When $n$ is even, $PH_{DR}^n(X)$ is a codimension 1 subspace of $H_{DR}^n(X)$, which is explicitly described by Griffiths-Dwork reduction, and $PH_n(X)$ is the quotient space $H_n(X)/Zh$, where $h$ is the homology class of a linear section of $X$. A primitive period matrix for $X$ is the matrix of the pairing $PH_n(X) \times PH_{DR}^n(X) \to \mathbb{C}$, induced by integration, with a given explicit $\mathbb{C}$-basis of $PH_{DR}^n(X)$ and some implicit $\mathbb{Z}$-basis of $PH_n(X)$. We show this pairing is well defined in Section 3.2.

The algorithm proceeds by induction on the dimension of $X$. Let $H \subseteq \mathbb{P}^{n+1}$ be a generic hyperplane. A primitive period matrix of $X$ is computed from a primitive period matrix of $X \cap H$ (as an hypersurface in $H \simeq \mathbb{P}^n$). To this end, we choose a pencil of hyperplanes $\{H_t\}_{t \in \mathbb{P}^1}$ and a base point $b$ such that $H_b = H$ and which induces a Lefschetz fibration, as defined in Section 2.1.1.

Up to a change of coordinates, we may assume that the pencil is given by $H_t = V(x_{n+1} - tx_0)$. As in the previous sections, we consider the rational map $f: X \to \mathbb{P}^1$ given by $[\mathbf{x}] \mapsto [x_0: x_{n+1}]$. We consider the blowup $\pi: Y \to X$ of $X$ along the base locus $X' = X \cap V(x_0, x_1)$ of the pencil. The composition $f \circ \pi: Y \to \mathbb{P}^1$ extends to a regular map on $Y$, also denoted $f$. The fibre $X_t \stackrel{\text{def}}{=} f^{-1}(t)$ is isomorphic to the intersection $X \cap H_t$. The set of critical values is denoted $\Sigma$, it is the set of all $t$ such that $X_t$ is singular.

The main steps of the algorithms are:

(1) derive the action of monodromy of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $H_{n-1}(X_b)$ from the primitive period matrix of $X_b$, see Section 3.5;

(2) compute a basis of homology of $H_n(Y)$ from the action of monodromy, see Section 3.7;

(3) compute a primitive period matrix of $X$ by integrating the varying periods of $X_t$ in an appropriate way, see Section 3.7.

<figure><img src="image_6.png" /></figure>

The starting point of this induction is the case of 0-dimensional varieties, where a description of homology and the effective period matrix can be obtained directly. This case is treated in Section 3.4. From then on, steps (1), (2), (3) allow to recover the effective period matrix of a curve, another iteration the one of surfaces, and so on.

**3.1. Numerical analytic continuation.** To begin with, we briefly present the algorithms underlying our numerical computations. Consider a linear differential system, in the complex plane, with rational coefficients – that is an equation

$$ (20) \quad Y'(t) = A(t)Y(t), $$

where $A(t) \in \mathbb{C}(t)^{r \times r}$, and $Y$ is a unknown vector or matrix of functions. A point $t \in \mathbb{C}$ is *ordinary* if $A$ is continuous at $t$ and *singular* otherwise. At any ordinary point $b \in \mathbb{C}$, there is a uniquely determined $r \times r$ solution matrix $Y_b$ with $Y_b(b) = I_r$ (Haraoka, 2020, Theorem 3.1). Let us call it the *fundamental solution at b*. Any other solution matrix $\tilde{Y}$ of (20) in a neighbourhood of $b$ can be written as $\tilde{Y}(t) = Y_b(t)U$ for some constant matrix $U$.

Consider a continuous path $\gamma: [0, 1] \to \mathbb{C}$ which avoids singular values. From the computational point of view, we assume that $\gamma$ is polygonal with ordinary vertices in $\mathbb{Q}[i]$ (results in the more general setting where the vertices are singular points or given numerically exist, but we will not need them). The analytic continuation along $\gamma$ of the fundamental solution at $\gamma(0)$ gives a new solution, denoted $\gamma_*Y$ in the neighbourhood of $\gamma(1)$ (Haraoka, 2020, Theorem 3.2). In particular, there is a unique matrix $\Lambda_\gamma \in \mathbb{C}^{r \times r}$, the *transition matrix along* $\gamma$, such that

$$ (21) \quad \gamma_* Y = Y_{\gamma(1)} \Lambda_\gamma. $$
Since $Y_{\gamma(1)}(\gamma(1)) = \text{id}$, we have $\Lambda_{\gamma} = \gamma_* Y(\gamma(1))$. The map $\gamma \to \Lambda_{\gamma}$ is a morphism from the fundamental groupoid of $\mathbb{C} \setminus \Sigma$ to $\text{GL}(\mathbb{C}^r)$: $\Lambda_{\gamma}$ depends on $\gamma$ only up to homotopy, and if $\gamma\eta$ is the composition of two paths (going through $\eta$ first then $\gamma$), then $\Lambda_{\gamma\eta} = \Lambda_{\gamma}\Lambda_{\eta}$.

**Theorem 5** (Chudnovsky and Chudnovsky, 1990; van der Hoeven, 1999; Mezzarobba, 2010). *Given $p > 0$, we can compute an approximation of $\Lambda_{\gamma}$ up to $2^{-p}$ (for any norm on $\mathbb{C}^{r \times r}$). When the differential system (20) and the path $\gamma$ are fixed, and $p \to \infty$, we need $O(M(p(\log p)^2)) = p^{1+o(1)}$ bit operations, where $M(n)$ is the complexity of n-bit integer multiplication.*

We will use this result in two different ways. First, when $\gamma$ is a loop, the transition matrix along $\gamma$ is the monodromy matrix of the differential system (20) along $\gamma$. Second, we use this result to integrate the solutions of (20) along a path. Let $R(t) \in \mathbb{C}(t)^{1 \times r}$ be a vector of rational functions. Consider the differential system of dimension $r+1$

$$ (22) \qquad Z' = \left( \begin{array}{c|c} A & 0 \\ \hline R & 0 \end{array} \right) Z. $$

The vector solutions are exactly of the form $Z(t) = (Y(t), g(t))^t$ where $Y(t)$ is a solution of (20) and $g(t)$ is a primitive integral of $R(t) \cdot Y(t)$. More precisely, the fundamental solution at a point $b$ has the form

$$ (23) \qquad Z_b(t) = \left( \begin{array}{c|c} Y_b(t) & 0 \\ \hline \int_b^t R(t) \cdot Y_b(t) & 1 \end{array} \right). $$

The last row of the transition matrix $\Lambda_{\gamma}$ associated to the augmented system (22) is therefore $\int_{\gamma} R(t) \cdot Y_b(t)$ (and the coefficient 1). This gives an algorithm for computing integrals over $\gamma$ of rational function multiples of the coefficients of vector solutions of (20).

As for the practical aspects, we used the implementation of numerical analytic continuation provided in Sagemath by Mezzarobba (2016) in the `ore_algebra` package (Kauers et al., 2015). This package deals with scalar differential equations. This has practical implications, but from the mathematical point of view, scalar differential equations and differential systems are equivalent (Haraoka, 2020, Chapter 2).

## 3.2. De Rham middle cohomology classes of a hypersurface.
The understanding of the De Rham cohomology of $X$ is made simpler by looking at the cohomology of the complement $X^{\mathcal{C}} = \mathbb{P}^{n+1} \setminus X$ in projective space (Griffiths, 1969, §2; Cox & Katz, 1999, §5.3).

There is a natural injective morphism $\text{Res} : H_{\text{DR}}^{n+1}(X^{\mathcal{C}}) \to H_{\text{DR}}^n(X)$ called the residue mapping. Its image is

$$ (24) \qquad PH_{\text{DR}}^n(X) \stackrel{\text{def}}{=} \text{Res} \left( H_{\text{DR}}^{n+1}(X^{\mathcal{C}}) \right) = \left\{ \omega \in \left| \int_h \omega = 0 \right. \right\}. $$

We also recall the tubular mapping $T : H_n(X) \to H_{n+1}(X^{\mathcal{C}})$ which sends a cycle to the boundary of a tubular neighbourhood of one of its representative. These mappings are dual to each other: for any $\omega \in H^{n+1}(X^{\mathcal{C}})$ and $\gamma \in H_n(X)$,

$$ (25) \qquad 2\pi i \int_{\gamma} \text{Res} \omega = \int_{T(\gamma)} \omega. $$

The kernel of $T$ is generated by $h$ and we have $PH_n(X) = \text{coker}(T) = H_n(X)/\text{Zh}$. Equation (25) shows that the pairing $PH_n(X) \times PH_{\text{DR}}^n(X)$ is well defined.

The cohomology classes in $H^{n+1}(X^{\mathcal{C}})$ have an explicit description. Recall that $P \in \mathbb{C}[x_0, \dots, x_{n+1}]$ denotes the defining polynomial of $X$. The algebraic differential $n+1$-forms on $X^{\mathcal{C}}$ can be written uniquely as

$$ (26) \qquad \omega = \frac{A}{P^k} \Omega_{n+1}, $$
Since $Y_{\gamma(1)}(\gamma(1)) = \text{id}$, we have $\Lambda_{\gamma} = \gamma_* Y(\gamma(1))$. The map $\gamma \to \Lambda_{\gamma}$ is a morphism from the fundamental groupoid of $\mathbb{C} \setminus \Sigma$ to $\text{GL}(\mathbb{C}^r)$: $\Lambda_{\gamma}$ depends on $\gamma$ only up to homotopy, and if $\gamma\eta$ is the composition of two paths (going through $\eta$ first then $\gamma$), then $\Lambda_{\gamma\eta} = \Lambda_{\gamma}\Lambda_{\eta}$.

**Theorem 5** (Chudnovsky and Chudnovsky, 1990; van der Hoeven, 1999; Mezzarobba, 2010). *Given $p > 0$, we can compute an approximation of $\Lambda_{\gamma}$ up to $2^{-p}$ (for any norm on $\mathbb{C}^{r \times r}$). When the differential system (20) and the path $\gamma$ are fixed, and $p \to \infty$, we need $O(M(p(\log p)^2)) = p^{1+o(1)}$ bit operations, where $M(n)$ is the complexity of n-bit integer multiplication.*

We will use this result in two different ways. First, when $\gamma$ is a loop, the transition matrix along $\gamma$ is the monodromy matrix of the differential system (20) along $\gamma$. Second, we use this result to integrate the solutions of (20) along a path. Let $R(t) \in \mathbb{C}(t)^{1 \times r}$ be a vector of rational functions. Consider the differential system of dimension $r+1$

$$ (22) \qquad Z' = \left( \begin{array}{c|c} A & 0 \\ \hline R & 0 \end{array} \right) Z. $$

The vector solutions are exactly of the form $Z(t) = (Y(t), g(t))^t$ where $Y(t)$ is a solution of (20) and $g(t)$ is a primitive integral of $R(t) \cdot Y(t)$. More precisely, the fundamental solution at a point $b$ has the form

$$ (23) \qquad Z_b(t) = \left( \begin{array}{c|c} Y_b(t) & 0 \\ \hline \int_b^t R(t) \cdot Y_b(t) & 1 \end{array} \right). $$

The last row of the transition matrix $\Lambda_{\gamma}$ associated to the augmented system (22) is therefore $\int_{\gamma} R(t) \cdot Y_b(t)$ (and the coefficient 1). This gives an algorithm for computing integrals over $\gamma$ of rational function multiples of the coefficients of vector solutions of (20).

As for the practical aspects, we used the implementation of numerical analytic continuation provided in Sagemath by Mezzarobba (2016) in the *ore_algebra* package (Kauers et al., 2015). This package deals with scalar differential equations. This has practical implications, but from the mathematical point of view, scalar differential equations and differential systems are equivalent (Haraoka, 2020, Chapter 2).

## 3.2. De Rham middle cohomology classes of a hypersurface.
The understanding of the De Rham cohomology of $X$ is made simpler by looking at the cohomology of the complement $X^{\mathcal{C}} = \mathbb{P}^{n+1} \setminus X$ in projective space (Griffiths, 1969, §2; Cox & Katz, 1999, §5.3).

There is a natural injective morphism $\text{Res} : H_{\text{DR}}^{n+1}(X^{\mathcal{C}}) \to H_{\text{DR}}^n(X)$ called the *residue mapping*. Its image is

$$ (24) \qquad \text{Res} \left( H_{\text{DR}}^{n+1}(X^{\mathcal{C}}) \right) = \left\{ \omega \in \left| \int_h \omega = 0 \right. \right\}. $$

We also recall the *tubular mapping* $T: H_n(X) \to H_{n+1}(X^{\mathcal{C}})$ which sends a cycle to the boundary of a tubular neighbourhood of one of its representative. These mappings are dual to each other: for any $\omega \in H^{n+1}(X^{\mathcal{C}})$ and $\gamma \in H_n(X)$,

$$ (25) \qquad 2\pi i \int_{\gamma} \text{Res} \omega = \int_{T(\gamma)} \omega. $$

The kernel of $T$ is generated by $h$ and we have $\text{PH}_n(X) = \text{coker}(T) = H_n(X)/\text{Zh}$. Equation (25) shows that the pairing $\text{PH}_n(X) \times \text{PH}_{\text{DR}}^n(X)$ is well defined.

The cohomology classes in $H^{n+1}(X^{\mathcal{C}})$ have an explicit description. Recall that $P \in \mathbb{C}[x_0, \dots, x_{n+1}]$ denotes the defining polynomial of $X$. The algebraic differential $n+1$-forms on $X^{\mathcal{C}}$ can be written uniquely as

$$ (26) \qquad \omega = \frac{A}{P^k} \Omega_{n+1}, $$
where $\Omega_{n+1} = \sum_{i=0}^{n+1} (-1)^i x_i dx_1 \cdots dx_{i-1} dx_{i+1} \cdots dx_{n+1}$ is the projective volume form, $k$ is a positive integer and $A \in \mathbb{C}[\mathbf{x}]_{kd-n-2}$ is a homogeneous polynomial of degree $kd-n-2$. Since the variety $X^{\mathcal{C}}$ is affine, its De Rham cohomology can be computed using algebraic forms directly (Grothendieck, 1966). Explicitly, we have

$$ (27) \qquad H_{\mathrm{DR}}^{n+1}(X^{\mathcal{C}}) \simeq \frac{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{A}{P^k}\Omega_{n+1} \mid k \ge 0 \text{ and } A \in \mathbb{C}[\mathbf{x}]_{kd-n-2}\right\}}{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{\partial}{\partial x_i}\left(\frac{B}{P^k}\right)\Omega_{n+1} \mid k \ge 0 \text{ and } 0 \le i \le n+1 \text{ and } B \in \mathbb{C}[\mathbf{x}]_{kd-n-1}\right\}}. $$

This is the quotient of homogeneous rational functions, regular outside of $X$, of degree $-n-2$ modulo sums of partial derivatives of homogeneous rational functions, regular outside of $X$, of degree $-n-1$.

In this representation, a basis of $H_{\mathrm{DR}}^{n+1}(X^{\mathcal{C}})$ can be described in terms of the Jacobian ideal of $f$, namely

$$ (28) \qquad J = \left\langle \frac{\partial P}{\partial x_0}, \dots, \frac{\partial P}{\partial x_{n+1}} \right\rangle \subseteq \mathbb{C}[\mathbf{x}]. $$

We fix any monomial ordering on $\mathbb{C}[\mathbf{x}]$. A basis of the cohomology space is given by the forms $\frac{m}{P^k}\Omega_{n+1}$, where $m$ is a monomial in the variables $\mathbf{x}$ such that:

* $kd = \deg(m) + n + 2$;

* $m$ is not the leading monomial of any element of $J$.

The process of computing the coefficients in this basis of a given equivalence class of a $n+1$-form on $X^{\mathcal{C}}$ is called *Griffiths-Dwork reduction*. For more details, we refer to Cox and Katz (1999, §5.3).

### 3.3. Gauss-Manin connection.
Let $P_t = P(x_0, \dots, x_n, tx_0)$, where $P \in \mathbb{C}[x_0, \dots, x_{n+1}]$ is the defining polynomial of $X$, so that $X_t$ identifies with $V(P_t) \subset \mathbb{P}^n$. Following Section 3.2, the residue mapping induces an isomorphism

$$ (29) \qquad PH_{\mathrm{DR}}^{n-1}(X_t) \simeq \frac{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{A}{P_t^k}\Omega_n \mid k \ge 0 \text{ and } A \in \mathbb{C}[x_0, \dots, x_n]_{kd-n-1}\right\}}{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{\partial}{\partial x_i}\left(\frac{B}{P_t^k}\right)\Omega_n \mid k \ge 0 \text{ and } 0 \le i \le n \text{ and } B \in \mathbb{C}[x_0, \dots, x_n]_{kd-n}\right\}}. $$

By extending the scalars from $\mathbb{C}$ to $\mathbb{C}(t)$, we can define the *space of sections* of $PH_{\mathrm{DR}}^{n-1}(X_t)$ as the $\mathbb{C}(t)$-vector space

$$ (30) \qquad \mathcal{H} = \frac{\mathrm{Vect}_{\mathbb{C}(t)}\left\{\frac{A}{P_t^k}\Omega_n \mid k \ge 0 \text{ and } A \in \mathbb{C}(t)[x_0, \dots, x_n]_{kd-n-1}\right\}}{\mathrm{Vect}_{\mathbb{C}(t)}\left\{\frac{\partial}{\partial x_i}\left(\frac{B}{P_t^k}\right)\Omega_n \mid k \ge 0 \text{ and } 0 \le i \le n \text{ and } B \in \mathbb{C}(t)[x_0, \dots, x_n]_{kd-n}\right\}}. $$

For a given $\beta \in \mathcal{H}$ and a generic $t \in \mathbb{P}^1$, evaluation at $t$ gives an element $\beta(t)$ of $PH_{\mathrm{DR}}^n(X_t)$. Because $\frac{\partial}{\partial t}$ commutes with $\frac{\partial}{\partial x_i}$, we see that differentiation with respect to the parameter $t$ induces a derivation $\nabla$ of $\mathcal{H}$, called the *Gauss-Manin connection*.

Let $\beta \in \mathcal{H}$. For $\eta \in H_{n-1}(X_b)$, let $\eta(t) \in H_{n-1}(X_t)$ be the cycle uniquely determined by transporting $\eta$ in $Y_t$, following a path in some simply connected neighbourhood of $b$. The Gauss-Manin connection is uniquely determined by the property

$$ (31) \qquad \frac{d}{dt} \int_{\eta(t)} \beta(t) = \int_{\eta(t)} \nabla \beta(t). $$

Using Griffiths-Dwork reduction, we can compute a basis of $\mathcal{H}$, say $\beta_1, \dots, \beta_s$, and the matrix $A(t) = (a_{ij}) \in \mathbb{C}(t)^{r \times r}$ of the Gauss-Manin connection (for details on its computation, see Bostan et al. (2013)), defined by

$$ (32) \qquad \nabla \beta_i = \sum_j a_{ij} \beta_j. $$
where $\Omega_{n+1} = \sum_{i=0}^{n+1} (-1)^i x_i dx_1 \cdots dx_{i-1} dx_{i+1} \cdots dx_{n+1}$ is the projective volume form, $k$ is a positive integer and $A \in \mathbb{C}[\mathbf{x}]_{kd-n-2}$ is a homogeneous polynomial of degree $kd-n-2$. Since the variety $X^{\mathcal{C}}$ is affine, its De Rham cohomology can be computed using algebraic forms directly (Grothendieck, 1966). Explicitly, we have

$$ (27) \quad H_{\mathrm{DR}}^{n+1}(X^{\mathcal{C}}) \simeq \frac{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{A}{P^k}\Omega_{n+1} \mid k \ge 0 \text{ and } A \in \mathbb{C}[\mathbf{x}]_{kd-n-2}\right\}}{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{\partial}{\partial x_i}\left(\frac{B}{P^k}\right)\Omega_{n+1} \mid k \ge 0 \text{ and } 0 \le i \le n+1 \text{ and } B \in \mathbb{C}[\mathbf{x}]_{kd-n-1}\right\}}. $$

This is the quotient of homogeneous rational functions, regular outside of $X$, of degree $-n-2$ modulo sums of partial derivatives of homogeneous rational functions, regular outside of $X$, of degree $-n-1$.

In this representation, a basis of $H_{\mathrm{DR}}^{n+1}(X^{\mathcal{C}})$ can be described in terms of the Jacobian ideal of $f$, namely

$$ (28) \quad J = \left\langle \frac{\partial P}{\partial x_0}, \dots, \frac{\partial P}{\partial x_{n+1}} \right\rangle \subseteq \mathbb{C}[\mathbf{x}]. $$

We fix any monomial ordering on $\mathbb{C}[\mathbf{x}]$. A basis of the cohomology space is given by the forms $\frac{m}{P^k}\Omega_{n+1}$, where $m$ is a monomial in the variables $\mathbf{x}$ such that:

* $kd = \deg(m) + n + 2$;

* $m$ is not the leading monomial of any element of $J$.

The process of computing the coefficients in this basis of a given equivalence class of a $n+1$-form on $X^{\mathcal{C}}$ is called *Griffiths-Dwork reduction*. For more details, we refer to Cox and Katz (1999, §5.3).

**3.3. Gauss-Manin connection.** Let $P_t = P(x_0, \dots, x_n, tx_0)$, where $P \in \mathbb{C}[x_0, \dots, x_{n+1}]$ is the defining polynomial of $X$, so that $X_t$ identifies with $V(P_t) \subset \mathbb{P}^n$. Following Section 3.2, the residue mapping induces an isomorphism

$$ (29) \quad PH_{\mathrm{DR}}^{n-1}(X_t) \simeq \frac{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{A}{P_t^k}\Omega_n \mid k \ge 0 \text{ and } A \in \mathbb{C}[x_0, \dots, x_n]_{kd-n-1}\right\}}{\mathrm{Vect}_{\mathbb{C}}\left\{\frac{\partial}{\partial x_i}\left(\frac{B}{P_t^k}\right)\Omega_n \mid k \ge 0 \text{ and } 0 \le i \le n \text{ and } B \in \mathbb{C}[x_0, \dots, x_n]_{kd-n}\right\}}. $$

By extending the scalars from $\mathbb{C}$ to $\mathbb{C}(t)$, we can define the *space of sections* of $PH_{\mathrm{DR}}^{n-1}(X_t)$ as the $\mathbb{C}(t)$-vector space

$$ (30) \quad \mathcal{H} = \frac{\mathrm{Vect}_{\mathbb{C}(t)}\left\{\frac{A}{P_t^k}\Omega_n \mid k \ge 0 \text{ and } A \in \mathbb{C}(t)[x_0, \dots, x_n]_{kd-n-1}\right\}}{\mathrm{Vect}_{\mathbb{C}(t)}\left\{\frac{\partial}{\partial x_i}\left(\frac{B}{P_t^k}\right)\Omega_n \mid k \ge 0 \text{ and } 0 \le i \le n \text{ and } B \in \mathbb{C}(t)[x_0, \dots, x_n]_{kd-n}\right\}}. $$

For a given $\beta \in \mathcal{H}$ and a generic $t \in \mathbb{P}^1$, evaluation at $t$ gives an element $\beta(t)$ of $PH_{\mathrm{DR}}^n(X_t)$. Because $\frac{\partial}{\partial t}$ commutes with $\frac{\partial}{\partial x_i}$, we see that differentiation with respect to the parameter $t$ induces a derivation $\nabla$ of $\mathcal{H}$, called the *Gauss-Manin connection*.

Let $\beta \in \mathcal{H}$. For $\eta \in H_{n-1}(X_b)$, let $\eta(t) \in H_{n-1}(X_t)$ be the cycle uniquely determined by transporting $\eta$ in $Y_t$, following a path in some simply connected neighbourhood of $b$. The Gauss-Manin connection is uniquely determined by the property

$$ (31) \quad \frac{d}{dt} \int_{\eta(t)} \beta(t) = \int_{\eta(t)} \nabla \beta(t). $$

Using Griffiths-Dwork reduction, we can compute a basis of $\mathcal{H}$, say $\beta_1, \dots, \beta_s$, and the matrix $A(t) = (a_{ij}) \in \mathbb{C}(t)^{r \times r}$ of the Gauss-Manin connection (for details on its computation, see Bostan et al. (2013)), defined by

$$ (32) \quad \nabla \beta_i = \sum_j a_{ij} \beta_j. $$
Typically, $\beta_i$ will be in the form $\frac{m}{P^k}\Omega_n$, for some monomial $m$, and so $\nabla\beta_i$ will be given by the Griffiths-Dwork reduction of $-k\frac{m}{P^k}\frac{\partial P_t}{\partial t}\Omega_n$. We can also choose $\beta_1$ to be a cyclic vector and $\beta_i = \nabla^{i-1}\beta_1$ so that the differential system is encoded in a single scalar equation which is well adapted to the `ore_algebra` package (see Section 3.1). We may assume that the evaluations $\beta_i(b)$ yield a basis of $PH_{DR}^n(X_b)$, as this will generically be true.

**3.4. Primitive period matrix of a 0-dimensional hypersurface.** We start with the simple case where $X$ is a zero-dimensional variety in $\mathbb{P}^1$. The periods are directly given by residues of rational fractions.

More precisely, the middle homology group $H_0(X)$ is freely generated by $d$ points. The cohomology space $H_{DR}^0(X)$ is the set of functions $X \to \mathbb{C}$. The linear section $h$ is the sum of all points. In particular $PH_{DR}^0(X)$ is the set of functions $r: X \to \mathbb{C}$ with $\sum_{x \in X} r(x) = 0$. A basis of the middle primitive cohomology space $H_{DR}^1(X^{\mathbb{C}})$ is given by the rational forms $\omega_k = \frac{x^k y^{d-k-2}}{P}\Omega_1$ for $0 \le k \le d-2$. The residue mapping $H_{DR}^1(X^{\mathbb{C}}) \to H^0(X)$ is the classical residue

$$ (33) \qquad \frac{A}{P}\Omega_1 \mapsto \left( z \in X \mapsto \mathrm{Res}_z \left( \frac{A}{P}\Omega_1 \right) \right), $$

the tube map $T: H_0(X) \to H_1(X^{\mathbb{C}})$ maps a point of $X$ to a loop around it, and Equation (25) is Cauchy's residue theorem. Since, the sum of residues is zero, the image of the residue mapping is indeed included in $PH_{DR}^0(X)$.

We choose $d-1$ roots $z_1, \dots, z_{d-1}$ of $P$ in $X$ in the affine chart $y=1$, they give a basis of $PH_0(X)$ and a primitive period matrix of $X$ is given by the coefficients

$$ (34) \qquad z_i^j \frac{\partial P}{\partial x}(z_i)^{-1}, $$

for $1 \le i \le d-1$ and $0 \le j \le d-2$.

**3.5. Computation of the monodromy matrices of a Lefschetz fibration.**

**3.5.1. Monodromy on the primitive homology.** We consider the monodromy action of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $H_{n-1}(X_b)$. Let $\ell$ be a loop $\mathbb{P}^1 \setminus \Sigma$, starting from the base point $b$. As $t$ runs along $\ell$, $X_t$ is continuously deformed and there is a uniquely determined continuation $\eta(t)$ of $\eta$ in $H_{n-1}(X_t)$. The action of $\ell$ on $\eta$, denoted $\ell_*\eta$ is defined as the determination of $\eta(b)$ after $t$ has travelled along $\ell$. It is clear that a linear section of $X_b$ has trivial monodromy, thus the monodromy action on $H_{n-1}(X_b)$ induces an action on $PH_{n-1}(X_b)$.

**3.5.2. Computation of a monodromy matrix given a path.** Let $\Pi(t)$ be a primitive period matrix of $X_t$ defined by

$$ (35) \qquad \Pi_{ij}(t) = \int_{\eta_j(t)} \beta_i(t), $$

for some basis $\eta_j$ of $PH_{n-1}(X_b)$, and where the $\beta_i(t)$'s form a basis of $\mathcal{H}$, see Section 3.3. It depends holomorphically on $t$ (on some neighbourhood of $b$). Combining (31) and (32), we obtain the first-order linear differential system

$$ (36) \qquad \Pi'(t) = A(t)\Pi(t). $$

In particular, the matrix $\Pi$ extends holomorphically along the path $\ell$ and gives another determination, denoted $\ell_*\Pi$, of $\Pi$ in a neighbourhood of $b$. Naturally,

$$ (37) \qquad \ell_* \Pi_{ij}(t) = \int_{\ell_* \eta_j(t)} \beta_i(t). $$
Typically, $\beta_i$ will be in the form $\frac{m}{P^k}\Omega_n$, for some monomial $m$, and so $\nabla\beta_i$ will be given by the Griffiths-Dwork reduction of $-k\frac{m}{P^k}\frac{\partial P_t}{\partial t}\Omega_n$. We can also choose $\beta_1$ to be a cyclic vector and $\beta_i = \nabla^{i-1}\beta_1$ so that the differential system is encoded in a single scalar equation which is well adapted to the `ore_algebra` package (see Section 3.1). We may assume that the evaluations $\beta_i(b)$ yield a basis of $PH_{DR}^n(X_b)$, as this will generically be true.

**3.4. Primitive period matrix of a 0-dimensional hypersurface.** We start with the simple case where $X$ is a zero-dimensional variety in $\mathbb{P}^1$. The periods are directly given by residues of rational fractions.

More precisely, the middle homology group $H_0(X)$ is freely generated by $d$ points. The cohomology space $H_{DR}^0(X)$ is the set of functions $X \to \mathbb{C}$. The linear section $h$ is the sum of all points. In particular $PH_{DR}^0(X)$ is the set of functions $r: X \to \mathbb{C}$ with $\sum_{x \in X} r(x) = 0$. A basis of the middle primitive cohomology space $H_{DR}^1(X^{\mathbb{C}})$ is given by the rational forms $\omega_k = \frac{x^k y^{d-k-2}}{P}\Omega_1$ for $0 \le k \le d-2$. The residue mapping $H_{DR}^1(X^{\mathbb{C}}) \to H^0(X)$ is the classical residue

$$ (33) \qquad \frac{A}{P}\Omega_1 \mapsto \left( z \in X \mapsto \mathrm{Res}_z \left( \frac{A}{P}\Omega_1 \right) \right), $$

the tube map $T: H_0(X) \to H_1(X^{\mathbb{C}})$ maps a point of $X$ to a loop around it, and Equation (25) is Cauchy's residue theorem. Since, the sum of residues is zero, the image of the residue mapping is indeed included in $PH_{DR}^0(X)$.

We choose $d-1$ roots $z_1, \dots, z_{d-1}$ of $P$ in $X$ in the affine chart $y=1$, they give a basis of $PH_0(X)$ and a primitive period matrix of $X$ is given by the coefficients

$$ (34) \qquad z_i^j \frac{\partial P}{\partial x}(z_i)^{-1}, $$

for $1 \le i \le d-1$ and $0 \le j \le d-2$.

**3.5. Computation of the monodromy matrices of a Lefschetz fibration.**

**3.5.1. Monodromy on the primitive homology.** We consider the monodromy action of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $H_{n-1}(X_b)$. Let $\ell$ be a loop $\mathbb{P}^1 \setminus \Sigma$, starting from the base point $b$. As $t$ runs along $\ell$, $X_t$ is continuously deformed and there is a uniquely determined continuation $\eta(t)$ of $\eta$ in $H_{n-1}(X_t)$. The action of $\ell$ on $\eta$, denoted $\ell_*\eta$ is defined as the determination of $\eta(b)$ after $t$ has travelled along $\ell$. It is clear that a linear section of $X_b$ has trivial monodromy, thus the monodromy action on $H_{n-1}(X_b)$ induces an action on $PH_{n-1}(X_b)$.

**3.5.2. Computation of a monodromy matrix given a path.** Let $\Pi(t)$ be a primitive period matrix of $X_t$ defined by

$$ (35) \qquad \Pi_{ij}(t) = \int_{\eta_j(t)} \beta_i(t), $$

for some basis $\eta_j$ of $PH_{n-1}(X_b)$, and where the $\beta_i(t)$'s form a basis of $\mathcal{H}$, see Section 3.3. It depends holomorphically on $t$ (on some neighbourhood of $b$). Combining (31) and (32), we obtain the first-order linear differential system

$$ (36) \qquad \Pi'(t) = A(t)\Pi(t). $$

In particular, the matrix $\Pi$ extends holomorphically along the path $\ell$ and gives another determination, denoted $\ell_*\Pi$, of $\Pi$ in a neighbourhood of $b$. Naturally,

$$ (37) \qquad \ell_* \Pi_{ij}(t) = \int_{\ell_* \eta_j(t)} \beta_i(t). $$
In particular, the matrix of the action of $\ell$ on $H_{n-1}(X_b)$ in the basis $(\eta_j)$ is given by

$$ (38) \quad \mathrm{Mat}(\ell_*) = \Pi^{-1}(b) \cdot \ell_* \Pi(b) = \Pi^{-1}(b) \Lambda_\ell \Pi(b), $$

where $\Lambda_\ell$ is the transition matrix introduced in Section 3.1, associated to the differential system (36) and the loop $\ell$. It is possible to compute $\Delta_\ell$ numerically with arbitrary precision and rigorous error bounds using the differential system (36), see Theorem 5. Together with the data of $\Pi(b)$, we compute $\mathrm{Mat}(\ell_*)$.

### 3.5.3. Computation of appropriate paths.
It only remains to compute a set of generators of $\pi_1(\mathbb{P}^1\setminus\Sigma)$, which we compute as piecewise linear paths. To do this, we compute the Voronoi diagram of $\Sigma$ in $\mathbb{C}$. Each critical point $c_i \in \Sigma$ lies in a unique Voronoi cell. Up to adding additional points around the convex hull of $\Sigma$, we may assume that the boundary of that cell is a polygon that describes a loop $\ell'_i$ around the critical point (although not pointed at $b$). We pick the loop to be anticlockwise.

For each $i$, we pick a vertex $v_i$ of $\ell'_i$. We can then consider the Voronoi graph $V$, for which the vertices and edges are those of the Voronoi cells. We also add the basepoint $b$, and an edge connecting the basepoint to the closest other vertex in $V$. We compute a subtree $T$ of $V$ covering all the $v_i$ and rooted at $b$. In $T$ there is a unique path $p_i$ connecting $b$ to a given $v_i$. A simple loop around $c_i$ pointed at $b$ is then given by the composition $\ell_i = p_i^{-1}\ell'_i p_i$.

For the sake of computing the extension around the equator $\tau_\infty$ (see (43) below), we need to order these paths so that the composition of them is the loop around $\infty$. We define a supertree $T'$ of $T$ by adding a child corresponding to $\ell'_i$ at $v_i$, for each $i$. For a given node of $T'$, we order its children in anticlockwise order starting from the parent. Finally the ordering on the loops is simply the ordering induced by the prefix ordering of the nodes of $T'$. This can be achieved with a depth-first search throughout $T$, illustrated in Fig. 4.

<figure><img src="image_6.png" /><figcaption>**Figure 4.** The tree $T$ (bold) is a subtree of the Voronoi graph (dashed) that connects all the points on which the polygonal loops are pointed. Assume we are visiting vertex $v$, coming from vertex $p$, and that two polygonal loops $\ell'_i$ and $\ell'_j$ are pointed at $v$. $v$ has three neighbours $p_1, p_2$ and $p_3$. The sorting algorithm will yield $j$, the result of visiting $p_1$, $i$, and finally the result of visiting $p_2$, in this order. Applying this sorting algorithm from the vertex $b$ gives an order on the loops pointed at $b$ such that their composition is the loop around $\infty$.</figcaption></figure>
In particular, the matrix of the action of $\ell$ on $H_{n-1}(X_b)$ in the basis $(\eta_j)$ is given by

$$ (38) \quad \mathrm{Mat}(\ell_*) = \Pi^{-1}(b) \cdot \ell_* \Pi(b) = \Pi^{-1}(b) \Lambda_\ell \Pi(b), $$

where $\Lambda_\ell$ is the transition matrix introduced in Section 3.1, associated to the differential system (36) and the loop $\ell$. It is possible to compute $\Delta_\ell$ numerically with arbitrary precision and rigorous error bounds using the differential system (36), see Theorem 5. Together with the data of $\Pi(b)$, we compute $\mathrm{Mat}(\ell_*)$.

### 3.5.3. Computation of appropriate paths.
It only remains to compute a set of generators of $\pi_1(\mathbb{P}^1\setminus\Sigma)$, which we compute as piecewise linear paths. To do this, we compute the Voronoi diagram of $\Sigma$ in $\mathbb{C}$. Each critical point $c_i \in \Sigma$ lies in a unique Voronoi cell. Up to adding additional points around the convex hull of $\Sigma$, we may assume that the boundary of that cell is a polygon that describes a loop $\ell'_i$ around the critical point (although not pointed at $b$). We pick the loop to be anticlockwise.

For each $i$, we pick a vertex $v_i$ of $\ell'_i$. We can then consider the Voronoi graph $V$, for which the vertices and edges are those of the Voronoi cells. We also add the basepoint $b$, and an edge connecting the basepoint to the closest other vertex in $V$. We compute a subtree $T$ of $V$ covering all the $v_i$ and rooted at $b$. In $T$ there is a unique path $p_i$ connecting $b$ to a given $v_i$. A simple loop around $c_i$ pointed at $b$ is then given by the composition $\ell_i = p_i^{-1}\ell'_i p_i$.

For the sake of computing the extension around the equator $\tau_\infty$ (see (43) below), we need to order these paths so that the composition of them is the loop around $\infty$. We define a supertree $T'$ of $T$ by adding a child corresponding to $\ell'_i$ at $v_i$, for each $i$. For a given node of $T'$, we order its children in anticlockwise order starting from the parent. Finally the ordering on the loops is simply the ordering induced by the prefix ordering of the nodes of $T'$. This can be achieved with a depth-first search throughout $T$, illustrated in Fig. 4.

<figure><img src="image_7.png" /><figcaption>**Figure 4.** The tree $T$ (bold) is a subtree of the Voronoi graph (dashed) that connects all the points on which the polygonal loops are pointed. Assume we are visiting vertex $v$, coming from vertex $p$, and that two polygonal loops $\ell'_i$ and $\ell'_j$ are pointed at $v$. $v$ has three neighbours $p$, $n_1$ and $n_2$. The sorting algorithm will yield $j$, the result of visiting $n_1$, $i$, and finally the result of visiting $n_2$, in this order. Applying this sorting algorithm from the vertex $b$ gives an order on the loops pointed at $b$ such that their composition is the loop around $\infty$.</figcaption></figure>
**3.6. Computation of a homology basis.** We seek a description of $PH_n(X)$ given the matrices of the monodromy action of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $PH_{n-1}(X_b)$. Firstly, $PH_n(X)$ identifies with a quotient of $\mathcal{T}(Y)$, by (19). By computing $PH_n(X)$, we mean, first, computing $\mathcal{T}(Y)$ and, second, computing the kernel of $\pi_*: \mathcal{T}(Y) \to PH_n(X)$.

**3.6.1. Basis of $\mathcal{T}(Y)$.** Recall the setting of Section 2.1.2: we have a generating set $\ell_1, \dots, \ell_r$ of $\pi_1(\mathbb{P}^1 \setminus \Sigma, b)$ and we further assume that $\ell_r \cdots \ell_1 = 1$ is the loop at $\infty$. Each $\ell_i$ induces an automorphism of $PH_{n-1}(X_b)$, denoted $\ell_{i*}$. Thanks to the algorithm given in Section 3.5, we can compute the matrix $M_i$ of $\ell_{i*}$ with respect to some fixed basis $\beta_1, \dots, \beta_s$ of $PH_{n-1}(X_b)$.

The linear section $h$ (which is nonzero when $n$ is even) is fixed by $\ell_{i*}$. By the Picard–Lefschetz formula (8), this implies that $\langle h, \delta_i \rangle = 0$. In particular, $\langle h, h \rangle = \deg X \neq 0$, and therefore $h$ is not a vanishing cycle. These two observations show that monodromy action on the quotient is well defined, and the corresponding matrices still satisfy $\mathrm{rk} M_i - \mathrm{rk} I_s = 1$. Thus there are vectors $d_i \in \mathbb{Z}^{s \times 1}$ and $m_i \in \mathbb{Z}^{1 \times s}$ such that

$$ (39) \qquad M_i = I_s + d_i m_i \in \mathbb{Z}^{s \times s}. $$

The vectors $d_i$ and $m_i$ are uniquely determined, up to sign, by $M_i$. The vector $d_i$ is the coordinates of the vanishing cycle $\delta_i$ (see §2.1.2) in the basis $\beta_1, \dots, \beta_s$ of $PH_{n-1}(X_b)$, and $m_i$ is the linear form $\eta \mapsto (-1)^{\frac{n(n+1)}{2}} \langle \eta, \delta_i \rangle$, which is well defined on $PH_{n-1}(X_b)$ since $\langle h, \delta_i \rangle = 0$.

The extension map $\tau_{\ell_i}: H_{n-1}(X_b) \to H_n(Y_+, X_b)$ is described by (10) in terms of the linear maps $\langle - , \delta_i \rangle$. In particular, it factors through $PH_{n-1}(X)$, and in the bases $(\beta_j)_{1 \le j \le s}$ for $PH_{n-1}(X_b)$ and $(\Delta_i)_{1 \le i \le r}$ for $H_n(Y_+, X_b)$, the matrix $T_i$ of the induced map is given by

$$ (40) \qquad T_i = (-1)^{n-1} \left( \frac{\begin{smallmatrix} 0 \\ m_i \\ 0 \end{smallmatrix}}{\begin{smallmatrix} 0 \\ \ell_i \\ 0 \end{smallmatrix}} \right) \in \mathbb{Z}^{r \times s}, \quad \text{where } m_i \text{ is the } i\text{-th line.} $$

Finally, the boundary map $\delta: H_n(Y_+, X_b) \to H_{n-1}(X_b)$ mapping $\Delta_i$ to $\delta_i$ induces a map $\tilde{\delta}: H_n(Y_+, X_b) \to PH_{n-1}(X_b)$. The matrix $B$ of $\tilde{\delta}$ is given by

$$ (41) \qquad B = \mathrm{Mat}(\tilde{\delta}) = \left( \begin{array}{c|c} d_1 & \cdots & d_r \end{array} \right) \in \mathbb{Z}^{s \times r}. $$

Recall that $\tau_\infty$ is the extension map $H_{n-1}(X_b) \to H_n(Y_+, X_b)$ along the equator, which is homotopically equivalent to the composition $\ell_r \cdots \ell_1$. By (5), it follows that

$$ (42) \qquad \tau_\infty = \sum_{i=1}^{r} \tau_{\ell_i} \ell_{i-1*} \cdots \ell_{1*}, $$

and therefore, in terms of the notations above, the matrix of the map $PH_{n-1}(X_b) \to H_n(Y_+, X_b)$ induced by $\tau_\infty$ is

$$ (43) \qquad T_\infty = T_1 + T_2 M_1 + T_3 M_2 M_1 + \cdots + T_r M_{r-1} \cdots M_1. $$

With these matrices in hands, we obtain a basis of $\mathcal{T}(Y)$ as $\ker(B)/\mathrm{im}(T_\infty)$.

**3.6.2. Kernel of $\mathcal{T}(Y) \to PH_n(X)$.** The final step to get $PH_n(X)$ is to identify the cycles stemming from the blowup of the base locus of the fibration $Y \to X$. We propose two methods. The first one, which we implemented, uses the duality between $PH_n(X)$ and $PH_{\mathrm{DR}}^n(X)$ to obtain that

$$ (44) \qquad \ker(\pi_*: \mathcal{T}(Y) \to PH_n(X)) = \left\{ \gamma \in \mathcal{T}(Y) \mid \forall \omega \in PH_{\mathrm{DR}}^n(X), \int_{\pi_*(\gamma)} \omega = 0 \right\}. $$

This amounts to computing the kernel of a full-rank matrix with complex coefficients, knowing that it is generated by integer-coefficient vectors. This is numerically stable as the matrix we consider
**3.6. Computation of a homology basis.** We seek a description of $PH_n(X)$ given the matrices of the monodromy action of $\pi_1(\mathbb{P}^1 \setminus \Sigma)$ on $PH_{n-1}(X_b)$. Firstly, $PH_n(X)$ identifies with a quotient of $\mathcal{T}(Y)$, by (19). By computing $PH_n(X)$, we mean, first, computing $\mathcal{T}(Y)$ and, second, computing the kernel of $\pi_*: \mathcal{T}(Y) \to PH_n(X)$.

**3.6.1. Basis of $\mathcal{T}(Y)$.** Recall the setting of Section 2.1.2: we have a generating set $\ell_1, \dots, \ell_r$ of $\pi_1(\mathbb{P}^1 \setminus \Sigma, b)$ and we further assume that $\ell_r \cdots \ell_1 = 1$ is the loop at $\infty$. Each $\ell_i$ induces an automorphism of $PH_{n-1}(X_b)$, denoted $\ell_{i*}$. Thanks to the algorithm given in Section 3.5, we can compute the matrix $M_i$ of $\ell_{i*}$ with respect to some fixed basis $\beta_1, \dots, \beta_s$ of $PH_{n-1}(X_b)$.

The linear section $h$ (which is nonzero when $n$ is even) is fixed by $\ell_{i*}$. By the Picard–Lefschetz formula (8), this implies that $\langle h, \delta_i \rangle = 0$. In particular, $\langle h, h \rangle = \deg X \neq 0$, and therefore $h$ is not a vanishing cycle. These two observations show that monodromy action on the quotient is well defined, and the corresponding matrices still satisfy $\mathrm{rk} M_i - \mathrm{rk} I_s = 1$. Thus there are vectors $d_i \in \mathbb{Z}^{s \times 1}$ and $m_i \in \mathbb{Z}^{1 \times s}$ such that

$$ (39) \qquad M_i = I_s + d_i m_i \in \mathbb{Z}^{s \times s}. $$

The vectors $d_i$ and $m_i$ are uniquely determined, up to sign, by $M_i$. The vector $d_i$ is the coordinates of the vanishing cycle $\delta_i$ (see §2.1.2) in the basis $\beta_1, \dots, \beta_s$ of $PH_{n-1}(X_b)$, and $m_i$ is the linear form $\eta \mapsto (-1)^{\frac{n(n+1)}{2}} \langle \eta, \delta_i \rangle$, which is well defined on $PH_{n-1}(X_b)$ since $\langle h, \delta_i \rangle = 0$.

The extension map $\tau_{\ell_i}: H_{n-1}(X_b) \to H_n(Y_+, X_b)$ is described by (10) in terms of the linear maps $\langle -, \delta_i \rangle$. In particular, it factors through $PH_{n-1}(X)$, and in the bases $(\beta_j)_{1 \le j \le s}$ for $PH_{n-1}(X_b)$ and $(\Delta_i)_{1 \le i \le r}$ for $H_n(Y_+, X_b)$, the matrix $T_i$ of the induced map is given by

$$ (40) \qquad T_i = (-1)^{n-1} \left( \frac{\begin{smallmatrix} 0 \\ m_i \\ 0 \end{smallmatrix}}{\begin{smallmatrix} 0 \\ 0 \end{smallmatrix}} \right) \in \mathbb{Z}^{r \times s}, \quad \text{where } m_i \text{ is the } i\text{-th line.} $$

Finally, the boundary map $\delta: H_n(Y_+, X_b) \to H_{n-1}(X_b)$ mapping $\Delta_i$ to $\delta_i$ induces a map $\tilde{\delta}: H_n(Y_+, X_b) \to PH_{n-1}(X_b)$. The matrix $B$ of $\tilde{\delta}$ is given by

$$ (41) \qquad B = \mathrm{Mat}(\tilde{\delta}) = \left( \begin{array}{c|c} d_1 & \cdots & d_r \end{array} \right) \in \mathbb{Z}^{s \times r}. $$

Recall that $\tau_\infty$ is the extension map $H_{n-1}(X_b) \to H_n(Y_+, X_b)$ along the equator, which is homotopically equivalent to the composition $\ell_r \cdots \ell_1$. By (5), it follows that

$$ (42) \qquad \tau_\infty = \sum_{i=1}^{r} \tau_{\ell_i} \ell_{i-1*} \cdots \ell_{1*}, $$

and therefore, in terms of the notations above, the matrix of the map $PH_{n-1}(X_b) \to H_n(Y_+, X_b)$ induced by $\tau_\infty$ is

$$ (43) \qquad T_\infty = T_1 + T_2 M_1 + T_3 M_2 M_1 + \cdots + T_r M_{r-1} \cdots M_1. $$

With these matrices in hands, we obtain a basis of $\mathcal{T}(Y)$ as $\ker(B)/\mathrm{im}(T_\infty)$.

**3.6.2. Kernel of $\mathcal{T}(Y) \to PH_n(X)$.** The final step to get $PH_n(X)$ is to identify the cycles stemming from the blowup of the base locus of the fibration $Y \to X$. We propose two methods. The first one, which we implemented, uses the duality between $PH_n(X)$ and $PH_{\mathrm{DR}}^n(X)$ to obtain that

$$ (44) \qquad \ker(\pi_*: \mathcal{T}(Y) \to PH_n(X)) = \left\{ \gamma \in \mathcal{T}(Y) \mid \forall \omega \in PH_{\mathrm{DR}}^n(X), \int_{\pi_*(\gamma)} \omega = 0 \right\}. $$

This amounts to computing the kernel of a full-rank matrix with complex coefficients, knowing that it is generated by integer-coefficient vectors. This is numerically stable as the matrix we consider
has full rank. In practice, the coefficients are small and we can compute them using lattice-reduction algorithms. However, we cannot certify this computation. In Section 5.1 we give a certified method for finding the coefficients of the blowups in terms of the thimbles in the case of surfaces. This method generalises to higher dimensions but we did not implement it.

Since the matrix of the pairing $PH_n(X) \times PH_{DR}^n(X)$ is non-degenerate, the kernel of $\pi_*$ is exactly the left-kernel of the full-rank matrix $P_{Y,X}$. This is a sublattice of $\mathcal{T}(Y)$, so $\ker \pi_*$ is generated by integer-coefficient vectors. We present an alternative rigorous way of computing $\ker \pi_*$ in Section 5.1.

**3.7. Computation of the effective period matrix.** We now have a basis of $\mathcal{T}(Y)$ and, by (19), $\pi: Y \to X$ induces a surjective map $\mathcal{T}(Y) \to PH_n(X)$. In order to compute the period matrix of $H_n(X)$, we first compute the matrix $P_{Y,X}$ of the pairing $\mathcal{T}(Y) \times PH_{DR}^n(X) \to \mathbb{C}$

$$ (45) \qquad (\gamma, \omega) \mapsto \int_{\pi_*(\gamma)} \omega. $$

To recover a primitive period matrix of $X$, it is then sufficient to compute a basis of $\mathcal{T}(Y)/\ker \pi_*$ and extract from $P_{Y,X}$ the relevant submatrix.

**3.7.1. Integrating periods.** Let $\omega \in PH_{DR}^n(X)$ and $\gamma \in \mathcal{T}(Y)$. By definition, $\gamma$ is the extension along some path $\ell$ in $\mathbb{P}^1 \setminus \Sigma$ of some cycle $\eta \in H_{n-1}(X_b)$. Assume for now that we can write $\pi^*\omega = \beta \wedge df$, for some $n-1$-form $\beta$ on $Y$. Then

$$ (46) \qquad \int_{\pi_*\gamma} \omega = \int_{\gamma} \pi^* \omega = \int_{\tau_\ell(\eta)} \beta \wedge df = \int_{\ell} \left( \int_{\eta_t} \beta |_{X_t} \right) dt, $$

where $\eta_t$ is the uniquely determined continuation of $\eta \in H_{n-1}(X_t)$. This expresses the period $\int_{\pi_*\gamma} \omega$ as an integral of a period of the fiber $X_t$, varying with the parameter.

The computations can be more explicitly carried out using the isomorphism between $PH_{DR}^n(X)$ and $H_{DR}^{n+1}(X^\mathcal{C})$. Recall that $X^\mathcal{C}$ denotes the complement $\mathbb{P}^{n+1} \setminus X$. Let $Y' = Y \setminus Y_\infty$, where $Y_\infty$ is the fibre of $f: Y \to \mathbb{P}^1$ above the point at infinity. By choice of coordinates, the hyperplane family $(H_t)_{t \in \mathbb{P}^1}$ is given by $H_t = V(x_{n+1} - tx_0)$, and we check that

$$ Y' \simeq \{(x, t) \in \mathbb{P}^n \times \mathbb{C} \mid P_t(x_0, \dots, x_n) = 0\}, $$

where $P_t(x_0, \dots, x_n) = P(x_0, \dots, x_n, tx_0)$ is the equation of $X_t$ in $\mathbb{P}^n$. Let $Y^\mathcal{C}$ be the complement of $Y'$, that is

$$ Y^\mathcal{C} = \{(x, t) \in \mathbb{P}^n \times \mathbb{C} \mid P_t(x_0, \dots, x_n) \neq 0\}. $$

The map

$$ ([x_0 : \dots : x_n], t) \mapsto [x_0 : \dots : x_n : tx_0] $$

induces a map $\pi: Y^\mathcal{C} \to X^\mathcal{C}$. The Leray residue maps $H^{n+1}(Y^\mathcal{C}) \to H_n(Y')$ and $H^{n+1}(X^\mathcal{C}) \to H^n(X)$ commute with $\pi$. Therefore, given a form $\omega \in PH_{DR}^n(X)$, which we write as $\text{Res}(\frac{A}{P^k}\Omega_{n+1})$ following Section 3.2, we have

$$ (47) \qquad \int_{\pi_*\gamma} \omega = \int_{\gamma} \pi^* \text{Res} \left( \frac{A}{P^k} \Omega_{n+1} \right) = \int_{T(\gamma)} \pi^* \left( \frac{A}{P^k} \Omega_{n+1} \right) = \int_{T(\gamma)} \frac{x_0 A_t}{P_t^k} \Omega_n \wedge dt $$

$$ (48) \qquad = \int_{\ell} \left( \int_{T(\eta_t)} \frac{x_0 A_t}{P_t^k} \Omega_n \right) dt. $$
has full rank. In practice, the coefficients are small and we can compute them using lattice-reduction algorithms. However, we cannot certify this computation. In Section 5.1 we give a certified method for finding the coefficients of the blowups in terms of the thimbles in the case of surfaces. This method generalises to higher dimensions but we did not implement it.

Since the matrix of the pairing $PH_n(X) \times PH_{DR}^n(X)$ is non-degenerate, the kernel of $\pi_*$ is exactly the left-kernel of the full-rank matrix $P_{Y,X}$. This is a sublattice of $\mathcal{T}(Y)$, so $\ker \pi_*$ is generated by integer-coefficient vectors. We present an alternative rigorous way of computing $\ker \pi_*$ in Section 5.1.

**3.7. Computation of the effective period matrix.** We now have a basis of $\mathcal{T}(Y)$ and, by (19), $\pi: Y \to X$ induces a surjective map $\mathcal{T}(Y) \to PH_n(X)$. In order to compute the period matrix of $H_n(X)$, we first compute the matrix $P_{Y,X}$ of the pairing $\mathcal{T}(Y) \times PH_{DR}^n(X) \to \mathbb{C}$

$$ (45) \qquad (\gamma, \omega) \mapsto \int_{\pi_*(\gamma)} \omega. $$

To recover a primitive period matrix of $X$, it is then sufficient to compute a basis of $\mathcal{T}(Y)/\ker \pi_*$ and extract from $P_{Y,X}$ the relevant submatrix.

**3.7.1. Integrating periods.** Let $\omega \in PH_{DR}^n(X)$ and $\gamma \in \mathcal{T}(Y)$. By definition, $\gamma$ is the extension along some path $\ell$ in $\mathbb{P}^1 \setminus \Sigma$ of some cycle $\eta \in H_{n-1}(X_b)$. Assume for now that we can write $\pi^*\omega = \beta \wedge df$, for some $n-1$-form $\beta$ on $Y$. Then

$$ (46) \qquad \int_{\pi_*\gamma} \omega = \int_{\gamma} \pi^* \omega = \int_{\tau_\ell(\eta)} \beta \wedge df = \int_{\ell} \left( \int_{\eta_t} \beta |_{X_t} \right) dt, $$

where $\eta_t$ is the uniquely determined continuation of $\eta \in H_{n-1}(X_t)$. This expresses the period $\int_{\pi_*\gamma} \omega$ as an integral of a period of the fiber $X_t$, varying with the parameter.

The computations can be more explicitly carried out using the isomorphism between $PH_{DR}^n(X)$ and $H_{DR}^{n+1}(X^\mathcal{C})$. Recall that $X^\mathcal{C}$ denotes the complement $\mathbb{P}^{n+1} \setminus X$. Let $Y' = Y \setminus Y_\infty$, where $Y_\infty$ is the fibre of $f: Y \to \mathbb{P}^1$ above the point at infinity. By choice of coordinates, the hyperplane family $(H_t)_{t \in \mathbb{P}^1}$ is given by $H_t = V(x_{n+1} - tx_0)$, and we check that

$$ Y' \simeq \{(x, t) \in \mathbb{P}^n \times \mathbb{C} \mid P_t(x_0, \dots, x_n) = 0\}, $$

where $P_t(x_0, \dots, x_n) = P(x_0, \dots, x_n, tx_0)$ is the equation of $X_t$ in $\mathbb{P}^n$. Let $Y^\mathcal{C}$ be the complement of $Y'$, that is

$$ Y^\mathcal{C} = \{(x, t) \in \mathbb{P}^n \times \mathbb{C} \mid P_t(x_0, \dots, x_n) \neq 0\}. $$

The map

$$ ([x_0 : \dots : x_n], t) \mapsto [x_0 : \dots : x_n : tx_0] $$

induces a map $\pi: Y^\mathcal{C} \to X^\mathcal{C}$. The Leray residue maps $H^{n+1}(Y^\mathcal{C}) \to H_n(Y')$ and $H^{n+1}(X^\mathcal{C}) \to H^n(X)$ commute with $\pi$. Therefore, given a form $\omega \in PH_{DR}^n(X)$, which we write as $\text{Res}(\frac{A}{P^k}\Omega_{n+1})$ following Section 3.2, we have

$$ (47) \qquad \int_{\pi_*\gamma} \omega = \int_{\gamma} \pi^* \text{Res} \left( \frac{A}{P^k} \Omega_{n+1} \right) = \int_{T(\gamma)} \pi^* \left( \frac{A}{P^k} \Omega_{n+1} \right) = \int_{T(\gamma)} \frac{x_0 A_t}{P_t^k} \Omega_n \wedge dt $$

$$ (48) \qquad = \int_{\ell} \left( \int_{T(\eta_t)} \frac{x_0 A_t}{P_t^k} \Omega_n \right) dt. $$
The form $\frac{x_0 A_t}{P_t^k} \Omega_n$ defines an element of the space $\mathcal{H}$ of sections of $PH_{\mathrm{DR}}^n(X_t^\mathcal{C})$. In particular, we can write, in $\mathcal{H}$,

$$ \frac{x_0 A_t}{P_t^k} \Omega_n = \sum_{i=1}^{s} r_i(t) \beta_i(t) $$

for some rational functions $r_i(t)$, which we can compute explicitely using the Griffiths–Dwork reduction. The vector $Y' = (y_i(t))_{1\le i\le s}$ defined by $y_i(t) = \int_{\eta_i} \beta_i(t)$ is a solution to the differential system $Y'(t) = A(t)Y(t)$ coming from the Gauss–Manin connection, see (32) and (36). Moreover, (47) gives

$$ (49) \quad \int_{\pi_*\gamma} \omega = \int_{\ell} \sum_{i=1}^{s} r_i(t)y_i(t)dt. $$

We can compute $Y(0)$ from the primitive period matrix of $X_b$ (which we assume is given as input data), and then we can use numerical analytic continuation to compute the integral in (49) efficiently (Section 3.1).

**3.8. Wrapup.** Let us summarise the main steps of the algorithm for computing a primitive period matrix of a projective hypersurface $X$ in $\mathbb{P}^{n+1}$ given:

* the defining polynomial $P(x_0, \dots, x_{n+1})$ of $X$;

* a generic hyperplane family $H_t = V(x_{n+1} - tx_0)$;

* a generic base point $b$;

* a primitive period matrix $\Pi(b)$ of $X_b = X \cap H_b$, for a well-specified basis of $PH_{\mathrm{DR}}^n(X_b)$.

(1) Using Griffiths–Dwork reduction, compute a basis $\beta_1(t), \dots, \beta_s(t)$ of $\mathcal{H}$ (as a $\mathbb{C}(t)$-linear space), the space of sections of $PH_{\mathrm{DR}}^{n-1}(X_t)$ defined in Section 3.3, and the matrix $A(t) \in \mathbb{C}(t)^{s \times s}$ of the Gauss–Manin connection over it (§§3.2 and 3.3).

(2) If necessary, perform a change of basis so that the primitive period matrix $\Pi(b)$ of $X_b$ is given with respect to the basis $(\beta_i(b))$ of $PH_{\mathrm{DR}}^n(X_b)$.

(3) Compute the critical values $\Sigma \subset \mathbb{P}^1$ and polygonal loops $\ell_1, \dots, \ell_r$ generating the fundamental group of $\mathbb{P}^1 \setminus \Sigma$ (§3.5.3).

(4) For each $\ell_i$, integrate numerically the differential system $\Pi'(t) = A(t)\Pi(t)$, with given initial value $\Pi(b)$ along $\ell_i$ to obtain the value $\ell_{i*}\Pi(b)$, with rigorous error bounds. Compute the matrix $M_i = \Pi(b)^{-1} \cdot \ell_{i*}\Pi(b)$. It is an integer matrix, so we only need to compute the coefficients of $M_i$ with a coefficient-wise error bounded by $\frac{1}{2}$ (§3.5.2).

(5) Using Equations (41) and (43), compute the integer matrices $B \in \mathbb{Z}^{s \times r}$ and $T_\infty \in \mathbb{Z}^{r \times s}$. Compute bases of $\ker(B)$ and $\mathrm{im}(T_\infty)$ in $\bigoplus_{i=1}^r \mathbb{Z}\Delta_i$ and a basis of a sublattice $T \subseteq \ker(B)$ such that $\ker(B) = T \oplus \mathrm{im}(T_\infty)$. This sublattice is isomorphic to $\mathcal{T}(Y)$ (§3.6).

(6) Compute a basis $\omega_1, \dots, \omega_e$ of $PH_{\mathrm{DR}}^n(X)$, using Griffiths–Dwork reduction, and compute the integrals $\int_{\pi^*(\Delta_i)} \omega_j$ (§3.7.1). This amounts to

(a) Computing the coefficients of $\omega_j|_{X_t}$ in the basis $(\beta_i)$ of $\mathcal{H}$;

(b) Computing a Picard–Fuchs differential equation for the partial integral $y(t) = \int_{\delta_i(t)} \omega_j|_{X_t}$, using the coefficients above and the matrix $A(t)$ of the Gauss–Manin connection, where $\delta_i(t)$ is the vanishing cycle associated to the $i$-th critical value, transported in $X_t$;

(c) Computing initial conditions $y^{(k)}(b)$ using the matrix $\Pi(b)$;

(d) Computing $\int_{\ell_i} y(t)dt$ using the method given in Section 3.1.

(7) With appropriate linear combinations, compute $\int_{\pi^*(\tau_i)} \omega_j$ for some basis $(\tau_i)$ of $T \simeq \mathcal{T}(Y)$ computed at Step 5, which gives the matrix $P$ of the pairing $\mathcal{T}(Y) \times PH_{\mathrm{DR}}^n(X)$.
The form $\frac{x_0 A_t}{P_t^k} \Omega_n$ defines an element of the space $\mathcal{H}$ of sections of $PH_{\text{DR}}^n(X_t^{\mathcal{C}})$. In particular, we can write, in $\mathcal{H}$,

$$ \frac{x_0 A_t}{P_t^k} \Omega_n = \sum_{i=1}^{s} r_i(t) \beta_i(t) $$

for some rational functions $r_i(t)$, which we can compute explicitely using the Griffiths–Dwork reduction. The vector $Y' = (y_i(t))_{1\le i\le s}$ defined by $y_i(t) = \int_{\eta_i} \beta_i(t)$ is a solution to the differential system $Y'(t) = A(t)Y(t)$ coming from the Gauss–Manin connection, see (32) and (36). Moreover, (47) gives

$$ (49) \quad \int_{\pi_*\gamma} \omega = \int_{\ell} \sum_{i=1}^{s} r_i(t)y_i(t)dt. $$

We can compute $Y(0)$ from the primitive period matrix of $X_b$ (which we assume is given as input data), and then we can use numerical analytic continuation to compute the integral in (49) efficiently (Section 3.1).

**3.8. Wrapup.** Let us summarise the main steps of the algorithm for computing a primitive period matrix of a projective hypersurface $X$ in $\mathbb{P}^{n+1}$ given:

* the defining polynomial $P(x_0, \dots, x_{n+1})$ of $X$;

* a generic hyperplane family $H_t = V(x_{n+1} - tx_0)$;

* a generic base point $b$;

* a primitive period matrix $\Pi(b)$ of $X_b = X \cap H_b$, for a well-specified basis of $PH_{\text{DR}}^n(X_b)$.

(1) Using Griffiths–Dwork reduction, compute a basis $\beta_1(t), \dots, \beta_s(t)$ of $\mathcal{H}$ (as a $\mathbb{C}(t)$-linear space), the space of sections of $PH_{\text{DR}}^{n-1}(X_t)$ defined in Section 3.3, and the matrix $A(t) \in \mathbb{C}(t)^{s \times s}$ of the Gauss–Manin connection over it (§§3.2 and 3.3).

(2) If necessary, perform a change of basis so that the primitive period matrix $\Pi(b)$ of $X_b$ is given with respect to the basis $(\beta_i(b))$ of $PH_{\text{DR}}^n(X_b)$.

(3) Compute the critical values $\Sigma \subset \mathbb{P}^1$ and polygonal loops $\ell_1, \dots, \ell_r$ generating the fundamental group of $\mathbb{P}^1 \setminus \Sigma$ (§3.5.3).

(4) For each $\ell_i$, integrate numerically the differential system $\Pi'(t) = A(t)\Pi(t)$, with given initial value $\Pi(b)$ along $\ell_i$ to obtain the value $\ell_{i*}\Pi(b)$, with rigorous error bounds. Compute the matrix $M_i = \Pi(b)^{-1} \cdot \ell_{i*}\Pi(b)$. It is an integer matrix, so we only need to compute the coefficients of $M_i$ with a coefficient-wise error bounded by $\frac{1}{2}$ (§3.5.2).

(5) Using Equations (41) and (43), compute the integer matrices $B \in \mathbb{Z}^{s \times r}$ and $T_\infty \in \mathbb{Z}^{r \times s}$. Compute bases of $\ker(B)$ and $\mathrm{im}(T_\infty)$ in $\bigoplus_{i=1}^r \mathbb{Z}\Delta_i$ and a basis of a sublattice $T \subseteq \ker(B)$ such that $\ker(B) = T \oplus \mathrm{im}(T_\infty)$. This sublattice is isomorphic to $\mathcal{T}(Y)$ (§3.6).

(6) Compute a basis $\omega_1, \dots, \omega_e$ of $PH_{\text{DR}}^n(X)$, using Griffiths–Dwork reduction, and compute the integrals $\int_{\pi^*(\Delta_i)} \omega_j$ (§3.7.1). This amounts to

(a) Computing the coefficients of $\omega_j|_{X_t}$ in the basis $(\beta_i)$ of $\mathcal{H}$;

(b) Computing a Picard–Fuchs differential equation for the partial integral $y(t) = \int_{\delta_i(t)} \omega_j|_{X_t}$, using the coefficients above and the matrix $A(t)$ of the Gauss–Manin connection, where $\delta_i(t)$ is the vanishing cycle associated to the $i$-th critical value, transported in $X_t$;

(c) Computing initial conditions $y^{(k)}(b)$ using the matrix $\Pi(b)$;

(d) Computing $\int_{\ell_i} y(t)dt$ using the method given in Section 3.1.

(7) With appropriate linear combinations, compute $\int_{\pi^*(\tau_i)} \omega_j$ for some basis $(\tau_i)$ of $T \simeq \mathcal{T}(Y)$ computed at Step 5, which gives the matrix $P$ of the pairing $\mathcal{T}(Y) \times PH_{\text{DR}}^n(X)$.
(8) Numerically compute the left kernel of this matrix, this is a subgroup of $\mathcal{T}(Y)$. Restrict this matrix to a supplement of this kernel, to obtain a primitive period matrix of $X$.

*Complexity aspects.* Let $d$ be the degree of $P$. We can perform Step 1 using $d^{5n+O(1)}$ operations (Bostan et al., 2013). The dimension $s$ of $\mathcal{H}$ is bounded by $d^n$ and the entries of the $s \times s$ matrix $A$ are rational functions with numerators and denominators of degree at most $n3^nd^{n+1}$ (Bostan et al., 2013, Proposition 8).

In Step 3, the set $\Sigma$ of critical values has $d(d-1)^n$ elements (by genericity of the hyperplane family). We can compute them by solving a system of $n+1$ homogeneous equations of degree at most $d$ in $\mathbb{P}^{n+1}$. The algebraic complexity is bounded by $d^{O(n)}$ (Giusti et al., 2001), and we should also consider the cost of numerical approximation in the complex plane. In practice, the computational cost is negligible. The polynomial systems we have can be considered as toy examples.

In Step 5, we reduce to integrating a differential operator of order at most $d^n$ and coefficients of degree $d^{O(n)}$. As an optimization, Steps 5 and 6d can be performed simultaneously. The complexity depends on the size of the differential operator, the desired precision but also numerical parameters. No complete description is known. With respect to precision only, when everything else is fixed, Theorem 5 guarantees a quasilinear complexity.

## 4. AN EXPLICIT EXAMPLE: QUARTIC SURFACE

Let $P = w^4 + x^4 + y^4 + z^4$ and define the Fermat quartic surface $X = V(P) \subset \mathbb{P}^3$. It is a smooth quartic projective surface. Thus it is a $K3$ surface, its middle cohomology group has rank 22 and its holomorphic subgroup has rank 1. In this section, we give an explicit description of the computation of the periods of $X$.

A static SAGE worksheet reproducing the computations of this section can be found at `Fermat periods.ipynb<fnref n="2" />`. The computation of this notebook took a bit less than 18 minutes on a laptop.

**4.1. Constructing the Lefschetz fibration.** Let $\lambda = w$ and $\mu = 2x + 3y + z$, and for $t \in \mathbb{P}^1$, define $H_t = V(\lambda - t\mu)$. This defines a hyperplane pencil $\{H_t\}_{t \in \mathbb{P}^1}$ with axis $A = V(\lambda, \mu)$. Then the modification of $Y$ along $X$ is the blowup of $X$ along $A$ which resolves the indeterminacies of the rational map $\lambda/\mu: X \to \mathbb{P}^1$ into a map $f: Y \to \mathbb{P}^1$. The fibre $f^{-1}(t)$ is isomorphic to $X_t \stackrel{\text{def}}{=} X \cap H_t$. The defining equation for $X_t$ when $t \neq \infty$ is

$$ (50) \qquad P_t = t^4(2x + 3y + z)^4 + x^4 + y^4 + z^4. $$

The map $f$ has 36 critical values $t_1, \dots, t_{36}$. We chose a basepoint $b$ and a value which will serve as $\infty$, both regular.

**4.2. Computing cohomology.** The primitive cohomology $PH^2(X)$ is computed thanks to the Griffiths-Dwork reduction (see Section 3.2). $PH^2(X)$ has rank 21 and a basis is given by the residues of rational forms

$$ (51) \qquad \frac{1}{P}\Omega_3, \frac{A_1}{P^2}\Omega_3, \dots, \frac{A_{19}}{P^2}\Omega_3, \frac{w^2x^2y^2z^2}{P^3}\Omega_3 \in H^3(\mathbb{P}^2 \setminus X), $$

where $A_1, \dots, A_{19}$ are all the monomials of degree 4 in $w, x, y, z$ with exponents at most 2, and $\Omega_3 = wdx dy dz - xdw dy dz + ydw dx dz - zdw dxdy$ is the volume form of $\mathbb{P}^3$. The 21 monomials 1, $w^2x^2y^2z^2$ and $A_1, \dots, A_{19}$ are all the monomials whose degree is a multiple of 4 and that are not divisible by the leading term of any element of the Jacobian ideal of $P$, which is in this case, the monomial ideal $\langle w^3, x^3, y^3, z^3 \rangle$.

<footnote n="2">²https://nbviewer.org/urls/gitlab.inria.fr/epichonp/eplt-support/-/raw/main/Fermat periods.ipynb</footnote>
(8) Numerically compute the left kernel of this matrix, this is a subgroup of $\mathcal{T}(Y)$. Restrict this matrix to a supplement of this kernel, to obtain a primitive period matrix of $X$.

*Complexity aspects.* Let $d$ be the degree of $P$. We can perform Step 1 using $d^{5n+O(1)}$ operations (Bostan et al., 2013). The dimension $s$ of $\mathcal{H}$ is bounded by $d^n$ and the entries of the $s \times s$ matrix $A$ are rational functions with numerators and denominators of degree at most $n3^nd^{n+1}$ (Bostan et al., 2013, Proposition 8).

In Step 3, the set $\Sigma$ of critical values has $d(d-1)^n$ elements (by genericity of the hyperplane family). We can compute them by solving a system of $n+1$ homogeneous equations of degree at most $d$ in $\mathbb{P}^{n+1}$. The algebraic complexity is bounded by $d^{O(n)}$ (Giusti et al., 2001), and we should also consider the cost of numerical approximation in the complex plane. In practice, the computational cost is negligible. The polynomial systems we have can be considered as toy examples.

In Step 5, we reduce to integrating a differential operator of order at most $d^n$ and coefficients of degree $d^{O(n)}$. As an optimization, Steps 5 and 6d can be performed simultaneously. The complexity depends on the size of the differential operator, the desired precision but also numerical parameters. No complete description is known. With respect to precision only, when everything else is fixed, Theorem 5 guarantees a quasilinear complexity.

## 4. AN EXPLICIT EXAMPLE: QUARTIC SURFACE

Let $P = w^4 + x^4 + y^4 + z^4$ and define the Fermat quartic surface $X = V(P) \subset \mathbb{P}^3$. It is a smooth quartic projective surface. Thus it is a $K3$ surface, its middle cohomology group has rank 22 and its holomorphic subgroup has rank 1. In this section, we give an explicit description of the computation of the periods of $X$.

A static SAGE worksheet reproducing the computations of this section can be found at `Fermat periods.ipynb<fnref n="2" />`. The computation of this notebook took a bit less than 18 minutes on a laptop.

**4.1. Constructing the Lefschetz fibration.** Let $\lambda = w$ and $\mu = 2x + 3y + z$, and for $t \in \mathbb{P}^1$, define $H_t = V(\lambda - t\mu)$. This defines a hyperplane pencil $\{H_t\}_{t \in \mathbb{P}^1}$ with axis $A = V(\lambda, \mu)$. Then the modification of $Y$ along $X$ is the blowup of $X$ along $A$ which resolves the indeterminacies of the rational map $\lambda : X \to \mathbb{P}^1$ into a map $f : Y \to \mathbb{P}^1$. The fibre $f^{-1}(t)$ is isomorphic to $X_t \stackrel{\text{def}}{=} X \cap H_t$. The defining equation for $X_t$ when $t \neq \infty$ is

$$ (50) \qquad P_t = t^4(2x + 3y + z)^4 + x^4 + y^4 + z^4. $$

The map $f$ has 36 critical values $t_1, \dots, t_{36}$. We chose a basepoint $b$ and a value which will serve as $\infty$, both regular.

**4.2. Computing cohomology.** The primitive cohomology $PH^2(X)$ is computed thanks to the Griffiths-Dwork reduction (see Section 3.2). $PH^2(X)$ has rank 21 and a basis is given by the residues of rational forms

$$ (51) \qquad \frac{1}{P}\Omega_3, \frac{A_1}{P^2}\Omega_3, \dots, \frac{A_{19}}{P^2}\Omega_3, \frac{w^2x^2y^2z^2}{P^3}\Omega_3 \in H^3(\mathbb{P}^2 \setminus X), $$

where $A_1, \dots, A_{19}$ are all the monomials of degree 4 in $w, x, y, z$ with exponents at most 2, and $\Omega_3 = wdx dy dz - xdw dy dz + ydw dx dz - zdw dxdy$ is the volume form of $\mathbb{P}^3$. The 21 monomials 1, $w^2x^2y^2z^2$ and $A_1, \dots, A_{19}$ are all the monomials whose degree is a multiple of 4 and that are not divisible by the leading term of any element of the Jacobian ideal of $P$, which is in this case, the monomial ideal $\langle w^3, x^3, y^3, z^3 \rangle$.

<footnote n="2">²https://nbviewer.org/urls/gitlab.inria.fr/epichonp/eplt-support/-/raw/main/Fermat periods.ipynb</footnote>
<figure><img src="image_7.png" /><figcaption>**Figure 5.** The 6 × 36 matrix B of the border map $\tilde{\delta}: H_2(Y_+, Y_b) \to PH_1(Y_b)$. Each column corresponds to the coordinates of a vanishing cycle at a critical point in the undetermined basis of $PH_1(X_b)$.</figcaption></figure>

Similarly, a basis of $\mathcal{H}$, defined as the space of sections of $PH_1(X_t)$ (which, since 1 is odd, is just $H_1(X_t)$) is given by the residues of the forms

$$ (52) \quad \frac{x}{P_t}\Omega_2, \frac{y}{P_t}\Omega_2, \frac{z}{P_t}\Omega_2, \frac{z^5}{P_t^2}\Omega_2, \frac{yz^4}{P_t^2}\Omega_2, \text{ and } \frac{xz^4}{P_t^2}\Omega_2. $$

**4.3. The action of monodromy on $H_1(X_b)$, thimbles, and recovering $H_2(Y)$.** As $X_b$ is a smooth quartic curve, it has genus 3 and the homology group $H_1(X_b)$ is free of rank 6. We assume we have a (primitive) period matrix of $H_1(X_b)$ given in the basis (52) for $H_{DR}^1(X_b)$ and some basis $\eta_1, \dots, \eta_6$ of $H_1(X_b)$ which needs not be specified. We first aim at computing the action of $\pi_1(\mathbb{P}^1 \setminus \{t_1, \dots, t_{36}\}, b)$ on $H_1(X_b)$.

First we compute the simple direct loops $\ell_1, \dots, \ell_{36}$ around the critical values $t_1, \dots, t_{36}$, such that the composition $\ell_{36} \dots \ell_1$ is the indirect loop around $\infty$. Then for each $i$ we may compute the monodromy matrix $M_i \in GL_6(\mathbb{Z})$ of the action of monodromy along $\ell_i$ on $H_1(Y_b)$ in the basis $\eta_1, \dots, \eta_6$ (see Section 3.5). For instance, we find

$$ (53) \quad M_1 = \begin{bmatrix} 1 & 0 & 1 & 1 & 2 & 2 \\ 0 & 1 & -1 & -1 & -2 & -2 \\ 0 & 0 & 2 & 1 & 2 & 2 \\ 0 & 0 & -1 & 0 & -2 & -2 \\ 0 & 0 & 1 & 1 & 3 & 2 \\ 0 & 0 & -1 & -1 & -2 & -1 \end{bmatrix} = I_6 + \begin{bmatrix} 1 \\ -1 \\ 1 \\ -1 \\ 1 \\ -1 \end{bmatrix} \cdot \begin{bmatrix} 0 & 0 & 1 & 1 & 2 & 2 \end{bmatrix}. $$

This decomposition is the one of Equation (39). We choose a generator $d_i \in H_1(Y_b)$ of the image of $M_i - I$ (the choice is up to a sign). This is the vector of the coordinates of the vanishing cycle $\delta_i$ at $t_i$ in the basis of $H_1(X_b)$. We have for example $d_1 = (1, -1, 1, -1, 1, -1)$. We also pick a permuting cycle, i.e. a preimage $p_i$ of $d_i$ through $M_i - I$, so that $d_i = M_i p_i - p_i$. For instance $p_1 = (0, 0, 1, 0, 0, 0)$. We then have an explicit understanding of the thimble $\Delta_i \in H_2(Y_+, X_b)$ as the extension $\tau_{\ell_i}(p_i)$ of $p_i$ along $\ell_i$. These thimbles freely generate $H_2(Y_+, X_b)$, and we have the 36 × 6 integer matrix B of the border map

$$ (54) \quad \tilde{\delta}: \begin{cases} H_2(Y_+, Y_b) \to PH_1(Y_b) \\ \Delta_i \mapsto \delta_i \end{cases}, $$

as per (41). This matrix has full column rank, and its kernel gives us a basis for $H_2(Y_+)/H_2(X_b)$, which has rank 30.

In order to recover $\mathcal{T}(Y)$, we need to quotient by the extensions of cycles in $H_1(Y_b)$ along the loop around $\infty$, which we recall is simply the composition $\ell_{36} \cdots \ell_1$. The matrix $T_i$ of the extension map $\tau_{\ell_i}: H_1(X_b) \to H_2(Y, X_b)$ in the bases $\beta_1, \dots, \beta_6$ of $H_1(Y_b)$ and $\Delta_1, \dots, \Delta_{36}$ of $H_n(Y, X_b)$ is
<figure><img src="image_8.png" /><figcaption>**Figure 5.** The 6 × 36 matrix B of the border map $\tilde{\delta}: H_2(Y_+, Y_b) \to PH_1(Y_b)$. Each column corresponds to the coordinates of a vanishing cycle at a critical point in the undetermined basis of $PH_1(X_b)$.</figcaption></figure>

Similarly, a basis of $\mathcal{H}$, defined as the space of sections of $PH_1(X_t)$ (which, since 1 is odd, is just $H_1(X_t)$) is given by the residues of the forms

$$ (52) \quad \frac{x}{P_t}\Omega_2, \frac{y}{P_t}\Omega_2, \frac{z}{P_t}\Omega_2, \frac{z^5}{P_t^2}\Omega_2, \frac{yz^4}{P_t^2}\Omega_2, \text{ and } \frac{xz^4}{P_t^2}\Omega_2. $$

**4.3. The action of monodromy on $H_1(X_b)$, thimbles, and recovering $H_2(Y)$.** As $X_b$ is a smooth quartic curve, it has genus 3 and the homology group $H_1(X_b)$ is free of rank 6. We assume we have a (primitive) period matrix of $H_1(X_b)$ given in the basis (52) for $H_{DR}^1(X_b)$ and some basis $\eta_1, \dots, \eta_6$ of $H_1(X_b)$ which needs not be specified. We first aim at computing the action of $\pi_1(\mathbb{P}^1 \setminus \{t_1, \dots, t_{36}\}, b)$ on $H_1(X_b)$.

First we compute the simple direct loops $\ell_1, \dots, \ell_{36}$ around the critical values $t_1, \dots, t_{36}$, such that the composition $\ell_{36} \dots \ell_1$ is the indirect loop around $\infty$. Then for each $i$ we may compute the monodromy matrix $M_i \in GL_6(\mathbb{Z})$ of the action of monodromy along $\ell_i$ on $H_1(Y_b)$ in the basis $\eta_1, \dots, \eta_6$ (see Section 3.5). For instance, we find

$$ (53) \quad M_1 = \begin{bmatrix} 1 & 0 & 1 & 1 & 2 & 2 \\ 0 & 1 & -1 & -1 & -2 & -2 \\ 0 & 0 & 2 & 1 & 2 & 2 \\ 0 & 0 & -1 & 0 & -2 & -2 \\ 0 & 0 & 1 & 1 & 3 & 2 \\ 0 & 0 & -1 & -1 & -2 & -1 \end{bmatrix} = I_6 + \begin{bmatrix} 1 \\ -1 \\ 1 \\ -1 \\ 1 \\ -1 \end{bmatrix} \cdot \begin{bmatrix} 0 & 0 & 1 & 1 & 2 & 2 \end{bmatrix}. $$

This decomposition is the one of Equation (39). We choose a generator $d_i \in H_1(Y_b)$ of the image of $M_i - I$ (the choice is up to a sign). This is the vector of the coordinates of the vanishing cycle $\delta_i$ at $t_i$ in the basis of $H_1(X_b)$. We have for example $d_1 = (1, -1, 1, -1, 1, -1)$. We also pick a permuting cycle, i.e. a preimage $p_i$ of $d_i$ through $M_i - I$, so that $d_i = M_i p_i - p_i$. For instance $p_1 = (0, 0, 1, 0, 0, 0)$. We then have an explicit understanding of the thimble $\Delta_i \in H_2(Y_+, X_b)$ as the extension $\tau_{\ell_i}(p_i)$ of $p_i$ along $\ell_i$. These thimbles freely generate $H_2(Y_+, X_b)$, and we have the 36 × 6 integer matrix B of the border map

$$ (54) \quad \tilde{\delta}: \begin{cases} H_2(Y_+, Y_b) \to PH_1(Y_b) \\ \Delta_i \mapsto \delta_i \end{cases}, $$

as per (41). This matrix has full column rank, and its kernel gives us a basis for $H_2(Y_+)/H_2(X_b)$, which has rank 30.

In order to recover $\mathcal{T}(Y)$, we need to quotient by the extensions of cycles in $H_1(Y_b)$ along the loop around $\infty$, which we recall is simply the composition $\ell_{36} \cdots \ell_1$. The matrix $T_i$ of the extension map $\tau_{\ell_i}: H_1(X_b) \to H_2(Y, X_b)$ in the bases $\beta_1, \dots, \beta_6$ of $H_1(Y_b)$ and $\Delta_1, \dots, \Delta_{36}$ of $H_n(Y, X_b)$ is
$$
\begin{pmatrix}
0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & -1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & -1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 1 & -1 & 2 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 1 & -1 & -1 & 1 & 1 & 1 & 1 & 1 & 2 & 0 & -1 & 0 & 1 & 0 & -2 & 0 & -1 & 0 & -1 & 1 & 2 & 1 & 0 & 0 \\
1 & 0 & -1 & 1 & -1 & 0 & 0 & 0 & 0 & 1 & -1 & -1 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 1 & 0 & -1 & -1 & 0 & 1 & -1 & 0 & -1 & 0 & -1 & 1 & 1 & 0 & 0 \\
1 & -1 & 0 & 0 & 0 & -1 & -1 & 0 & 0 & 0 & 1 & -1 & -1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & -1 & 0 & 0 & -1 & -1 & 0 & 0 & 0 & -1 & 0 & 1 \\
2 & 0 & -1 & 1 & 0 & -1 & -1 & 1 & 0 & 1 & 0 & -2 & 0 & 0 & -1 & 1 & 2 & 2 & 2 & 2 & 0 & 1 & 1 & -2 & -2 & 0 & 0 & -2 & -1 & -2 & 1 & -1 & 1 & 0 & 1 & 1 \\
2 & 1 & 0 & 0 & 0 & -1 & 0 & 2 & 1 & 1 & 0 & -2 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & -1 & 1 & 2 & -2 & -2 & 1 & 0 & -2 & -1 & -2 & 1 & 0 & 1 & 0 & 0 & 0 & 0
\end{pmatrix}
$$

<caption>**Figure 6.** The transpose of the 36 × 6 matrix $T_\infty$ of the extension map $\tau_\infty : H_1(Y_b) \to H_2(Y_+, Y_b)$. Each line corresponds to the coordinates of an extension along the equator in the basis of thimbles $\Delta_1, \dots, \Delta_{36}$.</caption>

given by equation (40). For instance, we have

$$
(55) \quad T_1 = \begin{bmatrix} 0 & 0 & 1 & 1 & 2 & 2 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \vdots & & & & & \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \in \mathbb{Z}^{36 \times 6}.
$$

Using equation (43), we may then compute the matrix $T_\infty$ of the extension map $\tau_\infty : H_1(X_b) \to H_2(Y, X_b)$.

We may then compute a supplement (as a Z-module) of the image of $T_\infty$ in the kernel of $B$, which has rank $36 - 6 - 6 = 24$. This gives a description of $\mathcal{T}(Y)$ as integer linear combinations of thimbles, given as 24 vectors of $\mathbb{Z}^{36}$. We may compute a basis $e_1, \dots, e_{24}$ of this space. For instance we compute $e_2 = \Delta_2 - \Delta_{31} - \Delta_{35} - \Delta_{36}$.

4.4. **Integrating forms.** Let $\pi : Y \to X$ denote the canonical projection. As we know the periods of $X_b$, we may compute the integral of the pullback of a primitive cohomology form $\mathrm{Res}\omega_j \in \mathrm{PH}_{\mathrm{DR}}^2(X)$ along the thimbles $\int_{\Delta_i} \pi^* \mathrm{Res}\omega_j$ using methods detailed in Section 3.7.1. To recover the integral along an extension, it is sufficient to take the corresponding linear combinations of integrals along thimbles. For instance

$$
\begin{align}
(56) \quad \int_{e_2} \pi^* \mathrm{Res} \omega_j &= \int_{\Delta_2} \pi^* \mathrm{Res} \omega_j - \int_{\Delta_{33}} \pi^* \mathrm{Res} \omega_j - \int_{\Delta_{35}} \pi^* \mathrm{Res} \omega_j - \int_{\Delta_{36}} \pi^* \mathrm{Res} \omega_j \nonumber \\
&= i.178796454505093\dots \quad \text{with 139 digits of precision.} \nonumber
\end{align}
$$

This allows us to recover the full pairing $\mathcal{T}(Y) \times \mathrm{PH}_{\mathrm{DR}}^2(X) \to \mathbb{C}$.

4.5. Recovering $PH_2(X)$. To recover $PH_2(X)$, we need to remove the 3 differences of blowup cycles in $H_2(Y)$, i.e. $E_i - E_1$ for $i \in \{2, 3, 4\}$. To identify them in $\mathcal{T}(Y)$ we can simply take the right kernel of the $21 \times 24$ period matrix $(\int_{e_j} \pi^* \mathrm{Res} \omega_i)$.

5. THE LATTICE STRUCTURE ON $H_n(X)$

In Section 3 we showed how to compute the matrix of the integration pairing $PH_n(X) \times PH_{DR}^n(X) \to \mathbb{C}$ given a hypersurface $X \subseteq \mathbb{P}^{n+1}$, with respect to some basis of $PH_n(X)$. In the case of surfaces in $\mathbb{P}^3$, which we restrict the discussion to in this section, this is enough to compute some algebraic invariants (most importantly the Picard rank), but not enough to recover finer invariants (such as the Néron-Severi lattice and the transcendental lattice). The extra information we need is the intersection form on $H_2(X)$, the fundamental class $h$ of the hyperplane section $H_2(X)$, and the matrix of the projection $H_2(X) \to PH_2(X)$. This section describes the computation of this extra information. It also provides a rigorous way to compute the kernel of the map $\mathcal{T}(Y) \to PH_2(X)$, as an alternative to the heuristic method described in Section 3.6.2.

For more details on how to exploit period computations with the intersection form to compute algebraic invariants of surfaces, see Lairez and Sertöz (2019).
$$
\begin{pmatrix}
0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & -1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 1 & 0 & -1 & 0 & -1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 1 & -1 & 2 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 1 & -1 & -1 & 1 & 1 & 1 & 1 & 1 & 2 & 0 & -1 & 0 & 1 & 0 & -2 & 0 & -1 & 0 & -1 & 1 & 2 & 1 & 0 & 0 \\
1 & 0 & -1 & 1 & -1 & 0 & 0 & 0 & 0 & 1 & -1 & -1 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 1 & 0 & -1 & -1 & 0 & 1 & -1 & 0 & -1 & 0 & -1 & 1 & 1 & 0 & 0 \\
1 & -1 & 0 & 0 & 0 & -1 & -1 & 0 & 0 & 0 & 1 & -1 & -1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & -1 & -1 & 0 & 0 & -1 & -1 & 0 & 0 & 0 & -1 & 0 & 1 \\
2 & 0 & -1 & 1 & 0 & -1 & -1 & 1 & 0 & 1 & 0 & -2 & 0 & 0 & -1 & 1 & 2 & 2 & 2 & 2 & 0 & 1 & 1 & -2 & -2 & 0 & 0 & -2 & -1 & -2 & 1 & -1 & 1 & 0 & 1 & 1 \\
2 & 1 & 0 & 0 & 0 & -1 & 0 & 2 & 1 & 1 & 0 & -2 & 1 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & -1 & 1 & 2 & -2 & -2 & 1 & 0 & -2 & -1 & -2 & 1 & 0 & 1 & 0 & 0 & 0 & 0
\end{pmatrix}
$$

<caption>**Figure 6.** The transpose of the 36 × 6 matrix $T_\infty$ of the extension map $\tau_\infty : H_1(Y_b) \to H_2(Y_+, Y_b)$. Each line corresponds to the coordinates of an extension along the equator in the basis of thimbles $\Delta_1, \dots, \Delta_{36}$.</caption>

given by equation (40). For instance, we have

$$
(55) \quad T_1 = \begin{bmatrix} 0 & 0 & 1 & 1 & 2 & 2 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ \vdots & & & & & \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \in \mathbb{Z}^{36 \times 6}.
$$

Using equation (43), we may then compute the matrix $T_\infty$ of the extension map $\tau_\infty : H_1(X_b) \to H_2(Y, X_b)$.

We may then compute a supplement (as a Z-module) of the image of $T_\infty$ in the kernel of $B$, which has rank $36 - 6 - 6 = 24$. This gives a description of $\mathcal{T}(Y)$ as integer linear combinations of thimbles, given as 24 vectors of $\mathbb{Z}^{36}$. We may compute a basis $e_1, \dots, e_{24}$ of this space. For instance we compute $e_2 = \Delta_2 - \Delta_{31} - \Delta_{35} - \Delta_{36}$.

4.4. **Integrating forms.** Let $\pi : Y \to X$ denote the canonical projection. As we know the periods of $X_b$, we may compute the integral of the pullback of a primitive cohomology form $\mathrm{Res}\omega_j \in \mathrm{PH}_{\mathrm{DR}}^2(X)$ along the thimbles $\int_{\Delta_i} \pi^* \mathrm{Res}\omega_j$ using methods detailed in Section 3.7.1. To recover the integral along an extension, it is sufficient to take the corresponding linear combinations of integrals along thimbles. For instance

$$
(56) \quad \int_{e_2} \pi^* \mathrm{Res} \omega_j = \int_{\Delta_2} \pi^* \mathrm{Res} \omega_j - \int_{\Delta_{33}} \pi^* \mathrm{Res} \omega_j - \int_{\Delta_{35}} \pi^* \mathrm{Res} \omega_j - \int_{\Delta_{36}} \pi^* \mathrm{Res} \omega_j \\
\qquad = i.718796454505093\dots \quad \text{with 139 digits of precision.}
$$

This allows us to recover the full pairing $\mathcal{T}(Y) \times \mathrm{PH}_{\mathrm{DR}}^2(X) \to \mathbb{C}$.

4.5. **Recovering $\mathrm{PH}_2(X)$**. To recover $\mathrm{PH}_2(X)$, we need to remove the 3 differences of blowup cycles in $H_2(Y)$, i.e. $E_i - E_1$ for $i \in \{2, 3, 4\}$. To identify them in $\mathcal{T}(Y)$ we can simply take the right kernel of the $21 \times 24$ period matrix $(\int_{e_j} \pi^* \mathrm{Res} \omega_i)$.

5. THE LATTICE STRUCTURE ON $H_n(X)$

In Section 3 we showed how to compute the matrix of the integration pairing $\mathrm{PH}_n(X) \times \mathrm{PH}_{\mathrm{DR}}^n(X) \to \mathbb{C}$ given a hypersurface $X \subseteq \mathbb{P}^{n+1}$, with respect to some basis of $\mathrm{PH}_n(X)$. In the case of surfaces in $\mathbb{P}^3$, which we restrict the discussion to in this section, this is enough to compute some algebraic invariants (most importantly the Picard rank), but not enough to recover finer invariants (such as the Néron-Severi lattice and the transcendental lattice). The extra information we need is the intersection form on $H_2(X)$, the fundamental class $h$ of the hyperplane section $H_2(X)$, and the matrix of the projection $H_2(X) \to \mathrm{PH}_2(X)$. This section describes the computation of this extra information. It also provides a rigorous way to compute the kernel of the map $\mathcal{T}(Y) \to \mathrm{PH}_2(X)$, as an alternative to the heuristic method described in Section 3.6.2.

For more details on how to exploit period computations with the intersection form to compute algebraic invariants of surfaces, see Lairez and Sertöz (2019).
<figure><img src="image_8.png" /><figcaption>**Figure 7.** The action of monodromy on relative homology and total transforms</figcaption></figure>

Let $m_{kj} \in \mathbb{Z}$ such that $v_{kj} = m_{kj}\delta_j$.

**Lemma 7.** With the above notations, $E_k - E_1 = \sum_{j=1}^r m_{kj}\Delta_j$ in $\mathcal{T}(Y)$.

*Proof.* Consider in $Y$ the 3-chain

$$ (61) \quad B = \overline{\phi^{-1}(\alpha_k \times U)} = -\overline{\cup_{u \in U} \alpha_k(u)}. $$

The border $\partial B$ defines an element of $H_2(Y)$. It decomposes into a part coming from the border of $\alpha_k$ and another coming from the border of $U$. The part coming from $\partial \alpha_k$ is the closure of all $\partial \alpha_k(u)$, that is $E_k - E_1$, by (60). The part coming from $\partial U$ is $\cup_{t \in T}(\alpha_k(t^+) - \alpha_k(t^-))$. For a given edge $p_j$ of $T$, the union $\cup_{t \in p_j}(\alpha_k(t^+) - \alpha_k(t^-))$ is the extension along $p_j$ of the cycle $v_{kj}$. Since $v_{kj}$ is a multiple of the vanishing cycle $m_{kj}\delta_j$, the boundary of $\cup_{t \in p_j}(\alpha_k(t^+) - \alpha_k(t^-))$ is $m_{kj}\delta_j$. In particular this extension is a multiple of the Lefschetz' thimble $\Delta_j$ with the same factor. $\square$

<figure><img src="image_9.png" /></figure>

An illustration of this construction is given in Fig. 7.

5.1.1. *Monodromy action on relative homology.* Consider the relative homology space $H_1(X_b, X')$, where $X'$ is the indeterminacy locus of $f$. As in the previous section, let $\alpha_k$ be a path from $s_1$ to $s_k$ in $X_b$. It follows directly from the long exact sequence of relative homology of the pair $(X_b, X')$ that

$$ (62) \quad H_1(X_b, X') \simeq H_1(X_b) \oplus \bigoplus_{i=2}^{d} \mathbb{Z}\alpha_k. $$

Following the construction in the previous section, we have a monodromy action of $\pi_1(\mathbb{P}^1 \setminus \Sigma, b)$ on $H_1(X_b, X')$ which extends the monodromy action on $H_1(X_b)$.

In view of Lemma 7, the problem of computing the exceptional divisors in $\mathcal{T}(Y)$ reduces to the computation of the coefficients $m_{kj}$, which are determined by the monodromy action on $H_1(X_b, X')$.

**Lemma 8.** The integers $m_{kj}$ in Lemma 7 satisfy

$$ \ell_{j_*} \alpha_k = \alpha_k + m_{kj} \delta_j. $$

*Proof.* This is simply a reformulation of the definition of $m_{kj}$. $\square$

<figure><img src="image_10.png" /></figure>
<figure><img src="image_9.png" /><figcaption>**Figure 7.** The action of monodromy on relative homology and total transforms</figcaption></figure>

Let $m_{kj} \in \mathbb{Z}$ such that $v_{kj} = m_{kj}\delta_j$.

**Lemma 7.** With the above notations, $E_k - E_1 = \sum_{j=1}^r m_{kj}\Delta_j$ in $\mathcal{T}(Y)$.

*Proof.* Consider in $Y$ the 3-chain

$$ (61) \quad B = \overline{\phi^{-1}(\alpha_k \times U)} = -\overline{\bigcup_{u \in U} \alpha_k(u)}. $$

The border $\partial B$ defines an element of $H_2(Y)$. It decomposes into a part coming from the border of $\alpha_k$ and another coming from the border of $U$. The part coming from $\partial \alpha_k$ is the closure of all $\partial \alpha_k(u)$, that is $E_k - E_1$, by (60). The part coming from $\partial U$ is $\cup_{t \in T}(\alpha_k(t^+) - \alpha_k(t^-))$. For a given edge $p_j$ of $T$, the union $\cup_{t \in p_j}(\alpha_k(t^+) - \alpha_k(t^-))$ is the extension along $p_j$ of the cycle $v_{kj}$. Since $v_{kj}$ is a multiple of the vanishing cycle $m_{kj}\delta_j$, the boundary of $\cup_{t \in p_j}(\alpha_k(t^+) - \alpha_k(t^-))$ is $m_{kj}\delta_j$. In particular this extension is a multiple of the Lefschetz' thimble $\Delta_j$ with the same factor. $\square$

<figure><img src="image_10.png" /></figure>

An illustration of this construction is given in Fig. 7.

5.1.1. *Monodromy action on relative homology.* Consider the relative homology space $H_1(X_b, X')$, where $X'$ is the indeterminacy locus of $f$. As in the previous section, let $\alpha_k$ be a path from $s_1$ to $s_k$ in $X_b$. It follows directly from the long exact sequence of relative homology of the pair $(X_b, X')$ that

$$ (62) \quad H_1(X_b, X') \simeq H_1(X_b) \oplus \bigoplus_{i=2}^{d} \mathbb{Z}\alpha_k. $$

Following the construction in the previous section, we have a monodromy action of $\pi_1(\mathbb{P}^1 \setminus \Sigma, b)$ on $H_1(X_b, X')$ which extends the monodromy action on $H_1(X_b)$.

In view of Lemma 7, the problem of computing the exceptional divisors in $\mathcal{T}(Y)$ reduces to the computation of the coefficients $m_{kj}$, which are determined by the monodromy action on $H_1(X_b, X')$.

**Lemma 8.** The integers $m_{kj}$ in Lemma 7 satisfy

$$ \ell_{j_*} \alpha_k = \alpha_k + m_{kj} \delta_j. $$

*Proof.* This is simply a reformulation of the definition of $m_{kj}$. $\square$

<figure><img src="image_11.png" /></figure>
The method described in Section 3.5.2 to compute the matrices of the monodromy action on $H_1(X_b)$ extends to the relative case to compute the action on $H_1(X_b, X')$.

We choose a basis $\omega_1, \dots, \omega_r$ of $\mathcal{H}$ in the form

$$ (63) \qquad \omega_i = \operatorname{Res} \frac{B_i}{P_t^2} \Omega_2. $$

Recall the period matrix $\Pi(t)$ defined by the coefficients

$$ (64) \qquad \Pi_{ij}(t) = \int_{\eta_j(t)} \omega_i(t) = \int_{T(\eta_j(t))} \frac{B_i}{P_t^2} \Omega_2, $$

where $T: H_1(X_t) \to H_2(\mathbb{P}^2 \setminus X_t)$ is the Leray tube map. Recall that $\Pi(t)$ satisfies a differential equation $\Pi'(t) = A(t)\Pi(t)$, see (36), and that the monodromy action on the solution space of this differential equation is dual to the monodromy action on $H_1(X_b)$.

We can extend the matrix $\Pi(t)$ with integrals related to the paths $\alpha_k(t)$. For each $k$, we define a Leray tube $T(\alpha_k(t))$ around $\alpha_k(t)$ as follows. For each point $p$ of $\alpha_k(t)$, we choose, continuously with respect to $p$, a line $L_p$ in $\mathbb{P}^2$ passing through $p$ and not tangent to $X_t$. Then, for $\varepsilon$ small enough, we define $T(\alpha_k(t))$ as the union over all points $p \in \alpha_k(t)$ of the $\varepsilon$-circle in $L_p$ with center $p$. Up to homotopy, $T(\alpha_k(t))$ only depends on the choice of $L_{s_1}$ and $L_{s_k}$, which determine the border. Indeed, for each $p$, the space of possible lines $L_p$ is contractible, so the choice of $L_p$ is irrelevant. We assume that $L_{s_1}$ and $L_{s_k}$ are fixed, so that the border of $T(\alpha_k(t))$ is constant.

Let

$$ (65) \qquad \Theta_{ik}(t) = \int_{T(\alpha_k(t))} \frac{B_i}{P_t^2} \Omega_2. $$

It is an analytic function of $t$, in a neighbourhood of $b$. Indeed, if $t$ is close enough to $b$, then $T(\alpha_k(t))$ deforms into $T(\alpha_k(b))$ in $X_t^c$, with fixed boundary. So the integral (65) may be taken over the fixed domain $T(\alpha_k(b))$. Since the integrand depends analytically on the parameter $t$, this shows that $\Theta_{ik}(t)$ depends analytically on $t$. By following the deformation of the path $\alpha_k(t)$, the function $\Theta_{ik}$ extends meromorphically on any simply connected open subset of the complex plane avoiding the singular values $\Sigma$. (There may be poles at points $t$ where $L_{s_1}$ or $L_{s_k}$ are tangent to $X_t$.) After extending $\Theta_{ik}(t)$ over a loop $\ell_j$, we obtain a new determination $\ell_{j*}\Theta_{ik}$ which satisfies

$$ (66) \qquad \ell_{j*} \Theta_{ik}(t) = \int_{T(\alpha_k(t)+v_{kj}(t))} \frac{B_i}{P_t^2} \Omega_2 = \Theta_{ik}(t) + m_{kj} \int_{\delta_j(t)} \omega_i(t). $$

In particular, the monodromy action on the functions $\Theta_{ik}$ determine the coefficients $m_{kj}$, and therefore the monodromy action on $H_1(X_b, X')$.

It remains to see that the $\Theta_{ik}$ are solutions of a differential system, so that the monodromy action can be recovered by numerical integration. Indeed, by definition of $\mathcal{H}$, there are some $\beta_i$ 1-forms on $X_t^c$ such that

$$ (67) \qquad \frac{\partial}{\partial t} \frac{B_i}{P_t^2} \Omega_2 = \sum_j a_{ij}(t) \frac{B_j}{P_t^2} \Omega_2 + d\beta_i. $$

After integrating over $T(\alpha_k(t))$, we obtain

$$ (68) \qquad \Theta'_{ik}(i) = \sum_j a_{ij}(t) \Theta_{ik}(t) + \int_{T(\alpha_k(t))} d\beta_i. $$

The boundary of $T(\alpha_k(t))$ is two circles, one in $L_{s_k}$ and one in $L_{s_1}$ (with a minus sign), so by Stokes' and Cauchy's formulae,

$$ (69) \qquad \int_{T(\alpha_k(t))} d\beta_i = \int_{\partial T(\alpha_k(t))} \beta_i = \operatorname{Res}_{s_k}(\beta_i|_{L_{s_k}}) - \operatorname{Res}_{s_1}(\beta_i|_{L_{s_1}}). $$
The method described in Section 3.5.2 to compute the matrices of the monodromy action on $H_1(X_b)$ extends to the relative case to compute the action on $H_1(X_b, X')$.

We choose a basis $\omega_1, \dots, \omega_r$ of $\mathcal{H}$ in the form

$$ (63) \qquad \omega_i = \operatorname{Res} \frac{B_i}{P_t^2} \Omega_2. $$

Recall the period matrix $\Pi(t)$ defined by the coefficients

$$ (64) \qquad \Pi_{ij}(t) = \int_{\eta_j(t)} \omega_i(t) = \int_{T(\eta_j(t))} \frac{B_i}{P_t^2} \Omega_2, $$

where $T: H_1(X_t) \to H_2(\mathbb{P}^2 \setminus X_t)$ is the Leray tube map. Recall that $\Pi(t)$ satisfies a differential equation $\Pi'(t) = A(t)\Pi(t)$, see (36), and that the monodromy action on the solution space of this differential equation is dual to the monodromy action on $H_1(X_b)$.

We can extend the matrix $\Pi(t)$ with integrals related to the paths $\alpha_k(t)$. For each $k$, we define a Leray tube $T(\alpha_k(t))$ around $\alpha_k(t)$ as follows. For each point $p$ of $\alpha_k(t)$, we choose, continuously with respect to $p$, a line $L_p$ in $\mathbb{P}^2$ passing through $p$ and not tangent to $X_t$. Then, for $\varepsilon$ small enough, we define $T(\alpha_k(t))$ as the union over all points $p \in \alpha_k(t)$ of the $\varepsilon$-circle in $L_p$ with center $p$. Up to homotopy, $T(\alpha_k(t))$ only depends on the choice of $L_{s_1}$ and $L_{s_k}$, which determine the border. Indeed, for each $p$, the space of possible lines $L_p$ is contractible, so the choice of $L_p$ is irrelevant. We assume that $L_{s_1}$ and $L_{s_k}$ are fixed, so that the border of $T(\alpha_k(t))$ is constant.

Let

$$ (65) \qquad \Theta_{ik}(t) = \int_{T(\alpha_k(t))} \frac{B_i}{P_t^2} \Omega_2. $$

It is an analytic function of $t$, in a neighbourhood of $b$. Indeed, if $t$ is close enough to $b$, then $T(\alpha_k(t))$ deforms into $T(\alpha_k(b))$ in $X_t^c$, with fixed boundary. So the integral (65) may be taken over the fixed domain $T(\alpha_k(b))$. Since the integrand depends analytically on the parameter $t$, this shows that $\Theta_{ik}(t)$ depends analytically on $t$. By following the deformation of the path $\alpha_k(t)$, the function $\Theta_{ik}$ extends meromorphically on any simply connected open subset of the complex plane avoiding the singular values $\Sigma$. (There may be poles at points $t$ where $L_{s_1}$ or $L_{s_k}$ are tangent to $X_t$.) After extending $\Theta_{ik}(t)$ over a loop $\ell_j$, we obtain a new determination $\ell_{j*} \Theta_{ik}$ which satisfies

$$ (66) \qquad \ell_{j*} \Theta_{ik}(t) = \int_{T(\alpha_k(t)+v_{kj}(t))} \frac{B_i}{P_t^2} \Omega_2 = \Theta_{ik}(t) + m_{kj} \int_{\delta_j(t)} \omega_i(t). $$

In particular, the monodromy action on the functions $\Theta_{ik}$ determine the coefficients $m_{kj}$, and therefore the monodromy action on $H_1(X_b, X')$.

It remains to see that the $\Theta_{ik}$ are solutions of a differential system, so that the monodromy action can be recovered by numerical integration. Indeed, by definition of $\mathcal{H}$, there are some $\beta_i$ 1-forms on $X_t^c$ such that

$$ (67) \qquad \frac{\partial}{\partial t} \frac{B_i}{P_t^2} \Omega_2 = \sum_j a_{ij}(t) \frac{B_j}{P_t^2} \Omega_2 + d\beta_i. $$

After integrating over $T(\alpha_k(t))$, we obtain

$$ (68) \qquad \Theta'_{ik}(i) = \sum_j a_{ij}(t) \Theta_{ik}(t) + \int_{T(\alpha_k(t))} d\beta_i. $$

The boundary of $T(\alpha_k(t))$ is two circles, one in $L_{s_k}$ and one in $L_{s_1}$ (with a minus sign), so by Stokes' and Cauchy's formulae,

$$ (69) \qquad \int_{T(\alpha_k(t))} d\beta_i = \int_{\partial T(\alpha_k(t))} \beta_i = \operatorname{Res}_{s_k}(\beta_i|_{L_{s_k}}) - \operatorname{Res}_{s_1}(\beta_i|_{L_{s_1}}). $$
Since $s_1$ and $s_k$ are fixed, this is simply a rational function in $t$, which we denote $R_{ik}(t)$, defining a matrix $R \in \mathbb{C}(t)^{r \times (d-1)}$.

So we can consider the following differential system, of dimension $r+d-1$,

$$ (70) \quad Z' = \left( \begin{array}{c|c} A & R \\ \hline 0 & 0 \end{array} \right) Z, $$

which admits the fundamental solution

$$ (71) \quad \tilde{\Pi} = \left( \begin{array}{c|c} \Pi & \Theta \\ \hline 0 & 1 \end{array} \right). $$

The monodromy of this differential system is conjugate to the monodromy action on $H_1(X_b, X')$. Namely, considering the matrix $\mathrm{Mat}(\ell_*)$ of the action of a path $\ell$ in the basis $\eta_1, \dots, \eta_r, \alpha_2, \dots, \alpha_d$ of $H_1(X_b, X')$, we have similarly to (38)

$$ (72) \quad \mathrm{Mat}(\ell_*) = \tilde{\Pi}(b)^{-1} \cdot \ell_* \tilde{\Pi}(b) = \tilde{\Pi}(b)^{-1} \tilde{\Lambda}_\ell \tilde{\Pi}(b), $$

where $\tilde{\Lambda}_\ell$ is the transition matrix associated to the system (71). This gives the desired algorithm for computing the monodromy action on relative homology.

**Remark 9.** The order of the differential operators that need to be integrated is larger than those of Section 3.5, so the computation is expensive in practice, even for quartic surfaces. An alternative approach is to track explicitly the deformation of the paths $\alpha_k(t)$ by following the movement of the critical values of the fibration $X_t \dashrightarrow \mathbb{P}^1$ induced by a fixed projection $\mathbb{P}^2 \dashrightarrow \mathbb{P}^1$ when $t$ changes. Indeed, we may choose the fibration to be such that $X' = X_b \cap H'_a$ where $\{H'_t\}$ is the hyperplane pencil of the fibration of $X_b$, and thus $H_1(X_b, X') = H_1(X_b, X_b \cap H'_a)$. It then becomes apparent that the $\tilde{M}_i$ represents the action of monodromy on the thimbles, which can be obtained from the braid induced by the movement of the aforementioned critical values. We will not expand upon this method, which goes beyond the scope of this paper.

## 5.2. Computing the intersection product.

5.2.1. *The intersection product of $H_n(Y)$.* In this section we explain how to recover the intersection matrix of $H_n(Y)$ using methods similar to those of Shiga (1979, §2) or Narumiya and Shiga (2001, §3). Let $n \le 2$ and $d$ be respectively the dimension and degree of $X$.

We begin with a lemma characterising $H_n(X)$ as a subspace of $H_n(Y)$.

**Lemma 10.** The Poincaré dual of the pullback $\pi^* \ embeds H_n(X)$ to the orthogonal complement of $H_{n-2}(X')$ in $H_n(Y)$ isometrically (i.e. the intersection product is preserved).

*Proof.* Let $\alpha, \beta \in H^n(X)$. As $\pi^*$ preserves cup products, we have that

$$ (73) \quad \langle \pi^* \alpha, \pi^* \beta \rangle = \langle \alpha, \beta \rangle . $$

For $1 \le i \le d$, let $\tilde{E}_i \in H^n(Y)$ be the Poincaré dual of the exceptional divisor $E_i$. The projection formula (Hartshorne, 1977, p. 256, A4) yields that

$$ (74) \quad \pi_*(\tilde{E}_i \cdot \pi^* \alpha) = \pi_* \tilde{E}_i \cdot \alpha = 0, $$

as $\pi_* \tilde{E}_i = 0$. Poincaré duality yields the desired result. $\square$

<figure><img src="image_11.png" /></figure>

Therefore it is relevant to compute the intersection product of $H_n(Y)$. When $n=2$, consider the maps

$$ (75) \quad \begin{array}{ccc} H_2(X_b) & \dashrightarrow & H_2(Y_+) \\ & \searrow_{\phi} & \mathcal{T}(Y) \\ & \searrow_{\ell_*} & H_2(Y) \end{array} $$
Since $s_1$ and $s_k$ are fixed, this is simply a rational function in $t$, which we denote $R_{ik}(t)$, defining a matrix $R \in \mathbb{C}(t)^{r \times (d-1)}$.

So we can consider the following differential system, of dimension $r+d-1$,

$$ (70) \quad Z' = \left( \begin{array}{c|c} A & R \\ \hline 0 & 0 \end{array} \right) Z, $$

which admits the fundamental solution

$$ (71) \quad \tilde{\Pi} = \left( \begin{array}{c|c} \Pi & \Theta \\ \hline 0 & \mathbf{1} \end{array} \right). $$

The monodromy of this differential system is conjugate to the monodromy action on $H_1(X_b, X')$. Namely, considering the matrix $\mathrm{Mat}(\ell_*)$ of the action of a path $\ell$ in the basis $\eta_1, \dots, \eta_r, \alpha_2, \dots, \alpha_d$ of $H_1(X_b, X')$, we have similarly to (38)

$$ (72) \quad \mathrm{Mat}(\ell_*) = \tilde{\Pi}(b)^{-1} \cdot \ell_* \tilde{\Pi}(b) = \tilde{\Pi}(b)^{-1} \tilde{\Lambda}_\ell \tilde{\Pi}(b), $$

where $\tilde{\Lambda}_\ell$ is the transition matrix associated to the system (71). This gives the desired algorithm for computing the monodromy action on relative homology.

**Remark 9.** The order of the differential operators that need to be integrated is larger than those of Section 3.5, so the computation is expensive in practice, even for quartic surfaces. An alternative approach is to track explicitly the deformation of the paths $\alpha_k(t)$ by following the movement of the critical values of the fibration $X_t \dashrightarrow \mathbb{P}^1$ induced by a fixed projection $\mathbb{P}^2 \dashrightarrow \mathbb{P}^1$ when $t$ changes. Indeed, we may choose the fibration to be such that $X' = X_b \cap H'_a$ where $\{H'_t\}$ is the hyperplane pencil of the fibration of $X_b$, and thus $H_1(X_b, X') = H_1(X_b, X_b \cap H'_a)$. It then becomes apparent that the $\tilde{M}_i$ represents the action of monodromy on the thimbles, which can be obtained from the braid induced by the movement of the aforementioned critical values. We will not expand upon this method, which goes beyond the scope of this paper.

## 5.2. Computing the intersection product.

### 5.2.1. The intersection product of $H_n(Y)$.
In this section we explain how to recover the intersection matrix of $H_n(Y)$ using methods similar to those of Shiga (1979, §2) or Narumiya and Shiga (2001, §3). Let $n \le 2$ and $d$ be respectively the dimension and degree of $X$.

We begin with a lemma characterising $H_n(X)$ as a subspace of $H_n(Y)$.

**Lemma 10.** The Poincaré dual of the pullback $\pi^* \ embeds H_n(X)$ to the orthogonal complement of $H_{n-2}(X')$ in $H_n(Y)$ isometrically (i.e. the intersection product is preserved).

*Proof.* Let $\alpha, \beta \in H^n(X)$. As $\pi^*$ preserves cup products, we have that

$$ (73) \quad \langle \pi^* \alpha, \pi^* \beta \rangle = \langle \alpha, \beta \rangle . $$

For $1 \le i \le d$, let $\tilde{E}_i \in H^n(Y)$ be the Poincaré dual of the exceptional divisor $E_i$. The projection formula (Hartshorne, 1977, p. 256, A4) yields that

$$ (74) \quad \pi_*(\tilde{E}_i \cdot \pi^* \alpha) = \pi_* \tilde{E}_i \cdot \alpha = 0, $$

as $\pi_* \tilde{E}_i = 0$. Poincaré duality yields the desired result. $\square$

<figure><img src="image_12.png" /></figure>

Therefore it is relevant to compute the intersection product of $H_n(Y)$. When $n=2$, consider the maps

$$ (75) \quad \begin{array}{ccc} H_2(X_b) & \longrightarrow & H_2(Y_+) \xrightarrow{\phi} \mathcal{T}(Y) \\ \searrow & & \downarrow \\ H_2(Y) & & \end{array} $$
Recall from Lemma 3 that $H_2(X_b)$ is generated by the inclusion of a linear section $h = [X_b \cap L]$ in $X_b \subset Y$. Furthermore, from the long exact sequence of the pair $(Y_+, X_b)$, $\phi$ is surjective.

**Lemma 11.** The intersection product on $H_2(Y_+)$ induced by $\iota_*$ induces an intersection product on $\mathcal{T}(Y)$ through $\phi$.

*Proof.* The inclusion $\iota: Y_+ \to Y$ induces an intersection product on $H_2(Y_+)$ from that on $H_2(Y)$. We aim to prove that this product induces a uniquely defined product on $\mathcal{T}(Y)$. From the long exact sequence of the pair $(Y_+, X_b)$, $H_2(Y_+)$ can be identified with $\ker \delta \oplus H_2(X_b)$.

Let $\Gamma_1, \Gamma_2 \in H_2(Y_+)$ and assume that the class of $\phi(\Gamma_2) = 0$. Then $\Gamma_2 \in \operatorname{im} \tau_\infty \oplus h\mathbb{Z}$. In particular, as $\operatorname{im} \tau_\infty \subset \ker \iota_*$ from the second line of (16), $\iota_*\Gamma_2 = kh$ for some integer $k \in \mathbb{Z}$. We thus have

$$ (76) \quad \langle \Gamma_1, \Gamma_2 \rangle = k \langle \iota_* \Gamma_1, h \rangle = 0, $$

as $h$ can be deformed to a fibre in the interior of the lower hemisphere $Y_-$, and thus not intersect $\iota_*\Gamma_1$. $\square$

Let $\Gamma_i = \sum_j a_{ij} \Delta_j \in \mathcal{T}(Y)$ be two extensions, described as a linear combination of thimbles for $i = 1, 2$. The previous lemma implies that the intersection product $\langle \Gamma_1, \Gamma_2 \rangle$ is well defined.

In order to compute this intersection product, we may deform the geometric representatives of the thimbles for $\Gamma_2$ slightly, in a way that the basepoint is no longer the same for $\Gamma_1$ and $\Gamma_2$, as is represented in Fig. 8. We then notice that the intersection between $\Delta_i$ and $\Delta'_j$ (where the latter is the aforementioned deformation of $\Delta_j$) is contained in at most 4 fibres. This means that in order to compute the intersection product $\langle \Gamma_1, \Gamma_2 \rangle$, we may simply consider the intersection of pairs of thimbles (which we will also denote $\langle \Delta_i, \Delta_j \rangle$ by abuse of notation) and use bilinearity. More precisely, we see that

* if $i > j$, then $\langle \Delta_i, \Delta_j \rangle = 0$,

* if $i < j$, then $\langle \Delta_i, \Delta_j \rangle = \langle \delta_i, \delta_j \rangle$,

* if $i = j$, then $\langle \Delta_i, \Delta_j \rangle = -\langle p_i, \delta_i \rangle$,

where $\delta_i$ and $p_i$ are respectively the vanishing cycle and a permuting cycle of $\Delta_i$, i.e. $\delta_i = \ell_{i*}p_i - p_i$. We can then recover the intersection product with the formula $\langle \Gamma_1, \Gamma_2 \rangle = \sum_{i,j} a_{1i}a_{2j} \langle \Delta_i, \Delta_j \rangle$.

<figure><img src="image_12.png" /><figcaption>**Figure 8.** The intersection between two thimbles can be reduced to intersection products of cycles of the fibre at the four fibres above the intersections of $\ell_i$ and $\ell_j$.</figcaption></figure>
Recall from Lemma 3 that $H_2(X_b)$ is generated by the inclusion of a linear section $h = [X_b \cap L]$ in $X_b \subset Y$. Furthermore, from the long exact sequence of the pair $(Y_+, X_b)$, $\phi$ is surjective.

**Lemma 11.** The intersection product on $H_2(Y_+)$ induced by $\iota_*$ induces an intersection product on $\mathcal{T}(Y)$ through $\phi$.

*Proof.* The inclusion $\iota: Y_+ \to Y$ induces an intersection product on $H_2(Y_+)$ from that on $H_2(Y)$. We aim to prove that this product induces a uniquely defined product on $\mathcal{T}(Y)$. From the long exact sequence of the pair $(Y_+, X_b)$, $H_2(Y_+)$ can be identified with $\ker \delta \oplus H_2(X_b)$.

Let $\Gamma_1, \Gamma_2 \in H_2(Y_+)$ and assume that the class of $\phi(\Gamma_2) = 0$. Then $\Gamma_2 \in \text{im } \tau_\infty \oplus h\mathbb{Z}$. In particular, as $\text{im } \tau_\infty \subset \ker \iota_*$ from the second line of (16), $\iota_*\Gamma_2 = kh$ for some integer $k \in \mathbb{Z}$. We thus have

$$ (76) \quad \langle \Gamma_1, \Gamma_2 \rangle = k \langle \iota_* \Gamma_1, h \rangle = 0, $$

as $h$ can be deformed to a fibre in the interior of the lower hemisphere $Y_-$, and thus not intersect $\iota_*\Gamma_1$. $\square$

Let $\Gamma_i = \sum_j a_{ij} \Delta_j \in \mathcal{T}(Y)$ be two extensions, described as a linear combination of thimbles for $i = 1, 2$. The previous lemma implies that the intersection product $\langle \Gamma_1, \Gamma_2 \rangle$ is well defined.

In order to compute this intersection product, we may deform the geometric representatives of the thimbles for $\Gamma_2$ slightly, in a way that the basepoint is no longer the same for $\Gamma_1$ and $\Gamma_2$, as is represented in Fig. 8. We then notice that the intersection between $\Delta_i$ and $\Delta'_j$ (where the latter is the aforementioned deformation of $\Delta_j$) is contained in at most 4 fibres. This means that in order to compute the intersection product $\langle \Gamma_1, \Gamma_2 \rangle$, we may simply consider the intersection of pairs of thimbles (which we will also denote $\langle \Delta_i, \Delta_j \rangle$ by abuse of notation) and use bilinearity. More precisely, we see that

* if $i > j$, then $\langle \Delta_i, \Delta_j \rangle = 0$,

* if $i < j$, then $\langle \Delta_i, \Delta_j \rangle = \langle \delta_i, \delta_j \rangle$,

* if $i = j$, then $\langle \Delta_i, \Delta_j \rangle = -\langle p_i, \delta_i \rangle$,

where $\delta_i$ and $p_i$ are respectively the vanishing cycle and a permuting cycle of $\Delta_i$, i.e. $\delta_i = \ell_{i*}p_i - p_i$. We can then recover the intersection product with the formula $\langle \Gamma_1, \Gamma_2 \rangle = \sum_{i,j} a_{1i}a_{2j} \langle \Delta_i, \Delta_j \rangle$.

<figure><img src="image_13.png" /><figcaption>**Figure 8.** The intersection between two thimbles can be reduced to intersection products of cycles of the fibre at the four fibres above the intersections of $\ell_i$ and $\ell_j$.</figcaption></figure>
For $n = 1$, this is sufficient to recover the intersection product on $H_1(Y)$.

Assume $n = 2$. By the same argument as that of Lemma 11, $h$ is orthogonal to the image of $H_2(Y_+)$ in $H_2(Y)$. All that remains it to compute the intersection products of an exceptional divisor, say $E_1$. The intersection of $E_1$ with $h$ is precisely one point, $\{s_1\}$, and thus

$$ (77) \qquad \langle h, E_1 \rangle = 1. $$

Let $\Gamma_1, \dots, \Gamma_s \in H_2(Y_+)$ induce a basis of $\mathcal{T}(Y)$ through $\phi$. Up to adding multiples of $h$, we may assume the $\Gamma_i$'s to be orthogonal to $E_1$. These observations allow us to recover the full intersection matrix of $H_2(Y)$. We synthesise these results with the following lemma.

**Lemma 12.** There exist $\Gamma_1, \dots, \Gamma_s \in H_2(Y_+)$, $h \in H_2(X_b)$ and $E_1 \in H_2(Y)$ such that

* $\phi(\Gamma_1), \dots, \phi(\Gamma_s)$ is a basis of $\mathcal{T}(Y)$,

* $E_1$ is the exceptional divisor of the blow-up at $s_1$,

* $h, \iota_*\Gamma_1, \dots, \iota_*\Gamma_s, E_1$ is a basis of $H_2(Y)$.

Define the coefficients $a_{ij}$ to be so that $\phi(\Gamma_i) = \sum_j a_{ij} \Delta_j$. The intersection products are given by

* $\langle \iota_*\Gamma_i, \iota_*\Gamma_j \rangle = \sum_{k,l} a_{ik}a_{jl}\langle \Delta_k, \Delta_l \rangle$ for all $i, j$,

* $\langle \iota_*\Gamma_i, h \rangle = 0$ for all $i$,

* $\langle \iota_*\Gamma_i, E_1 \rangle = 0$ for all $i$,

* $\langle h, h \rangle = 0$,

* $\langle h, E_1 \rangle = 1$,

* $\langle E_1, E_1 \rangle = -1$.

The intersection matrix in the aforementioned basis of $H_2(Y)$ is therefore given by

$$ (78) \qquad \begin{bmatrix} 0 & \mathbf{0} & 1 \\ \mathbf{0} & M & \mathbf{0} \\ 1 & \mathbf{0} & -1 \end{bmatrix}, $$

where $M$ is the matrix given coefficient-wise by $M_{ij} = \sum_{k,l} a_{ik}a_{jl}\langle \Delta_k, \Delta_l \rangle$.

**5.2.2. The intersection product of $H_2(X)$**. For surfaces, in order to recover the intersection product on $H_2(X)$, it only remains to remove the exceptional divisors $E_1, \dots, E_{d-1}$. We begin with the following lemma which allows us to compute the intersection product of the $E_i$.

**Lemma 13.** $\langle E_i, E_j \rangle = -\delta_{ij}$ (Kronecker delta)

*Proof.* If $i \neq j$, $E_i$ and $E_j$ are disjoint and thus their intersection product is empty. As $E_i$ is the exceptional divisor of a blow up at a point, $E_i^2 = -1$. $\square$

**Lemma 14.** For $1 \le i \le d-1$, $E_i - E_1 = \sum_{j=1}^s m_{ij}\Gamma_j + h$, where the $m_{ij}$ are the integers computed in section 5.1.

*Proof.* Per Section 5.1, we have for every $i$ the equality

$$ (79) \qquad E_i - E_1 = \sum_{j=1}^{s} m_{ij} \Gamma_j + k_i h, $$

where the $m_{ij}$'s are known integers, and $k_i \in \mathbb{Z}$. Taking the intersection product with $E_1$ makes it clear that $k_i = 1$. $\square$

We thus have the image of $H_{n-2}(X')$ in $H_n(Y)$, and Lemma 10 allows us to conclude.
For $n = 1$, this is sufficient to recover the intersection product on $H_1(Y)$.

Assume $n = 2$. By the same argument as that of Lemma 11, $h$ is orthogonal to the image of $H_2(Y_+)$ in $H_2(Y)$. All that remains it to compute the intersection products of an exceptional divisor, say $E_1$. The intersection of $E_1$ with $h$ is precisely one point, $\{s_1\}$, and thus

$$ (77) \quad \langle h, E_1 \rangle = 1. $$

Let $\Gamma_1, \dots, \Gamma_s \in H_2(Y_+)$ induce a basis of $\mathcal{T}(Y)$ through $\phi$. Up to adding multiples of $h$, we may assume the $\Gamma_i$'s to be orthogonal to $E_1$. These observations allow us to recover the full intersection matrix of $H_2(Y)$. We synthesise these results with the following lemma.

**Lemma 12.** There exist $\Gamma_1, \dots, \Gamma_s \in H_2(Y_+)$, $h \in H_2(X_b)$ and $E_1 \in H_2(Y)$ such that

* $\phi(\Gamma_1), \dots, \phi(\Gamma_s)$ is a basis of $\mathcal{T}(Y)$,

* $E_1$ is the exceptional divisor of the blow-up at $s_1$,

* $h, \iota_* \Gamma_1, \dots, \iota_* \Gamma_s, E_1$ is a basis of $H_2(Y)$.

Define the coefficients $a_{ij}$ to be so that $\phi(\Gamma_i) = \sum_j a_{ij} \Delta_j$. The intersection products are given by

* $\langle \iota_* \Gamma_i, \iota_* \Gamma_j \rangle = \sum_{k,l} a_{ik} a_{jl} \langle \Delta_k, \Delta_l \rangle$ for all $i, j$,

* $\langle \iota_* \Gamma_i, h \rangle = 0$ for all $i$,

* $\langle \iota_* \Gamma_i, E_1 \rangle = 0$ for all $i$,

* $\langle h, h \rangle = 0$,

* $\langle h, E_1 \rangle = 1$,

* $\langle E_1, E_1 \rangle = -1$.

The intersection matrix in the aforementioned basis of $H_2(Y)$ is therefore given by

$$ (78) \quad \begin{bmatrix} 0 & \mathbf{0} & 1 \\ \mathbf{0} & M & \mathbf{0} \\ 1 & \mathbf{0} & -1 \end{bmatrix}, $$

where $M$ is the matrix given coefficient-wise by $M_{ij} = \sum_{k,l} a_{ik} a_{jl} \langle \Delta_k, \Delta_l \rangle$.

**5.2.2. The intersection product of $H_2(X)$**. For surfaces, in order to recover the intersection product on $H_2(X)$, it only remains to remove the exceptional divisors $E_1, \dots, E_{d-1}$. We begin with the following lemma which allows us to compute the intersection product of the $E_i$.

**Lemma 13.** $\langle E_i, E_j \rangle = -\delta_{ij}$ (Kronecker delta)

*Proof.* If $i \neq j$, $E_i$ and $E_j$ are disjoint and thus their intersection product is empty. As $E_i$ is the exceptional divisor of a blow up at a point, $E_i^2 = -1$. $\square$

**Lemma 14.** For $1 \le i \le d-1$, $E_i - E_1 = \sum_{j=1}^s m_{ij} \Gamma_j + h$, where the $m_{ij}$ are the integers computed in section 5.1.

*Proof.* Per Section 5.1, we have for every $i$ the equality

$$ (79) \quad E_i - E_1 = \sum_{j=1}^{s} m_{ij} \Gamma_j + k_i h, $$

where the $m_{ij}$'s are known integers, and $k_i \in \mathbb{Z}$. Taking the intersection product with $E_1$ makes it clear that $k_i = 1$. $\square$

We thus have the image of $H_{n-2}(X')$ in $H_n(Y)$, and Lemma 10 allows us to conclude.
<table><thead><tr><th>n</th><th>d</th><th>|Σ|</th><th>rk PH<sup>n</sup>(X)</th><th>deg L</th><th>ord L</th><th>Time</th><th>Precision (dec. digits)</th></tr></thead><tbody><tr><td>1</td><td>3</td><td>6</td><td>2</td><td>10-30</td><td>3</td><td>10 sec.</td><td>300</td></tr><tr><td>2</td><td>3</td><td>12</td><td>6</td><td>60</td><td>3</td><td>3 min.</td><td>300</td></tr><tr><td>3</td><td>3</td><td>24</td><td>10</td><td>110-320</td><td>7</td><td>8 hours*</td><td>260</td></tr><tr><td>1</td><td>4</td><td>12</td><td>6</td><td>30-80</td><td>4</td><td>8 min.</td><td>350</td></tr><tr><td>2</td><td>4</td><td>36</td><td>21</td><td>170-800</td><td>7</td><td>1 hour*</td><td>300</td></tr><tr><td>1</td><td>5</td><td>20</td><td>12</td><td>70-170</td><td>5</td><td>7 hours</td><td>270</td></tr></tbody></table>

<caption>**Table 1.** Data on the computation of hypersurfaces of degree $d$ in $\mathbb{P}^{n+1}(\mathbb{C})$. $|\Sigma|$ is to the number of critical values of the fibration. rk $H^n(X)$ is the size of the period matrix. ord $\mathcal{L}$ and deg $\mathcal{L}$ are the order and degree of the differential operators arising in the computation. Time is the real time, running on 10 cores. Precision is the number of correct decimal digits obtained.</caption>

# 6. EXPERIMENTS

## 6.1. Benchmarking.

6.1.1. *Expected timings.* Table 1 shows the time taken on a laptop to compute the periods of $X$ for different dimensions and degrees, as well as the obtained precision. Each line of Table 1 corresponds to the computation of a single hypersurface $X = V(P)$, with $P = \sum_{m \in \mathcal{M}_{n,d}} a_m m$ where $\mathcal{M}_{n,d}$ is the set of monomial of degree $d$ of $\mathbb{Q}(X_0, \dots, X_n)$, and $a_m$ are random integer coefficients chosen uniformly between $-20$ and $20$. These timings were obtained on an Apple Macbook Pro M1, using all 10 cores.

The column $|\Sigma|$ corresponds to the number of critical values of the fibration. This has an impact on the number of edges on which the Picard-Fuchs operators need to be integrated, and thus on the computational cost. More precisely, as the integration edges follow the Voronoi graph of the critical points, the number of edges is at most $3|\Sigma| - 6$ (Preparata & Shamos, 1985, Cor. 5.2).

The column rk $PH^n(X)$ corresponds to the number of Picard-Fuchs operators that need to be integrated to recover the full period matrix of $X$, see Section 3.3.

The columns deg $\mathcal{L}$ and ord $\mathcal{L}$ correspond to the degree and order of these operators. More precisely let $\mathcal{L}$ be one of these Picard-Fuchs operators, corresponding to a form $\omega = \text{Res}_{\mathcal{P}k} \frac{A}{P^k}$, as per Section 3.2. The order of $\mathcal{L}$ is rk $PH^{n-1}(X_b) + 1$, and is the same for all forms. In contrast, the degree deg $\mathcal{L}$ changes depending on the form – therefore a range is given instead of a single value<fnref n="3" />. The numbers in the column deg $\mathcal{L}$ are lower and higher bounds for this degree for a specific $P$.

In the case of dimension greater than 2, the exceptional divisors of the modification were not identified. For quartic surfaces and cubic threefold, only the periods necessary to describe the Hodge structure were computed (this corresponds to respectively 1 and 5 forms). This is typically what we are interested in when computing periods. Note that, the recovered data is not sufficient to continue the induction and access higher dimensional varieties – for this, the full period matrix is required.

<footnote>*only the periods necessary for describing the Hodge structure were computed (see Section 6.1.1)</footnote>

<footnote n="3">³It seems from experiments that the degree increases with the pole order $k$ of $\omega$. As the filtration with respect to this pole order coincides with the Hodge filtration (Griffiths, 1969), this implies that the degrees of the Picard-Fuchs operators of the holomorphic forms are the lowest. Thus the holomorphic periods are conveniently the less computationally expensive periods to compute.</footnote>
<table><thead><tr><th>n</th><th>d</th><th>|Σ|</th><th>rk PH<sup>n</sup>(X)</th><th>deg L</th><th>ord L</th><th>Time</th><th>Precision (dec. digits)</th></tr></thead><tbody><tr><td>1</td><td>3</td><td>6</td><td>2</td><td>10-30</td><td>3</td><td>10 sec.</td><td>300</td></tr><tr><td>2</td><td>3</td><td>12</td><td>6</td><td>60</td><td>3</td><td>3 min.</td><td>300</td></tr><tr><td>3</td><td>3</td><td>24</td><td>10</td><td>110-320</td><td>7</td><td>8 hours*</td><td>260</td></tr><tr><td>1</td><td>4</td><td>12</td><td>6</td><td>30-80</td><td>4</td><td>8 min.</td><td>350</td></tr><tr><td>2</td><td>4</td><td>36</td><td>21</td><td>170-800</td><td>7</td><td>1 hour*</td><td>300</td></tr><tr><td>1</td><td>5</td><td>20</td><td>12</td><td>70-170</td><td>5</td><td>7 hours</td><td>270</td></tr></tbody></table>

<caption>**Table 1.** Data on the computation of hypersurfaces of degree $d$ in $\mathbb{P}^{n+1}(\mathbb{C})$. $|\Sigma|$ is to the number of critical values of the fibration. rk $H^n(X)$ is the size of the period matrix. ord $\mathcal{L}$ and deg $\mathcal{L}$ are the order and degree of the differential operators arising in the computation. Time is the real time, running on 10 cores. Precision is the number of correct decimal digits obtained.</caption>

# 6. EXPERIMENTS

## 6.1. Benchmarking.

6.1.1. *Expected timings.* Table 1 shows the time taken on a laptop to compute the periods of $X$ for different dimensions and degrees, as well as the obtained precision. Each line of Table 1 corresponds to the computation of a single hypersurface $X = V(P)$, with $P = \sum_{m \in \mathcal{M}_{n,d}} a_m m$ where $\mathcal{M}_{n,d}$ is the set of monomial of degree $d$ of $\mathbb{Q}(X_0, \dots, X_n)$, and $a_m$ are random integer coefficients chosen uniformly between $-20$ and $20$. These timings were obtained on an Apple Macbook Pro M1, using all 10 cores.

The column $|\Sigma|$ corresponds to the number of critical values of the fibration. This has an impact on the number of edges on which the Picard-Fuchs operators need to be integrated, and thus on the computational cost. More precisely, as the integration edges follow the Voronoi graph of the critical points, the number of edges is at most $3|\Sigma| - 6$ (Preparata & Shamos, 1985, Cor. 5.2).

The column rk $PH^n(X)$ corresponds to the number of Picard-Fuchs operators that need to be integrated to recover the full period matrix of $X$, see Section 3.3.

The columns deg $\mathcal{L}$ and ord $\mathcal{L}$ correspond to the degree and order of these operators. More precisely let $\mathcal{L}$ be one of these Picard-Fuchs operators, corresponding to a form $\omega = \text{Res}_{\mathcal{P}k} \frac{A}{P^k}$, as per Section 3.2. The order of $\mathcal{L}$ is rk $PH^{n-1}(X_b) + 1$, and is the same for all forms. In contrast, the degree deg $\mathcal{L}$ changes depending on the form – therefore a range is given instead of a single value<fnref n="3" />. The numbers in the column deg $\mathcal{L}$ are lower and higher bounds for this degree for a specific $P$.

In the case of dimension greater than 2, the exceptional divisors of the modification were not identified. For quartic surfaces and cubic threefold, only the periods necessary to describe the Hodge structure were computed (this corresponds to respectively 1 and 5 forms). This is typically what we are interested in when computing periods. Note that, the recovered data is not sufficient to continue the induction and access higher dimensional varieties – for this, the full period matrix is required.

<footnote>*only the periods necessary for describing the Hodge structure were computed (see Section 6.1.1)</footnote>

<footnote n="3">³It seems from experiments that the degree increases with the pole order $k$ of $\omega$. As the filtration with respect to this pole order coincides with the Hodge filtration (Griffiths, 1969), this implies that the degrees of the Picard-Fuchs operators of the holomorphic forms are the lowest. Thus the holomorphic periods are conveniently the less computationally expensive periods to compute.</footnote>
<table><caption>**Table 2.** Comparison of CPU time necessary for the computation of the periods of the quartic surface defined by $x^4+y^4+z^4+w^4+P$, using *numperiods* and *lefschetz-family*. The columns *ord L* and *deg L* record the order of and the degree of the coefficients of the Picard-Fuchs differential equation that *numperiods* integrates. The periods of the Fermat hypersurface are hard-coded in *numperiods*, which explains the instantaneous computation for $P=0$.</caption><thead><tr><th>P</th><th>numperiods</th><th>lefschetz-family</th><th>ord L</th><th>deg L</th></tr></thead><tbody><tr><td>0</td><td>&lt; 1 s</td><td>384 min.</td><td>-</td><td>-</td></tr><tr><td>2x<sup>2</sup>zw</td><td>4 s</td><td>574 min.</td><td>3</td><td>4</td></tr><tr><td>-2y<sup>3</sup>z - 4z<sup>2</sup>w<sup>2</sup></td><td>2 min.</td><td>510 min.</td><td>5</td><td>38</td></tr><tr><td>-xyzw + 4xzw<sup>2</sup> - 2y<sup>4</sup></td><td>25 min.</td><td>607 min.</td><td>7</td><td>110</td></tr><tr><td>y<sup>3</sup>z + z<sup>4</sup> + y<sup>3</sup>w + x<sup>2</sup>zw</td><td>346 min.</td><td>635 min.</td><td>14</td><td>591</td></tr><tr><td>4xyz<sup>2</sup> - 5x<sup>2</sup>zw - 4xw<sup>3</sup> - 4zw<sup>3</sup></td><td>&gt; 2880 min.</td><td>494 min.</td><td>21</td><td>?</td></tr><tr><td>-2x<sup>2</sup>w<sup>2</sup> - 4y<sup>2</sup>w<sup>2</sup> - 2yzw<sup>2</sup> + 2yw<sup>3</sup></td><td>&gt; 500 Gb</td><td>543 min.</td><td>21</td><td>?</td></tr><tr><td>x<sup>4</sup> - 4y<sup>2</sup>z<sup>2</sup> - 5xz<sup>2</sup>w + 2yz<sup>2</sup>w + xyw<sup>2</sup></td><td>&gt; 500 Gb</td><td>538 min.</td><td>14</td><td>?</td></tr></tbody></table>

### 6.1.2. Comparison with *numperiods* on quartic surfaces.
The algorithm consists of 4 main steps:

* Computing the fundamental group of $\mathbb{P}^1 \setminus \Sigma$;

* Computing the Picard-Fuchs operators;

* Computing the monodromy matrices of the Picard-Fuchs operator;

* Recovering the action of monodromy and reconstructing the homology.

In practice, most of the time is spent on the third step. In the case of the computation of the periods of a quartic surface, the algorithm spends less than 1 second on step 4, around 20 seconds on step 1 and 2, and around 10 hours on step 3.

The algorithm of Sertöz (2019) is implemented in the package *numperiods*<fnref n="4" /> (Lairez & Sertöz, 2019). In order to compare the efficiency of both methods, we show the time taken by *numperiods* to compute the periods of K3 surfaces defined by quartic polynomials of the form $F+P$, where $F = x^4+y^4+z^4+w^4$ defines the Fermat quartic surface, and $P$ is a polynomial with $n$ monomials, with $n$ ranging from 0 to 5. These examples were run on a single core, on a cluster with 500 Gb of memory, and for at most 48 hours each. Timings for specific cases are given in Table 2. In all but five of the 100 examples for $n \in \{4, 5\}$, the computation with *numperiods* could not be carried out, either because the memory usage exceeded the allocated 500 Gb, or because the computation lasted longer than the allocated 48 hours.

In total the CPU time for the computation of the periods of 204 quartic surfaces was measured using *lefschetz-family* with an input precision of 1500 bits. The average time taken was 9 hours, 56 minutes and 46 seconds. In practice, the package *lefschetz-family* makes use of several cores for the computation of the monodromy matrices of the Picard-Fuchs operators, which can greatly speed up the computation.

## 6.2. An application: Picard rank of families of quartic surfaces.
In this section we explain how to use our algorithm to obtain certain algebraic invariants of quartic surfaces. Notably we compute the generic Picard rank of families of quartic surfaces (§§6.2.1 and 6.2.2), we check that two quartic surfaces are isomorphic to each other (§6.2.3), and give equations for quartic surfaces for each possible Picard rank (§6.2.4). These examples allow us to test our algorithm against known results.

<footnote n="4">⁴https://gitlab.inria.fr/lairez/numperiods</footnote>
<table><caption>**Table 2.** Comparison of CPU time necessary for the computation of the periods of the quartic surface defined by $x^4+y^4+z^4+w^4+P$, using numperiods and lefschetz-family. The columns ord L and deg L record the order of and the degree of the coefficients of the Picard-Fuchs differential equation that numperiods integrates. The periods of the Fermat hypersurface are hard-coded in numperiods, which explains the instantaneous computation for $P = 0$.</caption><thead><tr><th>P</th><th>numperiods</th><th>lefschetz-family</th><th>ord L</th><th>deg L</th></tr></thead><tbody><tr><td>0</td><td>&lt; 1 s</td><td>384 min.</td><td>-</td><td>-</td></tr><tr><td>2x<sup>2</sup>zw</td><td>4 s</td><td>574 min.</td><td>3</td><td>4</td></tr><tr><td>-2y<sup>3</sup>z - 4z<sup>2</sup>w<sup>2</sup></td><td>2 min.</td><td>510 min.</td><td>5</td><td>38</td></tr><tr><td>-xyzw + 4xzw<sup>2</sup> - 2y<sup>4</sup></td><td>25 min.</td><td>607 min.</td><td>7</td><td>110</td></tr><tr><td>y<sup>3</sup>z + z<sup>4</sup> + y<sup>3</sup>w + x<sup>2</sup>zw</td><td>346 min.</td><td>635 min.</td><td>14</td><td>591</td></tr><tr><td>4xyz<sup>2</sup> - 5x<sup>2</sup>zw - 4xw<sup>3</sup> - 4zw<sup>3</sup></td><td>&gt; 2880 min.</td><td>494 min.</td><td>21</td><td>?</td></tr><tr><td>-2x<sup>2</sup>w<sup>2</sup> - 4y<sup>2</sup>w<sup>2</sup> - 2yzw<sup>2</sup> + 2yw<sup>3</sup></td><td>&gt; 500 Gb</td><td>543 min.</td><td>21</td><td>?</td></tr><tr><td>x<sup>4</sup> - 4y<sup>2</sup>z<sup>2</sup> - 5xz<sup>2</sup>w + 2yz<sup>2</sup>w + xyw<sup>2</sup></td><td>&gt; 500 Gb</td><td>538 min.</td><td>14</td><td>?</td></tr></tbody></table>

### 6.1.2. Comparison with numperiods on quartic surfaces.
The algorithm consists of 4 main steps:

* Computing the fundamental group of $\mathbb{P}^1 \setminus \Sigma$;

* Computing the Picard-Fuchs operators;

* Computing the monodromy matrices of the Picard-Fuchs operator;

* Recovering the action of monodromy and reconstructing the homology.

In practice, most of the time is spent on the third step. In the case of the computation of the periods of a quartic surface, the algorithm spends less than 1 second on step 4, around 20 seconds on step 1 and 2, and around 10 hours on step 3.

The algorithm of Sertöz (2019) is implemented in the package `numperiods`<fnref n="4" /> (Lairez & Sertöz, 2019). In order to compare the efficiency of both methods, we show the time taken by `numperiods` to compute the periods of K3 surfaces defined by quartic polynomials of the form $F + P$, where $F = x^4 + y^4 + z^4 + w^4$ defines the Fermat quartic surface, and $P$ is a polynomial with $n$ monomials, with $n$ ranging from 0 to 5. These examples were run on a single core, on a cluster with 500 Gb of memory, and for at most 48 hours each. Timings for specific cases are given in Table 2. In all but five of the 100 examples for $n \in \{4, 5\}$, the computation with `numperiods` could not be carried out, either because the memory usage exceeded the allocated 500 Gb, or because the computation lasted longer than the allocated 48 hours.

In total the CPU time for the computation of the periods of 204 quartic surfaces was measured using `lefschetz-family` with an input precision of 1500 bits. The average time taken was 9 hours, 56 minutes and 46 seconds. In practice, the package `lefschetz-family` makes use of several cores for the computation of the monodromy matrices of the Picard-Fuchs operators, which can greatly speed up the computation.

## 6.2. An application: Picard rank of families of quartic surfaces.
In this section we explain how to use our algorithm to obtain certain algebraic invariants of quartic surfaces. Notably we compute the generic Picard rank of families of quartic surfaces (§§6.2.1 and 6.2.2), we check that two quartic surfaces are isomorphic to each other (§6.2.3), and give equations for quartic surfaces for each possible Picard rank (§6.2.4). These examples allow us to test our algorithm against known results.

<footnote n="4">⁴https://gitlab.inria.fr/lairez/numperiods</footnote>