Skip to content

Commit

Permalink
updated the notebook for realzies
Browse files Browse the repository at this point in the history
  • Loading branch information
positr0nium committed Jan 9, 2025
1 parent dcc6a48 commit b5e751b
Showing 1 changed file with 61 additions and 10 deletions.
71 changes: 61 additions & 10 deletions src/qrisp/examples/jasp_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -789,10 +789,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"id": "2793d8d1-73df-4d9b-bfe0-de4ca15953fe",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"9.254493951797485\n"
]
}
],
"source": [
"import time\n",
"t0 = time.time()\n",
Expand All @@ -810,10 +818,19 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 19,
"id": "e197d7f3-c954-400c-b4f6-98a515106865",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1440.0\n",
"Took 0.005087852478027344 to simulate 120 iterations\n"
]
}
],
"source": [
"t0 = time.time()\n",
"print(main(3, 4, 120)) # Expected to be 3*4*120 = 1440\n",
Expand All @@ -830,10 +847,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"id": "93a7e489-ea30-43ce-a195-5d56b4a666c8",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"475690240.0\n"
]
}
],
"source": [
"print(main(532, 233, 1000000))"
]
Expand All @@ -851,10 +876,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"id": "342f1bdc-4b9c-408b-b267-fee3e02b919f",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 0, Loss: 1.1255793726499572\n",
"Epoch 10, Loss: 1.075287382286886\n",
"Epoch 20, Loss: 1.0277242824464026\n",
"Epoch 30, Loss: 0.9834605224633858\n",
"Epoch 40, Loss: 0.9429307856413472\n",
"Epoch 50, Loss: 0.9063988210301136\n",
"Epoch 60, Loss: 0.8739494586871209\n",
"Epoch 70, Loss: 0.845496268788587\n",
"Epoch 80, Loss: 0.8208042884256824\n",
"Epoch 90, Loss: 0.7995303839215936\n",
"Final accuracy: 0.49931600689888\n"
]
}
],
"source": [
"import jax\n",
"import jax.numpy as jnp\n",
Expand Down Expand Up @@ -916,10 +959,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"id": "c36ba0fb-b9e6-4b01-bd66-7c06dda7b1af",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"22.0 \u001b[2K\n"
]
}
],
"source": [
"from qrisp.jasp import *\n",
"from qrisp import *\n",
Expand Down

0 comments on commit b5e751b

Please sign in to comment.