Pfaffian

Johann Friedrich Pfaff
Johann Friedrich Pfaff

In mathematics, the determinant of an m-by-m skew-symmetric matrix can always be written as the square of a polynomial in the matrix entries, a polynomial with integer coefficients that only depends on m. When m is odd, the polynomial is zero, and when m is even, it is a nonzero polynomial of degree m/2, and is unique up to multiplication by ±1. The convention on skew-symmetric tridiagonal matrices, given below in the examples, then determines one specific polynomial, called the Pfaffian polynomial. The value of this polynomial, when applied to the entries of a skew-symmetric matrix, is called the Pfaffian of that matrix. The term Pfaffian was introduced by Cayley (1852), who indirectly named them after Johann Friedrich Pfaff.

Explicitly, for a skew-symmetric matrix A,

pf⁡(A)2=det⁡(A),

which was first proved by Cayley (1849), who cites Jacobi for introducing these polynomials in work on Pfaffian systems of differential equations. Cayley obtains this relation by specialising a more general result on matrices that deviate from skew symmetry only in the first row and the first column. The determinant of such a matrix is the product of the Pfaffians of the two matrices obtained by first setting in the original matrix the upper left entry to zero and then copying, respectively, the negative transpose of the first row to the first column and the negative transpose of the first column to the first row. This is proved by induction by expanding the determinant on minors and employing the recursion formula below.

Examples

A=[0a−a0],pf⁡(A)=a.
B=[0ab−a0c−b−c0],pf⁡(B)=0.

(3 is odd, so the Pfaffian of B is 0)

pf⁡[0abc−a0de−b−d0f−c−e−f0]=af−be+dc.

The Pfaffian of a 2n × 2n skew-symmetric tridiagonal matrix is equal to

pf⁡[0a100−a1000000a200−a20⋱⋱⋱0an−an0]=a1a2⋯an.

(Note that any skew-symmetric matrix can be reduced to this form by conjugation with a unitary matrix; see Spectral theory of a skew-symmetric matrix.)

Formal definition

Let A = (aij) be a 2n × 2n skew-symmetric matrix. The Pfaffian of A is explicitly defined by the formula

pf⁡(A)=12nn!∑σ∈S2nsgn⁡(σ)∏i=1naσ(2i−1),σ(2i),

where S2n is the symmetric group of degree 2n and sgn(σ) is the signature of σ.

One can make use of the skew-symmetry of A to avoid summing over all possible permutations. Let Π be the set of all partitions of {1, 2, ..., 2n} into pairs without regard to order. There are (2n)!/(2nn!) = (2n − 1)!! such partitions. A permutation σ specifies a partition

{{σ(1),σ(2)},{σ(3),σ(4)},⋯,{σ(2n−1),σ(2n)}}.

Because of the skew-symmetry of A, all of the 2nn! permutations specifying a given partition contribute the same amount to the sum. Thus the number of terms in the sum can be reduced by picking a single permutation for each possible partition. An element α ∈ Π can be written as

α={(i1,j1),(i2,j2),⋯,(in,jn)}

with ik < jk and i1<i2<⋯<in. Let

πα=[1234⋯2n−12ni1j1i2j2⋯injn]

be the corresponding permutation. Given a partition α as above, define

Aα=sgn⁡(πα)ai1,j1ai2,j2⋯ain,jn.

The Pfaffian of A is then given by

pf⁡(A)=∑α∈ΠAα.

The Pfaffian of a n × n skew-symmetric matrix for n odd is defined to be zero, as the determinant of an odd skew-symmetric matrix is zero, since for a skew-symmetric matrix, det⁡A=det⁡AT=det⁡(−A)=(−1)ndet⁡A, and for n odd, this implies det⁡A=0.

Recursive definition

By convention, the Pfaffian of the 0 × 0 matrix is equal to one. The Pfaffian of a skew-symmetric 2n × 2n matrix A with n > 0 can be computed recursively as

pf⁡(A)=∑j=1j≠i2n(−1)i+j+1+θ(i−j)aijpf⁡(Aı̂ȷ̂),

where the index i can be selected arbitrarily, θ(i−j) is the Heaviside step function, and Aı̂ȷ̂ denotes the matrix A with both the i-th and j-th rows and columns removed. Note how for the special choice i=1 this reduces to the simpler expression:

pf⁡(A)=∑j=22n(−1)ja1jpf⁡(A1̂ȷ̂).

Alternative definitions

One can associate to any skew-symmetric 2n × 2n matrix A = (aij) a bivector

ω=∑i<jaijei∧ej,

where {e1, e2, ..., e2n} is the standard basis of R2n. The Pfaffian is then defined by the equation

1n!ωn=pf⁡(A)e1∧e2∧⋯∧e2n,

