Given a rational bivariate power series $F(x,y)=\sum{a\_{n,m}x^ny^m}$, the diagonal function $G(t):=\sum{a\_{n,n}t^n}$ is known to be algebraic, although not rational in general. I was wondering if there were some known conditions for it to be rational. The setting I'm working with has $a\_{n,m}$ non-negative integers; I'm interested in both characteristic 0 and positive characteristic.



When is the diagonal of a rational bivariate power series again rational
Assume for convenience that each $a\_{n,m}\in\mathbb{C}$. Consider the
proof in *Enumerative Combinatorics*, vol. 2, Theorem 6.3.3, that
$G(t)$ is algebraic. One computes the constant term (with respect to
$s$) of $F(s,t/s)$ (being careful of the meaning of $F(s,t/s)$). The
zeros of the denominator of $F(s,t/s)$ (with respect to $s$) are
algebraic functions of $t$ that enter into the formula for the
diagonal. Factor the denominator of $F(x,y)$ as $D\_1(x,y)\cdots
D\_k(x,y)$, where each $D\_i(x,y)$ is irreducible (over
$\mathbb{C}$). Let $d\_i$ be the least integer for which
$s^{d\_i}D\_i(s,t/s)$ has no negative exponents. The zeros of
$s^{d\_i}D\_i(s,t/s)$ (as a polynomial in
$s$ whose coefficients are polynomials in $t$) will all be rational
functions if and only if $s^{d\_i}D\_i(s,t/s)$ has degree $0$ or $1$ (in
$s$). This is equivalent to the following: either (1)
every monomial of $D\_i(x,y)$ has $x$-degree minus $y$-degree equal to
$0$ or $1$, or
(2) every monomial of $D\_i(x,y)$ has $x$-degree minus $y$-degree equal
to $0$ or $-1$. An example is
 $$ F(x,y)=\frac{1}{(1-xy-x^2y+2x^3y^2)(1+xy^2-x^3y^3-5x^3y^4)}. $$


It seems plausible to me (and perhaps not so difficult to prove) that
the above sufficient condition is also "essentially necessary." This
means that we need to exclude such examples as (1) $F(x,y)=H(x^k,y^k)$,
where $k\geq 2$ and $H$ satisfies the condition above, (2)
"degenerate" examples like $F(x,y)=1/(1-xy^4+2x^2y^3-5x^5y^7)$, whose
diagonal is just $1$.


