}\right)  \right)  =\left(  -\left(  u^{\prime}+2\right)  \left(  u^{\prime
2}+u^{\prime}+1\right)  ,2i\sqrt{2}\left(  u^{\prime2}+u^{\prime}+1\right)
^{2}\right) . \label{rk41}
\end{align*}

Also we have the points $P^{\prime}$ with $x_{P^{\prime}}=jx_{P}\left(
ju^{\prime}\right)  $ and $Q^{\prime}$ with $x_{Q^{\prime}}=jx_{Q}\left(
ju^{\prime}\right)  $ (with $j^{3}=1$). As explained in the next paragraph we can
compute the height matrix and show that the Mordell-Weil  lattice is generated
by $P,P^{\prime},Q,Q^{\prime}$  and is equal to $A_2\left(  \frac{1}%
{4}\right)  \oplus A_2\left( \frac{1}{2}\right).$

The second exemple is obtained from $\#20\left(  7-w\right)$ with the parameter
$n=\frac{Y}{t^{2}}$ we obtain  the fibration
$\#9\left(  12-g\right)  $

\begin{align*}
E_{g}  & :y^{2}=x^{3}+4x^{2}n^{2}+n^{3}(n+1)^{2}x
\end{align*}

with the following transformation

\begin{align*}
X  & =\frac{x^{2}\left(  x+2n^{2}\right)  \left(  n-1\right)  }{y^{2}}%
,Y=\frac{1}{n}\frac{x^{2}\left(  x+2n^{2}\right)  ^{2}}{y^{2}},t=\frac
{x\left(  x+2n^{2}\right)  }{ny}\\
x  & =\frac{Y^{2}\left(  Y-2X-t^{2}\right)  }{Xt^{4}},y=\frac{Y^{3}\left(
Y-t^{2}\right)  \left(  Y-2X-t^{2}\right)  }{X^{2}t^{7}},n=\frac{Y}{t^{2}}.%
\end{align*}

Notice that if $n=\frac{Y}{t^{2}}=v^{3}$ in $E_{w}$ then we have the equation
of $H_{w}.$ More precisely if $X=tQv$, the equation  becomes

\[
\]

a cubic equation in $Q$ and $v$ with a rational point $v=1,Q=0.$ Easely we
obtain $H_{w}.$
So in the Weierstrass equation $E_{g}$, if we replace the parameter $n$ by
$g^{3}$ we obtain the following fibration of $Y_{10}$

\begin{align}
y^{2}  & =x^{3}+4g^{2}x^{2}+g\left(  g+1\right)  ^{2}\left(  g^{2}-g+1\right)
^{2}x  \label{rk42}
\end{align}

with singular fibers $2III\left(  0,\infty\right)  ,3I_{4}\left(
-1,g^{2}-g+1\right)  ,3I_{1}\left(  1,g^{2}+g+1\right)  $ and rank $4.$
Notice the two infinite sections with $x$ coordinates $(t+1)^2(t^2-t+1)$ and $-\frac{1}{3}(t-1)^2(t^2-t+1).$

§.§  Mordell-Weil group of $E_{u}$

The aim of this paragraph is to construct generators of the Mordell-Weil
lattice of the previous fibration of rank $7$ with Weierstrass equation

\begin{align*}
E_{u} &  :Y^{2}=X^{3}-5u^{2}X^{2}+u^{3}(u^{3}+1)^{2}\\
&  2I_{0}^{\ast}\left(  \infty,0\right)  ,3I_{2}\left(  u^{3}+1\right)
\end{align*}

Notice that the $j$-invariant of $E_{u}$ is invariant by the two
transformations $u\mapsto\frac{1}{u}$ and $u\mapsto ju.$ These automorphisms
of the base $\mathbb{P}^{1}$ of the fibration $E_{u}$ can be extended to the
sections as explained below.

Let $S_{3}=<\gamma,\tau;\gamma^{3}=1,\tau^{2}=1>$ be the non abelian group of
order $6$ and define an action of $S_{3}$ on the sections of $E_{u}$ by

\begin{align*}
&  \left(  X(u),Y(u)\right)  \overset{\tau}{\mapsto}\left(  u^{4}X\left(
\frac{1}{u}\right)  ,u^{6}Y\left(  \frac{1}{u}\right)  \right)  \\
&  \left(  X\left(  u\right)  ,Y\left(  u\right)  \right)  \overset{\gamma
}{\mapsto}\left(  jX\left(  ju\right)  ,Y\left(  ju\right)  \right).
\end{align*}

To obtain generators of $E_{u}$ following Shioda [42] we use the rational
elliptic surface $X^{\left(  3\right)  +}$ with $\sigma=u+\frac{1}{u}$ and a
Weierstrass equation

\begin{align*}
E_{\sigma}  &  :y^{2}=x^{3}-5x^{2}+\left(  \sigma-1\right)  ^{2}\left(
\sigma+2\right) \\
&  I_{0}^{\ast}\left(  \infty\right)  ,I_{2}\left(  -1\right)  ,4I_{1}%
\end{align*}

of rank $3.$

The Mordell-Weil lattice of a rational elliptic surface is generated by
sections of the form $(a+b\sigma+c\sigma^{2},d+e\sigma+f\sigma^{2}+g\sigma
^{3}).$ Moreover since we have a singular fiber of type $I_{0}^{\ast}$ at
$\infty$ the coefficients $c$ and $f,g$ are $0$ [22]. So after an easy
computation we find the $3$ sections  (with $j^{3}=1,i^{2}=-1).$

\begin{align*}
q_{1}  & =\left(  -\left(  \sigma-1\right)  ,i\sqrt{2}\left(  \sigma-1\right)
\right)  \quad\\
q_{2}  & =\left(  -j\left(  \sigma-1\right)  ,\left(  3+j\right)  \left(
\sigma-1\right)  \right)  \quad q_{3}=\left(  -j^{2}\left(  \sigma-1\right)
,\left(  3+j^{2}\right)  \left(  \sigma-1\right)  \right).
\end{align*}

These sections give the sections $\pi_{1},\pi_{2},\pi_{3}$ on $E_{u}$ which
are fixed by $\tau$.

\[%
\begin{array}
\pi_{1}=\left(  -u\left(  u^{2}-u+1\right)  ,i\sqrt{2}u^{2}\left(
u^{2}-u+1\right)  \right)  \\
\pi_{2}=\left(  -ju\left(  u^{2}-u+1\right)  ,\left(  3+j\right)  u^{2}\left(
u^{2}-u+1\right)  \right)  \\
\pi_{3}=\left(  -j^{2}u\left(  u^{2}-u+1\right)  ,\left(  3+j^{2}\right)
u^{2}\left(  u^{2}-u+1\right)  \right).
\end{array}
\]

We notice $\rho_{i}=\gamma\left(  \pi_{i}\right)  $ and $\mu_{i}=\gamma
^{2}\left(  \pi_{i}\right)  $ for $1\leq i\leq3$ which give $9$ rational
sections with some relations.

Moreover we have another section from the fibration $E_{h}$ of rank

The point of $x$ coordinate $\frac{1}{16}\left(  h^{2}+\frac{1}{h^{2}}\right)
-h-\frac{1}{h}+\frac{29}{24}$ is defined on $\mathbb{Q}\left(  h\right)  .$
Passing to $E_{u}$ we obtain $\omega=$

