Ian Jauslin
summaryrefslogtreecommitdiff
path: root/figs
diff options
context:
space:
mode:
Diffstat (limited to 'figs')
-rw-r--r--figs/atoms.fig/Makefile15
-rw-r--r--figs/atoms.fig/chiral-base.gp22
-rw-r--r--figs/atoms.fig/chiral.py102
-rw-r--r--figs/atoms.fig/crystal-base.gp21
-rw-r--r--figs/atoms.fig/crystal.py24
-rw-r--r--figs/atoms.fig/gas-base.gp21
-rw-r--r--figs/atoms.fig/gas.py39
-rw-r--r--figs/atoms.fig/liquid-base.gp21
-rw-r--r--figs/atoms.fig/liquid.py39
-rw-r--r--figs/atoms.fig/nematic-base.gp21
-rw-r--r--figs/atoms.fig/nematic.py90
l---------figs/cross_sliding.fig/Makefile1
-rw-r--r--figs/cross_sliding.fig/cross_sliding_2.tikz.tex14
-rw-r--r--figs/cross_sliding.fig/cross_sliding_3a.tikz.tex14
-rw-r--r--figs/cross_sliding.fig/cross_sliding_3b.tikz.tex16
l---------figs/cross_sliding.fig/libs/shapes.sty1
-rw-r--r--figs/dimer_example.fig/Makefile32
-rw-r--r--figs/dimer_example.fig/dimer_conf.py170
-rw-r--r--figs/dimer_example.fig/libs/dimer.sty33
-rw-r--r--figs/libs/Makefile25
-rw-r--r--figs/libs/shapes.sty87
l---------figs/packings.fig/Makefile1
-rw-r--r--figs/packings.fig/cross_packing_l.tikz.tex14
-rw-r--r--figs/packings.fig/cross_packing_r.tikz.tex14
l---------figs/packings.fig/libs/shapes.sty1
-rw-r--r--figs/shapes.fig/L_tetromino.tikz.tex11
l---------figs/shapes.fig/Makefile1
-rw-r--r--figs/shapes.fig/P_pentomino.tikz.tex11
-rw-r--r--figs/shapes.fig/T_tetromino.tikz.tex11
-rw-r--r--figs/shapes.fig/V_triomino.tikz.tex11
-rw-r--r--figs/shapes.fig/cross.tikz.tex11
-rw-r--r--figs/shapes.fig/diamond.tikz.tex11
-rw-r--r--figs/shapes.fig/hexagon.tikz.tex37
l---------figs/shapes.fig/libs/shapes.sty1
34 files changed, 943 insertions, 0 deletions
diff --git a/figs/atoms.fig/Makefile b/figs/atoms.fig/Makefile
new file mode 100644
index 0000000..a4b610f
--- /dev/null
+++ b/figs/atoms.fig/Makefile
@@ -0,0 +1,15 @@
+PROJECTNAME=crystal liquid gas nematic chiral
+PNGS=$(addsuffix .png, $(PROJECTNAME))
+
+all: $(PNGS)
+
+$(PNGS):
+ cp $(patsubst %.png, %, $@)-base.gp $(patsubst %.png, %, $@).gp
+ python $(patsubst %.png, %, $@).py >> $(patsubst %.png, %, $@).gp
+ gnuplot $(patsubst %.png, %, $@).gp > $@
+
+clean-aux:
+ rm -f $(addsuffix .gp, $(PROJECTNAME))
+
+clean: clean-aux
+ rm -f $(PNGS)
diff --git a/figs/atoms.fig/chiral-base.gp b/figs/atoms.fig/chiral-base.gp
new file mode 100644
index 0000000..74db566
--- /dev/null
+++ b/figs/atoms.fig/chiral-base.gp
@@ -0,0 +1,22 @@
+set terminal pngcairo size 2048,2048
+
+set key off
+unset colorbox
+unset border
+unset xtics
+unset ytics
+unset ztics
+
+set parametric
+
+set view 80,10,1.5
+set view equal xyz
+
+set isosample 100
+
+set pm3d depthorder
+set pm3d lighting primary 0.50 specular 0.6
+
+set palette defined (0 "#339999")
+
+splot \
diff --git a/figs/atoms.fig/chiral.py b/figs/atoms.fig/chiral.py
new file mode 100644
index 0000000..eed6df8
--- /dev/null
+++ b/figs/atoms.fig/chiral.py
@@ -0,0 +1,102 @@
+#!/usr/bin/env python3
+
+from math import *
+import random
+import sys
+
+# size of space
+L=30
+# number of lines
+H=5
+# heigh of lines
+height=5
+# number of rods per line
+N=16
+# aspect ratio
+a=10
+# spread in theta angle
+spread_t=pi/60
+# in phi
+spread_p=pi/60
+# in height
+spread_h=1/120
+
+# check whether two rods overlap
+def check_overlap(rod1,rod2):
+ # relative placement
+ relative_pos=unrotate(subtract(rod2[0],rod1[0]), rod1[1])
+ if(abs(relative_pos[0])<2 and abs(relative_pos[1])<2 and abs(relative_pos[2])<2):
+ return(True)
+ # relative angle
+ relative_ang=cart_to_spherical(unrotate(spherical_to_cart(rod2[1]), rod1[1]))
+ # exclusion volume
+ # rotate other rod
+ relative_pos=unrotate(relative_pos, [0,relative_ang[1]])
+ #if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(relative_pos[2])-a-2<abs(cos(relative_ang[0])*a)):
+ if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(sin(relative_ang[0])*relative_pos[2]-cos(relative_ang[0])*relative_pos[0])-2<abs(sin(relative_ang[0])*a)):
+ return(True)
+ return(False)
+
+# def subtract vectors
+def subtract(x,y):
+ return([x[0]-y[0],x[1]-y[1],x[2]-y[2]])
+# rotate vector
+def unrotate(x,w):
+ ret=[x[0],x[1],x[2]]
+ # rotate phi
+ tmp=cos(w[1])*ret[0]+sin(w[1])*ret[1]
+ ret[1]=-sin(w[1])*ret[0]+cos(w[1])*ret[1]
+ ret[0]=tmp
+ # rotate theta
+ tmp=cos(w[0])*ret[0]-sin(w[0])*ret[2]
+ ret[2]=sin(w[0])*ret[0]+cos(w[0])*ret[2]
+ ret[0]=tmp
+ return(ret)
+
+# convert coordinates
+def spherical_to_cart(w):
+ return([cos(w[1])*sin(w[0]),sin(w[1])*sin(w[0]),cos(w[0])])
+def cart_to_spherical(x):
+ w=[0,0]
+ w[0]=acos(x[2])
+ if(sin(w[0]==0)):
+ return([w[0],0])
+ c=x[0]/sin(w[0])
+ s=x[1]/sin(w[0])
+ # to avoid truncation errors
+ if(abs(c)>1 and abs(c)<1.0001):
+ if(c>0):
+ return([w[0],0])
+ else:
+ return([w[0],pi])
+ if(s>=0):
+ return([w[0],acos(c)])
+ return([w[0],2*pi-acos(c)])
+
+# configuration
+config=[]
+# add rods
+for h in range(H):
+ config_h=[]
+ while len(config_h)<N:
+ # random position and angles
+ x=[random.uniform(0,L), random.uniform(0,L), random.gauss(h*height,spread_h)]
+ w=[abs(random.gauss(pi/2,spread_t)), random.gauss(pi/2*(1-h/(H-1)),spread_p)]
+ # chek it does not interfere with other rods
+ fine=True
+ for rod in config+config_h:
+ if(check_overlap(rod,[x,w])):
+ fine=False
+ break
+ if fine:
+ config_h.append([x,w])
+ config=config+config_h
+
+for i in range(len(config)):
+ rod=config[i]
+ print(str(rod[0][0])+"+("+str(cos(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(-sin(rod[1][1]))+")*sin(u)*sin(v)+("+str(cos(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ")
+ print(str(rod[0][1])+"+("+str(sin(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][1]))+")*sin(u)*sin(v)+("+str(sin(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ")
+ print(str(rod[0][2])+"+("+str(-sin(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][0])*a)+")*cos(v)", end=" ")
+ print("with pm3d", end="")
+ if i<len(config)-1:
+ print(", \\")
diff --git a/figs/atoms.fig/crystal-base.gp b/figs/atoms.fig/crystal-base.gp
new file mode 100644
index 0000000..92ffc4d
--- /dev/null
+++ b/figs/atoms.fig/crystal-base.gp
@@ -0,0 +1,21 @@
+set terminal pngcairo size 2048,2048
+
+set key off
+unset colorbox
+unset border
+unset xtics
+unset ytics
+unset ztics
+
+set parametric
+
+set view equal xyz
+
+set isosample 100
+
+set pm3d depthorder
+set pm3d lighting primary 0.50 specular 0.6
+
+set palette defined (0 "#339999")
+
+splot \
diff --git a/figs/atoms.fig/crystal.py b/figs/atoms.fig/crystal.py
new file mode 100644
index 0000000..4b1ba3c
--- /dev/null
+++ b/figs/atoms.fig/crystal.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+
+from math import *
+import random
+import sys
+
+# size of lattice
+N=5
+
+# configuration
+config=[]
+for i in range(N):
+ for j in range(N):
+ for k in range(N):
+ config.append([2*i+((j+k)%2),sqrt(3)*(j+(k%2)/3),2*sqrt(6)/3*k])
+
+
+for i in range(len(config)):
+ print(str(config[i][0])+"+cos(u)*sin(v)", end=",")
+ print(str(config[i][1])+"+sin(u)*sin(v)", end=",")
+ print(str(config[i][2])+"+cos(v)", end=" ")
+ print("with pm3d", end="")
+ if i<len(config)-1:
+ print(", \\")
diff --git a/figs/atoms.fig/gas-base.gp b/figs/atoms.fig/gas-base.gp
new file mode 100644
index 0000000..92ffc4d
--- /dev/null
+++ b/figs/atoms.fig/gas-base.gp
@@ -0,0 +1,21 @@
+set terminal pngcairo size 2048,2048
+
+set key off
+unset colorbox
+unset border
+unset xtics
+unset ytics
+unset ztics
+
+set parametric
+
+set view equal xyz
+
+set isosample 100
+
+set pm3d depthorder
+set pm3d lighting primary 0.50 specular 0.6
+
+set palette defined (0 "#339999")
+
+splot \
diff --git a/figs/atoms.fig/gas.py b/figs/atoms.fig/gas.py
new file mode 100644
index 0000000..8685999
--- /dev/null
+++ b/figs/atoms.fig/gas.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+from math import *
+import random
+
+# size of space
+L=15
+# number of particles
+N=10
+
+# check whether two rods overlap
+def check_overlap(sphere1,sphere2):
+ if(sqrt((sphere2[0]-sphere1[0])**2+(sphere2[1]-sphere1[1])**2+(sphere2[2]-sphere1[2])**2)<2):
+ return(True)
+ return(False)
+
+# configuration
+config=[]
+# add spheres
+while len(config)<N:
+ # random position
+ x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)]
+ # check it does not interfere with other spheres
+ fine=True
+ for sphere in config:
+ if(check_overlap(sphere,x)):
+ fine=False
+ break
+ if fine:
+ config.append(x)
+
+for i in range(len(config)):
+ sphere=config[i]
+ print(str(sphere[0])+"+cos(u)*sin(v)", end=", ")
+ print(str(sphere[1])+"+sin(u)*sin(v)", end=", ")
+ print(str(sphere[2])+"+cos(v)", end=" ")
+ print("with pm3d", end="")
+ if i<len(config)-1:
+ print(", \\")
diff --git a/figs/atoms.fig/liquid-base.gp b/figs/atoms.fig/liquid-base.gp
new file mode 100644
index 0000000..92ffc4d
--- /dev/null
+++ b/figs/atoms.fig/liquid-base.gp
@@ -0,0 +1,21 @@
+set terminal pngcairo size 2048,2048
+
+set key off
+unset colorbox
+unset border
+unset xtics
+unset ytics
+unset ztics
+
+set parametric
+
+set view equal xyz
+
+set isosample 100
+
+set pm3d depthorder
+set pm3d lighting primary 0.50 specular 0.6
+
+set palette defined (0 "#339999")
+
+splot \
diff --git a/figs/atoms.fig/liquid.py b/figs/atoms.fig/liquid.py
new file mode 100644
index 0000000..99b09ba
--- /dev/null
+++ b/figs/atoms.fig/liquid.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+from math import *
+import random
+
+# size of space
+L=15
+# number of particles
+N=100
+
+# check whether two rods overlap
+def check_overlap(sphere1,sphere2):
+ if(sqrt((sphere2[0]-sphere1[0])**2+(sphere2[1]-sphere1[1])**2+(sphere2[2]-sphere1[2])**2)<2):
+ return(True)
+ return(False)
+
+# configuration
+config=[]
+# add spheres
+while len(config)<N:
+ # random position
+ x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)]
+ # check it does not interfere with other spheres
+ fine=True
+ for sphere in config:
+ if(check_overlap(sphere,x)):
+ fine=False
+ break
+ if fine:
+ config.append(x)
+
+for i in range(len(config)):
+ sphere=config[i]
+ print(str(sphere[0])+"+cos(u)*sin(v)", end=", ")
+ print(str(sphere[1])+"+sin(u)*sin(v)", end=", ")
+ print(str(sphere[2])+"+cos(v)", end=" ")
+ print("with pm3d", end="")
+ if i<len(config)-1:
+ print(", \\")
diff --git a/figs/atoms.fig/nematic-base.gp b/figs/atoms.fig/nematic-base.gp
new file mode 100644
index 0000000..92ffc4d
--- /dev/null
+++ b/figs/atoms.fig/nematic-base.gp
@@ -0,0 +1,21 @@
+set terminal pngcairo size 2048,2048
+
+set key off
+unset colorbox
+unset border
+unset xtics
+unset ytics
+unset ztics
+
+set parametric
+
+set view equal xyz
+
+set isosample 100
+
+set pm3d depthorder
+set pm3d lighting primary 0.50 specular 0.6
+
+set palette defined (0 "#339999")
+
+splot \
diff --git a/figs/atoms.fig/nematic.py b/figs/atoms.fig/nematic.py
new file mode 100644
index 0000000..5c779c0
--- /dev/null
+++ b/figs/atoms.fig/nematic.py
@@ -0,0 +1,90 @@
+#!/usr/bin/env python3
+
+from math import *
+import random
+
+# size of space
+L=30
+# number of rods
+N=75
+# aspect ratio
+a=10
+# spread in theta angle
+spread=pi/30
+
+# check whether two rods overlap
+def check_overlap(rod1,rod2):
+ # relative placement
+ relative_pos=unrotate(subtract(rod2[0],rod1[0]), rod1[1])
+ if(abs(relative_pos[0])<2 and abs(relative_pos[1])<2 and abs(relative_pos[2])<2):
+ return(True)
+ # relative angle
+ relative_ang=cart_to_spherical(unrotate(spherical_to_cart(rod2[1]), rod1[1]))
+ # exclusion volume
+ # rotate other rod
+ relative_pos=unrotate(relative_pos, [0,relative_ang[1]])
+ #if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(relative_pos[2])-a-2<abs(cos(relative_ang[0])*a)):
+ if(abs(relative_pos[1])<2 and abs(relative_pos[0])-2<abs(sin(relative_ang[0]))*a and abs(sin(relative_ang[0])*relative_pos[2]-cos(relative_ang[0])*relative_pos[0])-2<abs(sin(relative_ang[0])*a)):
+ return(True)
+ return(False)
+
+# def subtract vectors
+def subtract(x,y):
+ return([x[0]-y[0],x[1]-y[1],x[2]-y[2]])
+# rotate vector
+def unrotate(x,w):
+ ret=[x[0],x[1],x[2]]
+ # rotate phi
+ tmp=cos(w[1])*ret[0]+sin(w[1])*ret[1]
+ ret[1]=-sin(w[1])*ret[0]+cos(w[1])*ret[1]
+ ret[0]=tmp
+ # rotate theta
+ tmp=cos(w[0])*ret[0]-sin(w[0])*ret[2]
+ ret[2]=sin(w[0])*ret[0]+cos(w[0])*ret[2]
+ ret[0]=tmp
+ return(ret)
+
+# convert coordinates
+def spherical_to_cart(w):
+ return([cos(w[1])*sin(w[0]),sin(w[1])*sin(w[0]),cos(w[0])])
+def cart_to_spherical(x):
+ w=[0,0]
+ w[0]=acos(x[2])
+ if(sin(w[0]==0)):
+ return([w[0],0])
+ c=x[0]/sin(w[0])
+ s=x[1]/sin(w[0])
+ # to avoid truncation errors
+ if(abs(c)>1 and abs(c)<1.0001):
+ if(c>0):
+ return([w[0],0])
+ else:
+ return([w[0],pi])
+ if(s>=0):
+ return([w[0],acos(c)])
+ return([w[0],2*pi-acos(c)])
+
+# configuration
+config=[]
+# add rods
+while len(config)<N:
+ # random position and angles
+ x=[random.uniform(0,L), random.uniform(0,L), random.uniform(0,L)]
+ w=[abs(random.gauss(0,spread)), random.uniform(0,2*pi)]
+ # chek it does not interfere with other rods
+ fine=True
+ for rod in config:
+ if(check_overlap(rod,[x,w])):
+ fine=False
+ break
+ if fine:
+ config.append([x,w])
+
+for i in range(len(config)):
+ rod=config[i]
+ print(str(rod[0][0])+"+("+str(cos(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(-sin(rod[1][1]))+")*sin(u)*sin(v)+("+str(cos(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ")
+ print(str(rod[0][1])+"+("+str(sin(rod[1][1])*cos(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][1]))+")*sin(u)*sin(v)+("+str(sin(rod[1][1])*sin(rod[1][0])*a)+")*cos(v)", end=", ")
+ print(str(rod[0][2])+"+("+str(-sin(rod[1][0]))+")*cos(u)*sin(v)+("+str(cos(rod[1][0])*a)+")*cos(v)", end=" ")
+ print("with pm3d", end="")
+ if i<len(config)-1:
+ print(", \\")
diff --git a/figs/cross_sliding.fig/Makefile b/figs/cross_sliding.fig/Makefile
new file mode 120000
index 0000000..704310e
--- /dev/null
+++ b/figs/cross_sliding.fig/Makefile
@@ -0,0 +1 @@
+../libs/Makefile \ No newline at end of file
diff --git a/figs/cross_sliding.fig/cross_sliding_2.tikz.tex b/figs/cross_sliding.fig/cross_sliding_2.tikz.tex
new file mode 100644
index 0000000..dfc3267
--- /dev/null
+++ b/figs/cross_sliding.fig/cross_sliding_2.tikz.tex
@@ -0,0 +1,14 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\square{red}{(1,1)}
+\square{red}{(2,1)}
+\grid74{(-2,-2)}
+\cross{teal}{(0,0)}
+\cross{teal}{(3,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/cross_sliding.fig/cross_sliding_3a.tikz.tex b/figs/cross_sliding.fig/cross_sliding_3a.tikz.tex
new file mode 100644
index 0000000..0d55ee6
--- /dev/null
+++ b/figs/cross_sliding.fig/cross_sliding_3a.tikz.tex
@@ -0,0 +1,14 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\square{red}{(-1,1)}
+\grid77{(-4,-3)}
+\cross{teal}{(-2,-1)}
+\cross{teal}{(0,0)}
+\cross{teal}{(1,2)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/cross_sliding.fig/cross_sliding_3b.tikz.tex b/figs/cross_sliding.fig/cross_sliding_3b.tikz.tex
new file mode 100644
index 0000000..c54dbec
--- /dev/null
+++ b/figs/cross_sliding.fig/cross_sliding_3b.tikz.tex
@@ -0,0 +1,16 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\square{red}{(-1,-2)}
+\square{red}{(0,-2)}
+\square{red}{(1,-2)}
+\grid85{(-4,-3)}
+\cross{teal}{(-2,-1)}
+\cross{teal}{(0,0)}
+\cross{teal}{(2,-1)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/cross_sliding.fig/libs/shapes.sty b/figs/cross_sliding.fig/libs/shapes.sty
new file mode 120000
index 0000000..eaa25c7
--- /dev/null
+++ b/figs/cross_sliding.fig/libs/shapes.sty
@@ -0,0 +1 @@
+../../libs/shapes.sty \ No newline at end of file
diff --git a/figs/dimer_example.fig/Makefile b/figs/dimer_example.fig/Makefile
new file mode 100644
index 0000000..0596f04
--- /dev/null
+++ b/figs/dimer_example.fig/Makefile
@@ -0,0 +1,32 @@
+PROJECTNAME=interaction
+LIBS=$(notdir $(wildcard libs/*))
+
+PDFS=$(addsuffix .pdf, $(PROJECTNAME))
+SOURCES=$(addsuffix .tikz.tex, $(PROJECTNAME))
+
+all: $(PDFS)
+
+$(PDFS): $(SOURCES) $(LIBS)
+ echo $(LIBS)
+ pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@)
+
+$(SOURCES):
+ python3 dimer_conf.py
+
+$(LIBS):
+ ln -fs libs/$@ ./
+
+clean-libs:
+ rm -f $(LIBS)
+
+clean-aux:
+ rm -f $(addsuffix .aux, $(PROJECTNAME))
+ rm -f $(addsuffix .log, $(PROJECTNAME))
+
+clean-tex:
+ rm -f $(PDFS)
+
+clean-sources:
+ rm -f $(SOURCES)
+
+clean: clean-libs clean-aux clean-tex clean-sources
diff --git a/figs/dimer_example.fig/dimer_conf.py b/figs/dimer_example.fig/dimer_conf.py
new file mode 100644
index 0000000..ce918e7
--- /dev/null
+++ b/figs/dimer_example.fig/dimer_conf.py
@@ -0,0 +1,170 @@
+#!/usr/bin/env python3
+
+import random
+from math import *
+
+# size of the grid
+L=24
+# boundary thickness (must be even)
+l0=4
+# activity and interaction
+z=3
+J=5
+
+
+# draw random dimers in a select area
+def fill_dimers(mask,direction):
+ if(direction=="h"):
+ d=[1,0]
+ else:
+ d=[0,1]
+
+ dimers=[]
+
+ # keep track of which sites are occupied
+ occupied=[]
+ for i in range(L):
+ occupied.append([])
+ for j in range(L):
+ occupied[i].append(0)
+
+ for i in range(10000):
+ # pick a random edge (indexed by its lower-left corner)
+ e=None
+ while(e==None or e[0]+d[0]>=L or e[1]+d[1]>=L or mask[e[0]][e[1]]==0 or mask[e[0]+d[0]][e[1]+d[1]]==0):
+ e=[random.randint(0,L-1),random.randint(0,L-1)]
+ # check whether a dimer can be added to the edge
+ if(occupied[e[0]][e[1]]==0 and occupied[e[0]+d[0]][e[1]+d[1]]==0):
+ # number of interactions
+ interactions=0
+ if(e[0]+2*d[0]<L and e[1]+2*d[1]<L and occupied[e[0]+2*d[0]][e[1]+2*d[1]]==1):
+ interactions=interactions+1
+ if(e[0]-d[0]>=0 and e[1]-d[1]>=0 and occupied[e[0]-d[0]][e[1]-d[1]]==1):
+ interactions=interactions+1
+ # probability of adding the dimer
+ p=1/(1+1/z*exp(-J*interactions))
+ if(p>random.random()):
+ # add dimer
+ dimers.append(e)
+ occupied[e[0]][e[1]]=1
+ occupied[e[0]+d[0]][e[1]+d[1]]=1
+
+ return(dimers)
+
+# find interactions
+def interactions(dimers,direction):
+ if(direction=="h"):
+ d=[1,0]
+ else:
+ d=[0,1]
+
+ out=[]
+ for d1 in dimers:
+ for d2 in dimers:
+ if(d1[0]-d2[0]==2*d[0] and d1[1]-d2[1]==2*d[1]):
+ out.append([d2[0]+d[0],d2[1]+d[1]])
+ return(out)
+
+
+# draw dimers
+def draw_dimers(v_dimers,h_dimers,file_desc,color):
+ for d in v_dimers:
+ print("\\dimer{[color="+color+"]("+str(d[0])+","+str(d[1])+")}v", file=file_desc)
+ print("", file=file_desc)
+ for d in h_dimers:
+ print("\\dimer{[color="+color+"]("+str(d[0])+","+str(d[1])+")}h", file=file_desc)
+ print("", file=file_desc)
+
+# draw interactions
+def draw_interactions(v_interactions,h_interactions,file_desc):
+ for d in v_interactions:
+ print("\\interaction{("+str(d[0])+","+str(d[1])+")}v", file=file_desc)
+ print("", file=file_desc)
+ for d in h_interactions:
+ print("\\interaction{("+str(d[0])+","+str(d[1])+")}h", file=file_desc)
+ print("", file=file_desc)
+
+# init tikz file
+def init_tikz(filename):
+ file_desc=open(filename,"w")
+ print("\\documentclass{standalone}\n\n\\usepackage{tikz}\n\\usepackage{dimer}\n\\usetikzlibrary{decorations.pathmorphing}\n\n\\begin{document}\n\\begin{tikzpicture}\n\n", file=file_desc)
+ return(file_desc)
+
+# close tikz file
+def close_tikz(file_desc):
+ print("\\end{tikzpicture}\n\\end{document}", file=file_desc)
+ file_desc.close()
+
+
+mu=int(L/2)
+
+# masks
+# init
+v_mask=[]
+h_mask=[]
+for i in range(L):
+ v_mask.append([])
+ h_mask.append([])
+ for j in range(L):
+ v_mask[i].append(1)
+ h_mask[i].append(0)
+# draw masks
+for i in range(mu-l0,mu+l0):
+ for j in range(mu+1,mu+5):
+ v_mask[i][j]=0
+for i in range(mu-2*l0,mu+2*l0):
+ for j in range(mu-5,mu+1):
+ v_mask[i][j]=0
+for i in range(mu-l0+2,mu+l0-2):
+ for j in range(mu+1,mu+4):
+ h_mask[i][j]=1
+for i in range(mu-l0,mu+l0):
+ h_mask[i][mu]=1
+for i in range(mu-2*l0+2,mu+2*l0-2):
+ for j in range(mu-4,mu):
+ h_mask[i][j]=1
+h_mask[mu-1][mu+1]=0
+h_mask[mu-1][mu+2]=0
+h_mask[mu-1][mu-3]=0
+h_mask[mu-1][mu-2]=0
+h_mask[mu][mu-3]=0
+h_mask[mu][mu-2]=0
+
+# random dimers in mask
+v_dimers=fill_dimers(v_mask,"v")
+h_dimers=fill_dimers(h_mask,"h")
+
+# mantle dimers
+h_mantle=[]
+for i in range(0,l0):
+ h_mantle.append([mu-l0+2*i,mu+4])
+for i in range(0,4):
+ h_mantle.append([mu+l0-2,mu+4-i])
+ h_mantle.append([mu-l0,mu+4-i])
+for i in range(0,int(l0/2)):
+ h_mantle.append([mu+l0+2*i,mu])
+ h_mantle.append([mu-l0-2-2*i,mu])
+for i in range(0,5):
+ h_mantle.append([mu+2*l0-2,mu-i])
+ h_mantle.append([mu-2*l0,mu-i])
+for i in range(0,2*l0):
+ h_mantle.append([mu-2*l0+2*i,mu-5])
+
+v_mantle=[]
+v_mantle.append([mu-1,mu+1])
+v_mantle.append([mu-1,mu-3])
+v_mantle.append([mu,mu-3])
+
+# interactions
+v_interactions=interactions(v_dimers+v_mantle,"v")
+h_interactions=interactions(h_dimers+h_mantle,"h")
+
+
+# files
+
+interaction=init_tikz("interaction.tikz.tex")
+print("\\grid{"+str(L-1)+"}{"+str(L-1)+"}{(0,0)}\n", file=interaction)
+draw_interactions(v_interactions,h_interactions,interaction)
+draw_dimers(v_dimers+v_mantle,h_dimers+h_mantle,interaction,"black")
+close_tikz(interaction)
+
diff --git a/figs/dimer_example.fig/libs/dimer.sty b/figs/dimer_example.fig/libs/dimer.sty
new file mode 100644
index 0000000..0f087ef
--- /dev/null
+++ b/figs/dimer_example.fig/libs/dimer.sty
@@ -0,0 +1,33 @@
+% square lattice (width #1, height #2, origin #3)
+\def\grid#1#2#3{
+ \foreach\i in {0,...,#2}{
+ \draw#3++(0,\i)--++(#1,0);
+ }
+ \foreach\i in {0,...,#1}{
+ \draw#3++(\i,0)--++(0,#2);
+ }
+}
+
+% dimer (bottom-left vertex #1, vertical or horizontal #2)
+\def\dimer#1#2{
+ \if#2h
+ \draw[line width=5pt]#1--++(1,0);
+ \fill#1circle(7pt);
+ \fill#1++(1,0)circle(7pt);
+ \else
+ \draw[line width=5pt]#1--++(0,1);
+ \fill#1circle(7pt);
+ \fill#1++(0,1)circle(7pt);
+ \fi
+}
+
+% interactions (bottom-left vertex #1, vertical or horizontal #2)
+\def\interaction#1#2{
+ \if#2h
+ \draw[line width=5pt, color=white]#1--++(1,0);
+ \draw[line width=4pt, decorate, decoration={snake}, color=red]#1--++(1,0);
+ \else
+ \draw[line width=5pt, color=white]#1--++(0,1);
+ \draw[line width=4pt, decorate, decoration={snake}, color=red]#1--++(0,1);
+ \fi
+}
diff --git a/figs/libs/Makefile b/figs/libs/Makefile
new file mode 100644
index 0000000..994463b
--- /dev/null
+++ b/figs/libs/Makefile
@@ -0,0 +1,25 @@
+PROJECTNAME=$(basename $(basename $(wildcard *.tikz.tex)))
+LIBS=$(notdir $(wildcard libs/*))
+
+PDFS=$(addsuffix .pdf, $(PROJECTNAME))
+
+all: $(PDFS)
+
+$(PDFS): $(LIBS)
+ echo $(LIBS)
+ pdflatex -jobname $(basename $@) -file-line-error $(patsubst %.pdf, %.tikz.tex, $@)
+
+$(LIBS):
+ ln -fs libs/$@ ./
+
+clean-libs:
+ rm -f $(LIBS)
+
+clean-aux:
+ rm -f $(addsuffix .aux, $(PROJECTNAME))
+ rm -f $(addsuffix .log, $(PROJECTNAME))
+
+clean-tex:
+ rm -f $(PDFS)
+
+clean: clean-libs clean-aux clean-tex
diff --git a/figs/libs/shapes.sty b/figs/libs/shapes.sty
new file mode 100644
index 0000000..ee9a343
--- /dev/null
+++ b/figs/libs/shapes.sty
@@ -0,0 +1,87 @@
+% square lattice (width #1, height #2, origin #3, spacing #4)
+\def\grid#1#2#3{
+ \foreach\i in {0,...,#2}{
+ \draw#3++(0,\i)--++(#1,0);
+ }
+ \foreach\i in {0,...,#1}{
+ \draw#3++(\i,0)--++(0,#2);
+ }
+}
+
+
+% cross (color #1, position #2)
+\def\cross#1#2{
+ \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
+ \begin{scope}
+ \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
+ \grid44{[color=white]#2++(-2,-2)}
+ \end{scope}
+ \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-1)--++(-1,0)--++(0,-1)--++(1,0)--++(0,-1)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
+}
+
+% V triomino (color #1, position #2)
+\def\Vtriomino#1#2{
+ \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-2)--++(2,0)--++(0,1)--++(-1,0);
+ \begin{scope}
+ \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-2)--++(2,0)--++(0,1)--++(-1,0);
+ \grid33{[color=white]#2++(-1,-1)}
+ \end{scope}
+ \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-2)--++(2,0)--++(0,1)--++(-1,0);
+}
+
+% T tetromino (color #1, position #2)
+\def\Ttetromino#1#2{
+ \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
+ \begin{scope}
+ \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
+ \grid34{[color=white]#2++(-1,-2)}
+ \end{scope}
+ \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,1)--++(-1,0);
+}
+
+% L tetromino (color #1, position #2)
+\def\Ltetromino#1#2{
+ \fill[color=#1]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(2,0)--++(0,1)--++(-1,0)--++(0,1);
+ \begin{scope}
+ \clip#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(2,0)--++(0,1)--++(-1,0)--++(0,1);
+ \grid34{[color=white]#2++(-1,-2)}
+ \end{scope}
+ \draw[color=black]#2++(0.5,0.5)--++(0,1)--++(-1,0)--++(0,-3)--++(2,0)--++(0,1)--++(-1,0)--++(0,1);
+}
+
+% P pentomino (color #1, position #2)
+\def\Ppentomino#1#2{
+ \fill[color=#1]#2++(1.5,1.5)--++(-2,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,2);
+ \begin{scope}
+ \clip#2++(1.5,1.5)--++(-2,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,2);
+ \grid34{[color=white]#2++(-1,-2)}
+ \end{scope}
+ \draw[color=black]#2++(1.5,1.5)--++(-2,0)--++(0,-3)--++(1,0)--++(0,1)--++(1,0)--++(0,2);
+}
+
+% 1x1 square (color #1, position #2)
+\def\square#1#2{
+ \fill[color=#1]#2++(-0.5,-0.5)--++(0,1)--++(1,0)--++(0,-1)--cycle;
+ \draw[color=black]#2++(-0.5,-0.5)--++(0,1)--++(1,0)--++(0,-1)--cycle;
+ \draw[color=white]#2++(-0.5,0)--++(1,0);
+ \draw[color=white]#2++(0,-0.5)--++(0,1);
+}
+
+% 2x2 square (color #1, position #2)
+\def\ttsquare#1#2{
+ \fill[color=#1]#2++(-1,-1)--++(0,2)--++(2,0)--++(0,-2)--cycle;
+ \draw[color=black]#2++(-1,-1)--++(0,2)--++(2,0)--++(0,-2)--cycle;
+}
+\def\ttsquareempty#1{
+ \draw[color=black]#1++(-1,-1)--++(0,2)--++(2,0)--++(0,-2)--cycle;
+}
+
+% diamond (color #1, position #2)
+\def\diamond#1#2{
+ \fill[color=#1]#2++(0,-1)--++(1,1)--++(-1,1)--++(-1,-1)--cycle;
+ \begin{scope}
+ \clip#2++(0,-1)--++(1,1)--++(-1,1)--++(-1,-1)--cycle;
+ \grid22{[color=white]#2++(-1,-1)}
+ \end{scope}
+ \draw[color=black]#2++(0,-1)--++(1,1)--++(-1,1)--++(-1,-1)--cycle;
+}
diff --git a/figs/packings.fig/Makefile b/figs/packings.fig/Makefile
new file mode 120000
index 0000000..704310e
--- /dev/null
+++ b/figs/packings.fig/Makefile
@@ -0,0 +1 @@
+../libs/Makefile \ No newline at end of file
diff --git a/figs/packings.fig/cross_packing_l.tikz.tex b/figs/packings.fig/cross_packing_l.tikz.tex
new file mode 100644
index 0000000..b7b6b74
--- /dev/null
+++ b/figs/packings.fig/cross_packing_l.tikz.tex
@@ -0,0 +1,14 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+ \foreach \k in {0,...,3}{
+ \foreach \l in {0,...,3}{
+ \cross{teal}{(-2*\l,\l)++(\k,2*\k)}
+ }
+ }
+\end{tikzpicture}
+\end{document}
diff --git a/figs/packings.fig/cross_packing_r.tikz.tex b/figs/packings.fig/cross_packing_r.tikz.tex
new file mode 100644
index 0000000..1332a68
--- /dev/null
+++ b/figs/packings.fig/cross_packing_r.tikz.tex
@@ -0,0 +1,14 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+ \foreach \k in {0,...,3}{
+ \foreach \l in {0,...,3}{
+ \cross{teal}{(-\l,2*\l)++(2*\k,\k)}
+ }
+ }
+\end{tikzpicture}
+\end{document}
diff --git a/figs/packings.fig/libs/shapes.sty b/figs/packings.fig/libs/shapes.sty
new file mode 120000
index 0000000..eaa25c7
--- /dev/null
+++ b/figs/packings.fig/libs/shapes.sty
@@ -0,0 +1 @@
+../../libs/shapes.sty \ No newline at end of file
diff --git a/figs/shapes.fig/L_tetromino.tikz.tex b/figs/shapes.fig/L_tetromino.tikz.tex
new file mode 100644
index 0000000..5c82766
--- /dev/null
+++ b/figs/shapes.fig/L_tetromino.tikz.tex
@@ -0,0 +1,11 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\grid34{(-1,-2)}
+\Ltetromino{teal}{(0,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/Makefile b/figs/shapes.fig/Makefile
new file mode 120000
index 0000000..704310e
--- /dev/null
+++ b/figs/shapes.fig/Makefile
@@ -0,0 +1 @@
+../libs/Makefile \ No newline at end of file
diff --git a/figs/shapes.fig/P_pentomino.tikz.tex b/figs/shapes.fig/P_pentomino.tikz.tex
new file mode 100644
index 0000000..9ef3990
--- /dev/null
+++ b/figs/shapes.fig/P_pentomino.tikz.tex
@@ -0,0 +1,11 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\grid34{(-1,-2)}
+\Ppentomino{teal}{(0,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/T_tetromino.tikz.tex b/figs/shapes.fig/T_tetromino.tikz.tex
new file mode 100644
index 0000000..087e809
--- /dev/null
+++ b/figs/shapes.fig/T_tetromino.tikz.tex
@@ -0,0 +1,11 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\grid34{(-1,-2)}
+\Ttetromino{teal}{(0,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/V_triomino.tikz.tex b/figs/shapes.fig/V_triomino.tikz.tex
new file mode 100644
index 0000000..ba07c5f
--- /dev/null
+++ b/figs/shapes.fig/V_triomino.tikz.tex
@@ -0,0 +1,11 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\grid33{(-1,-1)}
+\Vtriomino{teal}{(0,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/cross.tikz.tex b/figs/shapes.fig/cross.tikz.tex
new file mode 100644
index 0000000..ef5f391
--- /dev/null
+++ b/figs/shapes.fig/cross.tikz.tex
@@ -0,0 +1,11 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\grid44{(-2,-2)}
+\cross{teal}{(0,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/diamond.tikz.tex b/figs/shapes.fig/diamond.tikz.tex
new file mode 100644
index 0000000..6d9eaa4
--- /dev/null
+++ b/figs/shapes.fig/diamond.tikz.tex
@@ -0,0 +1,11 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+\grid44{(-2,-2)}
+\diamond{teal}{(0,0)}
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/hexagon.tikz.tex b/figs/shapes.fig/hexagon.tikz.tex
new file mode 100644
index 0000000..a23b7dc
--- /dev/null
+++ b/figs/shapes.fig/hexagon.tikz.tex
@@ -0,0 +1,37 @@
+\documentclass{standalone}
+
+\usepackage{tikz}
+\usepackage{shapes}
+
+\begin{document}
+\begin{tikzpicture}
+
+\draw(0,0)--++(2,0);
+\draw(120:1)--++(3,0);
+\draw(120:2)--++(4,0);
+\draw(120:2)++(60:1)--++(3,0);
+\draw(120:2)++(60:2)--++(2,0);
+
+\draw(0,0)--++(60:4);
+\draw(1,0)--++(60:3);
+\draw(2,0)--++(60:2);
+\draw(120:1)--++(60:3);
+\draw(120:2)--++(60:2);
+
+\draw(0,0)--++(120:2);
+\draw(1,0)--++(120:3);
+\draw(2,0)--++(120:4);
+\draw(2,0)++(60:1)--++(120:3);
+\draw(2,0)++(60:2)--++(120:2);
+
+\fill[color=teal](60:1)--++(0:1)--++(60:1)--++(120:1)--++(180:1)--++(240:1)--++(300:1)--cycle;
+
+\draw[color=white](60:1)--++(60:2);
+\draw[color=white](60:1)++(1,0)--++(120:2);
+\draw[color=white](60:1)++(120:1)--++(2,0);
+
+\draw(60:1)--++(0:1)--++(60:1)--++(120:1)--++(180:1)--++(240:1)--++(300:1)--cycle;
+
+
+\end{tikzpicture}
+\end{document}
diff --git a/figs/shapes.fig/libs/shapes.sty b/figs/shapes.fig/libs/shapes.sty
new file mode 120000
index 0000000..eaa25c7
--- /dev/null
+++ b/figs/shapes.fig/libs/shapes.sty
@@ -0,0 +1 @@
+../../libs/shapes.sty \ No newline at end of file