#!/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)