ArticleslgStudy

mathematics

Hafnian

Hafnian is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Hafnian rather than just read about it. In short: In mathematics, the hafnian is a scalar function of a symmetric matrix that generalizes the permanent. The hafnian was named by Eduardo R.

Key takeaways

  • Hafnian belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Hafnian to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Hafnian from memory before moving on to harder problems.

Reference excerpt

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)."

Definition The hafnian of a 2n×2n symmetric matrix A is defined as

haf⁡(A)=∑ρ∈P2n2∏{i,j}∈ρAi,j, where P2n2 is the set of all partitions of the set {1,2,…,2n} into subsets of size 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.

Basic properties Besides its definition as a sum over perfect pairings, the hafnian of a 2n×2n symmetric matrix A can equivalently be written as

haf⁡(A)=1n!2n∑σ∈S2n∏i=1nAσ(2i−1),σ(2i), where S2n is the symmetric group on {1,2,…,2n}. An equivalent Levi-Civita representation holds for any even-dimensional symmetric matrix V=(Vij)i,j=1N:

haf⁡(V)=12N/2(N/2)!∑i1,…,iN=1N|ϵi1⋯iN|Vi1i2⋯ViN−1iN, where N is even. The hafnian also admits a fermionic (Berezin integral) representation. If V is a symmetric 2L×2L matrix and χi,χ¯i are Grassmann variables, then

∫D(χ,χ¯)exp⁡[12(χχ¯)𝖳V(χχ¯)]=haf⁡(V), where

(χχ¯)𝖳=(χ¯1χ1,…,χ¯2Lχ2L) and

D(χ,χ¯)=dχ1dχ¯1⋯dχ2Ldχ¯2L. For low-dimensional examples,

haf⁡(V11V12V12V22)=V12, and for a 4×4 symmetric matrix,

haf⁡(V11V12V13V14V12V22V23V24V13V23V33V34V14V24V34V44)=V12V34+V13V24+V14V23. A useful scaling property is the following. If V=(Vij) and S=(Sij) are symmetric matrices such that

Vij=gigjSij, then, for even N,

haf⁡(V)=(∏i=1Ngi)haf⁡(S). In particular, if V=gS for a scalar g, then

haf⁡(gS)=gN/2haf⁡(S). The hafnian of the adjacency matrix of a graph counts its perfect matchings (also known as 1-factors). Indeed, a partition of {1,2,…,2n} into subsets of size 2 is equivalent to a perfect matching of the complete graph K2n. The hafnian is closely related to the permanent. In particular,

per⁡(C)=haf⁡(0CC𝖳0). Thus, just as the hafnian counts perfect matchings in a graph from its adjacency matrix, the permanent counts matchings in a bipartite graph from its biadjacency matrix. The hafnian is also related to moments of multivariate Gaussian distributions. By Wick's probability theorem, for a real 2n×2n symmetric matrix A,

haf⁡(A)=𝔼(X1,…,X2n)∼𝒩(0,A+λI)[X1⋯X2n], where λ is any number large enough that A+λI is positive semi-definite. Since the hafnian does not depend on the diagonal entries of the matrix, the expectation on the right-hand side is independent of the choice of λ.

Generating function Let S=(ACC𝖳B)=S𝖳 be an arbitrary complex symmetric 2m×2m matrix composed of four m×m blocks A=A𝖳, B=B𝖳, C and C𝖳. Let z1,…,zm be a set of m independent variables, and let Z=(0diag(z1,z2,…,zm)diag(z1,z2,…,zm)0) be an antidiagonal block matrix composed of entries zj (each one is presented twice, one time per nonzero block). Let I denote the identity matrix. Then the following identity holds:

1det⁡(I−ZS)=∑{nk}haf⁡S~({nk})∏k=1mzknknk! where the right-hand side involves hafnians of (2∑knk)×(2∑knk) matrices S~({nk})=(A~({nk})C~({nk})C~𝖳({nk})B~({nk})), whose blocks A~({nk}), B~({nk}), C~({nk}) and C~𝖳({nk}) are built from the blocks A, B, C and C𝖳 respectively in the way introduced in MacMahon's Master theorem. In particular, A~({nk}) is a matrix built by replacing each entry Ak,t in the matrix A with a nk×nt block filled with Ak,t; the same scheme is applied to B, C and C𝖳. The sum ∑{nk} runs over all k-tuples of non-negative integers, and it is assumed that haf⁡S~({nk=0|k=1…m})=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/det⁡(I−ZS), is in fact a multivariate generating function for a series of hafnians, and the right-hand side constitutes its multivariable Taylor expansion in the vicinity of the point z1=…=zm=0. As a consequence of the given relation, the hafnian of a symmetric 2m×2m matrix S can be represented as the following mixed derivative of the order m:

haf⁡S=(∏k=1m∂∂zk)1det⁡(I−ZS)|zj=0. 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:

1det⁡(I−diag(z1,z2,…,zm)C)=∑{nk}per⁡C~({nk})∏k=1mzknknk! Note that MacMahon's Master theorem comes as a simple corollary from the hafnian generating function identity due to the relation per⁡(C)=haf⁡(0CC𝖳0).

Non-negativity If C is a Hermitian positive semi-definite n×n matrix and B is a complex symmetric n×n matrix, then

haf⁡(BCC‾B‾)≥0, where C‾ denotes the complex conjugate of C. A simple way to see this when (CBB‾C‾) is positive semi-definite is to observe that, by Wick's probability theorem, haf⁡(BCC‾B‾)=𝔼[|X1…Xn|2] when (X1,…,Xn) is a complex normal random vector with mean 0, covariance matrix C and relation matrix 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 using the relation per⁡(C)=haf⁡(0CC𝖳0).

Loop hafnian The loop hafnian of an m×m symmetric matrix is defined as

lhaf⁡(A)=∑ρ∈ℳ∏(i,j)∈ρAi,j where ℳ is the set of all perfect matchings of the complete graph on m vertices with loops, i.e., the set of all ways to partition the set {1,2,…,m} into pairs or singletons (treating a singleton (i) as the pair (i,i)). Thus the loop hafnian depends on the diagonal entries of the matrix, unlike the hafnian. Furthermore, the loop hafnian can be non-zero when m is odd. 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. 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×m symmetric matrix can be expressed as

lhaf⁡(A)=𝔼(X1,…,Xm)∼𝒩(diag⁡(A),A+λI)[X1…Xm], where λ is any number large enough to make A+λI positive semi-definite.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Hafnian

Start with the simplest possible case. Write down what Hafnian claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Hafnian before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Hafnian ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Hafnian

In research
Hafnian appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Hafnian in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Hafnian is common in secondary-school and first-year university syllabi. It links to neighbouring topics Algebraic graph theory, Combinatorics, Matching (graph theory), so understanding it makes those chapters shorter.
In everyday life
Look for Hafnian outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Hafnian” →

How to study Hafnian in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Hafnian means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Hafnian out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Hafnian in simple terms?

In mathematics, the hafnian is a scalar function of a symmetric matrix that generalizes the permanent. The hafnian was named by Eduardo R.

Why does Hafnian matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Hafnian?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Hafnian.

Tags

  • Algebraic graph theory
  • Combinatorics
  • Matching (graph theory)

Keep exploring