def fractalsquare(L): from support.fractalsquare import fractalsquare2 imatrix, coords = fractalsquare2(L=L) from .old.models import Graph G = Graph.from_imatrix(imatrix, coords=coords) return G
energy += 10 intn = numpy.round(energy) return intn # Mode 1: #coords = glencoords() coords, L = fractalsquare1(4) G = pcd.Graph.from_coords_and_efunc(coords, #lambda x: e_lj(x)*100, e_lj, boxsize=L) G = pcd.Graph(N=len(coords)) # Mode 2 #sep = 16 imatrix, coords = fractalsquare2(L=16) print imatrix print coords G = G.from_imatrix(imatrix) G.minimize(gamma=0) G.savefig('img.png', coords=coords) if not os.path.exists('imgs'): print "Creating dir:",os.path.join(os.getcwd(),'imgs') os.mkdir('imgs') def callback(gamma, data, state, **kwargs): G = data['Gmin'] G.remap(check=False) fname = 'imgs/gamma%011.5f.png'%gamma