|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "8490c8b9-abc4-40df-a8d0-281ec9c9441d", |
6 | 5 | "metadata": {}, |
7 | 6 | "source": [ |
8 | 7 | "---\n", |
|
16 | 15 | }, |
17 | 16 | { |
18 | 17 | "cell_type": "markdown", |
19 | | - "id": "895ce32a-0531-416c-b076-796406bf9613", |
20 | 18 | "metadata": { |
21 | 19 | "tags": [ |
22 | 20 | "version-info" |
|
47 | 45 | }, |
48 | 46 | { |
49 | 47 | "cell_type": "markdown", |
50 | | - "id": "f7733fee-ce78-4476-8199-bcf293b9bdc4", |
51 | 48 | "metadata": {}, |
52 | 49 | "source": [ |
53 | 50 | "The error mitigation techniques [PEA](/docs/guides/error-mitigation-and-suppression-techniques#pea) and [PEC](/docs/guides/error-mitigation-and-suppression-techniques#pec) both utilize a noise learning component based on a [Pauli-Lindblad noise model](https://arxiv.org/abs/2201.09866), which is typically managed during execution after submitting one or more jobs through `qiskit-ibm-runtime` without any local access to the fitted noise model. However, as of `qiskit-ibm-runtime` v0.27.1, a [`NoiseLearner`](/docs/api/qiskit-ibm-runtime/noise-learner) and associated [`NoiseLearnerOptions`](/docs/api/qiskit-ibm-runtime/options-noise-learner-options) class have been created to obtain the results of these noise learning experiments. These results can then be stored locally as a `NoiseLearnerResult` and used as input in later experiments. This page provides an overview of its usage and the associated options available.\n", |
|
68 | 65 | { |
69 | 66 | "cell_type": "code", |
70 | 67 | "execution_count": 1, |
71 | | - "id": "a2ea782f-1d47-49e8-97fe-1f32844a104a", |
72 | 68 | "metadata": {}, |
73 | 69 | "outputs": [], |
74 | 70 | "source": [ |
|
112 | 108 | }, |
113 | 109 | { |
114 | 110 | "cell_type": "markdown", |
115 | | - "id": "9b891a09-ffb4-408a-8176-6a4e92328bad", |
116 | 111 | "metadata": {}, |
117 | 112 | "source": [ |
118 | 113 | "The resulting `NoiseLearnerResult.data` is a list of [`LayerError`](../api/qiskit-ibm-runtime/utils-noise-learner-result-layer-error) objects containing the [noise model](https://arxiv.org/abs/2201.09866) for each individual entangling layer that belongs to the target circuit(s). Each `LayerError` stores the layer information, in the form of a circuit and a set of qubit labels, alongside the [`PauliLindbladError`](../api/qiskit-ibm-runtime/utils-noise-learner-result-pauli-lindblad-error) for the noise model that was learned for the given layer." |
|
121 | 116 | { |
122 | 117 | "cell_type": "code", |
123 | 118 | "execution_count": null, |
124 | | - "id": "db9fda1f-189c-4acc-9368-b9ce7c6e7057", |
125 | 119 | "metadata": {}, |
126 | 120 | "outputs": [ |
127 | 121 | { |
|
206 | 200 | }, |
207 | 201 | { |
208 | 202 | "cell_type": "markdown", |
209 | | - "id": "425ce528-1964-4df7-86c0-0310efaf7b99", |
210 | 203 | "metadata": {}, |
211 | 204 | "source": [ |
212 | 205 | "The `LayerError.error` attribute of the noise learning result contains the generators and error rates of the fitted Pauli Lindblad model, which has the form\n", |
|
218 | 211 | }, |
219 | 212 | { |
220 | 213 | "cell_type": "markdown", |
221 | | - "id": "c819a7f6-7f42-4b08-9a33-282afac9b51f", |
222 | 214 | "metadata": {}, |
223 | 215 | "source": [ |
224 | 216 | "### Noise learning options\n", |
|
231 | 223 | { |
232 | 224 | "cell_type": "code", |
233 | 225 | "execution_count": 3, |
234 | | - "id": "93039690-4b12-4967-83cd-d05d183a71e0", |
235 | 226 | "metadata": {}, |
236 | 227 | "outputs": [], |
237 | 228 | "source": [ |
|
260 | 251 | }, |
261 | 252 | { |
262 | 253 | "cell_type": "markdown", |
263 | | - "id": "584c02d4-40ad-4089-b8a0-70d617e9d4ed", |
264 | 254 | "metadata": {}, |
265 | 255 | "source": [ |
266 | 256 | "### Input noise model to a primitive\n", |
|
271 | 261 | { |
272 | 262 | "cell_type": "code", |
273 | 263 | "execution_count": 4, |
274 | | - "id": "f49176c5-0cb0-4823-9bc6-f3a7c4483d43", |
275 | 264 | "metadata": {}, |
276 | 265 | "outputs": [], |
277 | 266 | "source": [ |
|
283 | 272 | { |
284 | 273 | "cell_type": "code", |
285 | 274 | "execution_count": 5, |
286 | | - "id": "d2f637a1-2496-4d26-a7d7-25b279fdb747", |
287 | 275 | "metadata": {}, |
288 | 276 | "outputs": [], |
289 | 277 | "source": [ |
|
296 | 284 | { |
297 | 285 | "cell_type": "code", |
298 | 286 | "execution_count": 6, |
299 | | - "id": "fff7f21f-41de-4b8c-9b75-35ae7d1aa847", |
300 | 287 | "metadata": {}, |
301 | 288 | "outputs": [], |
302 | 289 | "source": [ |
|
311 | 298 | }, |
312 | 299 | { |
313 | 300 | "cell_type": "markdown", |
314 | | - "id": "5ad112ad-afc6-41a0-9397-88978b22501d", |
315 | 301 | "metadata": {}, |
316 | 302 | "source": [ |
317 | 303 | "After the noise model is passed into the `EstimatorV2` object, it can be used to run workloads and perform error mitigation as normal." |
318 | 304 | ] |
319 | 305 | }, |
320 | 306 | { |
321 | 307 | "cell_type": "markdown", |
322 | | - "id": "c77d7204-8618-4c91-a4fe-e94743bc61a0", |
323 | 308 | "metadata": {}, |
324 | 309 | "source": [ |
325 | 310 | "## NoiseLearnerV3\n", |
|
336 | 321 | { |
337 | 322 | "cell_type": "code", |
338 | 323 | "execution_count": 7, |
339 | | - "id": "7ffed5ab-b8c8-4e96-b879-36703d0138b1", |
340 | 324 | "metadata": {}, |
341 | 325 | "outputs": [ |
342 | 326 | { |
|
409 | 393 | }, |
410 | 394 | { |
411 | 395 | "cell_type": "markdown", |
412 | | - "id": "3d59bd31-95d7-45b2-8f88-02d57ac6385b", |
413 | 396 | "metadata": {}, |
414 | 397 | "source": [ |
415 | 398 | "The job result is a list of `NoiseLearnerV3Result` objects, one for each input-boxed set of instructions. `NoiseLearnerV3Result` has a `to_pauli_lindblad_map()` method that returns a [`PauliLindbladMap`](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap) object, which has methods to extract the generators, error rates, and more." |
|
418 | 401 | { |
419 | 402 | "cell_type": "code", |
420 | 403 | "execution_count": null, |
421 | | - "id": "3cfcc856-1fe5-4b79-ad2a-ebf275b87fb6", |
422 | 404 | "metadata": {}, |
423 | 405 | "outputs": [ |
424 | 406 | { |
|
457 | 439 | }, |
458 | 440 | { |
459 | 441 | "cell_type": "markdown", |
460 | | - "id": "f1bae39a-f2dc-474d-9521-4a2be6a47ea5", |
461 | 442 | "metadata": {}, |
462 | 443 | "source": [ |
463 | 444 | "### Noise learning options\n", |
|
467 | 448 | }, |
468 | 449 | { |
469 | 450 | "cell_type": "markdown", |
470 | | - "id": "6e747e83-8865-4de4-80c2-be92024b5f66", |
471 | 451 | "metadata": {}, |
472 | 452 | "source": [ |
473 | 453 | "### Input a noise model to Executor\n", |
|
495 | 475 | { |
496 | 476 | "cell_type": "code", |
497 | 477 | "execution_count": null, |
498 | | - "id": "8a5eee66-2636-435e-8674-0b8a27d1f6f8", |
499 | 478 | "metadata": {}, |
500 | 479 | "outputs": [ |
501 | 480 | { |
|
520 | 499 | }, |
521 | 500 | { |
522 | 501 | "cell_type": "markdown", |
523 | | - "id": "866b0f71-0399-455e-b513-0de0dbcbfdcd", |
524 | 502 | "metadata": {}, |
525 | 503 | "source": [ |
526 | 504 | "The result of the `NoiseLearnerV3` job must be converted to a dictionary before being passed to Executor. This dictionary's keys are the `InjectNoise.ref` attributes and the values are the corresponding noise maps. This mapping tells Executor which noise models to inject where.\n", |
|
531 | 509 | { |
532 | 510 | "cell_type": "code", |
533 | 511 | "execution_count": 10, |
534 | | - "id": "e750accb-740a-497f-8849-6e6283a06ddd", |
535 | 512 | "metadata": {}, |
536 | 513 | "outputs": [], |
537 | 514 | "source": [ |
|
564 | 541 | }, |
565 | 542 | { |
566 | 543 | "cell_type": "markdown", |
567 | | - "id": "651c8b3a-581a-4ce5-8fda-c1ab5f7dba49", |
568 | 544 | "metadata": {}, |
569 | 545 | "source": [ |
570 | 546 | "## Next steps\n", |
|
580 | 556 | ], |
581 | 557 | "metadata": { |
582 | 558 | "kernelspec": { |
583 | | - "display_name": "Python 3", |
| 559 | + "display_name": "Python 3 (ipykernel)", |
584 | 560 | "language": "python", |
585 | 561 | "name": "python3" |
586 | 562 | }, |
|
594 | 570 | "name": "python", |
595 | 571 | "nbconvert_exporter": "python", |
596 | 572 | "pygments_lexer": "ipython3", |
597 | | - "version": "3" |
| 573 | + "version": "3.12.3" |
598 | 574 | } |
599 | 575 | }, |
600 | 576 | "nbformat": 4, |
|
0 commit comments