|
27 | 27 | "source": [ |
28 | 28 | "## Introduction\n", |
29 | 29 | "\n", |
30 | | - "This notebook shows how to use the Qiskit Aer `noise.utils.approximate_quantum_error` and `noise.utils. approximate_noise_model` to transform quantum noise channels into a different, more suitable, noise channel.\n", |
| 30 | + "This notebook shows how to use the Qiskit Aer utility functions `approximate_quantum_error` and `approximate_noise_model` to transform quantum noise channels into a different, more suitable, noise channel.\n", |
31 | 31 | "\n", |
32 | 32 | "Our guiding example is Clifford simulation. A Clifford simulator can efficiently simulate quantum computations which include gates only from a limited, non-universal set of gates (the Clifford gates). Not all quantum noises can be added to such simulations; hence, we aim to find a \"close\" noise channel which can be simulated in a Clifford simulator.\n", |
33 | 33 | "\n", |
34 | | - "We begin by importing the transformation functions." |
| 34 | + "We begin by importing the transformation functions from the Aer provider utilities" |
35 | 35 | ] |
36 | 36 | }, |
37 | 37 | { |
|
45 | 45 | }, |
46 | 46 | "outputs": [], |
47 | 47 | "source": [ |
48 | | - "from qiskit.providers.aer.noise.utils import approximate_quantum_error\n", |
49 | | - "from qiskit.providers.aer.noise.utils import approximate_noise_model" |
| 48 | + "from qiskit.providers.aer.utils import approximate_quantum_error\n", |
| 49 | + "from qiskit.providers.aer.utils import approximate_noise_model" |
50 | 50 | ] |
51 | 51 | }, |
52 | 52 | { |
|
69 | 69 | }, |
70 | 70 | "outputs": [], |
71 | 71 | "source": [ |
72 | | - "from qiskit.providers.aer.noise.errors.standard_errors import amplitude_damping_error\n", |
73 | | - "from qiskit.providers.aer.noise.errors.standard_errors import reset_error\n", |
74 | | - "from qiskit.providers.aer.noise.errors.standard_errors import pauli_error" |
75 | | - ] |
76 | | - }, |
77 | | - { |
78 | | - "cell_type": "code", |
79 | | - "execution_count": 3, |
80 | | - "metadata": { |
81 | | - "ExecuteTime": { |
82 | | - "end_time": "2019-08-19T17:13:36.691234Z", |
83 | | - "start_time": "2019-08-19T17:13:36.688533Z" |
84 | | - } |
85 | | - }, |
86 | | - "outputs": [], |
87 | | - "source": [ |
88 | | - "import numpy as np" |
| 72 | + "import numpy as np\n", |
| 73 | + "\n", |
| 74 | + "# Import Aer QuantumError functions that will be used\n", |
| 75 | + "from qiskit.providers.aer.noise import amplitude_damping_error\n", |
| 76 | + "from qiskit.providers.aer.noise import reset_error\n", |
| 77 | + "from qiskit.providers.aer.noise import pauli_error" |
89 | 78 | ] |
90 | 79 | }, |
91 | 80 | { |
|
98 | 87 | "\n", |
99 | 88 | "Given quantum channels $\\mathcal{E}_{1},\\dots,\\mathcal{E}_{r}$, and probabilities $p_1, p_2, \\dots, p_r$ such that $0\\le p_i \\le 1$ and $p_1+\\dots +p_r = 1$, a new quantum channel $\\mathcal{C}_\\mathcal{E}$ can be constructed such that $\\mathcal{C}_\\mathcal{E}(\\rho)$ has the effect of choosing the channel $\\mathcal{E}_i$ with probability $p_i$ and applying it to $\\rho$.\n", |
100 | 89 | "\n", |
101 | | - "The noise transformation module solves the following optimization problem: Given a channel $\\mathcal{C}$ (\"goal\") and a list of channels $\\mathcal{E}_{1},\\dots,\\mathcal{E}_{r}$, find the probabilities $p_1, p_2, \\dots, p_r$ minimizing $D(\\mathcal{C}, \\mathcal{C}_\\mathcal{E})$ according to some distance metric $D$ (the Hilbert-Schmidt metric is currently used).\n", |
| 90 | + "The noise transformation function solves the following optimization problem: Given a channel $\\mathcal{C}$ (\"goal\") and a list of channels $\\mathcal{E}_{1},\\dots,\\mathcal{E}_{r}$, find the probabilities $p_1, p_2, \\dots, p_r$ minimizing $D(\\mathcal{C}, \\mathcal{C}_\\mathcal{E})$ according to some distance metric $D$ (the Hilbert-Schmidt metric is currently used).\n", |
102 | 91 | "\n", |
103 | 92 | "To ensure the approximation is honest, in the sense that the approximate error channel serves as an \"upper bound\" for the actual error channel, we add the additional honesty constraint:\n", |
104 | 93 | "\n", |
|
148 | 137 | }, |
149 | 138 | { |
150 | 139 | "cell_type": "code", |
151 | | - "execution_count": 4, |
| 140 | + "execution_count": 3, |
152 | 141 | "metadata": { |
153 | 142 | "ExecuteTime": { |
154 | 143 | "end_time": "2019-08-19T17:13:36.791986Z", |
|
171 | 160 | }, |
172 | 161 | { |
173 | 162 | "cell_type": "code", |
174 | | - "execution_count": 5, |
| 163 | + "execution_count": 4, |
175 | 164 | "metadata": { |
176 | 165 | "ExecuteTime": { |
177 | 166 | "end_time": "2019-08-19T17:13:36.812282Z", |
|
224 | 213 | }, |
225 | 214 | { |
226 | 215 | "cell_type": "code", |
227 | | - "execution_count": 6, |
| 216 | + "execution_count": 5, |
228 | 217 | "metadata": { |
229 | 218 | "ExecuteTime": { |
230 | 219 | "end_time": "2019-08-19T17:13:37.367331Z", |
|
265 | 254 | }, |
266 | 255 | { |
267 | 256 | "cell_type": "code", |
268 | | - "execution_count": 7, |
| 257 | + "execution_count": 6, |
269 | 258 | "metadata": { |
270 | 259 | "ExecuteTime": { |
271 | 260 | "end_time": "2019-08-19T17:13:38.083970Z", |
|
307 | 296 | }, |
308 | 297 | { |
309 | 298 | "cell_type": "code", |
310 | | - "execution_count": 8, |
| 299 | + "execution_count": 7, |
311 | 300 | "metadata": { |
312 | 301 | "ExecuteTime": { |
313 | 302 | "end_time": "2019-08-19T17:13:57.085790Z", |
|
318 | 307 | { |
319 | 308 | "data": { |
320 | 309 | "text/html": [ |
321 | | - "<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td>Qiskit</td><td>0.14.0</td></tr><tr><td>Terra</td><td>0.11.0</td></tr><tr><td>Aer</td><td>0.3.4</td></tr><tr><td>Ignis</td><td>0.2.0</td></tr><tr><td>Aqua</td><td>0.6.1</td></tr><tr><td>IBM Q Provider</td><td>0.4.4</td></tr><tr><th>System information</th></tr><tr><td>Python</td><td>3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]</td></tr><tr><td>OS</td><td>Windows</td></tr><tr><td>CPUs</td><td>2</td></tr><tr><td>Memory (Gb)</td><td>7.9987335205078125</td></tr><tr><td colspan='2'>Tue Dec 10 15:59:30 2019 Eastern Standard Time</td></tr></table>" |
| 310 | + "<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td>Qiskit</td><td>None</td></tr><tr><td>Terra</td><td>0.12.0.dev0+c028a28</td></tr><tr><td>Aer</td><td>0.4.0</td></tr><tr><td>Ignis</td><td>0.3.0.dev0+829207f</td></tr><tr><td>Aqua</td><td>0.7.0.dev0+2776c5d</td></tr><tr><td>IBM Q Provider</td><td>0.4.6rc1</td></tr><tr><th>System information</th></tr><tr><td>Python</td><td>3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 14:38:56) \n", |
| 311 | + "[Clang 4.0.1 (tags/RELEASE_401/final)]</td></tr><tr><td>OS</td><td>Darwin</td></tr><tr><td>CPUs</td><td>6</td></tr><tr><td>Memory (Gb)</td><td>32.0</td></tr><tr><td colspan='2'>Wed Feb 05 11:32:35 2020 EST</td></tr></table>" |
322 | 312 | ], |
323 | 313 | "text/plain": [ |
324 | 314 | "<IPython.core.display.HTML object>" |
|
330 | 320 | { |
331 | 321 | "data": { |
332 | 322 | "text/html": [ |
333 | | - "<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>© Copyright IBM 2017, 2019.</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>" |
| 323 | + "<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>© 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>" |
334 | 324 | ], |
335 | 325 | "text/plain": [ |
336 | 326 | "<IPython.core.display.HTML object>" |
|
370 | 360 | "name": "python", |
371 | 361 | "nbconvert_exporter": "python", |
372 | 362 | "pygments_lexer": "ipython3", |
373 | | - "version": "3.7.4" |
| 363 | + "version": "3.7.5" |
374 | 364 | }, |
375 | 365 | "varInspector": { |
376 | 366 | "cols": { |
|
0 commit comments