  The aim of the paper is to formulate a discrete analogue of the claim made by
Alvarez-Gaume et al., realizing the partition function of the free fermion on a
closed Riemann surface of genus g as a linear combination of 2^{2g} Pfaffians
of Dirac operators. Let G=(V,E) be a finite graph embedded in a closed Riemann
surface X of genus g, x_e the collection of independent variables associated
with each edge e of G (collected in one vector variable x) and S the set of all
2^{2g} Spin-structures on X. We introduce 2^{2g} rotations rot_s and (2|E|
times 2|E|) matrices D(s)(x), s in S, of the transitions between the oriented
edges of G determined by rotations rot_s. We show that the generating function
for the even subsets of edges of G, i.e., the Ising partition function, is a
linear combination of the square roots of 2^{2g} Ihara-Selberg functions
I(D(s)(x)) also called Feynman functions. By a result of Foata--Zeilberger
holds I(D(s)(x))= det(I-D'(s)(x)), where D'(s)(x) is obtained from D(s)(x) by
replacing some entries by 0. Thus each Feynman function is computable in
polynomial time. We suggest that in the case of critical embedding of a
bipartite graph G, the Feynman functions provide suitable discrete analogues
for the Pfaffians of discrete Dirac operators.
