Fireflies?
Did you ever see fireflies flashing in the night? If so, did you notice anything special about them?
If you did, you might have noticed that their light seems to blink in a synchronized manner, almost like a dance.
What if I told you that, using just a very slightly modified version of what we just saw, we can explain this synchronized flashing of fireflies?
Extending the Ising model
So far, we saw how to describe magnets using the Ising model.
But I just told you that using a generalization of this model, we could also describe fireflies. Try to think about how we could do this.
Let's first talk about the Ising model, again. Trust me on this. A core approximation that we did was to consider the spins of every atoms (their tiny arrows) only either pointing up or down, that is S_j = \pm 1. However, in real life, spins are not limited to just two values: they can point in any direction.
Here, we represent 2D spins to simplify the simulations, but the model can be extended to 3D spins.
To simplify a bit, instead of talking about vectors, we describe each atom by an angle to, let's say, the horizontal axis. Therefore, instead of using \color{electron}{S}_j to describe the atom j, we use the angle \color{electron}{\theta}_j. What is nice about this, is that now this angle is no longer just \pi/2 (up where S_j =\,+1) or -\pi/2 (down where S_j =\,-1), but can take any value in between, making it continuous.
We can now rewrite our earlier algorithm as the equation
\frac{\mathrm{d}\color{electron}{\theta}_j}{\mathrm{d}t} = \color{coupling}{K} \sum_{j' \mathrm{\ that\ are}\atop \mathrm{\ neighbors\ of\ } j} \sin(\color{electron}{\theta}_{j'} - \color{electron}{\theta}_j).Let's break this down:
- The notation \mathrm{d}\color{electron}{\theta}_j/\mathrm{d}t means that we are looking at how the angle of j changes over time.
- The term \sin(\color{electron}{\theta}_{j'} - \color{electron}{\theta}_j) tells us about the interactions:
- If the angle of j is larger than the angle of j' (j is ahead of j'), the sinus is negative, so \color{electron}{\theta}_j will tend to decrease: j will try to slow down for j'.
- Conversely, if the angle of j is lower compared to the one of j' (j is behind j'), the sinus is positive, so \color{electron}{\theta}_j will tend to increase: j will try to catch up with j'.
- The positive interaction strength constant \color{coupling}{K} measures how strongly the neighbors influence each other. If K is large, the arrows will tend to align more quickly than if it's small.
2D Ising Model
Here below is the simulation of this 2D Ising model, where each atom is represented as an arrow. Try to change the interaction strength K using the slider, and see what happens.
And... I think that we forgot about our last, and most important, ingredient!
Where is the temperature?
To add it, we can simply add a term in \sqrt{\color{temperature}{T}} times a factor \eta(t). This \eta(t) term will randomly change the angle of each atom at each time t, simulating the effect of thermal fluctuation.
For more informations...
Temperature dependence
The fact that we took the square root of the temperature is a bit technical, but it is a common way to model thermal fluctuations in physics. These types of equations are called stochastic spin dynamics, and here more particularly, the Langevin-Landau-Gilbert equation.
So our final equation becomes the so-called XY model\frac{\mathrm{d}\color{electron}{\theta}_j}{\mathrm{d}t} = \color{coupling}{K} \sum_{j' \mathrm{\ that\ are}\atop \mathrm{\ neighbors\ of\ } j} \sin(\color{electron}{\theta}_{j'} - \color{electron}{\theta}_j) + \eta(t) \sqrt{\color{temperature}{T}}.
XY Model
The same model as before, but now with the temperature T. Try to play with these two sliders. Now, the arrows should be moving around.
As I don't want to go into too much detail in this article, let's continue by finally talking about... fireflies!
For more informations...
BKT transition
The main difference with the previous 1D Ising model is that the XY model has a continuous symmetry, meaning that the arrows can point in any direction, not just up or down.
A mathematical theorem known as the
Mermin-Wagner theorem, explains why this continuous symmetry is important:
- For 3D spins, we recover a phase transition pretty similar to the Ising one.
- For 2D spins, however, a new phase transition appears, called the Berezinski-Kosterlitz-Thouless (BKT) transition, which is a bit more subtle than the one we saw in the Ising model. It is no longer a simple change from ordered to disordered, but rather a change in the nature of the order itself.
The synchronisation of fireflies
That's very nice, but what does it have to do with fireflies?
Let's start by thinking about it for a bit.
First let's change our perspective a little. Instead of thinking of a firefly as a complex organism, we can think of it as a little arrow that constantly rotates. When it is, let's say, pointing up, the firefly flashes.
So now, synchronisation of flashes of fireflies can be seen as if the little arrows of the fireflies are trying to align with each other... And this is exactly what the XY model describes!
Biologically, fireflies try to mimic the flashing rate of their neighbors. This occurs to be a strategy to maximize the chances of finding a mate, or reduce predation risk: a predator seeing a whole group of flashing fireflies might be confused, and not be able to focus on a single one.
One Firefly
One firefly is represented by a rotating arrow. When the arrow is up, it flashes.
Try to change the noise T using the slider to see how much the arrow is shaken around.
We can then use the same model as for
magnetism, with a slight change of perspective:
- Fireflies are not atoms arranged in a regular grid. They can freely move in all directions. Moreover, a neighbor of a firefly is now described as any other firefly that is close enough to it.
- The noise T, previously represented how much the arrows were shaken around due to temperature fluctuations. Now, this noise describes how much the fireflies are independent.
- The interaction strength K now describes how strongly a given firefly wants to align with its neighbors.
And... that's it! Just a change of interpretation, nothing more.
Fireflies Synchronisation
Here is the simulation of the fireflies described by our model.
You can change the noise and the interaction strength using the two sliders, and tick the box to show the individual arrows of each firefly.
Hum... why are they never flashing?
Oops! We forgot to add in our equation that each little arrow now rotates continuously over time. We write the speed of the rotation of each firefly as \color{electron}{\omega}_j. So let's add this to our model that becomes\frac{\mathrm{d}\color{electron}{\theta}_j}{\mathrm{d}t} = \color{electron}{\omega}_j + \color{coupling}{K} \sum_{j' \mathrm{\ that\ are}\atop \mathrm{\ neighbors\ of\ } j} \sin(\color{electron}{\theta}_{j'} - \color{electron}{\theta}_j) + \eta(t) \sqrt{\color{temperature}{T}}.
Here, we took the frequency \omega_j of each firefly from a Gaussian distribution.
Fireflies Synchronisation
The same as before, but now with the intrinsic rotation of each firefly activated.
Try to play with the interaction strength slider and see what happens!
In this simulation, the constant displacement of each firefly isn't relevant. I just added it to make the simulation more visually appealing.
If you paid attention, you just saw that the fireflies start to flash in unison when the interaction strength is large enough. However, below a certain threshold, they suddenly stop synchronizing and flash independently. Does this remind you of something? Again, a phase transition!
So now, how do we characterize this?
How do we know when the fireflies are synchronized or not?
The first thing that we can do is put each arrow on one big circle, to see how they are distributed.
Order parameter
The same simulation as before, but we now only draw the arrows of each firefly on a circle. This allows us to see how the arrows are distributed.
Try to change the interaction strength using the slider.
To measure the amount of synchronisation, we can use the same idea as before and define a sort of mean arrow. The length of the arrow now tells us how synchronized the fireflies are: if it is close to 1, they are all flashing in unison. However, if it is closer to 0, they are flashing independently.
For more informations...
Mathematical definition
Mathematically, we can define this mean arrow as a complex number \color{electron}{R} \mathrm{e}^{\mathrm{i}\Phi}, where R is the length of the arrow and \Phi is its angle\color{electron}{R} \mathrm{e}^{\mathrm{i}\Phi} = \frac{1}{N} \sum_{j=1}^N e^{\mathrm{i} \color{electron}{\theta}_j}.
So why not simply take the average of the angles? Because angles are periodic, meaning that if we take the average of two angles that are close to 0 and 2\pi, we would get something close to \pi, which is not what we want. Instead, we use complex numbers to represent the angles, which allows us to take into account this periodic nature.
Order parameter
Same as before, but now we also draw the mean arrow in white that represents the amount of synchronisation.
Then, you guessed it, let's measure this synchronisation amount (the length of the mean arrow) for different values of the interaction strength.
You can also do this for the noise, but will see that it is not as interesting. Here, the main parameter that drives the phase transition, the order parameter, is the interaction strength.
Synchronisation measurement
Try clicking on the graph to see how the fireflies synchronisation amount changes varies with the interaction strength.
Again, what you see is what we observed earlier. There is a sudden change in the synchronisation amount at a certain interaction strength. Below this value, the fireflies are not synchronized, while above it, they flash in unison.
What we observe is then another... phase transition! You guessed it.
This model, called the Kuramoto model, can also be used to describe many other systems, such as neurons firing in the brain, or even the synchronisation of power grids.
Let's recap what we have learned so far. Magnets, fireflies, neurons, power grids... all these systems can be described by a very similar model. And they all exhibit something called a phase transition for a certain parameter (temperature, interaction strength, etc.) which consist of a sudden change in their behavior.
To finish with this article, let's take a look at one last example, which is for me the most visually striking one, fishes.