369 lines
18 KiB
Plaintext
369 lines
18 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "1b2370f0-a4ee-49b1-9e53-e4527d37bc6f",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Noise learning helper"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "b5e65fb2-8556-4477-81a5-9b6bf551ca7e",
|
|
"metadata": {
|
|
"tags": [
|
|
"version-info"
|
|
]
|
|
},
|
|
"source": [
|
|
"<details>\n",
|
|
"<summary><b>Package versions</b></summary>\n",
|
|
"\n",
|
|
"The code on this page was developed using the following requirements.\n",
|
|
"We recommend using these versions or newer.\n",
|
|
"\n",
|
|
"```\n",
|
|
"qiskit[all]~=2.0.0\n",
|
|
"qiskit-ibm-runtime~=0.37.0\n",
|
|
"```\n",
|
|
"</details>"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "cabee439-d0f2-4079-a47d-b6d96ce78332",
|
|
"metadata": {},
|
|
"source": [
|
|
"The error mitigation techniques [PEA](./error-mitigation-and-suppression-techniques#probabilistic-error-amplification-pea) and [PEC](./error-mitigation-and-suppression-techniques#probabilistic-error-cancellation-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` 0.27.1, a [`NoiseLearner`](../api/qiskit-ibm-runtime/noise-learner) and associated [`NoiseLearnerOptions`](../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",
|
|
"\n",
|
|
"\n",
|
|
"## Overview\n",
|
|
"\n",
|
|
"The `NoiseLearner` class performs experiments that characterize noise processes based on a Pauli-Lindblad noise model for one (or more) circuits. It possesses a `run()` method that executes the learning experiments and takes as input either a list of circuits or a [PUB](./primitive-input-output#overview-of-pubs), and returns a `NoiseLearnerResult` containing the learned noise channels and metadata about the job(s) submitted. Below is a code snippet demonstrating the usage of the helper program."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "c5118119-5892-4ad9-9908-107795a1f1fa",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from qiskit import QuantumCircuit\n",
|
|
"from qiskit.transpiler import CouplingMap\n",
|
|
"from qiskit.transpiler import generate_preset_pass_manager\n",
|
|
"\n",
|
|
"from qiskit_ibm_runtime import QiskitRuntimeService, EstimatorV2\n",
|
|
"from qiskit_ibm_runtime.noise_learner import NoiseLearner\n",
|
|
"from qiskit_ibm_runtime.options import (\n",
|
|
" NoiseLearnerOptions,\n",
|
|
" ResilienceOptionsV2,\n",
|
|
" EstimatorOptions,\n",
|
|
")\n",
|
|
"\n",
|
|
"# Build a circuit with two entangling layers\n",
|
|
"num_qubits = 27\n",
|
|
"edges = list(CouplingMap.from_line(num_qubits, bidirectional=False))\n",
|
|
"even_edges = edges[::2]\n",
|
|
"odd_edges = edges[1::2]\n",
|
|
"\n",
|
|
"circuit = QuantumCircuit(num_qubits)\n",
|
|
"for pair in even_edges:\n",
|
|
" circuit.cx(pair[0], pair[1])\n",
|
|
"for pair in odd_edges:\n",
|
|
" circuit.cx(pair[0], pair[1])\n",
|
|
"\n",
|
|
"# Choose a backend to run on\n",
|
|
"service = QiskitRuntimeService()\n",
|
|
"backend = service.least_busy()\n",
|
|
"\n",
|
|
"# Transpile the circuit for execution\n",
|
|
"pm = generate_preset_pass_manager(backend=backend, optimization_level=3)\n",
|
|
"circuit_to_learn = pm.run(circuit)\n",
|
|
"\n",
|
|
"# Instantiate a NoiseLearner object and execute the noise learning program\n",
|
|
"learner = NoiseLearner(mode=backend)\n",
|
|
"job = learner.run([circuit_to_learn])\n",
|
|
"noise_model = job.result()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "1859540c-a597-411a-ab98-1b436b284f8a",
|
|
"metadata": {},
|
|
"source": [
|
|
"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."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "33d8cc11-6c6f-4838-8038-dd9994476db4",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Noise learner result contains 2 entries and has the following type:\n",
|
|
" <class 'qiskit_ibm_runtime.utils.noise_learner_result.NoiseLearnerResult'>\n",
|
|
"\n",
|
|
"Each element of `NoiseLearnerResult` then contains an object of type:\n",
|
|
" <class 'qiskit_ibm_runtime.utils.noise_learner_result.LayerError'>\n",
|
|
"\n",
|
|
"And each of these `LayerError` objects possess data on the generators for the error channel: \n",
|
|
"['IIIIIIIIIIIIIIIIIIIIIIIIIIX', 'IIIIIIIIIIIIIIIIIIIIIIIIIIY',\n",
|
|
" 'IIIIIIIIIIIIIIIIIIIIIIIIIIZ', 'IIIIIIIIIIIIIIIIIIIIIIIIIXI',\n",
|
|
" 'IIIIIIIIIIIIIIIIIIIIIIIIIXX', 'IIIIIIIIIIIIIIIIIIIIIIIIIXY',\n",
|
|
" 'IIIIIIIIIIIIIIIIIIIIIIIIIXZ', 'IIIIIIIIIIIIIIIIIIIIIIIIIYI',\n",
|
|
" 'IIIIIIIIIIIIIIIIIIIIIIIIIYX', 'IIIIIIIIIIIIIIIIIIIIIIIIIYY',\n",
|
|
" 'IIIIIIIIIIIIIIIIIIIIIIIIIYZ', 'IIIIIIIIIIII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III',\n",
|
|
" 'IIIIIIIIIIIIIIIIIIIIZIXIIII', 'IIIIIIIIIIIIIIIIIIIIZIYIIII', ...]\n",
|
|
"\n",
|
|
"Along with the error rates: \n",
|
|
"[4.70e-04 1.10e-04 1.17e-03 6.90e-04 2.10e-04 5.70e-04 3.00e-05 0.00e+00\n",
|
|
" 0.00e+00 1.60e-04 8.20e-04 3.30e-04 1.10e-04 0.00e+00 4.40e-04 1.90e-04\n",
|
|
" 5.00e-05 2.70e-04 2.20e-04 2.10e-04 5.00e-05 1.80e-04 3.10e-04 8.80e-04\n",
|
|
" 3.00e-05 0.00e+00 0.00e+00 6.70e-04 7.40e-04 7.10e-04 2.30e-04 3.60e-04\n",
|
|
" 9.00e-05 0.00e+00 4.70e-04 4.00e-04 1.00e-05 4.00e-05 4.30e-04 4.10e-04\n",
|
|
" 2.00e-05 0.00e+00 7.00e-05 5.80e-04 2.00e-05 7.00e-05 0.00e+00 1.28e-03\n",
|
|
" 0.00e+00 0.00e+00 0.00e+00 3.60e-04 6.00e-05 1.00e-05 6.00e-05 2.20e-04\n",
|
|
" 1.00e-05 6.00e-05 6.00e-05 1.01e-03 3.00e-05 3.00e-05 1.97e-03 4.20e-04\n",
|
|
" 6.70e-04 5.10e-04 5.60e-04 4.40e-04 3.20e-04 2.70e-04 1.17e-03 6.30e-04\n",
|
|
" 1.60e-04 2.70e-04 9.70e-04 9.30e-04 3.60e-04 4.90e-04 1.70e-04 2.30e-04\n",
|
|
" 1.70e-04 0.00e+00 6.20e-04 3.20e-04 0.00e+00 3.00e-05 5.20e-04 4.90e-04\n",
|
|
" 4.00e-05 1.00e-05 1.00e-05 5.30e-04 3.00e-05 2.60e-04 1.00e-05 2.50e-04\n",
|
|
" 3.00e-05 1.00e-05 2.60e-04 4.10e-04 6.50e-04 8.00e-05 0.00e+00 6.50e-04\n",
|
|
" 4.10e-04 6.00e-05 0.00e+00 9.90e-04 1.90e-04 5.60e-04 8.40e-04 6.60e-04\n",
|
|
" 4.00e-05 1.90e-04 2.50e-04 6.70e-04 4.00e-05 2.50e-04 1.90e-04 1.20e-03\n",
|
|
" 2.50e-04 1.00e-04 1.00e-04 2.67e-03 1.15e-03 1.14e-03 8.20e-04 4.10e-04\n",
|
|
" 5.40e-04 2.30e-04 1.54e-03 1.13e-03 1.00e-04 0.00e+00 8.10e-04 4.50e-03\n",
|
|
" 0.00e+00 0.00e+00 0.00e+00 1.91e-03 0.00e+00 4.10e-04 0.00e+00 1.47e-03\n",
|
|
" 0.00e+00 0.00e+00 4.10e-04 3.68e-03 7.03e-03 0.00e+00 0.00e+00 6.18e-03\n",
|
|
" 4.54e-03 0.00e+00 0.00e+00 4.42e-03 4.73e-03 1.88e-03 2.32e-03 7.90e-04\n",
|
|
" 2.80e-04 2.80e-04 2.30e-04 0.00e+00 0.00e+00 6.00e-05 2.00e-04 0.00e+00\n",
|
|
" 6.00e-05 0.00e+00 8.90e-04 7.00e-05 5.00e-05 5.00e-05 6.50e-04 0.00e+00\n",
|
|
" 0.00e+00 1.80e-04 2.60e-04 2.90e-04 0.00e+00 0.00e+00 0.00e+00 8.20e-04\n",
|
|
" 0.00e+00 5.00e-05 7.00e-05 6.80e-04 0.00e+00 8.90e-04 0.00e+00 0.00e+00\n",
|
|
" 1.70e-04 1.40e-04 6.10e-04 1.35e-03 1.34e-03 6.00e-05 0.00e+00 1.24e-03\n",
|
|
" 1.45e-03 1.20e-04 2.00e-04 5.80e-04 3.30e-04 3.90e-04 3.90e-04 3.80e-04\n",
|
|
" 9.70e-04 4.26e-03 3.80e-04 2.00e-05 9.00e-05 0.00e+00 4.40e-04 9.00e-05\n",
|
|
" 2.00e-05 0.00e+00 2.38e-03 7.00e-05 7.00e-05 4.73e-03 6.60e-04 0.00e+00\n",
|
|
" 0.00e+00 1.10e-04 5.50e-04 4.90e-04 3.90e-04 2.00e-04 0.00e+00 1.00e-05\n",
|
|
" 5.00e-05 1.00e-05 0.00e+00 1.06e-03 9.90e-04 1.00e-05 0.00e+00 5.00e-05\n",
|
|
" 2.90e-04 0.00e+00 2.60e-04 2.46e-03 1.15e-03 5.60e-04 8.00e-05 4.30e-04\n",
|
|
" 3.20e-04 1.00e-05 1.42e-03 4.80e-04 0.00e+00 6.00e-05 1.38e-03 7.70e-04\n",
|
|
" 7.00e-04 1.03e-03 4.80e-04 0.00e+00 1.40e-04 1.80e-04 2.00e-04 1.40e-04\n",
|
|
" 0.00e+00 1.80e-04 9.50e-04 6.00e-05 6.00e-05 2.17e-03 6.61e-03 9.00e-05\n",
|
|
" 2.50e-04 2.60e-04 5.30e-04 8.00e-04 4.00e-04 0.00e+00 3.00e-05 0.00e+00\n",
|
|
" 5.70e-04 0.00e+00 0.00e+00 1.35e-03 5.40e-04 1.60e-04 7.00e-04 1.00e-04\n",
|
|
" 6.00e-05 1.00e-05 6.00e-04 8.60e-04 9.00e-04 9.70e-04 7.00e-05 5.00e-04\n",
|
|
" 9.00e-05 0.00e+00 4.20e-04 3.70e-04 7.00e-05 3.00e-05 5.50e-04 1.93e-03\n",
|
|
" 0.00e+00 0.00e+00 0.00e+00 1.64e-03 0.00e+00 1.00e-05 1.00e-05 5.07e-03\n",
|
|
" 0.00e+00 1.00e-05 1.00e-05]\n",
|
|
"\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"print(\n",
|
|
" f\"Noise learner result contains {len(noise_model.data)} entries\"\n",
|
|
" f\" and has the following type:\\n {type(noise_model)}\\n\"\n",
|
|
")\n",
|
|
"print(\n",
|
|
" f\"Each element of `NoiseLearnerResult` then contains\"\n",
|
|
" f\" an object of type:\\n {type(noise_model.data[0])}\\n\"\n",
|
|
")\n",
|
|
"print(\n",
|
|
" f\"And each of these `LayerError` objects possess\"\n",
|
|
" f\" data on the generators for the error channel: \\n{noise_model.data[0].error.generators}\\n\"\n",
|
|
")\n",
|
|
"print(f\"Along with the error rates: \\n{noise_model.data[0].error.rates}\\n\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "a27a38f1-393d-49f9-92c3-a8634bfb1a60",
|
|
"metadata": {},
|
|
"source": [
|
|
"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",
|
|
"\n",
|
|
"$$ \\Lambda(\\rho) = \\exp{\\sum_j r_j \\left(P_j \\rho P_j^\\dagger - \\rho\\right)}, $$\n",
|
|
"\n",
|
|
"where the $r_j$ are the `LayerError.rates` and $P_j$ are the Pauli operators specified in `LayerError.generators`."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "7ebb4b7d-ef45-4996-bf5a-125d0831ebca",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Noise learning options\n",
|
|
"\n",
|
|
"You can choose among several options to input when you instantiate a `NoiseLearner` object. These options are encapsulated by the `qiskit_ibm_runtime.options.NoiseLearnerOptions` class and include the ability to specify the maximum layers to learn, number of randomizations, and the twirling strategy, among others. Refer to the API documentation about [`NoiseLearnerOptions`](../api/qiskit-ibm-runtime/options-noise-learner-options) for more detailed information.\n",
|
|
"\n",
|
|
"Below is a simple example showing how to use the `NoiseLearnerOptions` in a `NoiseLeaner` experiment:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "8f35d68a-b459-4f1c-ae44-a01bbe700ed0",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Build a GHZ circuit\n",
|
|
"circuit = QuantumCircuit(10)\n",
|
|
"circuit.h(0)\n",
|
|
"circuit.cx(range(0, 9), range(1, 10))\n",
|
|
"# Choose a backend to run on\n",
|
|
"service = QiskitRuntimeService()\n",
|
|
"backend = service.least_busy()\n",
|
|
"\n",
|
|
"# Transpile the circuit for execution\n",
|
|
"pm = generate_preset_pass_manager(backend=backend, optimization_level=3)\n",
|
|
"circuit_to_run = pm.run(circuit_to_learn)\n",
|
|
"\n",
|
|
"# Instantiate a noise learner options object\n",
|
|
"learner_options = NoiseLearnerOptions(\n",
|
|
" max_layers_to_learn=3, num_randomizations=32, twirling_strategy=\"all\"\n",
|
|
")\n",
|
|
"\n",
|
|
"# Instantiate a NoiseLearner object and execute the noise learning program\n",
|
|
"learner = NoiseLearner(mode=backend, options=learner_options)\n",
|
|
"job = learner.run([circuit_to_run])\n",
|
|
"noise_model = job.result()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "694b0e38-7aeb-48e0-8598-b64cff395bc2",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Input noise model to a primitive\n",
|
|
"\n",
|
|
"The noise model learned on the circuit can also be used as an input to the `EstimatorV2` primitive implemented in Qiskit IBM Runtime. This can be passed into the primitive a few different ways. The next three examples show how you can pass the noise model to the `estimator.options` attribute directly, via a `ResilienceOptionsV2` object before instantiating an Estimator primitive, and by passing in an appropriately formatted dictionary."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"id": "d8b504c1-17ad-4e23-b508-eac1955bd1d6",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# pass the noise model to the `estimator.options` attribute directly\n",
|
|
"estimator = EstimatorV2(mode=backend)\n",
|
|
"estimator.options.resilience.layer_noise_model = noise_model"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"id": "8aa753bc-915d-4d47-ba56-5179ec9cf4ca",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Specify options via a ResilienceOptionsV2 object\n",
|
|
"resilience_options = ResilienceOptionsV2(layer_noise_model=noise_model)\n",
|
|
"estimator_options = EstimatorOptions(resilience=resilience_options)\n",
|
|
"estimator = EstimatorV2(mode=backend, options=estimator_options)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"id": "6dcb70fe-e291-4b5a-a79b-14cace921905",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Specify options via a dictionary\n",
|
|
"options_dict = {\n",
|
|
" \"resilience_level\": 2,\n",
|
|
" \"resilience\": {\"layer_noise_model\": noise_model},\n",
|
|
"}\n",
|
|
"\n",
|
|
"estimator = EstimatorV2(mode=backend, options=options_dict)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "8fc627b2-fee5-4275-9895-a48d65ef26f1",
|
|
"metadata": {},
|
|
"source": [
|
|
"Once the noise model is passed into the `EstimatorV2` object, it can be used to run workloads and perform error mitigation as normal."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "6bcd1032-a674-466a-b40b-87f0c4d85984",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Next steps\n",
|
|
"\n",
|
|
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
|
|
" - Read more about [configuring error mitigation](configure-error-mitigation).\n",
|
|
" - Review the [EstimatorOptions API reference](/docs/api/qiskit-ibm-runtime/options-estimator-options) and [ResilienceOptionsV2 API reference](/docs/api/qiskit-ibm-runtime/options-resilience-options-v2).\n",
|
|
" - Learn more about [Error mitigation and suppression techniques](error-mitigation-and-suppression-techniques) that are available through Qiskit Runtime.\n",
|
|
" - Review how to [Specify options](specify-runtime-options) for the Qiskit Runtime primitives.\n",
|
|
" - Read [Migrate to V2 primitives](/docs/migration-guides/v2-primitives).\n",
|
|
"</Admonition>"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"description": "Get started with the noise learning helper program to save the noise models created when executing workloads in Qiskit IBM Runtime",
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3"
|
|
},
|
|
"title": "Noise learning helper"
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|