Skip to content

Commit 94a7202

Browse files
committed
update community/awards/teach_me_qiskit_2018 to work on qiskit 0.8.1
update: chsh_game & cryptography tutorials add: qiskit package versions to each notebook move: author name and link in the index.ipynb & README.md from qiskit 0.6 to 0.8.1
1 parent ec4f696 commit 94a7202

File tree

4 files changed

+192
-113
lines changed

4 files changed

+192
-113
lines changed

awards/teach_me_qiskit_2018/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ Most of the tutorials were written and tested with [qiskit-terra](https://github
55
version 0.4.15.
66

77

8-
Thanks to the awesome community these tutorials are updated to work with the Qiskit 0.6
9-
- [W State](w_state) by Pierre Decoodt - W states and interesting games using them.
10-
- [State Distribution in Qubit Chains](state_distribution_in_qubit_chains/index.ipynb) by Alexander Yu. Vlasov - state transport in quantum chains.
8+
Thanks to the awesome community these tutorials are updated to work with the Qiskit 0.8.1
119
- [CHSH Game](chsh_game/CHSH%20game-tutorial.ipynb) by Mirko Amico - get used to the quantum weirdness by playing a quantum game.
1210
- [Cryptography with BB84](cryptography/Cryptography.ipynb) by Costantino Carugno - implementation of the famous BB84 protocol.
11+
12+
The following work with Qiskit (0.6.0) from time of submission.
13+
- [W State](w_state) by Pierre Decoodt - W states and interesting games using them.
14+
- [State Distribution in Qubit Chains](state_distribution_in_qubit_chains/index.ipynb) by Alexander Yu. Vlasov - state transport in quantum chains.
1315
- [E91 Quantum Key Distribution Protocol](e91_qkd/e91_quantum_key_distribution_protocol.ipynb) by Andrey Kardashin - a tutorial on quantum key distribution based on the protocol by Ekert in 1991.
1416
- [Elementary Arithmetic Operations](elementary_arithmetic_operations/elementary_arithmetic_operations.ipynb) by Carlos Bravo Prieto - addition and modular exponentiation with quantum circuits which are important for Shor's algorithm.
1517
- [Hadamard Action](hadamard_action) by Connor Fieweger - three approaches to show equivalences of circuits.
1618
- [Quantum Cryptography](quantum_cryptography_qkd/Quantum_Cryptography2.ipynb) by A. J. Rasmusson and Richard Barney - quantum key distribution with the BB84 protocol.
1719
- [Quantum Error Correction](quantum_error_correction/error_correction.ipynb) by Andrew Selzler, Yin Li, Frederick Ira Moxley III - qubit errors and how to threat them.
1820
- [Quantum Machine Learning](quantum_machine_learning/QISKIT%20for%20quantum%20machine%20learning.ipynb) by Shan Jin, Xi He, Xiaokai Hou, Li Sun, Dingding Wen, Shaojun Wu and Xiaoting Wang - quantum k-means, linear system of equation, and SVM.
1921

20-
The others work with Qiskit (0.4.15) from time of submission.
22+
The following work with Qiskit (0.4.15) from time of submission.
2123
- [Exact Ising Model Simulation](exact_ising_model_simulation/Ising_time_evolution.ipynb) by Alba Cervera-Lierta - how to simulate time evolution at zero time. *The winner* of the Teach Me QISKit Award 2018. See [here](https://www.ibm.com/blogs/research/2018/06/teach-qiskit-winner/) for the announcement.

awards/teach_me_qiskit_2018/chsh_game/CHSH game-tutorial.ipynb

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"<img src=\"../../../images/qiskit-heading.gif\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"500 px\" align=\"left\">"
7+
"<img src=\"../../../../images/qiskit-heading.gif\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"500 px\" align=\"left\">"
88
]
99
},
1010
{
@@ -24,7 +24,35 @@
2424
"metadata": {},
2525
"source": [
2626
"### Contributors\n",
27-
"Mirko Amico"
27+
"Mirko Amico\n",
28+
"\n",
29+
"### Qiskit Package Versions"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 1,
35+
"metadata": {},
36+
"outputs": [
37+
{
38+
"data": {
39+
"text/plain": [
40+
"{'qiskit': '0.10.3',\n",
41+
" 'qiskit-terra': '0.8.1',\n",
42+
" 'qiskit-ignis': '0.1.1',\n",
43+
" 'qiskit-aer': '0.2.1',\n",
44+
" 'qiskit-ibmq-provider': '0.2.2',\n",
45+
" 'qiskit-aqua': '0.5.1'}"
46+
]
47+
},
48+
"execution_count": 1,
49+
"metadata": {},
50+
"output_type": "execute_result"
51+
}
52+
],
53+
"source": [
54+
"import qiskit\n",
55+
"qiskit.__qiskit_version__"
2856
]
2957
},
3058
{
@@ -104,7 +132,7 @@
104132
},
105133
{
106134
"cell_type": "code",
107-
"execution_count": 1,
135+
"execution_count": 2,
108136
"metadata": {},
109137
"outputs": [],
110138
"source": [
@@ -113,13 +141,13 @@
113141
"import random as rand\n",
114142
"\n",
115143
"# importing Qiskit\n",
116-
"from qiskit import Aer\n",
144+
"from qiskit import BasicAer\n",
117145
"from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute"
118146
]
119147
},
120148
{
121149
"cell_type": "code",
122-
"execution_count": 2,
150+
"execution_count": 3,
123151
"metadata": {},
124152
"outputs": [],
125153
"source": [
@@ -128,7 +156,7 @@
128156
},
129157
{
130158
"cell_type": "code",
131-
"execution_count": 1,
159+
"execution_count": 4,
132160
"metadata": {},
133161
"outputs": [
134162
{
@@ -152,7 +180,7 @@
152180
"<IPython.core.display.HTML object>"
153181
]
154182
},
155-
"execution_count": 1,
183+
"execution_count": 4,
156184
"metadata": {},
157185
"output_type": "execute_result"
158186
}
@@ -196,7 +224,7 @@
196224
},
197225
{
198226
"cell_type": "code",
199-
"execution_count": 3,
227+
"execution_count": 5,
200228
"metadata": {},
201229
"outputs": [],
202230
"source": [
@@ -227,15 +255,15 @@
227255
},
228256
{
229257
"cell_type": "code",
230-
"execution_count": 4,
258+
"execution_count": 6,
231259
"metadata": {},
232260
"outputs": [
233261
{
234262
"name": "stdout",
235263
"output_type": "stream",
236264
"text": [
237-
"select the classical strategy for Alice, input 1,2,3 or 4 to pick one of the strategies listed above 1\n",
238-
"select the classical strategy for Bob, input 1,2,3 or 4 to pick one of the strategies listed above 4\n"
265+
"select the classical strategy for Alice, input 1,2,3 or 4 to pick one of the strategies listed above 2\n",
266+
"select the classical strategy for Bob, input 1,2,3 or 4 to pick one of the strategies listed above 1\n"
239267
]
240268
}
241269
],
@@ -249,14 +277,14 @@
249277
},
250278
{
251279
"cell_type": "code",
252-
"execution_count": 5,
280+
"execution_count": 7,
253281
"metadata": {},
254282
"outputs": [
255283
{
256284
"name": "stdout",
257285
"output_type": "stream",
258286
"text": [
259-
"Alice and Bob won the game with probability: 77.0 %\n"
287+
"Alice and Bob won the game with probability: 76.0 %\n"
260288
]
261289
}
262290
],
@@ -324,7 +352,7 @@
324352
},
325353
{
326354
"cell_type": "code",
327-
"execution_count": 6,
355+
"execution_count": 8,
328356
"metadata": {},
329357
"outputs": [],
330358
"source": [
@@ -373,15 +401,15 @@
373401
},
374402
{
375403
"cell_type": "code",
376-
"execution_count": 7,
404+
"execution_count": 9,
377405
"metadata": {},
378406
"outputs": [
379407
{
380408
"name": "stdout",
381409
"output_type": "stream",
382410
"text": [
383-
"select the quantum strategy for Alice, input 1,2 or 3 to pick one of the strategies listed above: 3\n",
384-
"select the quantum strategy for Bob, input 1,2 or 3 to pick one of the strategies listed above: 3\n"
411+
"select the quantum strategy for Alice, input 1,2 or 3 to pick one of the strategies listed above: 2\n",
412+
"select the quantum strategy for Bob, input 1,2 or 3 to pick one of the strategies listed above: 1\n"
385413
]
386414
}
387415
],
@@ -395,21 +423,21 @@
395423
},
396424
{
397425
"cell_type": "code",
398-
"execution_count": 8,
426+
"execution_count": 10,
399427
"metadata": {},
400428
"outputs": [
401429
{
402430
"name": "stdout",
403431
"output_type": "stream",
404432
"text": [
405-
"Alice and Bob won the game with probability: 86.0 %\n"
433+
"Alice and Bob won the game with probability: 52.0 %\n"
406434
]
407435
}
408436
],
409437
"source": [
410438
"# set parameters of the quantum run of the game \n",
411439
"shots = 1 # set how many times the circuit is run, accumulating statistics about the measurement outcomes \n",
412-
"backend = Aer.get_backend('qasm_simulator') # set the machine where the quantum circuit is to be run \n",
440+
"backend = BasicAer.get_backend('qasm_simulator') # set the machine where the quantum circuit is to be run \n",
413441
"\n",
414442
"#fixes the numbers of games to be played\n",
415443
"N=100\n",
@@ -508,14 +536,14 @@
508536
},
509537
{
510538
"cell_type": "code",
511-
"execution_count": 9,
539+
"execution_count": 11,
512540
"metadata": {},
513541
"outputs": [
514542
{
515543
"name": "stdout",
516544
"output_type": "stream",
517545
"text": [
518-
"The quantum strategy gave Alice and Bob higher chances of winning\n"
546+
"The classical strategy gave Alice and Bob higher chances of winning\n"
519547
]
520548
}
521549
],

0 commit comments

Comments
 (0)