where ωn denotes the wedge product of n copies of ω.

Equivalently, we can consider the bivector (which is more convenient when we do not want to impose the summation constraint i<j): ω′=2ω=∑i,jaijei∧ej, which gives ω'n=2nn!pf⁡(A)e1∧e2∧⋯∧e2n.

Odd generalization

A non-zero generalisation of the Pfaffian to odd-dimensional matrices is given in the work of de Bruijn on multiple integrals involving determinants. In particular for any m × m matrix A, we use the formal definition above but set n=⌊m/2⌋. For m odd, one can then show that this is equal to the usual Pfaffian of an (m+1) × (m+1)-dimensional skew symmetric matrix where we have added an (m+1)th column consisting of m elements 1, an (m+1)th row consisting of m elements −1, and the corner element is zero. The usual properties of Pfaffians, for example the relation to the determinant, then apply to this extended matrix.

Properties and identities

Pfaffians have the following properties, which are similar to those of determinants.

Using these properties, Pfaffians can be computed quickly, akin to the computation of determinants.

Miscellaneous

For a 2n × 2n skew-symmetric matrix A

pf⁡(AT)=(−1)npf⁡(A).
pf⁡(λA)=λnpf⁡(A).
pf⁡(A)2=det⁡(A).

For an arbitrary 2n × 2n matrix B,

pf⁡(BABT)=det⁡(B)pf⁡(A).

Substituting in this equation B = Am, one gets for all integer m

pf⁡(A2m+1)=(−1)nmpf⁡(A)2m+1.
Proof of pf⁡(BABT)=det⁡(B)pf⁡(A):

As previously said, A→∑ijAijei∧ej→∧n2nn!Pf(A)e1∧⋯∧e2n. The same with BABT: BABT→∑ijklBikBjlAklei∧ej=∑klAklfk∧fl→∧n2nn!Pf(A)f1∧⋯∧f2n=2nn!Pf(BABT)e1∧⋯∧e2n, where we defined fk=∑iBikei.

Since f1∧⋯∧f2n=det⁡(B)e1∧⋯∧e2n, the proof is finished.

Proof of pf⁡(A)2=det⁡(A):

Since pf⁡(A)2=det⁡(A) is an equation of polynomials, it suffices to prove it for real matrices, and it would automatically apply for complex matrices as well.

By the spectral theory of skew-symmetric real matrices, A=QΣQT, where Q is orthogonal and Σ=[0a100−a1000000a200−a20⋱⋱⋱0an−an0] for real numbers ak. Now apply the previous theorem, we have pf(A)2=pf(Σ)2det⁡(Q)2=pf(Σ)2=(∏ai)2=det⁡(A).

Derivative identities

If A depends on some variable xi, then the gradient of a Pfaffian is given by

1pf⁡(A)∂pf⁡(A)∂xi=12tr⁡(A−1∂A∂xi),

and the Hessian of a Pfaffian is given by

1pf⁡(A)∂2pf⁡(A)∂xi∂xj=12tr⁡(A−1∂2A∂xi∂xj)−12tr⁡(A−1∂A∂xiA−1∂A∂xj)+14tr⁡(A−1∂A∂xi)tr⁡(A−1∂A∂xj).

The following formula applies even if the matrix A is singular for some values of the variable x:

∂∂xkpf⁡(A)=∑1≤i<j≤2n(−1)i+j+1∂Aij∂xkpf⁡(Aîĵ),

where Aîĵ is the (2n−2)×(2n−2) skew-symmetric matrix obtained from A by deleting rows and columns (i,j).

Trace identities

The product of the Pfaffians of skew-symmetric matrices A and B can be represented in the form of an exponential

pf(A)pf(B)=exp⁡(12trlog⁡(ATB)).

Suppose A and B are 2n × 2n skew-symmetric matrices, then

pf(A)pf(B)=1n!Bn(s1,s2,…,sn),wheresl=−12(l−1)!tr((AB)l)

and Bn(s1,s2,...,sn) are Bell polynomials.

Block matrices

For a block-diagonal matrix

A1⊕A2=[A100A2],
pf⁡(A1⊕A2)=pf⁡(A1)pf⁡(A2).

For an arbitrary n × n matrix M:

pf⁡[0M−MT0]=(−1)n(n−1)/2det⁡M.

It is often required to compute the Pfaffian of a skew-symmetric matrix S with the block structure

S=(MQ−QTN)

where M and N are skew-symmetric matrices and Q is a general rectangular matrix.

When M is invertible, one has

pf⁡(S)=pf⁡(M)pf⁡(N+QTM−1Q).

This can be seen from Aitken block-diagonalization formula,

(M00N+QTM−1Q)=(I0QTM−1I)(MQ−QTN)(I−M−1Q0I).

