From bdf817efec1cfdd67cc6176a6664442fd98173ae Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Mon, 17 Oct 2022 20:59:01 -0400 Subject: As presented at RUMA on 2022-10-12 --- figs/diamonds.fig/diamonds.py | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 figs/diamonds.fig/diamonds.py (limited to 'figs/diamonds.fig/diamonds.py') diff --git a/figs/diamonds.fig/diamonds.py b/figs/diamonds.fig/diamonds.py new file mode 100644 index 0000000..2bc4d9c --- /dev/null +++ b/figs/diamonds.fig/diamonds.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +from math import * +import random + +# size of space (must be int) +L=30 +# number of particles +N=int(L*L/2*0.97) + +# check whether two diamonds overlap +def check_overlap(x1,x2): + if(sqrt((x1[0]-x2[0])**2+(x1[1]-x2[1])**2)<=1): + return(True) + return(False) + +# configuration +config=[] + +# put particles on odd lattice manually +for i in range(4): + for j in range(4): + if (i!=2 or j!=1): + config.append([2*int(L/2/2)+1+i+j,2*int(L/2/2)+i-j]) + +# add particles +while len(config)