Skip to content

Commit

Permalink
Added device selection to jupyter notebook.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashaener committed Oct 3, 2017
1 parent 5da1d97 commit 7616ee7
Showing 1 changed file with 29 additions and 38 deletions.
67 changes: 29 additions & 38 deletions examples/ibm_entangle.ipynb
Expand Up @@ -57,7 +57,7 @@
},
"outputs": [],
"source": [
"engine = MainEngine(IBMBackend(use_hardware=True, num_runs=1024, verbose=True))\n",
"engine = MainEngine(IBMBackend(use_hardware=True, num_runs=1024, verbose=True, device='ibmqx4'))\n",
"qureg = engine.allocate_qureg(3)"
]
},
Expand Down Expand Up @@ -111,19 +111,19 @@
"output_type": "stream",
"text": [
"Authenticating...\n",
"IBM QE user (e-mail) > dsteiger@phys.ethz.ch\n",
"IBM QE user (e-mail) > haenert@phys.ethz.ch\n",
"IBM QE password > ········\n",
"Running code...\n",
"Waiting for results...\n",
"Done.\n",
"00000 with p = 0.4677734375*\n",
"00000 with p = 0.4814453125\n",
"10000 with p = 0.00390625\n",
"01000 with p = 0.009765625\n",
"11000 with p = 0.0224609375\n",
"00100 with p = 0.005859375\n",
"10100 with p = 0.0263671875\n",
"01100 with p = 0.0322265625\n",
"11100 with p = 0.431640625\n"
"01000 with p = 0.0087890625\n",
"11000 with p = 0.0205078125\n",
"00100 with p = 0.02734375\n",
"10100 with p = 0.046875\n",
"01100 with p = 0.04296875\n",
"11100 with p = 0.3681640625*\n"
]
}
],
Expand Down Expand Up @@ -155,7 +155,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[0, 0, 0]\n"
"[1, 1, 1]\n"
]
}
],
Expand Down Expand Up @@ -239,24 +239,24 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Allocate | Qubit[0]\n",
"Allocate | Qubit[1]\n",
"H | Qubit[1]\n",
"CX | ( Qubit[1], Qubit[0] )\n",
"Allocate | Qubit[2]\n",
"H | Qubit[2]\n",
"CX | ( Qubit[2], Qubit[0] )\n",
"Allocate | Qubit[3]\n",
"H | Qubit[3]\n",
"CX | ( Qubit[3], Qubit[0] )\n",
"Allocate | Qubit[4]\n",
"H | Qubit[4]\n",
"CX | ( Qubit[4], Qubit[0] )\n",
"H | Qubit[0]\n",
"H | Qubit[1]\n",
"H | Qubit[2]\n",
"H | Qubit[3]\n",
"H | Qubit[4]\n"
"Allocate | Qureg[0]\n",
"Allocate | Qureg[1]\n",
"H | Qureg[1]\n",
"CX | ( Qureg[1], Qureg[0] )\n",
"Allocate | Qureg[2]\n",
"H | Qureg[2]\n",
"CX | ( Qureg[2], Qureg[0] )\n",
"Allocate | Qureg[3]\n",
"H | Qureg[3]\n",
"CX | ( Qureg[3], Qureg[0] )\n",
"Allocate | Qureg[4]\n",
"H | Qureg[4]\n",
"CX | ( Qureg[4], Qureg[0] )\n",
"H | Qureg[0]\n",
"H | Qureg[1]\n",
"H | Qureg[2]\n",
"H | Qureg[3]\n",
"H | Qureg[4]\n"
]
}
],
Expand Down Expand Up @@ -370,15 +370,6 @@
"source": [
"print([int(q) for q in qureg3])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -397,7 +388,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.3"
"version": "3.4.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 7616ee7

Please sign in to comment.