Solution (source code)

= Solution

On the <complex torus> $\mathbb C/\Lambda$, the <Weierstrass elliptic function> $\wp$ is a degree-two map to the <Riemann sphere>, and its fibres are the pairs $\{z,-z\}$, with coalescence at the four branch points. An even <elliptic function> is constant on every fibre, so away from those branch points it descends to a meromorphic function $Q$ of $\wp$.

The descent also holds at a branch point. At a half-period $h$, evenness and periodicity give $f(h+u)=f(h-u)$, so its local <Laurent series> uses only even powers of $u$. Also $\wp(h+u)-\wp(h)$ is a local coordinate proportional to $u^2$. At $0$, use $1/\wp(z)\sim z^2$ instead. Thus $Q$ extends meromorphically across every branch point and infinity. Every <meromorphic function> on the <Riemann sphere> is a <rational function>, proving $f=Q\circ\wp$.

For a nonconstant rational function $Q=p/q$ in coprime form, $\deg Q=\max(\deg p,\deg q)$: a generic equation $p-wq=0$ has that many roots on the sphere. Degrees of holomorphic maps multiply under composition. Hence \b[the degree is]
$$
\boxed{\deg f=2\max(\deg p,\deg q).}
$$
Constant functions have degree zero. Degree two therefore occurs exactly when $Q$ is a <Möbius transformation>:
$$
\boxed{f(z)=\frac{a\wp(z)+b}{c\wp(z)+d},\qquad ad-bc\ne0.}
$$
Conversely every such function is even, elliptic and of degree two.