## October 16, 2022

### Partition Function as Cardinality

#### Posted by John Baez

In classical statistical mechanics we often think about sets where each point has a number called its ‘energy’. Then the ‘partition function’ counts the set’s points — but points with large energy count for less! And the amount each point gets counted depends on the temperature.

So, the partition function is a generalization of the cardinality $|X|$ that works for sets $X$ equipped with a function $E\colon X \to \mathbb{R}$. I’ve been talking with Tom Leinster about this lately, so let me say a bit more about how it works.

Say $X$ is a set where each point $i$ has a number $E_i \in \R$. Following the physicists, I’ll call this number the point’s energy.

The partition function is

$Z = \sum_{i \in X} e^{- E_i/kT}$

where $T \in \mathbb{R}$ is called temperature and $k$ is a number called Boltzmann’s constant. If you are a mathematician, feel free to set this constant equal to $1$.

So, the partition function counts the points of $X$ — but the idea is that it counts points with large energy for less. Points with energy $E_i \gg k T$ count for very little. But as $T \to \infty$, all points get fully counted and

$Z \to |X|$

So, the partition function is a generalization of the cardinality $|X|$ that works for sets $X$ equipped with a function $E\colon X \to \mathbb{R}$. And it reduces to the cardinality in the high-temperature limit.

Just like the cardinality, the partition function adds when you take disjoint unions, and multiplies when you take products! Let me explain this.

Let’s call a set $X$ with a function $E \colon X \to \mathbb{R}$ an energetic set. I may just call it $X$, and you need to remember it has this function. I’ll call its partition function $Z(X)$.

How does the partition function work for the disjoint union or product of energetic sets?

The disjoint union $X+X'$ of energetic sets $E\colon X \to \mathbb{R}$ and $E' \colon X' \to \mathbb{R}$ is again an energetic set: for points in $X$ we use the energy function $E$, while for points in $X'$ we use the function $E'$. And we can show that

$Z(X+X') = Z(X) + Z(X')$

Just like cardinality!

The cartesian product $X\ \times X'$ of energetic sets $E\colon X \to \mathbb{R}$ and $E' \colon X' \to \mathbb{R}$ is again an energetic set: define the energy of a point $(x,x') \in X \times X'$ to be $E(x) + E(x')$. This is how it really works in physics. And we can show that

$Z(X \times X') = Z(X)\, Z(X')$

Just like cardinality!

If you like category theory, here are some fun things to do:

1) Make up a category of energetic sets.

(Hint: I’m thinking about a slice category.)

2) Show the disjoint union of energetic sets, defined as above, is the coproduct in this category.

3) Show the ‘cartesian product’ of energetic sets, defined as above, is not the product in this category.

4) Show that the ‘cartesian product’ of energetic sets, defined as above, gives a symmetric monoidal structure on the category of energetic sets. So we should really write it as a tensor product $X \otimes X'$, not $X\times X'$.

5) Show the category of energetic sets has colimits and the tensor product distributes over them.

6) Show that the category $\mathbf{FinEn}$ of finite energetic sets has finite colimits and the tensor product distributes over them. So, it is a nice kind of symmetric rig category.

7) Show the partition function defines a map of symmetric rig categories

$Z \colon \mathbf{FinEn} \to C^\infty(\mathbb{R})$

where $C^\infty(\mathbb{R})$ is the usual ring of smooth real functions on the real line, thought of as a symmetric rig category with only identity morphisms.

Finally, a really nice fact:

8) Show that for finite energetic sets $X$ and $X'$, $X \cong X'$ if and only if $Z(X) = Z(X')$.

(Hint: use the Laplace transform.)

So, the partition function for finite energetic sets acts a lot like the cardinality of finite sets. Like the cardinality of finite sets, it’s a map of symmetric rig categories and a complete invariant. And it reduces to counting as $T \to +\infty$.

We can generalize 6) to certain infinite energetic sets, but then we have to worry about whether this sum converges:

$Z = \sum_{i \in X} e^{- E_i/k T}$

We can also go ahead and consider measure spaces, replacing this sum by an integral. This is very common in physics. But again, we need some conditions if we want these integrals to converge.

Posted at October 16, 2022 4:12 PM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/3423

### Convergence

Is there a p-adic version where the sum automatically converges? Also, I feel like one should be able to tie this up with L-functions, but I don’t remember enough about those to really know what I mean.

Posted by: Allen Knutson on October 17, 2022 2:11 AM | Permalink | Reply to this

### Re: Convergence

Allen wrote:

Is there a $p$-adic version where the sum automatically converges?

Maybe sometimes it will converge $p$-adically when it doesn’t converge in the usual way, and maybe that can be useful. It’s hard to imagine that it always converges: for a countably infinite set where each point has energy zero the partition function is