\[
\left(  \frac{1}{16}\frac{(  1-16u^{3}+46u^{6}-16u^{9}%
+u^{12})  }{u^{4}},-\frac{1}{64}\frac{(  u^{6}-1)  (
1-24u^{3}+126u^{6}-24u^{9}+1)  }{u^{6}}\right ).
\]

We hope to get a generator system with $\pi_{i},\rho_{i}$ and $\omega$ so we
have to compute the height-matrix. The absolute value of its determinant  is
$\frac{81}{16}.$ Since the discriminant of the surface is $72,$ we obtain a
subgroup of index $a$ with $\frac{81}{16}\times\frac{1}{a^{2}}\times2^{3}%
4^{2}=72$ so $a=3$.

After some specialization of $u$ $\in\mathbb{Z}$ (for example if $u=11$, $E_{u}$
has rank $3$ on $\mathbb{Q})$ we find other sections with $x$ coordinate
of the shape  $\ \left(  au+b\right)  \left(  u^{2}-u+1\right)  $

\begin{align*}
\mu &  =\left(  -\left(  u-1\right)  \left(  u^{2}-u+1\right)  ,-\left(
u^{2}-u+1\right)  \left(  u^{2}+2u-1\right)  \right)  \\
\mu_{1} &  =\left(  -\left(  u-9\right)  \left(  u^{2}-u+1\right)  ,\left(
u^{2}-u+1\right)  \left(  5u^{2}-18u+27\right)  \right)  \\
\mu_{2} &  =\left(  -\left(  u+\frac{1}{3}\right)  \left(  u^{2}-u+1\right)
,\frac{i\sqrt{3}}{9}\left(  u^{2}-u+1\right)  \left(  9u^{2}+4u+1\right)
\right).
\end{align*}

We deduce the relations

\begin{align*}
3\mu &  =\omega+\pi_{2}-\gamma\left(  \pi_{3}\right)  +\pi_{3}-\gamma
^{2}\left(  \pi_{2}\right)  \\
&  =\omega+2\pi_{2}+\gamma\left(  \pi_{2}\right)  +\pi_{3}-\gamma\left(
\pi_{3}\right)
\end{align*}

so, the Mordell-Weil lattice is generated by $\pi_{j},\rho_{j}=\gamma\left(
\pi_{j}\right)  $ for $1\leq j\leq3$ and $\mu$ with Gram matrix

\[
\left(
\begin{array}
1 & -\frac{1}{2} & 0 & 0 & 0 & 0 & 0\\
-\frac{1}{2} & 1 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 1 & -\frac{1}{2} & 0 & 0 & \frac{1}{2}\\
0 & 0 & -\frac{1}{2} & 1 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 1 & -\frac{1}{2} & \frac{1}{2}\\
0 & 0 & 0 & 0 & -\frac{1}{2} & 1 & \frac{-1}{2}\\
0 & 0 & \frac{1}{2} & 0 & \frac{1}{2} & \frac{-1}{2} & 2
\end{array}
\right)  .
\]

§.§ A fibration for Theorem 7.1

From the previous fibration $E_u$ we construct by a $2$-neigbour method a fibration with a $2$-torsion section used in Theorem 7.1.

We start from the Weierstrass equation (<ref>)

\[
Y^{2}=X^{3}-5u^{2}X^{2}+u^{3}\left(  u^{3}+1\right)  ^{2}%
\]

and obtain another elliptic fibration with the parameter $m=\frac{X}{u\left(
u^{2}-u+1\right)  }$, which gives the Weierstrass equation

\begin{align}
E_{m}  &  :y^{2}=x^{3}-\left(  m^{3}+5m^{2}-2\right)  x^{2}+\left(
m^{3}+1\right)  ^{2}x \label{rk4}
\end{align}

