Code

Conformal Probability in Julia

My GitHub page provides tools for working with common discrete statistical physics models: the dimer model, the loop-erased random walk, the uniform spanning tree, and the discrete Gaussian free field. The packages are written in Julia, for two reasons:

  • It’s simple. Julia’s syntax is readable and standard, so experience with Julia is not a prerequisite for using and modifying the code. Furthermore, Julia can be run online at JuliaBox, so you don’t need to install anything.
  • It’s fast. Julia is designed from the ground up to be efficiently just-in-time compiled. This means that, after a small compilation delay on each function’s first call, you can expect to get C-like speed with simple, idiomatic Julia code.

Instructions for getting started are below.

Examples

The SLE fan

using AsyPlots
using FractionalGaussianFields
n = 250
h = zeroboundary(torus_gff(n))
κ = 3
χ = 2/sqrt(κ) - sqrt(κ)/2
z0 = (n+1)/2 + im*(n+1)/2
L = 40
C = Colors.colormap("Blues",L)
paths = [Path(flowline(h, z0, χ, θ),color=c) 
                      for (θ,c) in zip(linspace(0,2π,L),C)]
Plot(paths,bgcolor="Black",border=0)
SLE fan

GFF level lines

using AsyPlots
using Contour
using FractionalGaussianFields
n = 250
h = zeroboundary(torus_gff(n))
levellines = contour(1.0:n,1.0:n,h,0.0)
C = Colors.distinguishable_colors(length(levellines), 
                                  lchoices=linspace(90,100,10))
loops = [Polygon(l,color=c) for (c,l) in zip(C.levellines)]
P = Plot(loops,bgcolor="Black")

GFF level lines

A Gaussian free field surface plot

using AsyPlots
using FractionalGaussianFields
h = zeroboundary(torus_gff(50))
plot(h)
GFF

Conformal maps

using AsyPlots
using ConformalMaps
slitdomain = 2*[0.0,
	        0.495, 
                0.5 + 0.25*im, 
		0.505, 
		1.0, 
		1.0 + 1.0*im, 
		im]
f = ConformalMap(slitdomain,1+im)
g = inv(f)
visualize(g)
Conformal Map

Wooded triangulations

using PlanarMaps, AsyPlots
draw(UWT(100),fillfaces=true,linecolor="black")
wooded triangulation

Getting Started

  1. Use your Google account to sign in at https://www.juliabox.com, or install Julia on your own machine.
  2. Open a new notebook and install the packages by running

    Pkg.add("AsyPlots")
    Pkg.add("ConformalMaps")
    Pkg.add("FractionalGaussianFields")
    
  3. That’s it! You can learn about the language on the Julia learning page, and you can read the package documentation and see more examples on my GitHub page. To inspect the source code, open the src directory on GitHub and look at PackageName.jl.