In mathematics, the hafnian is a scalar function of a symmetric matrix that generalizes the permanent.
The hafnian was named by Eduardo R. Caianiello "to mark the fruitful period of stay in Copenhagen (Hafnia in Latin)."[1]
The hafnian of a
2n x 2n
A
\operatorname{haf}(A)=
\sum | |||||||||
|
\prod\{i,j\\in\rho}Ai,j,
2 | |
P | |
2n |
\{1,2,...,2n\}
2
This definition is similar to that of the Pfaffian, but differs in that the signatures of the permutations are not taken into account. Thus the relationship of the hafnian to the Pfaffian is the same as relationship of the permanent to the determinant.[4]
The hafnian may also be defined as
\operatorname{haf}(A)=
1 | |
n!2n |
\sum | |
\sigma\inS2n |
n | |
\prod | |
i=1 |
A\sigma(2i,
where
S2n
\{1,2,...,2n\}
\sigma\inS2n
\{\{\sigma(2i-1),\sigma(2i)\}:i\in\{1,...,n\}\}
\{1,2,...,2n\}
\sigma
S2n
n!2n
A
The hafnian of an adjacency matrix of a graph is the number of perfect matchings (also known as 1-factors) in the graph. This is because a partition of
\{1,2,...,2n\}
K2n
The hafnian can also be thought of as a generalization of the permanent, since the permanent can be expressed as
\operatorname{per}(C)=\operatorname{haf}\begin{pmatrix} 0&C\\ CT&0 \end{pmatrix}
2n x 2n
\operatorname{haf}(A)=
E | |
\left(X1,...,X2n\right)\simlN\left(0,A+λI\right) |
\left[X1...X2n\right],
λ
A+λI
λ
Let
S=\begin{pmatrix} A&C\\ CT&B \end{pmatrix}=ST
2m x 2m
m x m
A=AT
B=BT
C
CT
z1,\ldots,zm
m
Z=\begin{pmatrix} 0&rm{diag}(z1,z2,\ldots,zm)\\ rm{diag}(z1,z2,\ldots,zm)&0 \end{pmatrix}
zj
I
1 | |
\sqrt{\det(I-ZS) |
(2\sumknk) x (2\sumknk)
\tilde{S}(\{nk\})=\begin{pmatrix} \tilde{A}(\{nk\})&\tilde{C}(\{nk\})
T(\{n | |
\\ \tilde{C} | |
k\}) |
&\tilde{B}(\{nk\})\\ \end{pmatrix}
\tilde{A}(\{nk\})
\tilde{B}(\{nk\})
\tilde{C}(\{nk\})
T(\{n | |
\tilde{C} | |
k\}) |
A
B
C
CT
\tilde{A}(\{nk\})
Ak,t
A
nk x nt
Ak,t
B
C
CT
\sum | |
\{nk\ |
k
\operatorname{haf}\tilde{S}(\{nk=0|k=1\ldotsm\})=1
The identity can be proved by means of multivariate Gaussian integrals and Wick's probability theorem.
The expression in the left-hand side,
1/\sqrt{\det(I-ZS)}.
z1=\ldots=zm=0.
2m x 2m
S
m
\operatorname{haf}S=
m | |
(\prod | |
k=1 |
\partial | |
\partialzk |
).
1 | |
\sqrt{\det(I-ZS) |
The hafnian generating function identity written above can be considered as a hafnian generalization of MacMahon's Master theorem, which introduces the generating function for matrix permanents and has the following form in terms of the introduced notation:
1 | |
\det(I-rm{diag |
(z1,z2,\ldots,zm)C)}=
\sum | |
\{nk\ |
Note that MacMahon's Master theorem comes as a simple corollary from the hafnian generating function identity due to the relation
\operatorname{per}(C)=\operatorname{haf}\begin{pmatrix} 0&C\\ CT&0 \end{pmatrix}
If
C
n x n
B
n x n
\operatorname{haf}\begin{pmatrix} B&C\\ \overline{C}&\overline{B} \end{pmatrix}\geq0,
\overline{C}
C
A simple way to see this when
\begin{pmatrix} C&B\\ \overline{B}&\overline{C}\\ \end{pmatrix}
\operatorname{haf}\begin{pmatrix} B&C\\ \overline{C}&\overline{B}\\ \end{pmatrix}=E\left[\left|X1...
2\right] | |
X | |
n\right| |
\left(X1,...,Xn\right)
0
C
B
This result is a generalization of the fact that the permanent of a Hermitian positive semi-definite matrix is non-negative. This corresponds to the special case
B=0
\operatorname{per}(C)=\operatorname{haf}\begin{pmatrix} 0&C\\ CT&0 \end{pmatrix}
The loop hafnian of an
m x m
\operatorname{lhaf}(A)=\sum\rho
l{M}
m
\{1,2,...,m\}
(i)
(i,i)
m
The loop hafnian can be used to count the total number of matchings in a graph (perfect or non-perfect), also known as its Hosoya index. Specifically, if one takes the adjacency matrix of a graph and sets the diagonal elements to 1, then the loop hafnian of the resulting matrix is equal to the total number of matchings in the graph.[7]
The loop hafnian can also be thought of as incorporating a mean into the interpretation of the hafnian as a multivariate Gaussian moment. Specifically, by Wick's probability theorem again, the loop hafnian of a real
m x m
\operatorname{lhaf}(A)=
E | |
\left(X1,...,Xm\right)\simlN\left(\operatorname{diag |
\left(A\right),A+λI\right)}\left[X1...Xm\right],
λ
A+λI
Computing the hafnian of a (0,1)-matrix is
, because computing the permanent of a (0,1)-matrix is #P-complete.[7]
The hafnian of a
2n x 2n
O(n32n)
If the entries of a matrix are non-negative, then its hafnian can be approximated to within an exponential factor in polynomial time.[8]