with singular fibers
$  I_{0}^{\ast}\left(  \infty\right) $, $3I_{4}\left(  m^{3}+1\right)
$,  $ I_{2}\left(  0\right)  $,  $4I_{1}\left(  1,-\frac{5}{3}%
and rank $4.$

From this fibration with the parameter $q=\frac{y}{xm}$ we recover the
fibration $H_{c.}$

§.§ $3$-isogenies from $Y_{10}$

Consider the two $K3$ surfaces of discriminant $72$ and of transcendental lattice  $[4 \quad 0 \quad 18]$  or $[2 \quad 0 \quad 36]$. There exist elliptic fibrations of $Y_{10}$ with a $3$-torsion section which induce by $3$-isogeny an elliptic fibration of one of the surface or of the other.

For the following elliptic fibrations of $Y_{10}$ with a $3$-torsion section, not specializations, given in the last paragraphs, we compute the Néron-Severi and
transcendental lattices of the surface with the elliptic fibration induced by the $3$-isogeny.

§.§.§ Fibration (11)

In section $6$ we found the rank $4$ elliptic fibration $(11)$.

After a translation to put the $3$-torsion section in $\left(  0,0\right)  $
we obtain the following Weierstrass equation and also
$p_{1}$ and $p_{2}$ generators of the Mordell-Weil lattice

\begin{equation}%
\begin{array}
E_{11}:Y^{2}+\left(  t^{2}-4\right)  YX+t^{2}\left(  2t^{2}-3\right)
p_{1}=\left(  6t^{2},27t^{2}\right)  ,p_{2}=\left(  6i\sqrt{3}t-3t^{2}%
,27t^{2}\right)  \\
2I_{6}\left(  \infty,0\right)  ,\quad2I_{3}\left(  2t^{2}-3\right)
,\quad2I_{2}\left(  \pm1\right)  ,\quad2I_{1}\left(  \pm8\right).
\end{array}
\end{equation}

We see that the $3$-isogenous elliptic fibration has a Weierstrass equation, generators of
Mordell-Weil lattice and singular fibers

\begin{align*}
H_{11}: &  Y^{2}-3\left(  t^{2}-4\right)  YX+\left(  t^{2}-1\right)
^{2}\left(  t^{2}-64\right)  Y=X^{3}\\
&  2I_{6}\left(  \pm1\right)  ,\quad2I_{3}\left(  \pm8\right)  ,\quad
2I_{2}\left(  \infty,0\right)  ,\quad2I_{1}\left(  2t^{2}-3\right)  \text{ of
rank }2.
\end{align*}

Notice the two sections

\begin{align*}
\pi_{1}  & =\left(  -\frac{1}{4}\left(  t^{2}-1\right)  \left(  t^{2}%
-64\right)  ,\frac{1}{8}\left(  t-8\right)  \left(  t-1\right)  \left(
t+1\right)  ^{2}\left(  t+8\right)  ^{2}\right)  \quad\\
\omega & =\left(  -7\left(  t^{2}-1\right)  ^{2},49\alpha\left(
t^{2}-1\right)  ^{3}\right)  \quad\text{where }49\alpha^{2}+20\alpha+7=0.
\end{align*}

So, computing the height matrix we see  the discriminant is $72.$

For each reducible fiber at $t=i$ we denote $\left(  X_{i},Y_{i}\right)  $ the
singular point of $H_{11}$

\[%
\begin{array}
t=\pm1 \quad t=\pm8 & t=0 & t=\infty\\
(  X_{\pm1}=0,Y_{\pm1}=0) &
(  X_{0}=-16,Y_{0}=64)  & (  x_{\infty}=-1,y_{\infty
(  X_{\pm8}=0,Y\pm_{8}=0)& &
\end{array}
\]

where if $t=\infty$ we substitute $t =\frac{1}{T}$,
$x=T^{4}X,y=T^{6}Y.$ We notice also $\theta_{i,j}$ the $j$-th component
of the reducible fiber at $t=i.$ A section $M=\left(  X_{M},Y_{M}\right)  $
intersects the component $\theta_{i,0}$ if and only if $\left(  X_{M},Y_{M}\right)
\not \equiv\left(  X_{i},Y_{i}\right)  \operatorname{mod}\left(  t-i\right)
.$ Using the additivity on the component, we deduce that $\omega$ does not
intersect $\theta_{i,0},2\omega$ intersects $\theta_{i,0}$ and so $\omega$
intersects $\theta_{i,3}$ for $i=\pm1.$ Also $\omega$ intersects $\theta_{i,0}$
for $i=\pm8$ $,i=0$ and $\infty.$

For $\pi_{1}$ we compute $k\pi_{1}$ with $2\leq k\leq6.$ For $i=\pm1$, only
$6\pi_{1}$ intersects $\theta_{i,0}$ so $\pi_{1}$ intersects $\theta_{i,1}.$
(this choice 1, not 5, fixes the numbering of components). For $i=\pm8$, only
$3\pi_{1}$ intersects $\theta_{i,0},$ so $\pi_{i}$ intersects $\theta_{i,1}.$
Modulo $t$, we get $\pi_{1}=\left(  -16,64\right)  ,$ so $\pi_{1}$ intersects
$\theta_{0,1},$ and $\pi_{1}$ intersects $\theta_{\infty,0}$.

As for the $3$-torsion section $s_{3}=\left(  0,0\right)  $,  $s_{3}$
intersects $\theta_{i,2}$ or $\theta_{i,4}$ if $i=\pm1$. Computing $2\pi_{1}-s_{3}$, we see that $s_{3}$ intersects $\theta_{1,2}$ and $\theta_{-1,4}$.

For $i=\pm8$, we compute $\pi_{1}-s_{3},$ for $t=8$ and show that $s_{3}$
intersects $\theta_{8,2} $ and
$\theta_{-8,1}.$ For $t=0$ and $t=\infty\ s_{3}$ intersects  the $0$ component.

So we can compute the relation between the section $s_{3}$ and the
$\theta_{i,j}$ and find  that $3s_{3}\approx -2\theta_{1,1}-4%
\theta_{1,2}-3\theta_{1,3}-2\theta_{1,4}-\theta
_{1,5}$. Thus, we can choose the following base of the Néron-Severi lattice ordered as
$s_{0},F,\theta_{1,j},$ with $1\leq j\leq4,$ $s_{3},\theta_{-1,k}$ with $1\leq
k\leq5,\theta_{8,k},k=1,2,$ $\theta_{-8,k},k=1,2$ and $\theta_{0,1},$

The last remark is that only the two sections $\omega$ and $\pi_{1}$
intersect. So we can write the Gram matrix $Ne$ of the Néron-Severi

\[
\left(
\begin{smallmatrix}
-2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 &
0 & 0 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 1 & -2 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 &
0 & 0 & 0 & 0 & 1 & -2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 1 & 0 & 1 & 0 & 0 & -2 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 &
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 1 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 1 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 0 &
0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 &
0 & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 & -2
\end{smallmatrix}
\right ).
\]

According to Shimada's lemma <ref>,  $G_{Ne}\equiv \mathbb{Z/}2\mathbb{Z} \oplus\mathbb{Z/}36\mathbb{Z}$ is generated by the vectors $L_1$ and $L_2$ satisfying $q_{L_{1}}=-\frac{1}{2},$ $q_{L_{2}}=\frac{37}{36},$ and $b(L_1,L_2)=\frac{1}{2}.$

Moreover the following generators of the discriminant group of the lattice with Gram matrix
\begin{smallmatrix}
4 & 0\\
0 & 18
\end{smallmatrix}
\right)$ namely $f_1=(0,\frac{1}{2})$, $f_2=(\frac{1}{4},\frac{7}{18})$ verify $q_{f_1}=\frac{1}{2}$, $q_{f_2}=-\frac{37}{36}$ and $b(f_1,f_2)=-\frac{1}{2}.$

So the Gram matrix of the transcendental lattice of the surface is $M_{18}$.

§.§.§ Fibration $H_c$

We have shown along the proof of Theorem 8.3 that $H_c$ has a $(Z/3Z)^2$- torsion group
and exhibited a 3-isogeny between some elliptic fibrations of $Y_{10}$ and $Y_2$.
Notice that with the previous Weierstrass equation $H_{c}$ the point
$\sigma_{3}$ of $X$ coordinate $-\left(  c^{2}+c+7\right)  \left(
c^{2}-c+7\right)  $ defines a $3$-torsion section. After a translation to put this point in $(0,0)$
and scaling, we obtain a Weierstrass equation

\[

The $3$-isogenous curve of
kernel $<\sigma_{3}>$ has a Weierstrass equation

\begin{align*}
y^{2}+3\left(  t^{2}+11\right)  xy+\left(  t^{2}+2\right)  ^{3}y &  =x^{3},
\end{align*}

with singular fibers $I_{2}\left(  \infty\right)  $, $2I_{9}\left(
t^{2}+2\right)  $, $4I_{1}\left(  t^{4}+13t^{2}+49\right)  .$

The section
$P_{c}=\left(  -\frac{1}{4}\left(  t^{4}+t^{2}+1\right)  ,-\frac{1}{8}\left(
t-j\right)  ^{3}\left(  t+j^{2}\right)  ^{3}\right)  $ where $j=\frac
{-1+i\sqrt{3}}{2},$ of infinite order, generates the Mordell-Weil lattice.

We consider the components of the reducible fibers in the following order
$\theta_{i\sqrt{2},j}$ $j\leq1\leq8,$ $\theta_{-i\sqrt{2},k}$ $1\leq k\leq8$,

The $3$-torsion section $s_{3}=\left(  0,0\right)  $ and the previous
components are linked by the relation

\[
3s_{3}\approx -\theta_{i\sqrt{2},8}+\sum a_{i,j}\theta_{i,j}.%
\]

So we can replace, in the previous ordered sequence of components, the element
$\theta_{i\sqrt{2},8}$ by $s_{3}.$ We notice that $\left(  s_{3}.P_{c}\right)
=2,\left(  P_{c}.\theta_{\pm i\sqrt{2},0}\right)  =1$ and $\left(
P_{c}.\theta_{\infty,0}\right)  =1,$ so  the Gram matrix of the Néron-Severi lattice is

\[
\left (\begin {smallmatrix} -2&1&0&0&0&0&0&0&0&0&0&0&0
\\0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&1&-2&1&0&0&0&1&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&1&-2&0&0&0&0&0&0&0&0&0&0&0
\\0&1&0&0&1&0&0&0&0&-2&0&0&1&0&0&0&0&0&0&2
\\0&0&0&0&0&0&0&0&0&0&-2&1&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&1&-2&1&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&1&0&1&-2&1&0&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&1&-2&1&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&1&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&1&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&1&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&-2&0
\\0&1&0&0&0&0&0&0&0&2&0&0&0&0&0&0&0&0&0&-2
\end {smallmatrix}\right).
\]

Its determinant is $-72.$
According to Shimada's lemma <ref>, $G_{NS}=\mathbb{Z}/2\mathbb{Z}%
\oplus\mathbb{Z}/36$ is generated by the vectors $L_{1}$ and $L_2$ satisfying
$q_{L_1}=\frac{-1}{2},q_{L_2}=\frac{5}{36}$ and $b(L_1,L_2)=\frac{1}{2}.$

Moreover the following generators of the discriminant group of the lattice with Gram matrix
\end{smallmatrix}\right)$, namely $f_1=(\frac{1}{2},0)$, $f_2=(\frac{-1}{2},\frac{-7}{36})$ verify $q_{f_1}=\frac{1}{2}$, $q_{f_2}=-\frac{5}{36}$ and

So the transcendental lattice is $M_{36}=\left(
\begin{array}
2 & 0\\
0 & 36
\end{array}
\right).  $

§.§.§ Fibration $89$ of rank $0$

The fibration $89$ of rank $0$ has a $3$-torsion section. A Weierstrass equation for the $3$-isogenous fibration is

\begin{align*}
Y^{2}+\left(  -27t^{2}-18t+27\right)  YX+27\left(  4t+3\right)  \left(
5t-3\right)  ^{2}Y=X^{3}
\end{align*}

with singular fibers $ I_{9}\left(  \infty\right) ,I_{6}\left(  \frac{3}{5}\right),I_{4},\left(  0\right) ,I_{3}\left(  -\frac{3}{4}\right),2I_1.$

From singular fibers, torsion and rank we see in Shimada-Zhang table [39] that it is the  $n^\circ 48$ case. So the transcendental lattice of the surface is
\begin{smallmatrix}
4 & 0\\
0 & 18
\end{smallmatrix}
\right) . $

§.§.§ Specialization of case #19 and #20 for $k=10$

In the following paragraph, we prove that $H_{\#20}(10)$ is an elliptic fibration of a K3 surface
with trancendental lattice [4 0  18], thus achieving the proof of Theorem 8.2.
We give also a direct proof of the fact that $H_{\#19}(10)$ is another elliptic fibration of the same surface.

§.§.§ case #19

We have the Weierstrass equation

\[
H_{\#19}\left(  10\right)  :Y^{2}-30tYX+t^{2}\left(  t-27\right)  \left(
27t-1\right)  Y=X^{3}%
\]

with the two sections

\[
\]

image of the point $\left(  -t^{2},-t^{2}\right)  $ on $E_{\#19}\left(  10\right)  ,$

\[
P^{\prime\prime}=\left(  -\left(  t+1\right)  \left(  27t-1\right)  ,-\left(
27t-1\right)  \left(  t+1\right)  ^{3}\right).
\]

The Néron-Severi lattice, with the following basis $(s_{0},F,\theta_{\infty
,i}$ $1\leq i\leq6$ , $\theta_{0},i,1\leq i\leq6$, $\theta_{t_{0},1}%
,\theta_{t_{0},2},$ $s_{3},\theta_{t_{1},2},P^{\prime},P^{\prime\prime})$ has
for Gram matrix

\[
\left(
\begin{smallmatrix}
-2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 &
0 & 0 & -2 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 &
0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 1 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 & 0 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & -2 & 1 & 0 & 0 & 0 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 0 & 0 &
0 & 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 1 & 2 &
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & -2 & 0 &
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 2 & 0 & -2 &
0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 1 & 0 & 2 & -2
\end{smallmatrix}
\right).
\]

According to Shimada's lemma <ref>, $G_{NS}=\mathbb{Z}/2\mathbb{Z}%
\oplus\mathbb{Z}/36$ is generated by the vectors $L_1$ and $L_2$ satisfying
$q_{L_1}=\frac{-1}{2},q_{L_2}=\frac{13}{36}$ and $b(L_1,L_2)=\frac{-1}{2}.$

Moreover the following generators of the discriminant group of the lattice with Gram matrix
\end{smallmatrix} \right)$ namely $f_1=(0,\frac{1}{2})$,$f_2=(\frac{1}{4},\frac{5}{18})$ verify $q_{f_1}=\frac{1}{2}$, $q_{f_2}=-\frac{13}{36}$ and

So the transcendental lattice is $M_{18}=\left(
\begin{array}
4 & 0\\
0 & 18
\end{array}
\right).  $

An alternative proof: From the equation $H_{\#19}\left(  10\right)  $ and with
the parameter $m=\frac{Y}{\left(  t-27\right)  ^{2}}$ we obtain another
elliptic fibration defined by the following cubic equation in $W$ and $t$ with
$X=W\left(  t-27\right)  $

\[
W^{3}+30Wtm-m\left(  t^{2}\left(  27t-1\right)  +m\left(  t-27\right)
\right)  =0
\]

and the rational point

\[
W=676\frac{m\left(  m-1\right)  }{m^{2}-648m+27},t=\frac{27m^{2}-648+1}%
\]

This fibration has a Weierstrass equation of the form

\[
y^{2}=x^{3}-3ax+\left(  m+\frac{1}{m}-2b\right)
\]

with $a=38425/9,b=-7521598/27$. $\ $ So the Kummer surface associated is the
product of two elliptic curves with $J,J^{\prime}=2950584125/27\pm
1204567000/27\sqrt{6}$ that is $j,j^{\prime}=188837384000\pm77092288000\sqrt
{6}.$ So the fibration $H_{\#19}\left(  10\right)  $ corresponds to a surface
with transcendental lattice of Gram matrix $\left(
\begin{array}
4 & 0\\
0 & 18
\end{array}
\right)  .$

§.§.§ case #20

A Weierstrass equation for $H_{\#20}\left(  10\right)  $ has a Weierstrass

\begin{align*}
&  Y^{2}+3\left(  t^{2}-22\right)  YX+\left(  t^{2}-25\right)  ^{2}\left(
t^{2}-16\right)  Y=X^{3}
\end{align*}

with singular fibers $I_{4}\left(  \infty\right)  ,2I_{6}\left(  \pm5\right)
,2I_{3}\left(  \pm4\right)  ,2I_{1}\left(  t^{2}-24\right)  .$ We have a
$2$-torsion section $s_2=\left(  -\left(  t^{2}-25\right)  ^{2},\left(
t^{2}-25\right)  ^{3}\right)  $ and a $6$-torsion section

$s_{6}=\left(  -\left(
t^{2}-25\right)  \left(  t^{2}-16\right)  ,-\left(  t^{2}-25\right)  \left(
t^{2}-16\right)  ^{2}\right)  $.

The section
$P_{w}=\left(  4\left(  t+5\right)  ^{2}\left(  t-4\right)  ,-\left(
t+5\right)  ^{4}\left(  t-4\right)  ^{2}\right)  $ is of infinite order and is
a generator of the Mordell Weil lattice.  Moreover we have $\theta_{\pm
5,1}.s_{6}=1,\theta_{\infty,2}.s_{6}=1,\theta_{\pm3,1}.s_{6}=1$. So the
following divisor is $6$ divisible

\[
\sum_{i=1}^{5}\left(  6-i\right)  \theta_{\pm5,i}+3\theta_{\infty,1}%
+3\theta_{\infty,3}+4\theta_{\pm,4,1}+2\theta_{\pm4,2}\approx 6s_{6}%
\]

So we can replace $\theta_{5,5}$ by $s_{6}.$

Moreover we can compute $s_{6}.P_{w}=1$ (for $t=-3).$ We have also
$\theta_{5,0}.P_{w}=1,\theta_{-5,4}.P_{w}=1$ and $\theta_{\infty,0}%
.P_{w}=1,\theta_{4,1}.P_{w}=1,\theta_{-4,0}.P_{w}=1.$ All these computations
give the Gram matrix of the Néron-Severi lattice of discriminant $-72$

\[
\left (\begin {smallmatrix}
\\0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&1&-2&0&0&0&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&-2&1&0&0&1&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&0&1&-2&1&0&0&0&0&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&1&-2&0&0&0&0&0&0&0&0&1
\\0&1&1&0&0&0&0&1&0&0&0&-2&0&1&0&1&0&1&0&1
\\0&0&0&0&0&0&0&0&0&0&0&0&-2&1&0&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&1&1&-2&1&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&0&0&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&-2&1&0&0&1
\\0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&0&0&0
\\0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&0&0&-2&1&0
\\0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&-2&0
\\0&1&0&0&0&0&0&0&0&0&1&1&0&0&0&1&0&0&0&-2
\end {smallmatrix}\right ).
\]

According to Shimada's lemma <ref>, $G_{NS}=\mathbb{Z}/2\mathbb{Z}%
\oplus\mathbb{Z}/36$ is generated by the vectors $L_1$ and $L_2$ satisfying
$q_{L_1}=\frac{-1}{2},q_{L_2}=\frac{-35}{36}$ and $b(L_1,L_2)=\frac{-1}{2}.$

Moreover the following generators of the discriminant group of the lattice with Gram matrix
\end{smallmatrix} \right)$, namely $f_1=(0,\frac{1}{2})$,$f_2=(\frac{1}{4},\frac{7}{18})$ verify $q_{f_1}=\frac{1}{2}$, $q_{f_2}=\frac{35}{36}$ and

So the Gram matrix of the transcendental lattice is $\left(
\begin{array}
4 & 0\\
0 & 18
\end{array}
\right)  .$

[3]
M. J. Bertin, Mesure de Mahler et série $L$ d'une surface $K3$-singulière, Publ. Math. Besancon, Actes de la Conférence Algèbre et Théorie des Nombres (2010), 5–28.

[4]
M. J. Bertin, The Mahler measure and $L$-series of a singular $K3$-surface, arXiv:0803.0413v1 [math.NT], 4 Mar 2008, 1–22.

[6]
M. J. Bertin,  Mahler's measure and L-series of $K3$ hypersurfaces, in Mirror Symmetry V, Proceedings of the BIRS Workshop on Calabi-Yau Varieties and Mirror Symmetry, AMS/IP, Studies in A

[5]
M.-J. Bertin, and O. Lecacheux,  Elliptic fibrations on the modular surface associated to $\Gamma_1 (8)$, in Arithmetic and geometry of K3 surfaces and Calabi-Yau threefolds,  Fields Inst.Commun., 67, Springer, New York, (2013), 153–199.

[7] M.J. Bertin, A. Garbagnati, R. Hortsch, O. Lecacheux, M. Mase, C. Salgado, and U. Whitcher,  Classifications of Elliptic Fibrations of a Singular $ K3$ Surface, in Women in Numbers Europe,  Research Directions in Number Theory, Association for Women in Mathematics Series, Springer, (2015), 17–49.

[8] M.-J. Bertin, and O. Lecacheux,  Apéry-Fermi pencil of $K3$-surfaces and 2-isogenies J. Math. Soc. Japan (2) 72  (2020), 599–637.

[9]
Braun, A. P.  Kimura, Y. and  Watari, T. On the Classification of Elliptic Fibrations modulo
Isomorphism on K3 Surfaces with large Picard Number, arXiv:1312.4421.

[11]
N. Bourbaki, Groupes et algèbres de Lie, Chap.4, 5, 6, (Masson, 1981).

[13]
J. H. Conway, N. J. A. Sloane, Sphere packings, lattices and groups, Grundlehren der Mathematischen Wissensthaften (Springer Verlag, 290 Second edition)

[14]
D. Festi, D. van Straten, Bhabha scattering and a special pencil of $K3$ surfaces, Communications in Number Theory and Physics, (2)13  (2019),  463–485,

[22]
A. Kumar, and M. Kuwata,  Elliptic $K3$ surfaces associated
with the product of two elliptic curves: Mordell-Weil lattices and their
fields of definition.  Nagoya Math. J. 228 (2017), 124–185.

[23]
M. Kuwata,  Elliptic $K3$ surfaces with given Mordell-Weil rank, Comment. Math. Univ. St. Paul.
49 (2000), 91–100.

[24]  M. Kuwata, and  K. Utsumi,   Mordell-Weil lattice of Inose's
elliptic$ K3 $surface arising from the product of 3-isogenous elliptic curves,
J. Number Theory 190 (2018), 333–351.

[27]
J. Martinet,
Perfect Lattices in Euclidean Spaces,
Grundlehren 327, (Springer-Verlag 2003).

[29]
H.-V.  Niemeier,Definite quadratische Formen der Dimension 24 und Diskriminante 1, J. Number Theory 5 (1973), 142–178.

[30]
V. V.  Nikulin,Integral symmetric bilinear forms and some of their applications, Izv. Math. (1) 14,  (1980), 103–167.

[31]
K.-I. Nishiyama, The Jacobian fibrations on some $K3$ surfaces and their Mordell-Weil groups, Japan. J. Math. 22 (1996), 293–347.

[34]
M. Schütt, $K3$ surfaces with Picard rank 20 over $\mathbb Q$, Algebra and Number Theory (3) 4 (2010), 335–356.

[36]
M. Schütt,  and T. Shioda,  Elliptic surfaces, Algebraic geometry in East Asia - Seoul 2008, Adv. Stud. Pure Math. 60 (2010), 51–160.

[37]
M. Schütt, CM newforms with rational coefficients, Ramanujan Journal 19 (2009), 187–205.

[38]
I. Shimada,  $K3$ surfaces and Lattice Theory, Talk Dec. 2, 2014, Hanoï Vietnam Institute for Advavanced Study in Mathematics, (Slides on Shimada's web page).

[39]
I. Shimada,  and D. Q. Zhang, Classification of extremal elliptic $K3$ surfaces and fundamental groups of open $K3$ surfaces, Nagoya Math. J. 161 (2001), 23–54.

[40] T. Shioda,  On elliptic modular surfaces, J. Math. Soc.
Japan 24 (1972), 20–59.

[41]
T. Shioda,  On the Mordell-Weil lattices, Comment. Math. Univ. St. Paul. 39 (1990), 211–240.

[42]
T. Shioda,  $K3$ surface and Sphere packing , J.
Math. Soc. Japan 60 (2008), 1083–1105.

[43] T.  Shioda, A note on K3 surfaces and sphere packings, Proc. Japan
Acad. Ser. A (5) 76,  (2000), 68–72.

[44] T. Shioda,  Correspondence of elliptic curves and Mordell-Weil
lattices of certain elliptic K3 surfaces,  Algebraic Cycles and Motives,
Cambridge Univ. Press 2 (2007) 319–339.

[46]
H. Sterk, Finiteness results for algebraic $K3$ surfaces, Math. Z., (4) 180  (1985), 507–513.

[16]
N. D. Elkies, The maximal Mordell-Weil rank of an elliptic $K3$ surface over $\mathbb Q(t)$, Talk at the Conference on Birational Automorphisms of Compact Complex Manifold and Dynamical Systems at Nagoya University, Aug. 28, 2007.

[17]
N. D. Elkies, Mordell-Weil generators for singular Shioda-Inose surfaces over $\mathbb Q$,

http://www.math.harvard.edu/ elkies/K3_20SI.html

[19]
K. Kodaira, On compact analytic surfaces I-III, Ann. of Math., 71 (1960), 111-152; 77 (1963), 563-626; 78 (1963), 1-40.

[26]
T. Harrache & O. Lecaheux, Etude des fibrations elliptiques d'une surface $K3$, J. théorie des nombres de Bordeaux, 23 nÃÂ°1 (2011), 183-207.

[20]
M. Kuwata, The canonical height and elliptic surfaces, Journal of Number Theory, Volume 36, Issue 2, October 1990, 201-211.

[27]
J. Martinet, Les réseaux parfaits des espaces euclidiens, Masson, Paris, (1996).

[29]
H.-V. Niemeier, Definite quadratische Formen der Dimension 24 und Diskriminante 1, J. Number Theory 5 (1973), 142-178.

[30]
V. V. Nikulin, Integral symmetric bilinear forms and some of their applications, Math. USSR Izv. 14, No. 1 (1980), 103-167.

[31]
K.-I. Nishiyama, The Jacobian fibrations on some $K3$ surfaces and their Mordell-Weil groups, Japan. J. Math. 22 (1996), 293-347.

[33]
I.-I. Piatetski-Shapiro , I.-R., Shafarevich, TorelliÃÂs theorem for algebraic surfaces of type
$K3$, Izv. Akad. Nauk SSSR Ser. Mat. 35 (1971), 530ÃÂ572.

[34]
M. Schütt, $K3$ surfaces with Picard rank 20 over $\mathbb Q$, Algebra Number Theory 4 (2010), No. 3, 335-356.

[35]
M. Schütt, Elliptic fibrations of some extremal $K3$ surfaces, Rocky Mountain Journal of Mathematics 37 (2007), No. 2, 609-652.

[36]
M. Schütt, T. Shioda, Elliptic surfaces, arXiv: 0907.0298v3 [math. AG], 9 Jul. 2010.

[39]
I. Shimada, D. Q. Zhang, Classification of extremal elliptic $K3$ surfaces and fundamental groups of open $K3$ surfaces, Nagoya Math. J. 161 (2001), 23-54.

[41]
T. Shioda, On the Mordell-Weil lattices, Comm. Math. Univ. St. Pauli 39 (1990), 211-240.

[48]
J. Tate, Algorithm for determining the type of a singular fibre in an elliptic pencil, in: Modular functions of one variableIV (Antwerpen 1972), Lect. Notes in Math. 476 (1975), 33-52.

[49]
N. Yui, Arithmetic of Certain Calabi-Yau Varieties and Mirror Symmetry, IAS/Park City Math. Ser., Vol. 9, (2001), 509-569.

[3]
M. J. Bertin, Mesure de Mahler et série $L$ d'une surface $K3$-singulière, Publ. Math. Besancon, Actes de la Conférence Algèbre et Théorie des Nombres (2010), 5–28.

[4]
M. J. Bertin, The Mahler measure and $L$-series of a singular $K3$-surface, arXiv:0803.0413v1 [math.NT], 4 Mar 2008, 1–22.

[5]
M. J. Bertin & O. Lecacheux, Elliptic fibrations on the modular surface associated to $\Gamma_1 (8)$, in Arithmetic and geometry of K3 surfaces and Calabi-Yau threefolds, 153Ã¢ÂÂ199, Fields Inst.Commun., 67, Springer, New York, 2013.

[37]
M. Schütt, CM newforms with rational coefficients, Ramanujan Journal 19 (2009), 187–205.

[50]
I. Shimada & D. Q. Zhang, Classification of extremal elliptic $K3$ surfaces and fundamental groups of open $K3$ surfaces, Nagoya Math. J. 161 (2001), 23–54.


# PGMax: Factor Graphs for Discrete Probabilistic Graphical Models and Loopy
Belief Propagation in JAX

Guangyao Zhou<EMAIL_ADDRESS>
Vicarious AI
Union City, CA 94560, USA Nishanth Kumar11footnotemark: 1<EMAIL_ADDRESS>
Computer Science and Artificial Intelligence Laboratory
Massachusetts Institute of Technology
Cambridge, MA 02139, USA Miguel Lázaro-Gredilla<EMAIL_ADDRESS>Shrinu
Kushagra<EMAIL_ADDRESS>Dileep George<EMAIL_ADDRESS>
Vicarious AI
Union City, CA 94560, USA Equal contribution.Work done during internship at
Vicarious AI.

###### Abstract

PGMax is an open-source Python package for easy specification of discrete
Probabilistic Graphical Models (PGMs) as factor graphs, and automatic
derivation of efficient and scalable loopy belief propagation (LBP)
implementation in JAX. It supports general factor graphs, and can effectively
leverage modern accelerators like GPUs for inference. Compared with existing
alternatives, PGMax obtains higher-quality inference results with orders-of-
magnitude inference speedups. PGMax additionally interacts seamlessly with the
rapidly growing JAX ecosystem, opening up exciting new possibilities. Our
source code, examples and documentation are available at
https://github.com/vicariousinc/PGMax.

Keywords: Probabilistic Graphical Models, Bayesian Networks, Markov Random
Fields, Energy Based Models, Factor Graphs, Loopy Belief Propagation, Python,
JAX

##  1 Introduction

Discrete Probabilistic Graphical Models (PGMs) can compactly encode joint
probability distributions over a set of discrete variables. Discrete PGMs are
commonly specified using factor graphs (Kschischang et al., 2001), and have
seen successful applications to problems in a wide range of fields such as
computer vision (Wang et al., 2013), natural language processing (Wang and
Cho, 2019) and biology (Mora and Bialek, 2011). A standard approach for
inference on discrete PGMs involves message passing algorithms like Loopy
Belief Propagation (LBP) (Pearl, 1988; Murphy et al., 1999), which adopts
easy-to-derive message updates given a factor graph and has enjoyed remarkable
empirical success. However, despite the many past attempts at implementing
factor graphs and LBP in Python111Some examples include pyfac, py-factorgraph,
factorflow, fglib, sumproduct, pgmpy, pomegranate., there exists no well-
established open-source Python package with efficient and scalable LBP
implementations for general factor graphs. A key challenge lies in the design
and manipulation of Python data structures containing LBP messages for factor
graphs with potentially complicated topology, factor definitions and discrete
variables with a varying number of states.

In this paper, we describe PGMax, a new open-source Python package that
provides an easy-to-use interface for specifying general factor graphs, and
implements efficient and scalable LBP in JAX (Bradbury et al., 2018). Compared
with existing alternative Python packages, PGMax supports more general factor
graphs, demonstrates superior inference performance in terms of quality,
efficiency and scalability, and additionally opens up exciting new
possibilities from its seamless interaction with the rapidly growing JAX
ecosystem.

##  2 Related Works

The most relevant existing Python packages are pgmpy (Ankan and Panda, 2015)
and pomegranate (Schreiber, 2017). However, in addition to limited factor
graph support, their inference implementations make heavy use of control flows
with irregular Python data structures. The lack of efficient array-based
implementations largely restricts their computations to CPUs. As we show in
Sec. 5.1, this severely limits their efficiency and scalability.

PGMax is a specialized probabilistic programming language (PPL) (van de Meent
et al., 2018) that provides an interface for specifying probabilistic models
(discrete PGMs), and automatically derives inference methods (LBP). While
existing PPLs (Carpenter et al., 2017; Bingham et al., 2018; Salvatier et al.,
2016; Phan et al., 2019; Ge et al., 2018) can be quite powerful, they
typically focus on probabilistic models with continuous variables, with Markov
Chain Monte Carlo methods like Hamiltonian Monte Carlo as the core inference
engine, and have limited support for undirected PGMs and discrete variables
(Zhou, 2019).

Due to the challenge in efficient LBP implementation in Python, past works
resort to C++ or Julia for LBP implementation. Among these, OpenGM (Andres et
al., 2012; Kappes et al., 2015) similarly supports general factor graphs but
is no longer maintained, while ForneyLab (Cox et al., 2019) and ReactiveMP
(Bagaev and de Vries, 2021) focus mostly on conjugate state-space models.
Moreover, PGMax’s pure Python implementation allows easy debugging and
interaction with the vast Python scientific computing ecosystem.

##  3 Package features

Easy specification of general factor graphs PGMax supports easy specification
of general factor graphs with potentially complicated topology, factor
definitions, and discrete variables with a varying number of states, as we
demonstrate and discuss in Sec. 5.2
Efficient, scalable LBP implementation PGMax adopts an LBP implementation
using parallel message updates and damping (Pretti, 2005), which has been
extensively tested in recent works (George et al., 2017; Lázaro-Gredilla et
al., 2021; Lazaro-Gredilla et al., 2021; Zhou et al., 2021) on a wide range of
discrete PGMs. PGMax develops a novel fully flat array-based LBP
implementation (Sec. 4) in JAX, and is able to effectively leverage just-in-
time compilation and modern accelerators like GPUs. As we show in Sec. 5.1,
the resulting inference engine is several orders-of-magnitude more efficient
than existing alternatives.
Seamless interaction with JAX PGMax implements LBP as pure functions with no
side effects. This functional design allows PGMax to seamlessly interact with
the rapidly growing JAX ecosystem, and opens up exciting new possibilities as
we discuss in Sec. 5.3.
Software engineering best practices PGMax follows professional software
development workflows, with enforced format and static type checking,
automated continuous integration and documentation generation, and
comprehensive unit tests that fully cover the codebase.

##  4 A fully flat array-based LBP implementation

LBP passes around real valued vectors called messages along factor graph
edges. Although we can easily derive message updates given a factor graph, due
to the potentially complicated topology, factor definitions and discrete
variables with a varying number of states, it’s challenging to design
efficient Python data structures for storing and updating messages. Existing
packages (e.g. pgmpy and pomegranate) typically resort to irregular data
structures for message storage and heavy use of control flows for message
updates. This makes them inefficient in Python, and largely restricts their
computations to CPUs. A possible alternative is to pad messages into regular
multidimensional arrays and update messages using efficient array-based
computations. However, this usually requires model-specific data structures
and padding strategies, and sometimes leads to highly inefficient memory
usage.

To address this challenge, PGMax concatenates variable-to-factor and factor-
to-variable messages associated with the edges into two separate 1D arrays,
and develops a novel fully flat array-based LBP implementation. By keeping
track of the global indices of variable states, edge states and factor valid
configurations, PGMax leverages the gather/scatter operations implemented in
JAX for a succinct222See pgmax.bp.infer for the fully flat array-based message
updates in two simple functions., efficient and scalable LBP implementation.

##  5 Experiments

We refer the readers to our companion blog post for a detailed tutorial on
basic PGMax usage, and additional discussions on the more advanced features
mentioned in this section.

###  5.1 Comparison with existing alternatives

We use maximum-a-posteriori (MAP) inference for randomly generated restricted
Boltzmann Machines (RBMs) as a benchmark to compare PGMax with existing Python
packages. Among the existing alternatives on PyPI (py-factorgraph, fglib,
pgmpy and pomegranate), py-factorgraph and fglib are non-functional. pgmpy’s
BP uses junction tree algorithm for exact inference, yet is not practical even
for a 30-unit RBM in our tests. Given the above, we exclude py-factorgraph,
fglib and pgmpy’s BP from comparison. pgmpy additionally implements max-
product linear programming (MPLP) (Globerson and Jaakkola, 2007), which we
use, together with pomegranate’s LBP (the predict function) as baselines. We
use default settings for pgmpy’s MPLP and pomegranate’s LBP, and 200
iterations with $0.5$ damping for PGMax’s max-product LBP. pgmpy only runs on
CPUs. Although pomegranate supports CPU multiprocessing and GPUs, in our tests
we do not see obvious speedups from these advanced features. As a result we
test pgmpy and pomegranate only on CPUs. We test PGMax on both CPUs (using
Intel(R) Core(TM) i7-7820HQ) and GPUs (using NVIDIA Quadro M1200), and measure
inference quality using MAP estimates potentials.

Figure 1: PGMax inference speedups on larger models

We start with 20 randomly generated 30-unit RBMs (with 15 hidden and 15
visible units), and obtain ground truth MAP estimates with brute force
enumeration. pgmpy’s MPLP consistently gives poor MAP estimates. pomegranate
recovers ground truth for only 2/20 RBMs, but in general gives high-quality
MAP estimates. PGMax recovers ground truth for 17/20 RBMs, and consistently
outperforms both pgmpy’s MPLP and pomegranate. We measure mean inference time
from 10 runs across all 20 RBMs to compare inference speed. Compared with
PGMax on CPU, pgmpy’s MPLP is 2.5x slower, and pomegranate is 1.43x slower.
Compared with PGMax on GPU, pgmpy’s MPLP is 6x slower, while pomegranate is
3.4x slower.

We additionally test scalability to larger models using randomly generated
RBMs of varying sizes ($40,60,\ldots,200$ total units) with an equal number of
hidden and visible units. pgmpy’s MPLP again consistently gives poor MAP
estimates. pomegranate and PGMax give similar-quality MAP estimates, with
PGMax obtaining better MAP estimates in 8/9 test cases. However, PGMax
achieves significant inference speedups, as we see in Fig. 1. The advantage is
more pronounced for large models: for a 200-unit RBM, inference takes 2.31s
with PGMax CPU, 0.84s with PGMax GPU, 377.97s with pgmpy’s MPLP, and 941.87s
with pomegranate. Note that our tests are done using a regular laptop GPU.
PGMax can achieve additional speedups with more powerful GPUs for even larger
models.

###  5.2 Specifying complex factor graphs

In Sec. 4 of our companion blog post, we demonstrate a PGMax implementation of
max-product LBP inference for Recursive Cortical Network (RCN) (George et al.,
2017). By explicitly enumerating valid configurations in factor definitions,
PGMax naturally supports RCN’s non-standard pairwise factors, as well as other
structured higher-order factors (e.g. those used in the recently proposed
Markov Attention Models (Zhou et al., 2021)). Moreover, PGMax’s fully flat
array-based LBP implementation allows it to support factor graphs with
arbitrary topology and discrete variables with a varying number of states
without compromises on speed or memory usage, something existing alternatives
struggle to do.

###  5.3 Exciting new possibilities from implementing LBP in JAX

PGMax implements LBP as pure functions with no side effects. This functional
design means we can easily apply JAX transformations like jit/vmap/grad, etc.,
to these functions, and additionally allows PGMax to seamlessly interact with
other packages in the rapidly growing JAX ecosystem. As we demonstrate in Sec.
5 of our companion blog post, this opens up some exciting new possibilities,
like processing batches of samples/models in parallel using vmap and the use
of LBP as part of a larger end-to-end differentiable system.

## References

  * Andres et al. (2012) Bjoern Andres, Thorsten Beier, and Jörg H Kappes.  Opengm: A c++ library for discrete graphical models.  _arXiv preprint arXiv:1206.0111_ , 2012.
  * Ankan and Panda (2015) Ankur Ankan and Abinash Panda.  pgmpy: Probabilistic graphical models using python.  In _Proceedings of the 14th Python in Science Conference (SCIPY 2015). Citeseer_ , volume 10. Citeseer, 2015.
  * Bagaev and de Vries (2021) Dmitry Bagaev and Bert de Vries.  Reactivemp. jl: A julia package for reactive message passing-based bayesian inference.  _Proceedings of JuliaCon_ , 1:1, 2021.
  * Bingham et al. (2018) Eli Bingham, Jonathan P. Chen, Martin Jankowiak, Fritz Obermeyer, Neeraj Pradhan, Theofanis Karaletsos, Rohit Singh, Paul Szerlip, Paul Horsfall, and Noah D. Goodman.  Pyro: Deep Universal Probabilistic Programming.  _arXiv preprint arXiv:1810.09538_ , 2018.
  * Bradbury et al. (2018) James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang.  JAX: composable transformations of Python+NumPy programs, 2018\.  URL http://github.com/google/jax.
  * Carpenter et al. (2017) Bob Carpenter, Andrew Gelman, Matthew Hoffman, Daniel Lee, Ben Goodrich, Michael Betancourt, Marcus Brubaker, Jiqiang Guo, Peter Li, and Allen Riddell.  Stan: A probabilistic programming language.  _Journal of Statistical Software, Articles_ , 76(1):1–32, 2017.
  * Cox et al. (2019) Marco Cox, Thijs van de Laar, and Bert de Vries.  A factor graph approach to automated design of Bayesian signal processing algorithms.  _International Journal of Approximate Reasoning_ , 104:185–204, January 2019.  ISSN 0888-613X.  doi: 10.1016/j.ijar.2018.11.002.
  * Ge et al. (2018) Hong Ge, Kai Xu, and Zoubin Ghahramani.  Turing: a language for flexible probabilistic inference.  In _International Conference on Artificial Intelligence and Statistics, AISTATS 2018, 9-11 April 2018, Playa Blanca, Lanzarote, Canary Islands, Spain_ , pages 1682–1690, 2018.
  * George et al. (2017) Dileep George, Wolfgang Lehrach, Ken Kansky, Miguel Lázaro-Gredilla, Christopher Laan, Bhaskara Marthi, Xinghua Lou, Zhaoshi Meng, Yi Liu, Huayan Wang, et al.  A generative vision model that trains with high data efficiency and breaks text-based CAPTCHAs.  _Science_ , 358(6368), 2017.
  * Globerson and Jaakkola (2007) Amir Globerson and Tommi Jaakkola.  Fixing max-product: Convergent message passing algorithms for map lp-relaxations.  _Advances in neural information processing systems_ , 20:553–560, 2007.
  * Kappes et al. (2015) JörgH. Kappes, Bjoern Andres, FredA. Hamprecht, Christoph Schnörr, Sebastian Nowozin, Dhruv Batra, Sungwoong Kim, BernhardX. Kausler, Thorben Kröger, Jan Lellmann, Nikos Komodakis, Bogdan Savchynskyy, and Carsten Rother.  A comparative study of modern inference techniques for structured discrete energy minimization problems.  _International Journal of Computer Vision_ , 115(2):155–184, 2015.  ISSN 0920-5691.  doi: 10.1007/s11263-015-0809-x.
  * Kschischang et al. (2001) Frank R Kschischang, Brendan J Frey, and H-A Loeliger.  Factor graphs and the sum-product algorithm.  _IEEE Transactions on information theory_ , 47(2):498–519, 2001.
  * Lazaro-Gredilla et al. (2021) Miguel Lazaro-Gredilla, Antoine Dedieu, and Dileep George.  Perturb-and-max-product: Sampling and learning in discrete energy-based models.  _Advances in Neural Information Processing Systems_ , 34, 2021.
  * Lázaro-Gredilla et al. (2021) Miguel Lázaro-Gredilla, Wolfgang Lehrach, Nishad Gothoskar, Guangyao Zhou, Antoine Dedieu, and Dileep George.  Query training: Learning a worse model to infer better marginals in undirected graphical models with hidden variables.  In _Proceedings of the AAAI Conference on Artificial Intelligence_ , volume 35, pages 8252–8260, 2021.
  * Mora and Bialek (2011) Thierry Mora and William Bialek.  Are biological systems poised at criticality?  _Journal of Statistical Physics_ , 144(2):268–302, 2011.
  * Murphy et al. (1999) Kevin P Murphy, Yair Weiss, and Michael I Jordan.  Loopy belief propagation for approximate inference: an empirical study.  In _Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence_ , pages 467–475, 1999.
  * Pearl (1988) Judea Pearl.  _Probabilistic reasoning in intelligent systems: networks of plausible inference_.  Morgan kaufmann, 1988.
  * Phan et al. (2019) Du Phan, Neeraj Pradhan, and Martin Jankowiak.  Composable effects for flexible and accelerated probabilistic programming in numpyro.  _arXiv preprint arXiv:1912.11554_ , 2019.
  * Pretti (2005) Marco Pretti.  A message-passing algorithm with damping.  _Journal of Statistical Mechanics: Theory and Experiment_ , 2005(11):P11008, 2005.
  * Salvatier et al. (2016) John Salvatier, Thomas V. Wiecki, and Christopher Fonnesbeck.  Probabilistic programming in python using PyMC3.  _PeerJ Computer Science_ , 2:e55, apr 2016.  doi: 10.7717/peerj-cs.55.
  * Schreiber (2017) Jacob Schreiber.  Pomegranate: fast and flexible probabilistic modeling in python.  _The Journal of Machine Learning Research_ , 18(1):5992–5997, 2017.
  * van de Meent et al. (2018) Jan-Willem van de Meent, Brooks Paige, Hongseok Yang, and Frank Wood.  An introduction to probabilistic programming.  _arXiv preprint arXiv:1809.10756_ , 2018.
  * Wang and Cho (2019) Alex Wang and Kyunghyun Cho.  Bert has a mouth, and it must speak: Bert as a markov random field language model.  _arXiv preprint arXiv:1902.04094_ , 2019.
  * Wang et al. (2013) Chaohui Wang, Nikos Komodakis, and Nikos Paragios.  Markov random field modeling, inference & learning in computer vision & image understanding: A survey.  _Computer Vision and Image Understanding_ , 117(11):1610–1627, 2013.
  * Zhou (2019) Guangyao Zhou.  Mixed hamiltonian monte carlo for mixed discrete and continuous variables.  _arXiv preprint arXiv:1909.04852_ , 2019.
  * Zhou et al. (2021) Guangyao Zhou, Wolfgang Lehrach, Antoine Dedieu, Miguel Lázaro-Gredilla, and Dileep George.  Graphical models with attention for context-specific independence and an application to perceptual grouping.  _arXiv preprint arXiv:2112.03371_ , 2021.