$\sum_{i = 1}^\infty 1$

Maybe this converges in the 1-adic topology?

Also, I feel like one should be able to tie this up with L-functions […]

If the set is $\{1,2,3,\dots\}$ and the energy of the $i$th point is $\ln i$, the partition function is the Riemann zeta function (up to a change of variables), and the Euler product formula rewrites it as the partition function of a gas of primes.

Posted by: John Baez on October 18, 2022 12:55 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

How to apply this to black hole thermodynamics? Beacause we know in that case the entropy formula is somehow related to partition in number theory, through the Hardy-Ramanujan approximation…

Posted by: Fen Zuo on October 17, 2022 2:46 AM | Permalink | Reply to this

### Re: Partition Function as Cardinality

I don’t know that connection between black hole entropy and Hardy and Ramanujan’s work, though I may have heard someone talking about it.

Mainly what I want to do is the usual thing we do in category theory: work with the things themselves rather than their decategorified ‘shadows’ like cardinalities, generating functions, elements of Grothendieck groups, etc. We’re seeing that the partition function is just a shadow of the thermodynamic system it’s the partition function of.

Posted by: John Baez on October 18, 2022 1:09 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

A mathematical object being a shadow of a physical object is why physics is useful in the first place. IMO the really salient thing about this stuff is not thermodynamics per se but statistical physics (which of course the partition function is the usual bridge between these two perspectives). To be a broken record: it would be really interesting to take the stuff you’ve done for composing thermodynamical systems and transport it to composing statistical-physical ones, like Glauber-Ising spins. Yes this might be “done in principle” already but the killer app here would be getting a handle on (real-space/Kadanoff style) renormalization, which IMO is the example par excellence of really nontrivial composition in physics.

Posted by: Steve Huntsman on October 18, 2022 2:27 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

The kind of ‘shadow’ I’m talking about here is not the usual way in which math is a shadow of the physical world. I’m talking about a specific sort of simplification maneuver within mathematics: ‘decategorification’. This means working with elements of sets instead of objects in categories, by taking any category and forming its set of isomorphism classes of objects. And this is a maneuver we have been fruitfully undoing lately as our ability to work directly with categories improves. I gave a bunch of examples here:

• John Baez and James Dolan, From finite sets to Feynman diagrams, in Mathematics Unlimited - 2001 and Beyond, vol. 1, eds. Björn Engquist and Wilfried Schmid, Springer, Berlin, 2001, pp. 29–50.

My post here shows that at least for statistical mechanical systems with finitely many states, taking the partition function is exactly nothing other than decategorification.

(The restriction to finitely many states can be dropped at the expense of additional fine print.)

To be a broken record: it would be really interesting to take the stuff you’ve done for composing thermodynamical systems and transport it to composing statistical-physical ones, like Glauber-Ising spins.

Yes, I agree that someone else should do this.

Posted by: John Baez on October 18, 2022 2:43 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Right but what I’m trying to point out is that many descriptions in mathematical physics are (or ought to be) decategorifications. After all, physics is about interaction, which presupposes composition. The partition function is merely one of the easier examples of this, and we should be surprised only if versatile descriptions aren’t decategorifications “all the way down” until we get to a description of reality that is so detailed as to be functionally equivalent to the real thing.

Posted by: Steve Huntsman on October 19, 2022 1:24 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Just to continue ranting, there are three unreasonably effective (in the Wignerian sense) things about mathematics that describe the physical world. The first is that interactions are repeatable, which IMO suggests if not demands mathematical descriptions that are categorical on some level. The fact that decategorified versions are so useful is why mathematics that’s so far from categorical in practice has predominated–viz., analysis. Anyway the second and more mysterious thing is that physical phenomena tend to enjoy separations of scales and interactions, so that it is rare to have multiple phenomena competing. Here the most remarkable thing IMO is that when multiple phenomena do compete you still often get good effective theories. I would guess that these are particularly resistant to categorification.

Posted by: Steve Huntsman on October 20, 2022 2:00 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

I understand. And I believe probably only in this way we can find a universal explanation for black hole entropy. Hardy and Ramanujan’s asymptotic formula is implicitly utilized in many works of black hole, and I learned it from Carlip’s papers, e.g., in https://arxiv.org/abs/gr-qc/0005017, appendix A.

Posted by: Fen Zuo on October 18, 2022 3:51 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

You don’t have to be a mathematician to put $k=1$ — just pick a suitable (natural) system of units!

Posted by: George on October 17, 2022 12:11 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Right, but that takes training. A mathematician needs to be told: “don’t worry, just assume $k = 1$.”

Posted by: John Baez on October 18, 2022 12:46 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

I’ve heard an apocryphal story that during a PhD defense in statistical physics a member of the committee asked what $k$ was, whereupon the student asked “like the actual number?” and could not cite it in SI units, whereupon they were failed. The narrow lesson here is to use $\beta$ instead of $1/k T$!

