Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Commit c54af2c

Browse files
committed
updating CNOT-Dihedral RB tutorial
1 parent 34fdf46 commit c54af2c

1 file changed

Lines changed: 56 additions & 9 deletions

File tree

qiskit/advanced/ignis/5d_cnot_dihedral_rb.ipynb

Lines changed: 56 additions & 9 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_header.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" align=\"middle\">"
7+
"![qiskit_header.png](attachment:qiskit_header.png)"
88
]
99
},
1010
{
@@ -13,15 +13,25 @@
1313
"source": [
1414
"# Non-Clifford CNOT-Dihedral Randomized Benchmarking\n",
1515
"\n",
16-
"- Last Updated: January 8, 2020\n",
16+
"- Last Updated: Feburary 19, 2020\n",
1717
"- Requires: qiskit-terra 0.11, qiskit-ignis 0.3, qiskit-aer 0.3.4\n",
1818
"\n",
1919
"## Introduction\n",
2020
"\n",
2121
"**Non-Clifford CNOT-Dihedral Randomized Benchmarking** is a variant of the Randomized Benchmarking (RB) method that is used for benchmarking certain non-Clifford gates via randomization, taken from the so-called *CNOT-dihedral group* which is generated by CNOTs and a single qubit dihedral group $\\langle T, X \\rangle$.\n",
2222
"The method is based on the paper \"Scalable randomized benchmarking of non-Clifford gates\"(https://arxiv.org/abs/1510.02720).\n",
2323
"\n",
24-
"This notebook gives an example for how to use the ``ignis.verification.randomized_benchmarking`` module in order to perform interleaved RB."
24+
"This notebook gives an example for how to use the ``ignis.verification.randomized_benchmarking`` module in order to perform interleaved RB.\n",
25+
"\n",
26+
"This notebook contains the following steps.\n",
27+
"\n",
28+
"1) Select the parameters for the non-Clifford CNOT-Dihedral RB and generate the RB sequences.\n",
29+
"\n",
30+
"2) Execute the RB circuits using Qiskit Aer Simulator (with some noise model).\n",
31+
"\n",
32+
"3) Fit the results and calculate the fidelity.\n",
33+
"\n",
34+
"4) Possible generalizations: generate non-Clifford CNOT-Dihedral RB sequences for interleaved RB and purity RB."
2535
]
2636
},
2737
{
@@ -48,7 +58,7 @@
4858
"cell_type": "markdown",
4959
"metadata": {},
5060
"source": [
51-
"## Select the Parameters of the non-Clifford CNOT-Dihedral RB Run\n",
61+
"## 1.1) Select the parameters of the non-Clifford CNOT-Dihedral RB run\n",
5262
"\n",
5363
"First, we need to choose the regular RB parameters:\n",
5464
"\n",
@@ -91,7 +101,7 @@
91101
"cell_type": "markdown",
92102
"metadata": {},
93103
"source": [
94-
"## Generate non-Clifford CNOT-Dihedral RB sequences\n",
104+
"## 1.2) Generate non-Clifford CNOT-Dihedral RB sequences\n",
95105
"\n",
96106
"We generate RB sequences. We start with a small example (so it doesn't take too long to run).\n",
97107
"\n",
@@ -226,7 +236,7 @@
226236
"cell_type": "markdown",
227237
"metadata": {},
228238
"source": [
229-
"## Define the noise model\n",
239+
"## 2) Define the noise model and execute the RB circuits\n",
230240
"\n",
231241
"We define a noise model for the simulator. To simulate decay, we add depolarizing error probabilities to the CNOT and U gates."
232242
]
@@ -340,7 +350,7 @@
340350
"cell_type": "markdown",
341351
"metadata": {},
342352
"source": [
343-
"## Fit the results\n",
353+
"## 3) Fit the results\n",
344354
"\n",
345355
"We fit the results of the non-Clifford CNOT-Dihedral Z RB circuits and the non-Clifford CNOT-Dihedral X RB circuits into an exponentially decaying function and obtain the Errors per group element $\\alpha_Z$ and $\\alpha_R$ of the Z and X sequences respectively."
346356
]
@@ -573,7 +583,7 @@
573583
"cell_type": "markdown",
574584
"metadata": {},
575585
"source": [
576-
"## Generating interleaved non-Clifford cnot-dihedral sequences\n",
586+
"## 4.1) Generating interleaved non-Clifford cnot-dihedral sequences\n",
577587
"\n",
578588
"We provide the same parameters as before including a list of interleaved gated.\n",
579589
"\n",
@@ -815,7 +825,7 @@
815825
"cell_type": "markdown",
816826
"metadata": {},
817827
"source": [
818-
"## Generating purity non-Clifford cnot-dihedral sequences\n",
828+
"## 4.2) Generating purity non-Clifford cnot-dihedral sequences\n",
819829
"\n",
820830
"We provide the same parameters as before and the following parameter for purity rb.\n",
821831
"\n",
@@ -889,6 +899,43 @@
889899
"source": [
890900
"print (rb_cnotdihedral_Z_circs[0][8][0])"
891901
]
902+
},
903+
{
904+
"cell_type": "code",
905+
"execution_count": 1,
906+
"metadata": {},
907+
"outputs": [
908+
{
909+
"data": {
910+
"text/html": [
911+
"<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td>Qiskit</td><td>0.15.0</td></tr><tr><td>Terra</td><td>0.12.0</td></tr><tr><td>Aer</td><td>0.4.0</td></tr><tr><td>Ignis</td><td>0.2.0</td></tr><tr><td>Aqua</td><td>0.6.4</td></tr><tr><td>IBM Q Provider</td><td>0.4.6</td></tr><tr><th>System information</th></tr><tr><td>Python</td><td>3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31) \n",
912+
"[GCC 7.3.0]</td></tr><tr><td>OS</td><td>Linux</td></tr><tr><td>CPUs</td><td>8</td></tr><tr><td>Memory (Gb)</td><td>62.920127868652344</td></tr><tr><td colspan='2'>Wed Feb 19 09:42:39 2020 IST</td></tr></table>"
913+
],
914+
"text/plain": [
915+
"<IPython.core.display.HTML object>"
916+
]
917+
},
918+
"metadata": {},
919+
"output_type": "display_data"
920+
},
921+
{
922+
"data": {
923+
"text/html": [
924+
"<div style='width: 100%; background-color:#d5d9e0;padding-left: 10px; padding-bottom: 10px; padding-right: 10px; padding-top: 5px'><h3>This code is a part of Qiskit</h3><p>&copy; Copyright IBM 2017, 2020.</p><p>This code is licensed under the Apache License, Version 2.0. You may<br>obtain a copy of this license in the LICENSE.txt file in the root directory<br> of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.<p>Any modifications or derivative works of this code must retain this<br>copyright notice, and modified files need to carry a notice indicating<br>that they have been altered from the originals.</p></div>"
925+
],
926+
"text/plain": [
927+
"<IPython.core.display.HTML object>"
928+
]
929+
},
930+
"metadata": {},
931+
"output_type": "display_data"
932+
}
933+
],
934+
"source": [
935+
"import qiskit.tools.jupyter\n",
936+
"%qiskit_version_table\n",
937+
"%qiskit_copyright"
938+
]
892939
}
893940
],
894941
"metadata": {

0 commit comments

Comments
 (0)