diff --git a/Exercise sheet 6/exercise_sheet_06.ipynb b/Exercise sheet 6/exercise_sheet_06.ipynb index ef61f3b..cbc1215 100644 --- a/Exercise sheet 6/exercise_sheet_06.ipynb +++ b/Exercise sheet 6/exercise_sheet_06.ipynb @@ -439,7 +439,7 @@ "\tequilibrating took 1.5426356792449951 seconds\n", "\tmeasuring took 3.485330104827881 seconds\n", "\n", - "T = 1.2000000000000002\n", + "T = 1.2\n", "\tequilibrating took 0.4475827217102051 seconds\n", "\tmeasuring took 1.3380379676818848 seconds\n", "\n", @@ -486,19 +486,19 @@ " \n", " for idx, T in enumerate(temperatures):\n", " toc()\n", - " print(\"T =\", T)\n", + " print(\"T = {:.1f}\".format(T))\n", " beta = 1/T\n", " \n", " # Equilibrate\n", " for _ in range(equilibration_moves):\n", " xy_cluster_move(state,beta)\n", - " print(\"\\tequilibrating took\", toc(), \" seconds\")\n", + " print(\"\\tequilibrating took {:2.3f} seconds\".format(toc()))\n", " \n", " # Measure\n", " for _ in range(measurement_moves):\n", - " cluster_sizes[idx] += np.norm(xy_cluster_move(state,beta))\n", + " cluster_sizes[idx] += xy_cluster_move(state,beta)\n", " cluster_sizes[idx] /= measurement_moves\n", - " print(\"\\tmeasuring took\", toc(), \" seconds\")\n", + " print(\"\\tmeasuring took {:2.3f} seconds\".format(toc()))\n", " print()\n", " \n", " f.create_dataset(\"cluster-size\",data=cluster_sizes)" @@ -628,48 +628,48 @@ "output_type": "stream", "text": [ "T = 0.5\n", - "\tequilibrating took 2.6317245960235596 seconds\n", - "\tmeasuring took 13.053837060928345 seconds\n", + "\tequilibrating took 2.632 seconds\n", + "\tmeasuring took 13.054 seconds\n", "\n", "T = 0.6\n", - "\tequilibrating took 2.8574910163879395 seconds\n", - "\tmeasuring took 12.967190027236938 seconds\n", + "\tequilibrating took 2.857 seconds\n", + "\tmeasuring took 12.967 seconds\n", "\n", "T = 0.7\n", - "\tequilibrating took 3.4188122749328613 seconds\n", - "\tmeasuring took 16.535584449768066 seconds\n", + "\tequilibrating took 3.419 seconds\n", + "\tmeasuring took 16.536 seconds\n", "\n", "T = 0.8\n", - "\tequilibrating took 3.129852294921875 seconds\n", - "\tmeasuring took 14.666396617889404 seconds\n", + "\tequilibrating took 3.130 seconds\n", + "\tmeasuring took 14.666 seconds\n", "\n", "T = 0.9\n", - "\tequilibrating took 2.749675750732422 seconds\n", - "\tmeasuring took 12.164067506790161 seconds\n", + "\tequilibrating took 2.750 seconds\n", + "\tmeasuring took 12.164 seconds\n", "\n", "T = 1.0\n", - "\tequilibrating took 2.770905017852783 seconds\n", - "\tmeasuring took 11.673817873001099 seconds\n", + "\tequilibrating took 2.771 seconds\n", + "\tmeasuring took 11.674 seconds\n", "\n", "T = 1.1\n", - "\tequilibrating took 2.59846830368042 seconds\n", - "\tmeasuring took 9.312909126281738 seconds\n", + "\tequilibrating took 2.598 seconds\n", + "\tmeasuring took 9.313 seconds\n", "\n", - "T = 1.2000000000000002\n", - "\tequilibrating took 2.9586286544799805 seconds\n", - "\tmeasuring took200] 10.83272385597229 seconds\n", + "T = 1.2\n", + "\tequilibrating took 2.959 seconds\n", + "\tmeasuring took 10.833 seconds\n", "\n", "T = 1.3\n", - "\tequilibrating took 2.4720122814178467 seconds\n", - "\tmeasuring took 9.212384223937988 seconds\n", + "\tequilibrating took 2.472 seconds\n", + "\tmeasuring took 9.212 seconds\n", "\n", "T = 1.4\n", - "\tequilibrating took 3.3535523414611816 seconds\n", - "\tmeasuring took 10.767858028411865 seconds\n", + "\tequilibrating took 3.354 seconds\n", + "\tmeasuring took 10.768 seconds\n", "\n", "T = 1.5\n", - "\tequilibrating took 3.0648155212402344 seconds\n", - "\tmeasuring took 9.897510051727295 seconds\n", + "\tequilibrating took 3.065 seconds\n", + "\tmeasuring took 9.898 seconds\n", "\n" ] } @@ -686,7 +686,7 @@ " \n", " for idx, T in enumerate(temperatures):\n", " toc()\n", - " print(\"T =\", T)\n", + " print(\"T = {:.1f}\".format(T))\n", " beta = 1/T\n", " # We let the sweep size depend on the width and the average cluster size\n", " # from before:\n", @@ -696,7 +696,7 @@ " for j in range(equil_sweeps*sweep_size):\n", " xy_cluster_move(state,beta)\n", " print(\"\\tequilibrating... [{}/{}]\".format(j, equil_sweeps*sweep_size), end='\\r')\n", - " print(\"\\tequilibrating took\", toc(), \" seconds\")\n", + " print(\"\\tequilibrating took {:2.3f} seconds\".format(toc()))\n", " \n", " # Measure\n", " for j in range(measurements):\n", @@ -708,7 +708,7 @@ " # TODO: Skip sweeps between measurements for last measurement in set.\n", " for _ in range(measure_sweeps*sweep_size):\n", " xy_cluster_move(state,beta)\n", - " print(\"\\tmeasuring took\", toc(), \" seconds\")\n", + " print(\"\\tmeasuring took {:2.3f} seconds\".format(toc()))\n", " print()\n", " \n", " f.create_dataset(\"square-magn\",data=square_magn)" @@ -844,37 +844,37 @@ "output_type": "stream", "text": [ "T = 0.5\n", - "\tequilibrating took 5.539074659347534 seconds\n", + "\tequilibrating took 5.540 seconds\n", "\n", "T = 0.6\n", - "\tequilibrating took 5.275792598724365 seconds\n", + "\tequilibrating took 5.276 seconds\n", "\n", "T = 0.7\n", - "\tequilibrating took 6.957661867141724 seconds\n", + "\tequilibrating took 6.958 seconds\n", "\n", "T = 0.8\n", - "\tequilibrating took 6.382277250289917 seconds\n", + "\tequilibrating took 6.382 seconds\n", "\n", "T = 0.9\n", - "\tequilibrating took 5.454374074935913 seconds\n", + "\tequilibrating took 5.454 seconds\n", "\n", "T = 1.0\n", - "\tequilibrating took 5.399614572525024 seconds\n", + "\tequilibrating took 5.400 seconds\n", "\n", "T = 1.1\n", - "\tequilibrating took 4.563677787780762 seconds\n", + "\tequilibrating took 4.564 seconds\n", "\n", - "T = 1.2000000000000002\n", - "\tequilibrating took 5.712708473205566 seconds\n", + "T = 1.2\n", + "\tequilibrating took 5.713 seconds\n", "\n", "T = 1.3\n", - "\tequilibrating took 5.183827877044678 seconds\n", + "\tequilibrating took 5.184 seconds\n", "\n", "T = 1.4\n", - "\tequilibrating took 6.481664180755615 seconds\n", + "\tequilibrating took 6.482 seconds\n", "\n", "T = 1.5\n", - "\tequilibrating took 6.137166976928711 seconds\n", + "\tequilibrating took 6.137 seconds\n", "\n" ] } @@ -889,7 +889,7 @@ " states = np.zeros(temperatures.shape + state.shape)\n", " for idx, T in enumerate(temperatures):\n", " toc()\n", - " print(\"T =\", T)\n", + " print(\"T = {:.1f}\".format(T))\n", " beta = 1/T\n", " sweep_size = np.ceil(width**2/f[\"cluster-size\"][idx]).astype(int)\n", " \n", @@ -897,7 +897,7 @@ " for j in range(equil_sweeps*sweep_size):\n", " xy_cluster_move(state,beta)\n", " print(\"\\tequilibrating... [{}/{}]\".format(j, equil_sweeps*sweep_size), end='\\r')\n", - " print(\"\\tequilibrating took\", toc(), \" seconds\")\n", + " print(\"\\tequilibrating took {:2.3f} seconds\".format(toc()))\n", " states[idx] = state.copy()\n", " print()\n", " \n", @@ -985,6 +985,14 @@ " plt.tight_layout()\n", " plt.show()" ] + }, + { + "cell_type": "markdown", + "id": "4b31ffe5", + "metadata": {}, + "source": [ + "The Kosterlitz-Thouless transition is vaguely visible. For $T = 1.0$ and lower, vortices and anti-vortices can be recognized. Above this temperature, this structure vanishes." + ] } ], "metadata": {