From f950c74e38d120e42637983d504f85843a63e95d Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Wed, 4 Apr 2018 06:21:21 +0000 Subject: As presented at Princeton University on 2018-04-04 --- figs/ising.fig/Makefile | 38 +++++++++++++++++++++++++++++ figs/ising.fig/ising.py | 56 +++++++++++++++++++++++++++++++++++++++++++ figs/ising.fig/libs/ising.sty | 9 +++++++ 3 files changed, 103 insertions(+) create mode 100644 figs/ising.fig/Makefile create mode 100644 figs/ising.fig/ising.py create mode 100644 figs/ising.fig/libs/ising.sty (limited to 'figs/ising.fig') diff --git a/figs/ising.fig/Makefile b/figs/ising.fig/Makefile new file mode 100644 index 0000000..eeff491 --- /dev/null +++ b/figs/ising.fig/Makefile @@ -0,0 +1,38 @@ +PROJECTNAME=ising ising_blue ising_red transfer1 transfer2 +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 ising.py + +install: $(PDFS) + cp $^ $(INSTALLDIR)/ + +install-sources: $(SOURCES) + cp $^ $(INSTALLDIR)/ + +$(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/ising.fig/ising.py b/figs/ising.fig/ising.py new file mode 100644 index 0000000..8dd1447 --- /dev/null +++ b/figs/ising.fig/ising.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +import random +from math import * + +# size of the grid +L=8 + +# draw spins, probability of reds: p, only fill up to H +def draw_spins(p, H, file_desc): + for i in range(L): + for j in range(H): + if(random.random()