Posted by: Steve Huntsman on October 18, 2022 2:31 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

… a member of the committee asked what k was, whereupon the student asked “like the actual number?”

Such `variable constants’ (\eg \hbar, Newton’s constant G, \dots) often signal the existence of an interesting real line bundle [but… on what space, Mr Spock… what… space…]? See also dimensional analysis.

Posted by: jack morava on October 20, 2022 7:32 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

I became enlightened when I realized that Boltzmann’s constant in SI units is roughly the reciprocal of Avogadro’s number, and that this is no coincidence.

(It’s off by a factor of about 1/6, but hopefully this remark would have kept me from failing.)

Posted by: John Baez on October 18, 2022 2:47 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

4) Show that the ‘cartesian product’ of energetic sets, defined as above, gives a symmetric monoidal structure on the category of energetic sets.

I recently learned this is the monoidal product for the category of ($G$-)augmented racks! Such a thing is a $G$-set with an equivariant map to $G$, where we take the self-action to be conjugation. For $G$ non-abelian the product of augmented racks gives a non-symmetric braided monoidal structure. But here we are taking $G$ to be the abelian group $\mathbb{R}$, you have the trivial action on your energetic set, and the braiding is a symmetric.

Not especially deep, but just interesting to see this product again.

Posted by: David Roberts on October 18, 2022 1:59 AM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Hmm, that’s weird and interesting. It would be fun if I could figure out a good way to deform the addition on $\mathbb{R}$ into some nonabelian group stucture, but that seems hard.

Posted by: John Baez on October 18, 2022 1:05 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Wondering whether $Z(X \times X') = Z(X) Z(X')$ could be taken as a defining property of the partition function led me to this a couple years ago. (A couple years… Where does the time go?!)

Posted by: Blake Stacey on October 22, 2022 4:48 AM | Permalink | Reply to this

### Re: Partition Function as Cardinality

That’s nice! But can we turn it into a theorem like this?

Conjecture. Any map $Z$ from energetic sets to real numbers which sends isomorphic energetic sets to the same number and obeys $Z(X \times X') = Z(X) Z(X')$ must be of the form

$Z(X) = \sum_{i \in X} e^{-\beta E_i}$

for some $\beta \in \mathbb{R}$ or have $Z(X) = 0$ for all energetic systems.

I added the last option because I noticed that exception, and there may be other exceptions I didn’t notice. I should really write $X \otimes X'$ for the product of thermostatic systems, but I didn’t.

I would find it a lot easier to tackle this conjecture if we included the extra hypothesis

$Z(X + X') = Z(X) + Z(X')$

This would let us break the problem down to energetic sets with just one element; then $Z(X \times X') = Z(X) Z(X')$ gives us Cauchy’s functional equation for $\ln Z$ assuming $Z \ne 0$. This isn’t a proof yet (because of the possibility that $Z(X) = 0$ for some one-element energetic sets but not all), but it’s getting close.

It would be cool if we could drop the additivity, though.

Posted by: John Baez on October 24, 2022 9:26 AM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Just replace $\mathbb{R}$ with $(-\infty,\infty]$ to get rid of the “exception” $Z = 0$ in this conjecture.

Posted by: Steve Huntsman on October 24, 2022 1:40 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Without the extra hypothesis, the assumption in that conjecture is too weak, since the solutions to the functional equation $Z(X \times X') = Z(X) Z(X')$ are closed under products. For example, the squared partition function

$Z(X) = \sum_{i,j} e^{-\beta(E_i + E_j)}$

still satisfies it, but it does not coincide with $Z$ at any temperature since it fails the extra hypothesis.

With the extra hypothesis, the conjecture is almost true: you can replace the exponential by any function satisfying Cauchy’s exponential functional equation, and that characterizes all the $Z$ that satisfy your conditions. So it should become true (and straightforward to prove) if also continuity/measurability/monotonicity is added as an assumption.

This is closely related to a characterization of the moment-generating function of a random variable given as Lemma 5.2 here. It’s also reminiscent of the multiplicative characterization of the $\ell^p$ norms, but obviously Tom will know more about this.

Posted by: Tobias Fritz on October 24, 2022 5:49 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

… and if $Z(X) = 0$ for some one-element $X$, then the multiplicativity implies that $Z$ vanishes on a dense set of single-element energetic sets. So with continuity or monotonicity assumed, it follows that such $Z$ vanishes identically.

Posted by: Tobias Fritz on October 24, 2022 6:17 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Hurrah! I’m happy to use both additivity and multiplicativity as assumptions in characterizing the partition function, because it goes along nicely with the idea that we’re decategorifying a symmetric rig category down to a commutative rig.

Besides, you showed we need both assumptions, so I have to be happy whether I like it or not.

And assuming the partition function is continuous or measurable is fine too.

Posted by: John Baez on October 24, 2022 9:27 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Short of fully decategorifying to a commutative rig, it might also be of interest to decategorify to a preordered commutative rig, where $A \le B$ is defined to hold whenever there is a monomorphism $A \to B$ in the original category (or regular monomorphism, or epimorphism $B \to A$, etc). This is useful because there are powerful separation theorems that can provide accurate information about this preordering in terms of homomorphisms to certain special rigs like $\mathbb{R}_+$ and the tropical reals. You can think of this statement as a rig analogue of the Hahn-Banach theorem, where instead of separating by a linear functional, one separates by a rig homomorphism. I’ve recently applied this idea to the representation theory of $SU(n)$, where it gives a sufficient and close to necessary criterion for when the $n$-th tensor power of one representation contains the $n$-th tensor power of another one for large $n$.

Posted by: Tobias Fritz on October 25, 2022 9:14 AM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Instead of describing the two preorders on energetic sets in terms of their partition functions, it’s easier to use another approach. Isomorphism classes of energetic sets correspond to measures on $\mathbb{R}$ that are finite sums of Dirac deltas. We can write such a measure as

$N = \sum_{x \in \mathbb{R}} n_x \delta_x$

where all but finitely many of the natural numbers $n_x$ are zero.

Then the ‘monomorphism preorder’ says that $M \le N$ iff $m_x \le n_x$ for all $x \in \mathbb{R}$.

The ‘epimorphism preorder’ says that $M \le N$ iff $m_x \le n_x$ and also $m_x = 0 \implies n_x = 0$ for all $x \in \mathbb{R}$.

Bringing in measures is really unnecessary. We could just say that isomorphism classes of finite energetic sets are elements of the free $\mathbb{N}$-semimodule on $\mathbb{R}$ — at least if you’re comfortable with semimodules for semirings (which are the same as rigs). But the measure viewpoint is nice, because then the Laplace transform of the measure is the partition function of the energetic set!

Posted by: John Baez on October 25, 2022 3:04 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Exactly! With that Laplace transform being known as moment-generating function to probability theorists.

That free semimodule description works, but doesn’t capture the multiplicative structure on energetic sets. It may be more interesting to note that the rig of isomorphism classes of energetic sets is the “group rig” of the multiplicative group $\mathbb{R}_{\gt 0}$ with coefficients in $\mathbb{N}$. The universal property of this rig identifies rig homomorphisms out of it with group homomorphisms out of $\mathbb{R}_{\gt 0}$! This is exactly the property that lets us reduce the problem of characterizing the partition function to solving the Cauchy exponential functional equation.

(I knew this before because I’m involved with applying the separation theorems mentioned above to this rig, but with respect to majorization as the preorder, which is of some interest in quantum information theory and in statistics.)

Posted by: Tobias Fritz on October 25, 2022 4:15 PM | Permalink | Reply to this

### Re: Partition Function as Cardinality

Neat! I can think of a couple interesting preorders on energetic sets, which both come naturally from the category of energetic sets that I hinted at in my post (the slice category $\mathsf{Set}/\mathbb{R}$). One comes from epimorphisms and the other from monomorphisms.

In statistical mechanics the first would be used to define ‘quotients’ of physical systems, where some states with the same energy get identified. The second would be used when the set of states of one system is a subset of the set of states of the other, with the same energies.

However, there seems to be a relationship between these two preorders!

Say we have two energetic sets

$E : X \to \mathbb{R}, \qquad E': X' \to \mathbb{R}$

and an epimorphism from the first to the second. Then I think there’s a monomorphism from the second to the first. The converse is not true: this is easy to see in an example. So we seem to be getting two preorders: a stronger one and a weaker one.

This seems to follow from some general abstract nonsense about slice categories of $\mathsf{Set}$ if you assume the axiom of choice, which I’m perfectly happy to do here for various reasons.

Say we have morphism from the first to the second, meaning

$f: X \to X'$

such that

$E = E' \circ f$

I believe this morphism is an epimorphism iff $f$ is onto. Then assuming the axiom of choice we can pick a map

$g: X' \to X$

that’s a section, i.e. such that $f \circ g = 1_{X'}$, and this will automatically have

$E' = E' \circ f \circ g = E \circ g$

so this map will be a morphism of energetic sets from $E': X' \to \mathbb{R}$ back to $E : X \to \mathbb{R}$, which is a right inverse to our original morphism. And I believe it’s a monomorphsm.

It’s fun to think about these two preorders on energetic sets in terms of their partition functions, but this is getting long so I’ll stop here.

Posted by: John Baez on October 25, 2022 11:18 AM | Permalink | Reply to this

Post a New Comment