Hyperuniformity has lately become a hot topic in condensed matter science, as witnessed by the relevant amount of publications authored in this area, especially with Salvatore Torquato and his group ahead. The classification of disordered systems, which seem at first glance indistinguishable, is one of the most exciting and useful features in the theoretical framework of hyperuniformity. The belonging to a given class of hyperuniformity can actually guide the design of new materials with specific physical properties.
The purpose of this post is to provide a gentle graphical introduction to under-graduated students of the basic concepts behind hyperuniformity detection in 2D systems with the help of Wolfram dynamic interactivity functionalities. It can also be considered as an advanced technical example tutorial for developing complex interactive applications with different controls.
The purpose of this post is to provide a gentle graphical introduction to under-graduated students of the basic concepts behind hyperuniformity detection in 2D systems with the help of Wolfram dynamic interactivity functionalities. It can also be considered as an advanced technical example tutorial for developing complex interactive applications with different controls.
Introduction to Hyperuniformity
Introduction to Hyperuniformity
One of the central tasks in condensed matter physics is the statistical description of density fluctuations in many-particle systems, ranging from eigenvalues of random matrices to galaxies or the distribution of photoreceptors in avians. The hyperuniformity definition is deeply related to the unusual large suppression of density fluctuations at large length scales. The understanding of this point about a couple of decades ago by Torquato’s group was extremely relevant since they could provide condensed matter scientists with universal order metrics for the classification of crystals, quasicrystals, universal gases and disordered materials with special point configurations [1, 2].In order to measure density fluctuations across different scales, one can think of placing a spherical observation window of a given radius R at random locations in the system and counting the number sites N(R) inside this window at each position. Accordingly, the number N(R) fluctuates across the positions in the system as well as the number variance (R)=(R)- associated with it. This is related to a classic number-theoretic problem which is better detailed in Appendix of Ref. [2]
2
σ
N
2
N
2
〈N(R)〉
Observation window, counting and number variance with dynamical interactivity
Observation window, counting and number variance with dynamical interactivity
In order to provide students with a quicker visual grasp of number variance and its central role in the theoretical framework of hyperuniformity, a dynamical representation based on mouse click interactivity can be extremely helpful in this case; we can define it as “discrete-type interactivity” since it relies on a few clicks and not a continuous interaction. After executing the following code cell, the user has just to click at any point inside the graphics: a pink disk will appear representing the observation window and the number of points inside the disk will be stored into the list of N(R) . This will allow for the computation of the mean and the number variance (R). By adding further clicks, other values for the counting N(R) will be appended and and (R) will be updated accordingly. The list can be made empty by pressing the corresponding button in the panel, in order to reset and start again the sampling by clicking again.
〈N(R)〉
2
σ
N
〈N(R)〉
2
σ
N
N(R)
ManipulateColumnDynamicModule[{pt={}},Deploy@EventHandler[g=Framed@Graphics[{Pink,Disk[Dynamic[pt],radius1],Blue,Point@patternAptsdata},PlotRange{{0,300},{300,0}},ImageSize->{310,310}],{"MouseClicked"(pt=MousePosition["Graphics"];(*displayhowmanypointsareinsideadiskregionofagivenradiusandstorethemintocountlist*)countlist=AppendTo[countlist,Count[RegionMember[Disk[pt,radius1]][patternAptsdata],True]])}]],Spacer[10],PaneColumnRow[{Text[Style["N(R) = ",Black,Italic,14]],Dynamic@countlist}],Row[{Text[Style["〈N(R)〉 = ",Black,Italic,14]],Dynamic@N@Mean[countlist]}],Row[{Text[Style["(R)= ",Black,Italic,14]],Dynamic@N[Mean[countlist^2]-Mean[countlist]^2]}],{300,80},ButtonBar[{"Empty counts list"(countlist={};)}],ControlPlacement->{Top},Initialization:>radius1=20;countlist={};(*2Dpointdataset*)patternAptsdata=;
2
σ
Out[]=
As shown in the followings, the hyperuniformity classification scheme revolves around the core idea of analyzing the scaling of the number variance (R) against the system dimensionality in the large limit.
For crystals and quasicrystals, due to their long-range translational and orientational order, one can reasonably expect that the number of sites inside the observation window would not change much, especially in the case of a large window. In fact, the main contribution to the fluctuations in N(R) comes from the boundary (2D) / surface (3D) of the circular (2D)/spherical (3D) window, thus leading for the number variance to the relation(R)∼ where d is the dimensionality of the system. For ideal gases, which are totally uncorrelated systems, one gets instead (R)∼ .
It's easier to understand the different behaviour for either a 2D perfect lattice array or a Poisson spatial point pattern by getting again a visual inspection through dynamical observation window, but in this case it’s better to implement the displacement with a continuous-type interaction driven by the control Slider2D, as shown in the following code.
2
σ
N
d
R
R
For crystals and quasicrystals, due to their long-range translational and orientational order, one can reasonably expect that the number of sites inside the observation window would not change much, especially in the case of a large window. In fact, the main contribution to the fluctuations in N(R) comes from the boundary (2D) / surface (3D) of the circular (2D)/spherical (3D) window, thus leading for the number variance to the relation
2
σ
N
d-1
R
2
σ
N
d
R
It's easier to understand the different behaviour for either a 2D perfect lattice array or a Poisson spatial point pattern by getting again a visual inspection through dynamical observation window, but in this case it’s better to implement the displacement with a continuous-type interaction driven by the control Slider2D, as shown in the following code.
In[]:=
Manipulate[Module[{rd},rd=radius2[[i]];Column[{Row[{Text[Style[" Disk centre",Black,14]],Text[Style[" x = ",Black,Bold,Italic,14]],Style[pt,Black,14],"\t",Text[Style["Counts inside disk",Black,14]],Text[Style[" N = ",Black,Bold,Italic,14]],(*displayhowmanypointsareinsideadiskregionofagivenradius*)Style[Count[RegionMember[Disk[pt,rd]][{squarelatpts,poispts}[[ss]]],True],Black,14]}],Spacer[10],Framed@Graphics[{Pink,Disk[pt,rd],Blue,Point@{squarelatpts,poispts}[[ss]],Red,PointSize[0.025],Point@pt},PlotRange{{-10.5,10.5},{10.5,-10.5}},ImageSize->Medium]}]],{{i,2,"radius "},{1->"2",2->"5",3->"7"},Setter},{{ss,1,"2D set"},{1->"Square lattice",2->"Poisson disordered"},Setter},{{pt,{0,0}},{-10.5,10.5},{10.5,-10.5},Slider2D},ControlPlacement->{Left},Initialization->(radius2={2,5,7};bsq={{0,1},{1,0}};(*Generatelatticepointsfromthesquarelatticebasis*)squarelatpts=Tuples[Range[-10,10],2].bsq;(*pointsfromadataset,disorderedsystemfromPoissonpointprocess*)poispts=RandomPointConfiguration[PoissonPointProcess[0.5,2],Rectangle[{-10.5,-10.5},{10.5,10.5}]][[1,1]]),TrackedSymbols:>(pt),SaveDefinitions->True]
Out[]=
Classes of hyperuniformity in 2D systems
Classes of hyperuniformity in 2D systems
As recalled in the introduction, in a hyperuniform system density fluctuations are suppressed at large length scales (i.e. large radius values) and thus the number variance vanishes for infinitely large windows according to (R)=0. In reciprocal space terms, the necessary and sufficient condition for getting hyperuniformity is that the static structure factor vanishes in the zero-wavenumber limit , i.e. . Thus, for crystals and quasicrystals we get (R)=/=1/R=0 , hence they are hyperuniform.In literature [1-3], three classes of hyperuniformity are reported according to the following trends in the large R limit for the number variance (R)Classes I and III represent the strongest and weakest forms of hyperuniformity, respectively. All crystals and many perfect quasicrystals belong to class I, whereas perfect glasses belong to class III. Class II includes some quasicrystals and many disordered classical and quantum states of matter. For a complete overview, see Table 1 in Ref. [2] .
lim
R→∞
2
σ
N
d
R
lim
k→0
S(k)=0
lim
R→∞
2
σ
N
d
R
lim
R→∞
d-1
R
d
R
lim
R→∞
2
σ
N
(R)∼
2
σ
N
| ||
d-α R |
Batch code for getting a statistical significant value for the number variance 2σN(R)
Batch code for getting a statistical significant value for the number variance (R)
2
σ
N
The following code allows to compute the number variance for different positions of the observation window. For didactical purposes, in this post two-dimensional systems in the form of 2D spatial point patterns have been considered. In order to get good statistics for the number variance, one would need to compute (R) for a quite large number of displacements of the observation window over the 2D domain range. In the first two lines of code below (variable datasamplepts), the number of displacements is actually set to 100 for practical demonstration purposes of this notebook, but the reported results in the following subsections refer to 10000 samplings, which of course require more CPU time. One should also pay attention to avoid misleading boundary effects, by keeping the disk entirely in the domain range, to get a full counting inside its area for each displacement. For example, for the variable datasamplepts below, the values of RandomReal range from -20 (i.e. the lowest boundary for the domain (-50) plus the largest value for the radius which is 30) to 20 (i.e. the highest boundary of the domain (50) minus 30).
Further work is required to improve the performance of this code through parallel programming and compiling, but it’s out of the scope of the purposes of this post at the moment.
2
σ
N
Further work is required to improve the performance of this code through parallel programming and compiling, but it’s out of the scope of the purposes of this post at the moment.
In[]:=
(*samplingpositionforobservationdisk*)datasamplepts=RandomReal[{-20,20},{100,2}];(*crystal2Dlattices:squarearrays*)bsq={{0,1},{1,0}};(*Generatelatticepointsfromthesquarelatticebasis*)squarelatpts=Tuples[Range[-50,50],2].bsq;(*evaluationforseveralradiuses*)datares=Table[counts=ParallelMap[Count[RegionMember[Disk[#,radius]][squarelatpts],True]&,datasamplepts];{N@Mean[counts],N@(Mean[counts^2]-Mean[counts]^2)},{radius,1,30,1}];(*extractnumbervarianceasafunctionofradiusR*)numvar=datares[[All,2]]
Out[]=
{0.4456,1.1691,1.2524,1.6204,1.8619,2.9411,3.5571,4.4384,4.0179,4.28,3.9316,7.3275,5.9564,7.3531,7.4019,6.5819,6.6659,7.9224,11.1859,9.0084,9.7864,8.8099,10.5931,11.5779,14.2044,12.7299,13.3404,9.8504,14.5451,14.4539}
Results for a square lattice and a 2D Fibonacci Quasicrystal model
Results for a square lattice and a 2D Fibonacci Quasicrystal model
Below the computed data for the scaling of the number variance (R)/ as a function of the radius R of the observation window are reported for the square lattice devised in the previous code cell at unit density and a 2D Fibonacci quasicrystal (QC) almost at unit density (0.9). For generating such structure the reader can check the code in a previous Demonstration by the author available at this link.
The trends of(R)/ vs R for both systems are pretty similar, which confirms their belonging to the first class of hyperuniformity.
2
σ
N
2
R
The trends of
2
σ
N
2
R
In[]:=
r=Range[1,30];(*squarelattice2D*)numvarSQ=;gSQ=ListPlotTranspose[{r,numvarSQ/r^2}],Joined->True,PlotMarkers->Automatic,PlotRange->{{-.5,31},{0,1}},PlotStyle->Blue,Frame->True,FrameLabel->"R","(R)";(*2DFibonacciQC*)numvarQC=;gQC=ListPlotTranspose[{r,numvarQC/r^2}],Joined->True,PlotMarkers->Automatic,PlotRange->{{-.5,31},{0,1}},PlotStyle->Cyan,Frame->True,FrameLabel->"R","(R)";GraphicsRow[{gSQ,gQC}]
2
σ
N
2
R
2
σ
N
2
R
Results for a nonhyperuniform (Poisson) random model
Results for a nonhyperuniform (Poisson) random model
Below the code is shown for the generation of a 2D disordered point set at unit density over a square domain.
Results for a stealthy hyperuniform system and a 2D random model from Determinantal Point Process
Results for a stealthy hyperuniform system and a 2D random model from Determinantal Point Process
Results for a disordered non hyperuniform system
Results for a disordered non hyperuniform system
As outlined in the previous subsection, let’s now consider a disordered non hyperuniform system resulting from a configuration of an equilibrium distribution of hard circular disks as reported in Fig. 7 of Ref. [2].
In general, one can notice from the overview graphics below a substantial agreement with the results reported for corresponding 3D systems as shown in Fig. 1 of Ref. [2], with just a few lines of Mathematica code.
A final question can be left as a computational exercise to the reader: which of these seemingly equally disordered point patterns is actually hyperuniform?
Summary
Summary
Dynamic interactivity applications developed with Wolfram Language with a variety of controls can be extremely useful to grasp visually some novel and advanced concepts introduced for order metrics and phase classifications in condensed matter systems on the basis of simple statistical measurements.
References
References
[2] Salvatore Torquato, Physics Reports 745 (2018) 1-95, “Hyperuniform states of matter”, https://doi.org/10.1016/j.physrep.2018.03.001
[3] Duyu Chen, Houlung Zhuang, Mohan Chen, Pinshane Y. Huang, Vojtech Vlcek and Yang Jiao, Applied Physics Reviews 10, 021310 (2023) , “Disordered hyperuniform solid state materials”, https://doi.org/10.1063/5.0137187
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Getting started with hyperuniformity in condensed matter with Wolfram dynamic interactivity tools
by Jessica Alfonsi
Wolfram Community, STAFF PICKS, August 1, 2025
https://community.wolfram.com/groups/-/m/t/3523218
by Jessica Alfonsi
Wolfram Community, STAFF PICKS, August 1, 2025
https://community.wolfram.com/groups/-/m/t/3523218