This decomposition involves a congruence transformations that allow to use the Pfaffian property pf⁡(BABT)=det⁡(B)pf⁡(A).

Similarly, when N is invertible, one has

pf⁡(S)=pf⁡(N)pf⁡(M+QN−1QT),

as can be seen by employing the decomposition

(M+QN−1QT00N)=(I−QN−10I)(MQ−QTN)(I0N−1QTI).

Calculating the Pfaffian numerically

Suppose A is a nonsingular 2n × 2n skew-symmetric matrix. Then

pf(A)=i(n2)exp⁡(12trlog⁡((σy⊗In)T⋅A)),

where σy is the second Pauli matrix, In is an identity matrix of dimension n, and the trace is taken over a primary matrix logarithm.

This equality is based on the trace identity

pf(A)pf(B)=exp⁡(12trlog⁡(ATB))

and on the observation that pf(σy⊗In)=(−i)n2. The trace identity assumes that both matrices are nonsingular and skew-symmetric and that a primary matrix logarithm is used.


Since calculating the logarithm of a matrix is a computationally demanding task, one can instead compute all eigenvalues of ((σy⊗In)T⋅A), take the log of all of these and sum them up:

pf(A)=i(n2)exp⁡(12∑k=12nlog⁡λk),

where λk are the eigenvalues of (σy⊗In)TA and the same branch of the complex logarithm is used for identical eigenvalues. This procedure exploits the property that the trace of a matrix function equals the sum of the corresponding function evaluated at its eigenvalues, counted with algebraic multiplicity:

tr⁡log⁡(M)=∑k=12nlog⁡λk,

where M=(σy⊗In)TA. This can be implemented in Mathematica with a single statement:

Pf[x_] := Module[{n = Dimensions[x][[1]] / 2}, I^(n^2) Exp[ 1/2 Total[ Log[Eigenvalues[ Dot[Transpose[KroneckerProduct[PauliMatrix[2], IdentityMatrix[n]]], x] ]]]]]

The eigenvalues of (σy⊗In)T⋅A are generally complex, and the imaginary parts of their principal logarithms lie in (−π,π]. Rounding errors in the computation of the complex phase may introduce a spurious imaginary component when the Pfaffian is real-valued. Moreover, numerical perturbations of repeated eigenvalues near the negative real axis may place them on opposite sides of the branch cut, potentially reversing the sign of the computed Pfaffian.

The eigenvalue-based expression can be further simplified using the identity

exp⁡(12∑k=12nlog⁡λk)=∏k=12nexp⁡(12log⁡λk)=∏k=12nλk,

for nonzero eigenvalues, with the principal values of the complex logarithm and square root. Consequently, the Pfaffian can be expressed as

pf⁡(A)=i(n2)∏k=12nλk.

The product formulation avoids explicit evaluation of logarithms and exponentials and remains well-defined for singular matrices. However, when the eigenvalue magnitudes span several orders of magnitude, the logarithmic formulation may be numerically preferable, as it reduces the risk of intermediate overflow and underflow. Both formulations are susceptible to numerical errors near the branch cut of the complex logarithm and square root.

A further simplification follows from the observation that M=(σy⊗In)TA is a skew-Hamiltonian matrix. Writing B=σy⊗In, and using AT=−A, BT=−B and B2=I2n, one obtains

MTB=−A,BM=−A⟹MTB=BM.

This establishes the skew-Hamiltonian property of M with respect to the transpose rather than the conjugate transpose. Unlike a skew-symmetric matrix, whose nonzero eigenvalues occur in opposite-sign pairs, a skew-Hamiltonian matrix under this definition has eigenvalues of even algebraic multiplicity. The eigenvalues can thus be ordered such that λ2k−1=λ2k for k=1,…,n in exact arithmetic. Grouping the corresponding square roots in pairs yields

pf⁡(A)=i(n2)∏k=12nλk=i(n2)∏k=1n(λ2k−1λ2k)=i(n2)∏k=1n(λ2k)2=i(n2)∏k=1nλ2k=i(n2)∏k=1nλ2k−1+λ2k2.

The square roots are thus eliminated by exploiting the even algebraic multiplicity of the eigenvalues. In finite-precision arithmetic, theoretically identical eigenvalues may differ slightly owing to rounding errors. Taking the arithmetic mean of each pair provides a symmetric estimate of the repeated eigenvalue and avoids the branch-cut ambiguity associated with complex logarithms and square roots. The numerical accuracy of this formulation depends on the conditioning and correct pairing of the computed eigenvalues, while direct multiplication may remain susceptible to intermediate overflow and underflow.

For other efficient numerical algorithms, see Wimmer 2012.

Applications

See also