An Interesting Little Thing about the CVM Entropy (with Code)
The 2-D CVM Entropy and Free Energy Minima when the Interaction Enthalpy Is Zero:
Today, we transition from deriving the equations for the Cluster Variation Method (CVM) entropies (both 1-D and 2-D) to looking at how these entropies fit into the overall context of a free energy equation.
Let’s start with entropy.
The truly important thing about entropy is that it gives shape and order to the universe.
Now, this may seem odd to those of us who’ve grown up imbibing a thinly-understood notion of entropy, and see it (solely) as the great force of dispersion in the universe. Yes, we can interpret entropy (sort of) as a tendency towards randomness or disorder.
The truth is a bit more subtle than this.
Entropy is not so much a tendency towards randomness, as it is a tendency towards the maximal number of microstates. The system configuration with the maximal number of microstates gives a corresponding maximum to the entropy, or minimum to the neg-entropy.
The great ruling law of the ‘Verse is that a system will move towards a free energy minimum, and this free energy minimum is largely dictated by the entropy term.
Recall that free energy equals enthalpy (an energy term) minus temperature times entropy. So, the free energy minimum, or equilibrium state, is going to be the entropy maximum (because we use negative entropy), adjusted by the enthalpy term.
The universe relies on the entropy having a maximum. This allows the free energy to have a minimum, which makes equilibrium possible. The very existence of an entropy maximum (negentropy minimum) is what brings some sense of law, order, and stability to the ‘Verse.
So as a first step, let’s revisit the entropy curve for a simple, bi-state system – one where we only consider whether units are on or off, and we’re not paying any attention to configuration variables.
Case in Point – Simple Entropy
If you meditate on entropy while drinking your morning coffee, or having an evening nightcap, then you won’t need Figure 1, showing the simple negentropy curve for a bistate system.
For most of us, though, it’s nice to have a visual reminder. Figure 1 shows us a very nicely-defined negentropy curve. Even if we add in all sorts of other things (due to enthalpy), it should still be pretty easy for a system to find its way to the minimum with this nice, deep negentropy curve dominating the game.
The equations for this simple bistate entropy are
where
For the simple bistate entropy, where x1 + x2 = 1.0, we can write this entropy equation as
The next step is to consider this entropy curve in the context of the overall free energy equation. There’s an interesting little gotcha that deserves our attention.
The End Game – Finding the Free Energy Minimum
Our purpose today is to think more broadly about how we’ll use the free energy equation, once we have our CVM entropies inserted into this equation. As a necessary precursor, let’s look at the free energy without the CVM approach; just singleton on and off nodes, no pairwise or triplet entropies.
Let’s write down a simple equation for an Ising spin lattice, which is a system where we define the free energy as enthalpy minus entropy.
Note that I’m using reduced equations here. The crucial bar over the key terms , , and means that F, H, and S are reduced terms. Reduced terms have been divided through by temperature (T) and the total number of units (N), along with Boltzmann’s constant (k), so they are dimensionless. The model exists in its own immutable space; no reference to physical constraints such as temperature or numbers of units in the system.
We’ve already looked at the entropy term. The most important thing to keep in mind is that entropy is parameter-free. All knob-turning in our system comes from the enthalpy terms, or energies associated with the units.
We have two kinds of enthalpy:
- Activation enthalpy – every unit that is active or in the on state (state A) contributes a bit of activation enthalpy to the whole system, so we measure this as a simple parameter times the total fraction of on units (x1), and
- Interaction enthalpy – units interact with each other, and we typically use a minus sign in front of the interaction enthalpy parameter so that these interactions reduce the total free energy; we approximate the interaction enthalpy that each on unit has as a simple parameter times the fraction of on units, and since we have this for every instance of an on unit, we wind up with the fraction of on units being squared; this gives us a parameter times the square of the total fraction of on units (x1).
This gives us the total (reduced) free energy equation as
where the activation enthalpy is given as , and the interaction enthalpy is given as . Notice that if we want a pairwise interaction between two on units to reduce the free energy, then we use a positive value for , as we’re subtracting it in the free energy equation. Since we’re working with the situation where on units have higher energy than off units, is always positive.
Let’s see what happens when we put some simple values into the free energy equation:
and
We can see what happens in the following Figure 2.
The important things to notice in Figure 2 are the entropy (blue, labeled ‘c’) and free energy (black, labeled ‘d’) curves.
The free energy curve is significantly shallower, compared with the entropy. In fact, between the x1 values of 0.1 and 0.5, the entropy value has a downward drop of about 0.37, and the free energy curve only a corresponding drop of about 0.21. We could play more with our epsilon parameters, but this shows a point.
The depth of our free energy curve is shaped by the activation and interaction enthalpy parameters.
If we’re going to use the free energy in a practical sense, that means that we’ll want our system to move towards a free energy minimum. That means that the free energy minimum should be relatively easy to find. Also, to have some semblance of reality, this minimum should be well-defined, and not broad and shallow. We want more of a bowl-shape than a saucer.
If we’re not careful with our epsilon parameters, we can move our free energy into a “saucer-shape,” which is not very practical.
This is not too important when we’re just dealing with a simple Ising model, and don’t have any configuration variables influencing the entropy term. In particular, when we have a simple Ising model, the entropy term is immutable – it is in no way affected by the interaction enthalpies.
However, when we move into the CVM world, things might be a bit different, because for any combination of epsilon parameters, there is (of course) a free energy. Given any pair of epsilon values, or any specification for the fraction of on units and an interaction enthalpy parameter, we can computationally find the free energy minimum associated with that pair. It’s just that to get the entropy term yielding this free energy minimum, we typically have to do a lot of swapping on and off units, refining the local pair and triplet configurations. As we do this, we change the configuration variables. When we change the configuration variables, we change the entropy. As we change the entropy, and keep only those changes resulting in a free energy minimum, we can move towards the system-wide free energy minimum. (Assuming that we don’t get caught in a local minimum; kind of like a sand trap.)
Much more subtle and complex.
As a first foray into these woods, though, we’re not going to do any node-swapping. We’re just going to look at one of the two cases where we have clean, clear analytic results. We want to get familiar with the shape and feel of the various contributions to our CVM entropy equation.
The Equations
You may recall the entropy definition from several blogposts ago, for the 2-D Cluster Variation Method (CVM). (Hah! You know I’m just being physicist-snarky with you. It’s taken me forever to have this equation firmly locked and loaded in my brain.)
Here’s the entropy, in the context of the free energy for a 2-D CVM system. We discussed this in The Big, Bad, Scary Free Energy Equation (and New Experimental Results).
where
and
and where
{Note: In previous posts and articles I’ve used G instead of F; the “G” refers to Gibbs Free Energy, but the distinction between Gibbs and Helmholtz free energies vanishes when we go into the more abstract, reduced space. I also have introduced a factor of 2 here in the interaction enthalpy term; this corresponds with the formalism used by Kikuchi and Brush (1967, Eqn. I.17); I’ve played with different versions of the interaction enthalpy. I haven’t gone back to previous posts to adjust the terms and make everything consistent. Just bear with me, please.}
Once again, the key terms and have that crucial “bar” over the F and the S; meaning that they are reduced terms. As with the simple bistate system, our reduced terms have been divided through by temperature and the total number of units, along with Boltzmann’s constant, so they are dimensionless. The model exists in its own immutable space; no reference to physical constraints such as temperature or numbers of units in the system.
The last two terms, and , are Lagrange factors and are introduced in order to help solve for a particular solution. We don’t need to think about them right now.
The leading two terms, involving two different epsilons, give us (respectively) the activation-enthalpy and the interaction-enthalpy terms for the system. The middle term is the entropy; it’s the one involving all the Lf(v) terms, where v can refer to any of the configuration variables; x(i), y(i), w(i), and z(i).
The following Figure 3 illustrates these configuration variables.
I discussed these configuration variables a few blogposts ago; in Expressing Total Microstates (Omega) for the 1-D Cluster Variation Method – Part 1. Also, I continued this discussion – and gave the Omega equation (which yields the entropy equation) in the subsequent post; see Expressing Total Microstates (Omega) for the 1-D and 2-D CVM (Part 2).
Thus, we know what we’re looking for. We want a nicely-shaped negentropy equation, with a clearly-defined minimum. This lets the system find its free energy minimum, or equilibrium point, with relative ease.
Looking at the Different Entropies
All the results being presented here are for a very special case. It’s the case where there is no interaction enthalpy, at all. All the units live in isolation, so to speak. The epsilon term involving the various z(i) configuration variables is set to zero; .
When the interaction enthalpy is zero, then – if we know the fraction of units in the on (active) state – then we can compute all the other configuration variables. This becomes a simple probability distribution.
For example, if x1 (the fraction of units in the active state) = 0.2, then of course x2 = 0.8. Moreover, the fraction of nearest-neighbors that are both in state A (A–A nearest neighbor pairs) is given as y1= x1*x1 = 0.2*0.2 = 0.04, etc. Using simple probabilities, we can easily fill in the entire values-table for the configuration variables.
Interestingly, from Figure 4, we see that while there is a nice negentropy minimum associated with the first curve (a), for the x configuration variables, the negentropy curves for the y (pairwise) and z (triplet) configurations have even deeper minima. (Notice that for the case where there is no interaction enthalpy, the values for the w next-nearest-neighbor pairs are the same as for the y nearest-neighbor pairs, so the w-negentropy curve is not show here.)
Let’s combine our entropy terms according to the entropy equation for the 2-D CVM system given just above. The following Figure 5 shows three entropy curves:
- (a): 2*Lf(y) + Lf(w)
- (b): 2*Lf(z) + Lf(x)
- (c): 2*Lf(y) + Lf(w) – 2*Lf(z) – Lf(x), which is the entropy for the 2-D CVM system.
The curve labeled (c), at the top of the graph, is the full 2-D CVM entropy, for the case where the interaction enthalpy is zero. It looks very shallow – but when we take a closer look we see that it is exactly the same as the first figure in this post; the simple bistate system.
Just to make that clear, here are the two results side-by-side in Figure 6.
When the interaction enthalpy is zero, the CVM entropy is the same as the entropy when only the x configuration variables are involved; it is the same as the basic Ising system.
What this tells us is that we can think of the entropy terms for the pairwise and triplet configuration variables as modifying a core entropy expression for the entropy for just the x values. Put another way, we can mentally group the entropy terms as follows
The GitHub links at the end of this post provide a link to Python 3.6 code used to generate these results, and also to the PPT deck summarizing these results. (The PPT deck includes all of the figures given here, with the exception of the first entropy equation and the table showing all the configuration variables.)
What’s Up Next (Spoiler Alert!)
We want to characterize the 2-D CVM entropy, as a function of various configuration variables. More specifically, we want to see the free energy for the 2-D CVM system. This will involve two parameters:
- epsilon0 – governing the activation enthalpy, and
- epsilon1 – governing the interaction enthalpy.
While the entropy equation itself is parameter-free, the set of configuration variables that contribute to the free energy minimum for any pair of epsilon parameters are influenced by these parameters. This introduces a complexity.
To achieve the free energy minimum for any given pair of epsilons , we need to make a “best guess” for the configuration variables in an actual 2-D CVM grid, and then start node-swapping until we come to a real minimum. This is where the object-oriented code that I’ve been discussing lately comes into play. (See Object-oriented for the CVM Continued (and an Oops!).)
What I’ve done so far is an approximation for the entropy and free energy, using code that didn’t quite count ALL the pairwise and triplet configurations in a 2-D CVM grid. (Leading to the “oops!” referenced in that blogpost above.)
Before moving into full-fledged code for hit-and-miss (random) attempts to seek free energy minima, we can take some steps to bound the problem. By constraining the allowed values for either of the two epsilon parameters, we can see how the entropy and free energy equations play out around the edges, so to speak.
In this post, we looked at the entropy and free energy for the case where epsilon1 = 0, or . This is the case where there is no interaction enthalpy.
In previous works, I’ve looked at the case where the activation enthalpy was zero; or epsilon0 = 0, or . In this case, we can derive an analytic expression for the configuration variables in terms of the interaction enthalpy. (See Maren (2016), link below.)
The problem with that solution is that it is limited strictly to the case where x1 = x2 = 0.5. The solution is valid, but systems with that composition are a little … crowded. It’s hard to play with topographies that are interesting, such as a continuum between scale-free to rich-club. Further, we don’t want to live only in the very constrained world of equiprobable x1 and x2 values; that’s just way too limiting.
However, we can use the results from that analytic solution to define another “edge,” giving us the set of configuration variables yielding a free energy minimum for a given value of the interaction-enthalpy.
Put together, this gives us a framework; a set of two edges on a phase space.
Our next job is to start filling in the intermediate values; we want to identify the configuration variables that yield a free energy minimum for any specified epsilon pair.
We can bound this investigation just a little bit; there are some values for the interaction enthalpies that will not interest us. Similarly, we will keep the activation enthalpy to a reasonable value also.
The reason for this latter step is that we don’t want to get very close to extreme values for x1. It’s not just that we’re operating in the realm of an entropy that is not too likely to give us valuable free energy minima. (See Figure 1.) It’s more that I’m going to approach this computationally, and that means working with a 2-D CVM grid where we approach free energy minima by doing actual node-swapping.
For the equations to work, we need at least one instance of EACH of the configuration variables. For example, we can’t let z1 (the A–A–A triplet) go to zero. But if we construct a system with a very small number of A nodes (x1 is very small), then that’s something that could happen.
In just a short while, we’ll be going back to some experimental runs that use a 16×16 node 2-D CVM system. (I choose this because it’s large enough to give us something interesting to examine, and small enough so that we can see the individual nodes and local patterns in a single grid. Anything with finer resolution would just be too tedious.)
Imagine that we had x1 = 0.1, or just 10% of the total nodes were in the on state. Then, we’d have (on a simple probabilistic basis), y1 = 0.1*0.1 = 0.01, and z1 = 0.1*0.1*0.1 = 0.001. Out of 256 nodes total, that would give us just two or three z1 triplets. Random (or even heuristically-driven) node swapping runs the risk of removing those triplets.
So … the next step will be to scope and frame our phase space, and identify what we can expect as we play with the epsilon value pairs. Then, we do some actual experiments and obtain the configuration values for different epsilon pair sets.
There’s something worth noting, before closing out today. This plan seems like a lot of work, and it is. A fair bit of computational crunch will be involved.
Once completed, though, this will be like storing multiplication tables. That is, once the configuration variables have been identified for any pair, then those values are stable. Forever.
This means that if we have a grid of nodes, in any configuration, and if we specify the values, then we know what set of configuration variables we want in order to bring the grid into a free energy equilibrium. That means that we can adjust configurations to move towards desired configuration variables, and don’t have to keep track of where we are in free-energy-space. We would know, in advance, that if we can achieve a certain configuration variable set, then free energy equilibrium is guaranteed.
This opens up the path to using heuristics to guide node selection, and not just random picks.
This is a “plot summary” for the next little while.
Once we actually HAVE a 2-D CVM grid where we can achieve the desired configuration variables for a given epsilon pair … ah! That opens up a brand new story!
Live free or die, my friend –
AJ Maren
Live free or die: Death is not the worst of evils.
Attr. to Gen. John Stark, American Revolutionary War
Key References
Cluster Variation Method – Essential Papers
- Kikuchi, R. (1951). A theory of cooperative phenomena. Phys. Rev. 81, 988-1003, pdf, accessed 2018/09/17.
- Kikuchi, R., & Brush, S.G. (1967), “Improvement of the Cluster‐Variation Method,” J. Chem. Phys. 47, 195; online as: online – for purchase through American Inst. Physics. Costs $30.00 for non-members.
- Maren, A.J. (2016). The Cluster Variation Method: A Primer for Neuroscientists. Brain Sci. 6(4), 44, https://doi.org/10.3390/brainsci6040044; online access, pdf; accessed 2018/09/19.
The 2D CVM – Code, Documentation, and V&V Documents (Including Slidedecks)
- GitHub for 2-D CVM Entropy with No Interaction Enthalpy
- Code: 2D-CVM-simple-eq_no-interaction-calc_v2_2018-10-27.py (Python 3.6; self-contained). New code. Nothing fancy; NO object-oriented programming, just simple straightforward computations; those used to produce the figures in this blogpost.
- Documentation / V&V: 2-D_CVM_No-interaction-enthalpy_2018-10-29.pptx (contains all the new figures shown in this blogpost)
Previous Related Posts
- Expressing Total Microstates (Omega) for the 1-D and 2-D CVM (Part 2)
- Expressing Total Microstates (Omega) for the 1-D Cluster Variation Method – Part 1
- Wrapping Our Heads around Entropy
- Figuring Out the Puzzle (in a 2-D CVM Grid).
- 2-D Cluster Variation Method: Code Verification and Validation
- The Big, Bad, Scary Free Energy Equation (and New Experimental Results)
One thought on “An Interesting Little Thing about the CVM Entropy (with Code)”