# Message Boards

# [WSS20] Weyl's Law And The Wolfram Model Of Physics

Introduction The rest of this work will be arranged as follows: 1. Heat Kernel on Graphs Part 1 will develop the theory and associated code in Mathematica for implementing the partial differential equation describing heat diffusion (i.e., the heat equation) on graphs. The motivation for this focus is to (a) explore issues relating to the mapping of continuous PDEs to discrete graph structures with respect to preserving the underlying physics; (b) explore how the representation of PDEs on graphs and spectral graph theory may illuminate various geometric attributes of these discrete structures including dimension and curvature. The computational aspects of this work will include development of code for performing temporal evolution of the heat equation from some initial conditions as well as visualization tools for studying the behavior of heat diffusion on graphs. 2. Weyl’s Law on Graphs Part 2 will introduce Weyl’s law and its interpretation as well as its application to a number of branches of physics, acoustics and of course Riemannian manifolds. The computational work in this section will examine whether any correspondence can be ascertained between the spectrum of the graph Laplacian and of the effective definition of dimension of a graph as defined in the Wolfram Physics Model. 3. The Laplace-Beltrami Operator Part 3 will examine approaches for developing and analog of the Laplace-Beltrami operator for graphs. First, we will provide a derivation of the functional form of the operator for continuous manifolds. Next, we will provide some analysis and thoughts regarding approaches for generalizing the Laplace-Beltrami operator on graphs. 4. Spectral Graph Theory and Future Work Part 4 will discuss some ideas in spectral graph theory and miscellaneous ideas for future work in further analyzing this problem.
1. The Heat Equation
The Heat Equation PDE The heat equation is a partial differential equation describing the time evolution of the diffusion in space of a physical quantity such as heat. α is a constant referred to as the thermal diffusivity. Interestingly, the Schrodinger equation bears some relationship to the heat equation in that it is 2nd order in space and first order in time although it introduces an imaginary coefficient in the time dependence. Linear operator equations such as the heat equation may be solved by several different methods. One method involves finding the Green’s function for the heat equation (the heat kernel). A Green’s function effectively describes the response function to a point source in time, space or both. The total response may then be determined by calculating the linear superposition of responses for an initial condition. Alternatively, the solution to the heat equation for some initial conditions may be determined by the following method: 1) Calculate the eigenvalues and eigenfunctions of the Laplacian operator; 2) Project the initial conditions onto the eigenspace using the determined eigenvectors to generate a set of eigenspace coordinates; 3) Perform the temporal evolution in the eigenspace for each eigenvector using the associated eigenvalue and projection coordinates. Because by definition, the operator is diagonal in the eigenspace coordinates, carrying out the time evolution will be a decoupled trivial exponential; 4) Upon evolving each eigen - component in the eigenspace, project back to the temperature space.We choose the latter approach. In particular, as we seek to encode the heat equation to a graph, we will derive the analogous discrete operator on a graph, the Laplacian matrix, which we turn to next.
Discretizing the Heat Equation How can we map the heat equation to a graph? Formally, a graph comprises a set of vertices connected via a series of edges. Our end goal is to study the behavior of the Laplacian and it’s generalization to non-Euclidean spaces, the Laplace-Beltrami operator with respect to graphs generated via the evolutionary application of rules as defined in the Wolfram Model. For now, however, Imagine a simple planar graph such as the following : simpleGridGraph=GridGraph[{16,16},VertexSizeLarge] In[]:= Out[]= Each vertex may associated with a temperature, such that the composite set of temperatures defines a heat distribution on the graph. We can define a temperature or heat distribution function ϕ(v) that maps a temperature to each vertex. For visualization purposes, we can indicate the temperature on a graph using color. To do so, let’s define some functions to color our graph based upon the temperature at each vertex. As our immediate goal is to model the temporal evolution of heat flow based upon the heat equation, We will use these coloring functions later visualizing the heat flow on more complex graphs such as those arising in the Wolfram Model. (*TakesagraphandtemperaturesandsetsthetemperaturesonthegraphastheVertextWeight*)Attributes[SetTemperatures]={HoldFirst};SetTemperatures[g_,temperatures_]:=AnnotationValue[g,VertexWeight]=temperatures;(*TakesagraphandtemperaturesandsetsthetemperaturesonthegraphastheVertextWeightreturninganewgraph*)SetTemperaturesNG[g_,tmps_]:=Module[{ng=g},AnnotationValue[{ng},VertexWeight]=tmps;ng];(*Returnsthetemperaturesonagraph*)GetTemperatures[g_]:=AnnotationValue[g,VertexWeight];(*Createsarandomtemperaturedistributiononagraph*)ColorByRandomTemperature[g_]:=ColorByTemperature[g,Table[RandomReal[],VertexCount[g]]];(*Colorsagraphusingatemperaturelist*)ColorByTemperature[g_,temperatures_]:=HighlightGraph[g,MapThread[Style,{VertexList[g],Map[ColorData["Rainbow"],temperatures]}]];(*Colorsagraphbyitsinternaltemperatures(fromalreadyassignedVertexWeights)*)ColorByInternalTemperature[g_]:=ColorByTemperature[g,GetTemperatures[g]]; In[]:= Let' s apply a random temperature distribution to our simple grid graph for illustrative purposes : ColorByRandomTemperature[simpleGridGraph] In[]:= Out[]= We are using the Rainbow color scheme as defined in Mathematica, but are free to choose other schemes. The Rainbow scheme maps purple to the coldest temperature and red to the hottest : ColorData["Rainbow"] In[]:= ColorDataFunction
Out[]= We can further imagine that a vertex coupling two vertices allows heat to flow directly between the two vertices. On the other hand, if two vertices are not directly connected no heat can directly flow, but instead may flow through some other path if the vertices are connected through some other set of vertices. Since we are seeking to model the temporal evolution of heat diffusion, we will necessarily define some initial conditions on our graph. Although the random distribution looks pretty, it' s not particularly realistic for what we might expect of our initial conditions. Instead, we seek something like a delta function wherein our heat distribution is characterized by a concentrated heat source. In order to do that, we will define some functionality to generate a a rough delta or point source distribution on our graph. While we’re at it, let’s also define some functionality to normalize temperatures between 0-1 so that we can conviently apply a color map. (*Setsadeltafunctiononagraphatvertexofsizedistance*)SetDeltaFunction[g_,vertex_,distance_]:=Module[{ng=g},(AnnotationValue[{ng,#},VertexWeight]=ConstantArray[1,Length[#]])&@VertexList[NeighborhoodGraph[g,vertex,distance]];ng];(*Normalizestemperaturesonagraphbetween0and1*)Attributes[NormalizeTemperatures]={HoldFirst};NormalizeTemperatures[g_]:=SetTemperatures[g,N[#/Max[#]]]&@GetTemperatures[g];(*Normalizesavectorofinitialconditions*)NormalizeConditions[ic_]:=N[ic/Max[ic]];(*Zerosoutthetemperaturedistribution*)MakeUniformlyCold[g_]:=SetTemperatures[g,ConstantArray[0,VertexCount[g]]]; In[]:= Let' s now clear our temperature distribution on simpleGridGraph and instead impose a delta function like initial condition: SetTemperatures[simpleGridGraph,ConstantArray[0,256]];ColorByInternalTemperature[simpleGridGraph];deltaGridGraph=SetDeltaFunction[simpleGridGraph,135,3];ColorByInternalTemperature[deltaGridGraph] In[]:= Out[]= Now we are set up to represent temperatures on our graph and define delta - like initial conditions. But, we are yet to attack the most important question of how to perform temporal evolution of the heat equation on the graph. In short, we will discretize over space but leave the time dependence as a continuous variable. In order to do that, we need to define the adjacency matrix A for our graph. If we define a matrix in which each row index corresponds to a vertex in the graph and similarly, each column, we define the entry for each row as 0 if an edge exists between the respective vertices indexed by the row and column. Thus, if we have N vertices in the graph, the adjacency matrix is an N*N matrix of 1’s and 0’s indicating whether particular vertices are connected to one another. The final step in encoding the heat equation PDE to a graph is to figure out how to model the Laplacian operator itself. A simple approach is to recognize physically that the rate of heat diffusion at a given vertex with respect an adjacent vertex by Newton’s law of cooling is proportional to the difference in temperature between the adjacent vertices assuming the temperature differential is small. Alternatively, we could have evaluated the discrete difference approximation to the second derivative using a numerical approximation scheme. This approach would yield a central difference approximation with a dependence upon the inverse square of the discrete distance between adjacent nodes. In our scheme, adjacent vertices are assumed to have a unit distance. However, because of complications involving applying the central difference approximation to graphs, we choose the former approach. We are now ready to write down our discretized heat equation on a graph. In words, the time derivative of the temperature of each vertex equals the linear superposition of temperature differences between ALL adjacent nodes. For purposes of this discussion, we will normalize α to 1. We can now manipulate this equation as follows. The operator ' deg' shown below calculates the number of outgoing or equivalently incoming vertices to a given vertex. In the end we arrive with a discrete operator equation for a new operator L, which represents the discrete Laplacian operator for our graph. After some derivation as follows, the Laplacian matrix emerges as the appropriate operator for the heat equation on a graph: Here D is a diagonal matrix wherein each entry on the diagonal counts the number of outgoing (or equivalently incoming) edges for a vertex. In essence, we are left with a simple one-dimensional homogeneous ordinary differential equation in time. It is understood here that ϕ is a vector of temperature coefficients defining the heat distribution on the graph. In our case, we seek to solve the this equation in which we define some initial conditions specifying the temperature distribution at time 0. As noted previously, this equation can be solved by standard techniques for ODEs by projecting the initial conditions onto the eigenspace, performing the temporal evolution there and projecting back again to temperature space. And indeed that is what we shall do as codified in the following Wolfram Language code. First, let’s calculate the graph associated matrices such as the adjacency matrix and the Laplacian matrix: (*ThefollowingcodecalculatesthegraphLaplaciananditsspectrum.UnnormalizedLaplacianreturnstheunnormalizedLaplacianoftheassociatedundirectedgraph.AdjMatrixconvertsadirectedgraphtoanundirectedgraphandcalculatestheadjacencymatrix.GraphSpectrumreturnstheeigenvaluesandeigenfunctionsofthegraphinputobjectasanassociativearray.*)UnnormalizedLaplacian[g_]:=N@(DiagonalMatrix[VertexOutDegree[#]]-AdjacencyMatrix[#])&@UndirectedGraph[g];AdjMatrix[g_]:=N@AdjacencyMatrix[#]&@UndirectedGraph[g];GraphSpectrum[g_]:=<|"eigenvalues"->Eigenvalues[#],"eigenvectors"->Eigenvectors[#]|>&@UnnormalizedLaplacian[g]; In[]:= The next set of code performs the heat kernel dynamics using the above described approach of eigenvector decomposition. (*Thefollowingcodeimplementstheheatkerneldynamics.*)(*Projectinitialconditionsontoeigenspace*)EigenSpaceProject[ic_,eigenvectors_]:=eigenvectors.ic;(*Projectvector,whichmaybeatimeevolvedvectorineigenspaceontovertexspace(temperaturespace)*)VertexSpaceProject[vector_,eigenvectors_]:=Transpose[eigenvectors].vector;(*Performtemporalevolutionineigenspace*)EigenSpaceAdvance[spectrum_,coordinates_,t_]:=Exp[-t*spectrum["eigenvalues"]]*coordinates;(*Performtemporalevolutionintemperature/vertexspace*)TemperatureSpaceAdvance[spectrum_,ic_,t_]:=VertexSpaceProject[EigenSpaceAdvance[spectrum,EigenSpaceProject[ic,#],t],#]&@spectrum["eigenvectors"];(*Thefollowingfunctiontemporallyadvancestheheatdistributiononagraphbymodifyingtheprovidedgraphobject*)Attributes[TimePropagate]={HoldFirst};TimePropagate[g_,t_]:=SetTemperatures[g,TemperatureSpaceAdvance[GraphSpectrum[g],GetTemperatures[g],t]]; In[]:= Let' s try out this code on our simpleGridGraph to see how a delta - function initial condition propagates in time by visualizing the temperature evolution at several different time advances starting at 0. SetTemperatures[simpleGridGraph,ConstantArray[0,256]];ColorByInternalTemperature[simpleGridGraph];deltaGridGraph=SetDeltaFunction[simpleGridGraph,135,3];ColorByInternalTemperature[deltaGridGraph]TimePropagate[deltaGridGraph,0];ColorByInternalTemperature[deltaGridGraph] In[]:= Out[]= Advance by 0.1 seconds : TimePropagate[deltaGridGraph,0.1];ColorByInternalTemperature[deltaGridGraph] In[]:= Out[]= Advance again by another 0.15 seconds : TimePropagate[deltaGridGraph,0.15];ColorByInternalTemperature[deltaGridGraph] In[]:= Out[]= Advance by another 0.25 seconds : TimePropagate[deltaGridGraph,0.25];ColorByInternalTemperature[deltaGridGraph] In[]:= Out[]= Advance one more time by 0.5 seconds : TimePropagate[deltaGridGraph,0.50];ColorByInternalTemperature[deltaGridGraph] In[]:= Out[]= This looks reasonable! We can see the heat diffusion over time. However, for visualization purposes perhaps an automated animation would provide some insight for visualization of the temporal evolution of the heat equation. The following set of code generates animation frames over a range of time values and sets up the appropriate animations. (*Thefollowingfunctiongeneratesalistoftemperaturespacevectorscorrespondingtoarangeoftimesasspecifiedbyastart,stopandincrementusinginitialconditionsbaseduponthecurrentgraphtemperatures.Thisfunctiongeneratesanoutputmatrixwhereineachrowcorrespondstoatimestepforthetemperaturedistributionforverticesonthegraph*)TemperatureSpaceAdvanceInterval[spectrum_,ic_,start_,stop_,increment_]:=Transpose[VertexSpaceProject[EigenSpaceAdvanceRange[start,stop,increment,#[[2]],EigenSpaceProject[ic,#[[1]]]],#[[1]]]]&@{spectrum["eigenvectors"],spectrum["eigenvalues"]};(*Thefollowingfunctiongeneratesarangeofadvancementsineigenspaceforasetoftimesbaseduponastart,stopandincrement*)EigenSpaceMakeRange[start_,stop_,increment_,eigenvalues_]:=Exp[-#*eigenvalues]&/@Range[start,stop,increment];(*ThefollowingfunctionadvancescoordinatesineigenspaceoverarangeoftimesusingEigenSpaceMakeRange*)EigenSpaceAdvanceRange[start_,stop_,increment_,eigenvalues_,coordinates_]:=Transpose[EigenSpaceMakeRange[start,stop,increment,eigenvalues]]*coordinates;(*Thefollowingcodeperformsanimationsonagraph*)HeatKernelRun[g_,ic_,start_,stop_,increment_]:=TemperatureSpaceAdvanceInterval[GraphSpectrum[g],ic,start,stop,increment];(*Thefollowingfunctioncreatesasequenceofanimationframesforperformingagraphanimationofthetemporalevolutionoftheheatdistributiononagraph*)CreateAnimationFrames[g_,temperatureList_]:=MapThread[SetTemperaturesNG,{Table[g,Dimensions[temperatureList][[1]]],temperatureList}];(*Generateheatkernelanimationframesforgraphgoverintervalstartstopwithincrement*)GenHeatKernelFrames[g_,ic_,start_,stop_,increment_]:=ColorByInternalTemperature/@CreateAnimationFrames[g,HeatKernelRun[g,ic,start,stop,increment]];(*Runheatkernelanimationforgraphgoverintervalstartstopwithincrement.Imagesizeandframespersecondmustbespecified*)RunHeatKernelAnimation[g_,ic_,start_,stop_,increment_,imagesize_,fps_]:=ListAnimate[Show[#,ImageSizeimagesize]&/@GenHeatKernelFrames[g,ic,start,stop,increment],fps,DeployedTrue,SaveDefinitionsTrue]; In[]:= Before applying this code, let' s define a more realistic graph in which vertices are coupled to all nearest neighbors including diagonal directions. We also will define some initial conditions on our graph. (*AdjHeatGridData=Import["/Users/jonlederman/Desktop/Wolfram Summer School/Project/Opus/Heatgrid/Adj.txt"];AdjHeatGridData=ImportString[AdjHeatGridData,"Table"][[1]];*)AdjHeatGridData=
In[]:= anim=RunHeatKernelAnimation[HeatGrid,NormalizedHeatGridIC,0,5,0.2,500,7] In[]:= Out[]= Next, we will apply this to one of the Wolfram Models. Specifically, we will look at 7714 from the Registry of Notable Universe Models. Before doing so, however, a fundamental question arises. Wolfram Model graphs are digraphs. However, the Laplacian matrix for digraphs is not well defined and in general will not be a symmetric positive-semidefinite matrix. One solution, which we adopt here, is to discard the directedness information and convert the graph to an undirected graph. Nonetheless, the validity of discarding the structure of the digraph is a question that warrants further consideration. In any case, we proceed with the approach of converting to an undirected graph. (*WolframModelResourceFunctions*)WM=ResourceFunction["WolframModel"];HG2G=ResourceFunction["HypergraphToGraph"];Universe7714=WM[{{{1,2,2},{3,1,4}}{{2,5,2},{2,3,5},{4,5,5}}},{{1,1,1},{1,1,1}},750,"FinalState"];unig7714=HG2G[Universe7714,VertexSize4] In[]:= Out[]= SetTemperatures[unig7714,ConstantArray[0,751]]; In[]:= unig7714Delta=SetDeltaFunction[unig7714,200,4];ColorByInternalTemperature[unig7714Delta] In[]:= Out[]= In[]:= ic=GetTemperatures[unig7714Delta];anim7714=RunHeatKernelAnimation[unig7714,ic,0,5,0.2,500,7] In[]:= Out[]=
2. Weyl' s Law
Background Weyl’s law has a rich history and diverse field of application. In general, it is a statement regarding the asymptotic growth of the eigenvalues of the Laplacian on bounded domains with DIrichlet or Neumann boundary conditions. The subject has roots in acoustics, specifically relating to the asymptotic behavior of the overtones of notes on instruments in a room, for example. In physics, the impetus for the development of Weyl’s law grew out of the black body radiation problem. Weyl' s law has been generalized to address non-Euclidean spaces such as d-dimensional manifolds with an associated Riemannian metric. In this case, the Laplacian must be replaced with the corresponding operator in these spaces, which is referred to as the Laplace-Beltrami operator. In the context of a manifold can be expressed as follows : Here Ω⊂ d ω d d A simple example illustrating Weyl’s law for a two-dimensional Dirichlet problem is derived by Matt Stevenson and proceeds as follows. We are interested in solving the following eigenvalue problem: on the bounded domain Ω. Take the boundary : In two dimensions this becomes : This equation can be solved using standard techniques such as separation of variables yielding the following separable solution : The eigenvalues are : Then, define an eigenvalue counting function : This equation is suggestive of the coefficients of an ellipse equation. We can define an ellipse and the associated area in the first quadrant cut out by the ellipse by dividing by lambda and re-introducing the continuous variables x and y : a=5;b=3;ContourPlot[(x/a)^2+(y/b)^21,{x,-5,5},{y,-3,3},AspectRatioAutomatic] In[]:= Out[]= N(λ)issimplythenumberoflatticepointsinside E λ For each eigenvalue pair, we can define a unit - area square : The counting function can now be expressed as follows :
Exploration of Weyl’s Law WIth Respect to Wolfram Model Graphs Using The Laplacian Operator As noted, a central issue concerns the appropriate analogue of the Laplace-Beltrami operator for d-dimensional manifolds in the context of graphs. This is an open question on the forefront of current research and will be discussed below in section 3. As a starting point, it will be instructive to attempt to naively apply the standard Laplacian operator to Wolfram Model graphs and examine whether the relationship holds in any form. Let us continue with Universe 7714. First, we will estimate it’s dimension as defined in the Wolfram Physics Project. (*Firstwecreateauniverseandcalculatethegeodesicballsfromamedianvertex*)universe7714WM=WM[{{{1,2,2},{3,1,4}}{{2,5,2},{2,3,5},{4,5,5}}},{{1,1,1},{1,1,1}},2500,"FinalState"];universe77142500=HG2G[universe7714WM];medianVertex=Median@VertexList@universe77142500;geoBalls=Neighb |