A simple division-free algorithm for computing Pfaffians
Adam J. Przezdziecki

TL;DR
This paper introduces a straightforward, division-free algorithm for computing Pfaffians that leverages matrix multiplication and truncation, offering efficiency especially for sparse matrices and enabling extraction of related polynomials.
Contribution
The paper presents a novel, simple algorithm for Pfaffian computation that avoids division and adapts the Bird determinant algorithm for this purpose.
Findings
Algorithm has complexity O(nM(n)) for 2n x 2n matrices.
Efficient extraction of characteristic and Pfaffian characteristic polynomials.
Suitable for sparse matrices with optimized dense-sparse multiplication.
Abstract
We present a very simple algorithm for computing Pfaffians which uses no division operations. Essentially, it amounts to iterating matrix multiplication and truncation. Its complexity, for a matrix, is , where is the cost of matrix multiplication. In case of a sparse matrix, is the cost of the dense-sparse matrix multiplication. The algorithm is an adaptation of the Bird algorithm for determinants. We show how to extract, with practically no additional work, the characteristic polynomial and the Pfaffian characteristic polynomial from these algorithms.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
Topicssemigroups and automata theory · Coding theory and cryptography · Cellular Automata and Applications
A simple division-free algorithm for computing Pfaffians
Adam J. Przeździecki
Adam Przeździecki, Warsaw University of Life Sciences—SGGW, Warsaw, Poland
Abstract. We present a very simple algorithm for computing Pfaffians which uses no division operations. Essentially, it amounts to iterating matrix multiplication and truncation. Its complexity, for a matrix, is , where is the cost of matrix multiplication. In case of a sparse matrix, is the cost of the dense-sparse matrix multiplication.
The algorithm is an adaptation of the Bird algorithm for determinants. We show how to extract, with practically no additional work, the characteristic polynomial and the Pfaffian characteristic polynomial from these algorithms.
Mathematics Subject Classification. 15A15.
Keywords. Combinatorial problems, Pfaffian, Division-free algorithms, Characteristic polynomial.
1. Introduction
Let be an matrix. Bird [2] defined
[TABLE]
Given , define , and inductively, . Compared to Bird’s original notation, we increase the upper index by so that becomes equal to the degree of the entries of viewed as homogeneous polynomials in the . He proves
Theorem 1.1** (Bird).**
The matrix is everywhere zero except for its leading entry, which equals .
Let , be two skew-symmetric matrices. Define , and inductively, and . We prove
Theorem 1.2**.**
The matrix is everywhere zero except for its leading entry, which equals .
Thus if we are interested in the Pfaffian of a single matrix , it is enough to set to any matrix whose Pfaffian is and change the sign. In Section 3 we discuss three examples of such matrices and describe how to extract the characteristic polynomial from the Bird algorithm and the Pfaffian characteristic polynomial from our modification.
Clearly, the complexity of computing the determinant or the Pfaffian by means of Theorems or is , where is the complexity of matrix multiplication. We agree with Bird’s claim that “it is difficult to imagine a simpler procedure for computing the determinant”. Recently, Bär [1] published a similarly simple algorithm for the Pfaffian and the Pfaffian characteristic polynomial, but his algorithm is not entirely division-free as it requires division by integers up to half of the dimension of the matrix. Bär remarks that his algorithm can be accelerated to by using ideas from Preparata and Sarwate [7], but this is done at a significant cost to the simplicity of the algorithm.
2. Proof of Theorem 1.2
The result can be proved by an adaptation of Rote’s [8] or Bird’s [2] argument. We choose the latter. For the most part we follow Bird’s notation. Given a word in the alphabet and a matrix , let denote the matrix where is the length of . Note that if is skew-symmetric then so is and for any , we have . An odd permutation of letters in changes the sign of . The proof presented below depends only on the Laplace-type expansion for Pfaffians, (see Fulton and Pragacz [3, Equation D.1, p. 116]):
[TABLE]
where is the word with the symbols in removed.
We derive explicit formulas for the matrices and in terms of the Pfaffians of submatrices of and . Let denote the set of subsequences of of length . We claim that, for skew-symmetric matrices and , the -th entry of and of are
[TABLE]
[TABLE]
where and , , denote the appropriate concatenations of words. Assuming (2.3), we see that is nonempty only for , in which case it has only one element, , and therefore
[TABLE]
The change of sign is caused by the odd permutation of letters in . As in [2] we see that for since contains twice. This shows that (2.3) implies Theorem 1.2.
We prove (2.2) and (2.3) by induction. For we agree that the Pfaffian of a matrix is and we verify (2.2):
[TABLE]
where is the empty word. Verifying (2.3), we see that and
[TABLE]
is the -th entry of the matrix product of the above diagonal part of by , as required.
We use (2.2) and (2.3) as the induction hypothesis and prove their analogues for increased by .
Proof that (2.2) implies (2.3). The diagonal of is null since in (2.2) is null for .
For we use (2.2) to expand the -th entry of :
[TABLE]
In order to show that (2.4) equals the right hand side of (2.3) we use (2.1) to expand the second Pfaffian in (2.3) along its first row/column and obtain
[TABLE]
where denotes the sign of the permutation which brings to the front. Thus (2.3) equals
[TABLE]
To prove that (2.4) equals (2.5) it is sufficient to show
[TABLE]
for every word without repeated letters. The change of sign is due to .
For of even length, we have and if then ; therefore, (2.6) reduces to
[TABLE]
Take and . Then and . Conversely, take and . Then can be inserted in a unique position in to give a word . Furthermore, .
Proof that (2.3) for implies (2.2) for . The -th diagonal element of is
[TABLE]
Applying (2.3) as induction hypothesis, we obtain
[TABLE]
Since and for of odd length, we have
[TABLE]
Using (2.8) we compute the -th entry of :
[TABLE]
We use (2.8) and the induction hypothesis (2.3) to expand the above as
[TABLE]
We intend to prove that (2.9) equals the right hand side of (2.2) for increased by , which is
[TABLE]
For of even length we have and we use (2.1) to expand the first Pfaffian in (2.2) along its first row/column to obtain
[TABLE]
Therefore (2.10) is equal to
[TABLE]
To prove that (2.9) equals (2.11) it is sufficient to show
[TABLE]
for every word without repeated letters. Note the changes of signs on the left, and on the right.
If then and therefore (2.12) reduces to
[TABLE]
This holds by the same argument as in the proof of (2.7).
3. The characteristic and Pfaffian-characteristic polynomials
Both the Bird algorithm and our adaptation to Pfaffians allow extraction of the characteristic polynomials at negligible additional cost.
Proposition 3.1**.**
The coefficients of the characteristic polynomial
[TABLE]
are given by .
Proof.
By [2, Equation (1)] the -th diagonal entry of is
[TABLE]
note that the index is increased by relative to Bird’s original notation. We have
[TABLE]
∎
In the case of the Pfaffian polynomial
[TABLE]
the choice of the skew-symmetric matrix which should play the role of the identity matrix is not obvious. Below we cite three examples of such matrices which are most often met in the literature or for other reasons interesting.
[TABLE]
The Pfaffian of each of these matrices is . The matrix is sparse and it is the easiest one to guess; it is considered for example by Bär [1] and Rote [8]. From the combinatorial point of view, which is closest to the author, the matrix is more interesting since for every we have . For this reason is considered by Rote [8] and by Iwata [4] who also uses . Knus, Merkurjev, Rost and Tignol [5] and Krivoruchenko [6] work with for general, invertible .
We have the following lemma for the Pfaffian of the sum of and another skew-symmetric matrix.
Lemma 3.2** (Stembridge [9, Lemma 4.2]).**
If is as above, then
[TABLE]
The closest analogy for Proposition 3.1 is
Proposition 3.3**.**
The coefficients of the Pfaffian characteristic polynomial
[TABLE]
are given by .
Note that the algorithm uses while in the definition of the polynomial we have .
Proof.
Lemma 3.2 implies
[TABLE]
Equation (2.3) for the pair of matrices , and yields
[TABLE]
hence
[TABLE]
∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] C. Bär, The Faddeev-Le Verrier algorithm and the Pfaffian , Linear Algebra Appl. 630 (2021), 39–55.
- 2[2] R.S. Bird, A simple division-free algorithm for computing determinants , Inform. Process. Lett. 111 (2011), no. 21–22, 1072–1074.
- 3[3] W. Fulton and P. Pragacz, Schubert varieties and degeneracy loci . Lecture Notes in Mathematics, 1689. Springer-Verlag, Berlin, 1998.
- 4[4] S. Iwata, A Pfaffian formula for matching polynomials of outerplanar graphs , Optim. Methods Softw. 36 (2021), no. 2-3, 332–336
- 5[5] M.-A. Knus, A. Merkurjev, M. Rost and J.-P. Tignol, The book of involutions , American Mathematical Society Colloquium Publications, 44. American Mathematical Society, Providence, RI, 1998. xxii+593 pp.
- 6[6] M. I. Krivoruchenko, Trace identities for skew-symmetric matrices , Math. Comput. Sci. 1 (2016), no. 2, 21–28.
- 7[7] F.P. Preparata and D.V. Sarwate, An improved parallel processor bound in fast matrix inversion , Information Processing Lett. 7 (1978), no. 3, 148–150.
- 8[8] G. Rote, Division-free algorithms for the determinant and the Pfaffian: algebraic and combinatorial approaches , Computational discrete mathematics, 119–135, Lecture Notes in Comput. Sci., 2122, Springer, Berlin, 2001.
