Skip to content

Commit

Permalink
removing legacy mixing flag
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdolan authored and maxdolan committed Aug 2, 2024
1 parent 486123c commit bd89449
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions examples/simple_examples/monte_carlo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -16,14 +16,14 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"def mc_simulation(number_of_particles, temperature, box_length, number_of_steps, sample_frequency):\n",
" # Initialise the system placing the particles on a square lattice\n",
" constants=[[1.363e-134, 9.273e-78],[1.363e-134, 9.273e-78]]\n",
" system = mc.initialise(number_of_particles, temperature, box_length, 'square', constants=constants, mixing = False)\n",
" system = mc.initialise(number_of_particles, temperature, box_length, 'square', constants=constants)\n",
" # This sets the sampling class as Energy, which shows the energy of the system\n",
" sample_system = sample.Energy(system)\n",
" # Compute the energy of the system\n",
Expand Down Expand Up @@ -68,20 +68,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "TypeError",
"evalue": "initialise() got an unexpected keyword argument 'mixing'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[27], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m system \u001b[38;5;241m=\u001b[39m \u001b[43mmc_simulation\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m50\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m273.15\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m45\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m2500\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m25\u001b[39;49m\u001b[43m)\u001b[49m\n",
"Cell \u001b[0;32mIn[26], line 4\u001b[0m, in \u001b[0;36mmc_simulation\u001b[0;34m(number_of_particles, temperature, box_length, number_of_steps, sample_frequency)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmc_simulation\u001b[39m(number_of_particles, temperature, box_length, number_of_steps, sample_frequency):\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m# Initialise the system placing the particles on a square lattice\u001b[39;00m\n\u001b[1;32m 3\u001b[0m constants\u001b[38;5;241m=\u001b[39m[[\u001b[38;5;241m1.363e-134\u001b[39m, \u001b[38;5;241m9.273e-78\u001b[39m],[\u001b[38;5;241m1.363e-134\u001b[39m, \u001b[38;5;241m9.273e-78\u001b[39m]]\n\u001b[0;32m----> 4\u001b[0m system \u001b[38;5;241m=\u001b[39m \u001b[43mmc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minitialise\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnumber_of_particles\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtemperature\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mbox_length\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43msquare\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconstants\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconstants\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmixing\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# This sets the sampling class as Energy, which shows the energy of the system\u001b[39;00m\n\u001b[1;32m 6\u001b[0m sample_system \u001b[38;5;241m=\u001b[39m sample\u001b[38;5;241m.\u001b[39mEnergy(system)\n",
"\u001b[0;31mTypeError\u001b[0m: initialise() got an unexpected keyword argument 'mixing'"
]
}
],
"source": [
"system = mc_simulation(50, 273.15, 45, 1000, 25)"
"system = mc_simulation(50, 273.15, 45, 2500, 25)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit bd89449

Please sign in to comment.