Skip to content

Commit

Permalink
update documentation files
Browse files Browse the repository at this point in the history
  • Loading branch information
DeborahVolpe committed Jun 5, 2024
1 parent 17f1c60 commit 781331a
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 15 deletions.
78 changes: 68 additions & 10 deletions docs/Quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "697e4c2b",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'mqt'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[2], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mmqt\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mqao\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Constraints, ObjectiveFunction, Problem, Solver, Variables\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'mqt'"
]
}
],
"source": [
"from mqt.qao import Constraints, ObjectiveFunction, Problem, Solver, Variables"
]
Expand All @@ -28,10 +40,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "73c0a2f9-adbd-4f85-8843-b6ab2ef53da8",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "NameError",
"evalue": "name 'Variables' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[3], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m var \u001b[38;5;241m=\u001b[39m \u001b[43mVariables\u001b[49m()\n\u001b[0;32m 2\u001b[0m a \u001b[38;5;241m=\u001b[39m var\u001b[38;5;241m.\u001b[39madd_binary_variable(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ma\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 3\u001b[0m b \u001b[38;5;241m=\u001b[39m var\u001b[38;5;241m.\u001b[39madd_discrete_variable(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m, [\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m3\u001b[39m])\n",
"\u001b[1;31mNameError\u001b[0m: name 'Variables' is not defined"
]
}
],
"source": [
"var = Variables()\n",
"a = var.add_binary_variable(\"a\")\n",
Expand All @@ -52,7 +76,18 @@
"execution_count": null,
"id": "b3f643db-f833-433c-87f8-65cdc5355304",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31mRunning cells with 'c:\\Users\\39333\\miniconda3\\envs\\MyEnvironmentName\\python.exe' requires the ipykernel package.\n",
"\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
"\u001b[1;31mCommand: 'conda install -p c:\\Users\\39333\\miniconda3\\envs\\MyEnvironmentName ipykernel --update-deps --force-reinstall'"
]
}
],
"source": [
"obj_func = ObjectiveFunction()\n",
"obj_func.add_objective_function(a + b * c + c**2)"
Expand All @@ -71,7 +106,18 @@
"execution_count": null,
"id": "0c327466-7905-45b9-980a-f96ca8cffadb",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31mRunning cells with 'c:\\Users\\39333\\miniconda3\\envs\\MyEnvironmentName\\python.exe' requires the ipykernel package.\n",
"\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
"\u001b[1;31mCommand: 'conda install -p c:\\Users\\39333\\miniconda3\\envs\\MyEnvironmentName ipykernel --update-deps --force-reinstall'"
]
}
],
"source": [
"cst = Constraints()\n",
"cst.add_constraint(\"b + c >= 2\", variable_precision=True)"
Expand All @@ -90,7 +136,18 @@
"execution_count": null,
"id": "fe643f31-9d3e-4b7f-875a-af27e3dab5ed",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31mRunning cells with 'c:\\Users\\39333\\miniconda3\\envs\\MyEnvironmentName\\python.exe' requires the ipykernel package.\n",
"\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n",
"\u001b[1;31mCommand: 'conda install -p c:\\Users\\39333\\miniconda3\\envs\\MyEnvironmentName ipykernel --update-deps --force-reinstall'"
]
}
],
"source": [
"prb = Problem()\n",
"prb.create_problem(var, cst, obj_func)"
Expand All @@ -101,7 +158,7 @@
"id": "93392cb4",
"metadata": {},
"source": [
"## Solve with Quantum Annealing"
"## Solve with Simulated Annealing"
]
},
{
Expand All @@ -111,7 +168,7 @@
"metadata": {},
"outputs": [],
"source": [
"solution = Solver().solve_Dwave_quantum_annealer(prb, token=token)"
"solution = Solver().solve_simulated_annealing(prb)"
]
}
],
Expand All @@ -130,7 +187,8 @@
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3"
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
5 changes: 0 additions & 5 deletions tests/__init__.py

This file was deleted.

0 comments on commit 781331a

Please sign in to comment.