1009 lines
71 KiB
Plaintext
1009 lines
71 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "c6bf54e5-ec4e-4029-a341-2dcef8574ebb",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Build noise models"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "633591c5-42ba-49a1-b3e5-d9b5ef5305f2",
|
|
"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]~=1.2.4\n",
|
|
"qiskit-aer~=0.15.1\n",
|
|
"qiskit-ibm-runtime~=0.31.0\n",
|
|
"qiskit-serverless~=0.17.1\n",
|
|
"qiskit-ibm-catalog~=0.1\n",
|
|
"```\n",
|
|
"</details>"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "3b5705bc-d978-464b-9257-82f87b5b3491",
|
|
"metadata": {},
|
|
"source": [
|
|
"This page shows how to use the Qiskit Aer [`noise`](https://qiskit.org/ecosystem/aer/apidocs/aer_noise.html) module to build noise models for simulating quantum circuits in the presence of errors. This is useful for emulating noisy quantum processors and for studying the effects of noise on the execution of quantum algorithms."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "4f0d2b6f-2567-450b-95fb-cc1d7983f4ed",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.403378Z",
|
|
"start_time": "2019-08-19T17:00:41.139269Z"
|
|
}
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"import numpy as np\n",
|
|
"from qiskit import QuantumCircuit\n",
|
|
"from qiskit.quantum_info import Kraus, SuperOp\n",
|
|
"from qiskit.visualization import plot_histogram\n",
|
|
"from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager\n",
|
|
"from qiskit_aer import AerSimulator\n",
|
|
"\n",
|
|
"# Import from Qiskit Aer noise module\n",
|
|
"from qiskit_aer.noise import (\n",
|
|
" NoiseModel,\n",
|
|
" QuantumError,\n",
|
|
" ReadoutError,\n",
|
|
" depolarizing_error,\n",
|
|
" pauli_error,\n",
|
|
" thermal_relaxation_error,\n",
|
|
")"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "54898138-a2e2-4f4d-9219-be0d23d75435",
|
|
"metadata": {
|
|
"slideshow": {
|
|
"slide_type": "slide"
|
|
}
|
|
},
|
|
"source": [
|
|
"## Qiskit Aer `noise` module\n",
|
|
"\n",
|
|
"The Qiskit Aer `noise` module contains Python classes to build customized noise models for simulation. There are three key classes:\n",
|
|
"\n",
|
|
"1. The `NoiseModel` class which stores a noise model used for noisy simulation.\n",
|
|
"2. The `QuantumError` class which describes CPTP gate errors. These can be applied:\n",
|
|
" * After *gate* or *reset* instructions\n",
|
|
" * Before *measure* instructions.\n",
|
|
"\n",
|
|
"3. The `ReadoutError` class which describes classical readout errors."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "4f936882-6e86-40a9-a65b-5a27a7d6986d",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Initializing a noise model from a backend\n",
|
|
"\n",
|
|
"You can initialize a noise model with parameters set from the latest calibration data for a physical backend:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "3c114909-aa2a-4638-b945-e31dcdbaf248",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from qiskit_ibm_runtime import QiskitRuntimeService\n",
|
|
"\n",
|
|
"service = QiskitRuntimeService()\n",
|
|
"backend = service.backend(\"ibm_brisbane\")\n",
|
|
"noise_model = NoiseModel.from_backend(backend)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "68d4eea9-b185-4508-ae4d-5c3ff3798a48",
|
|
"metadata": {},
|
|
"source": [
|
|
"This will yield a noise model that roughly approximates the errors one would encounter when using that backend. If you want to have more detailed control over the parameters of the noise model, then you'll need to create your own noise model, as described in the rest of this page."
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "191dc0e5-2a79-4167-9cca-b74163da21f6",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Quantum errors\n",
|
|
"\n",
|
|
"Rather than deal with the `QuantumError` object directly, many helper functions exist to automatically generate a specific type of parameterized quantum error. These are contained in the `noise` module and include functions for many common errors types used in quantum computing research. The function names and the type of error they return are:\n",
|
|
"\n",
|
|
"| Standard error function | Details |\n",
|
|
"| --- | --- |\n",
|
|
"| `kraus_error` | a general n-qubit CPTP error channel given as a list of Kraus matrices $[K_0, ...]$. |\n",
|
|
"| `mixed_unitary_error` | an n-qubit mixed unitary error given as a list of unitary matrices and probabilities $[(U_0, p_0),...]$. |\n",
|
|
"| `coherent_unitary_error` | an n-qubit coherent unitary error given as a single unitary matrix $U$. |\n",
|
|
"| `pauli_error` | an n-qubit Pauli error channel (mixed unitary) given as a list of Pauli's and probabilities $[(P_0, p_0),...]$ |\n",
|
|
"| `depolarizing_error` | an n-qubit depolarizing error channel parameterized by a depolarization probability $p$. |\n",
|
|
"| `reset_error` | a single-qubit reset error parameterized by a probabilities $p_0, p_1$ of resetting to the $|0\\rangle$, $|1\\rangle$ state.|\n",
|
|
"| `thermal_relaxation_error` | a single qubit thermal relaxation channel parameterized by relaxation time constants $T_1$, $T_2$, gate time $t$, and excited state thermal population $p_1$. |\n",
|
|
"| `phase_amplitude_damping_error` | A single-qubit generalized combined phase and amplitude damping error channel given by an amplitude damping parameter $\\lambda$, a phase damping parameter $\\gamma$, and an excited state thermal population $p_1$. |\n",
|
|
"| `amplitude_damping_error` | A single-qubit generalized amplitude damping error channel given by an amplitude damping parameter $\\lambda$, and an excited state thermal population $p_1$. |\n",
|
|
"| `phase_damping_error` | A single-qubit phase damping error channel given by a phase damping parameter $\\gamma$ |\n",
|
|
"\n",
|
|
"### Combining quantum errors\n",
|
|
"\n",
|
|
"`QuantumError` instances can be combined by using composition, tensor product, and tensor expansion (reversed order tensor product) to produce new `QuantumErrors` as:\n",
|
|
"\n",
|
|
" * Composition: $\\cal{E}(\\rho)=\\cal{E_2}(\\cal{E_1}(\\rho))$ as `error = error1.compose(error2)`\n",
|
|
" * Tensor product: $\\cal{E}(\\rho) =(\\cal{E_1}\\otimes\\cal{E_2})(\\rho)$ as `error error1.tensor(error2)`\n",
|
|
" * Expand product: $\\cal{E}(\\rho) =(\\cal{E_2}\\otimes\\cal{E_1})(\\rho)$ as `error error1.expand(error2)`"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "58d63841-a2be-4efd-932b-ec9e20bf2589",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Example\n",
|
|
"\n",
|
|
"To construct a 5% single-qubit bit-flip error:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "987429c9-091f-4297-bec2-64b36c498e82",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.420358Z",
|
|
"start_time": "2019-08-19T17:00:43.416062Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"QuantumError on 1 qubits. Noise circuits:\n",
|
|
" P(0) = 0.05, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q: ┤ X ├\n",
|
|
" └───┘\n",
|
|
" P(1) = 0.95, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q: ┤ I ├\n",
|
|
" └───┘\n",
|
|
"QuantumError on 1 qubits. Noise circuits:\n",
|
|
" P(0) = 0.05, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q: ┤ Z ├\n",
|
|
" └───┘\n",
|
|
" P(1) = 0.95, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q: ┤ I ├\n",
|
|
" └───┘\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Construct a 1-qubit bit-flip and phase-flip errors\n",
|
|
"p_error = 0.05\n",
|
|
"bit_flip = pauli_error([(\"X\", p_error), (\"I\", 1 - p_error)])\n",
|
|
"phase_flip = pauli_error([(\"Z\", p_error), (\"I\", 1 - p_error)])\n",
|
|
"print(bit_flip)\n",
|
|
"print(phase_flip)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"id": "14b78d47-420a-4476-b3f4-e6a58ffdb264",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.435843Z",
|
|
"start_time": "2019-08-19T17:00:43.432211Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"QuantumError on 1 qubits. Noise circuits:\n",
|
|
" P(0) = 0.0025000000000000005, Circuit = \n",
|
|
" ┌───┐┌───┐\n",
|
|
"q: ┤ X ├┤ Z ├\n",
|
|
" └───┘└───┘\n",
|
|
" P(1) = 0.0475, Circuit = \n",
|
|
" ┌───┐┌───┐\n",
|
|
"q: ┤ X ├┤ I ├\n",
|
|
" └───┘└───┘\n",
|
|
" P(2) = 0.0475, Circuit = \n",
|
|
" ┌───┐┌───┐\n",
|
|
"q: ┤ I ├┤ Z ├\n",
|
|
" └───┘└───┘\n",
|
|
" P(3) = 0.9025, Circuit = \n",
|
|
" ┌───┐┌───┐\n",
|
|
"q: ┤ I ├┤ I ├\n",
|
|
" └───┘└───┘\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Compose two bit-flip and phase-flip errors\n",
|
|
"bitphase_flip = bit_flip.compose(phase_flip)\n",
|
|
"print(bitphase_flip)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"id": "7133fddd-9dbe-4861-90e4-fda9ae07200e",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.460191Z",
|
|
"start_time": "2019-08-19T17:00:43.456782Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"QuantumError on 2 qubits. Noise circuits:\n",
|
|
" P(0) = 0.0025000000000000005, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q_0: ┤ X ├\n",
|
|
" ├───┤\n",
|
|
"q_1: ┤ Z ├\n",
|
|
" └───┘\n",
|
|
" P(1) = 0.0475, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q_0: ┤ I ├\n",
|
|
" ├───┤\n",
|
|
"q_1: ┤ Z ├\n",
|
|
" └───┘\n",
|
|
" P(2) = 0.0475, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q_0: ┤ X ├\n",
|
|
" ├───┤\n",
|
|
"q_1: ┤ I ├\n",
|
|
" └───┘\n",
|
|
" P(3) = 0.9025, Circuit = \n",
|
|
" ┌───┐\n",
|
|
"q_0: ┤ I ├\n",
|
|
" ├───┤\n",
|
|
"q_1: ┤ I ├\n",
|
|
" └───┘\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Tensor product two bit-flip and phase-flip errors with\n",
|
|
"# bit-flip on qubit-0, phase-flip on qubit-1\n",
|
|
"error2 = phase_flip.tensor(bit_flip)\n",
|
|
"print(error2)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "048f05a2-71a6-4f3a-8adf-2e49942a2404",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Converting to and from QuantumChannel operators\n",
|
|
"\n",
|
|
"We can also convert back and forth between `QuantumError` objects in Qiskit Aer and `QuantumChannel` objects in Qiskit."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"id": "98626eb1-a25b-45af-b765-7ed059eaecb3",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.482424Z",
|
|
"start_time": "2019-08-19T17:00:43.473779Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Kraus([[[ 9.74679434e-01+3.31566125e-18j,\n",
|
|
" 0.00000000e+00+0.00000000e+00j],\n",
|
|
" [-1.20234617e-16+0.00000000e+00j,\n",
|
|
" 9.74679434e-01+3.31566125e-18j]],\n",
|
|
"\n",
|
|
" [[-2.61894470e-16-8.88880931e-18j,\n",
|
|
" -2.23478117e-01-7.58494199e-03j],\n",
|
|
" [-2.23478117e-01-7.58494199e-03j,\n",
|
|
" 2.83948741e-16+9.63734062e-18j]]],\n",
|
|
" input_dims=(2,), output_dims=(2,))\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Convert to Kraus operator\n",
|
|
"bit_flip_kraus = Kraus(bit_flip)\n",
|
|
"print(bit_flip_kraus)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"id": "8b059cb7-2242-4c0c-bd6e-9e4421b3f87c",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.509521Z",
|
|
"start_time": "2019-08-19T17:00:43.503976Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"SuperOp([[1. +0.j, 0. +0.j, 0. +0.j, 0. +0.j],\n",
|
|
" [0. +0.j, 0.9+0.j, 0. +0.j, 0. +0.j],\n",
|
|
" [0. +0.j, 0. +0.j, 0.9+0.j, 0. +0.j],\n",
|
|
" [0. +0.j, 0. +0.j, 0. +0.j, 1. +0.j]],\n",
|
|
" input_dims=(2,), output_dims=(2,))\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Convert to Superoperator\n",
|
|
"phase_flip_sop = SuperOp(phase_flip)\n",
|
|
"print(phase_flip_sop)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"id": "6c8b72d9-80fb-440e-82da-ecabc148aa5c",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:43.794037Z",
|
|
"start_time": "2019-08-19T17:00:43.778223Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"QuantumError on 1 qubits. Noise circuits:\n",
|
|
" P(0) = 1.0, Circuit = \n",
|
|
" ┌───────┐\n",
|
|
"q: ┤ kraus ├\n",
|
|
" └───────┘\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"True"
|
|
]
|
|
},
|
|
"execution_count": 8,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Convert back to a quantum error\n",
|
|
"print(QuantumError(bit_flip_kraus))\n",
|
|
"\n",
|
|
"# Check conversion is equivalent to original error\n",
|
|
"QuantumError(bit_flip_kraus) == bit_flip"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "f1b2ceed-5e84-480a-a22b-6910f57aa054",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Readout error\n",
|
|
"\n",
|
|
"Classical readout errors are specified by a list of assignment probabilities vectors $P(A|B)$:\n",
|
|
"\n",
|
|
" * $A$ is the *recorded* classical bit value\n",
|
|
" * $B$ is the *true* bit value returned from the measurement\n",
|
|
"\n",
|
|
"For example, for one qubit: $ P(A|B) = [P(A|0), P(A|1)]$."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"id": "17424858-2c15-4902-b9ee-e23608e3fbf7",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:44.659598Z",
|
|
"start_time": "2019-08-19T17:00:44.654818Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"ReadoutError([[0.95 0.05]\n",
|
|
" [0.1 0.9 ]])"
|
|
]
|
|
},
|
|
"execution_count": 9,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Measurement misassignment probabilities\n",
|
|
"p0given1 = 0.1\n",
|
|
"p1given0 = 0.05\n",
|
|
"\n",
|
|
"ReadoutError([[1 - p1given0, p1given0], [p0given1, 1 - p0given1]])"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "b8365fab-f9b1-4969-ae05-be18470b0ccc",
|
|
"metadata": {},
|
|
"source": [
|
|
"Readout errors may also be combined using `compose`, `tensor` and `expand`, like with quantum errors."
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "55bda2dd-4a01-4287-b3bb-c183c30b31cc",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Add errors to a noise model\n",
|
|
"\n",
|
|
"When adding a quantum error to a noise model, we must specify the type of *instruction* that it acts on and what qubits to apply it to. There are two cases of quantum errors:\n",
|
|
"\n",
|
|
" 1. All-qubit quantum error\n",
|
|
" 2. Specific qubit quantum error\n",
|
|
"\n",
|
|
"### 1. All-qubit quantum error\n",
|
|
"\n",
|
|
"This applies the same error to any occurrence of an instruction, regardless of which qubits it acts on.\n",
|
|
"\n",
|
|
"It is added as `noise_model.add_all_qubit_quantum_error(error, instructions)`:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"id": "38d51e41-9088-4216-89ae-8fc05656bc11",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:45.882254Z",
|
|
"start_time": "2019-08-19T17:00:45.877630Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"NoiseModel:\n",
|
|
" Basis gates: ['cx', 'id', 'rz', 'sx', 'u1', 'u2', 'u3']\n",
|
|
" Instructions with noise: ['u1', 'u3', 'u2']\n",
|
|
" All-qubits errors: ['u1', 'u2', 'u3']\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Create an empty noise model\n",
|
|
"noise_model = NoiseModel()\n",
|
|
"\n",
|
|
"# Add depolarizing error to all single qubit u1, u2, u3 gates\n",
|
|
"error = depolarizing_error(0.05, 1)\n",
|
|
"noise_model.add_all_qubit_quantum_error(error, [\"u1\", \"u2\", \"u3\"])\n",
|
|
"\n",
|
|
"# Print noise model info\n",
|
|
"print(noise_model)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "f49cc32d-a189-4585-8a2b-0f1ed0ea492e",
|
|
"metadata": {},
|
|
"source": [
|
|
"### 2. Specific qubit quantum error\n",
|
|
"\n",
|
|
"This applies the error to any occurrence of an instruction acting on a specified list of qubits. Note that the order of the qubit matters: for example, an error applied to qubits [0, 1] for a two-qubit gate is different to one applied to qubits [1, 0].\n",
|
|
"\n",
|
|
"It is added as `noise_model.add_quantum_error(error, instructions, qubits)`:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"id": "b83e4e67-2ffb-40d9-a41a-d7a2aad3d223",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:46.615959Z",
|
|
"start_time": "2019-08-19T17:00:46.612055Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"NoiseModel:\n",
|
|
" Basis gates: ['cx', 'id', 'rz', 'sx', 'u1', 'u2', 'u3']\n",
|
|
" Instructions with noise: ['u1', 'u3', 'u2']\n",
|
|
" Qubits with noise: [0]\n",
|
|
" Specific qubit errors: [('u1', (0,)), ('u2', (0,)), ('u3', (0,))]\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Create an empty noise model\n",
|
|
"noise_model = NoiseModel()\n",
|
|
"\n",
|
|
"# Add depolarizing error to all single qubit u1, u2, u3 gates on qubit 0 only\n",
|
|
"error = depolarizing_error(0.05, 1)\n",
|
|
"noise_model.add_quantum_error(error, [\"u1\", \"u2\", \"u3\"], [0])\n",
|
|
"\n",
|
|
"# Print noise model info\n",
|
|
"print(noise_model)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "d6896131-b6e7-42fb-b96e-7554b64dc9b5",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Note on non-local qubit quantum error\n",
|
|
"\n",
|
|
"`NoiseModel` does not support addition of non-local qubit quantum errors. They should be handled outside of `NoiseModel`. That suggests you should [write your own transpiler pass](./custom-transpiler-pass) (`TransformationPass`) and run the pass just before running the simulator if you need to insert your quantum errors into your circuit under your own conditions."
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "3b2621ab-c894-487a-b773-a742e18476f1",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Execute a noisy simulation with a noise model\n",
|
|
"\n",
|
|
"The command `AerSimulator(noise_model=noise_model)` returns a simulator configured to the given noise model. In addition to setting the simulator's noise model, it also overrides the simulator's basis gates, according to the gates of the noise model."
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "71749280-7266-46ae-ab61-e1b3a5a345b3",
|
|
"metadata": {
|
|
"slideshow": {
|
|
"slide_type": "subslide"
|
|
}
|
|
},
|
|
"source": [
|
|
"## Noise model examples\n",
|
|
"\n",
|
|
"We will now give some examples of noise models. For our demonstrations we use a simple test circuit generating a n-qubit GHZ state:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"id": "41bad6bd-c69d-4024-a3a4-1c6fede88c9e",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:48.817405Z",
|
|
"start_time": "2019-08-19T17:00:48.806966Z"
|
|
},
|
|
"slideshow": {
|
|
"slide_type": "fragment"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
" ┌───┐ ░ ┌─┐ \n",
|
|
" q_0: ┤ H ├──■─────────────░─┤M├─────────\n",
|
|
" └───┘┌─┴─┐ ░ └╥┘┌─┐ \n",
|
|
" q_1: ─────┤ X ├──■────────░──╫─┤M├──────\n",
|
|
" └───┘┌─┴─┐ ░ ║ └╥┘┌─┐ \n",
|
|
" q_2: ──────────┤ X ├──■───░──╫──╫─┤M├───\n",
|
|
" └───┘┌─┴─┐ ░ ║ ║ └╥┘┌─┐\n",
|
|
" q_3: ───────────────┤ X ├─░──╫──╫──╫─┤M├\n",
|
|
" └───┘ ░ ║ ║ ║ └╥┘\n",
|
|
"meas: 4/════════════════════════╩══╩══╩══╩═\n",
|
|
" 0 1 2 3 \n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# System Specification\n",
|
|
"n_qubits = 4\n",
|
|
"circ = QuantumCircuit(n_qubits)\n",
|
|
"\n",
|
|
"# Test Circuit\n",
|
|
"circ.h(0)\n",
|
|
"for qubit in range(n_qubits - 1):\n",
|
|
" circ.cx(qubit, qubit + 1)\n",
|
|
"circ.measure_all()\n",
|
|
"print(circ)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "2b945a56-d136-4c1d-8b02-e8ea962329b9",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Ideal simulation"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"id": "6fe5c53d-3536-471f-aceb-b4b48a8a5889",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:50.560988Z",
|
|
"start_time": "2019-08-19T17:00:50.415545Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg width=\"415.16pt\" height=\"314.74pt\" version=\"1.1\" viewBox=\"0 0 415.16 314.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style></defs><path d=\"m0 314.74h415.16v-314.74h-415.16z\" fill=\"#ffffff\"/><path d=\"m50.837 273.31h357.12v-266.11h-357.12z\" fill=\"#ffffff\"/><defs><path id=\"19d9161d748\" d=\"m0 0v3.5\" stroke=\"#343a3f\" stroke-width=\".8\"/></defs><use x=\"121.178693\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#19d9161d748\"/><g transform=\"translate(119.61 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-30\" transform=\"scale(.015625)\" d=\"m2034 4250q-487 0-733-480-245-479-245-1442 0-959 245-1439 246-480 733-480 491 0 736 480 246 480 246 1439 0 963-246 1442-245 480-736 480zm0 500q785 0 1199-621 414-620 414-1801 0-1178-414-1799-414-620-1199-620-784 0-1198 620-414 621-414 1799 0 1181 414 1801 414 621 1198 621z\"/></defs><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"337.615057\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#19d9161d748\"/><g transform=\"translate(336.05 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-31\" transform=\"scale(.015625)\" d=\"m794 531h1031v3560l-1122-225v575l1116 225h631v-4135h1031v-531h-2687v531z\"/></defs><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><path d=\"m50.837 273.31h357.12\" clip-path=\"url(#981ba6baa7c)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><defs><path id=\"7298d997a34\" d=\"m0 0h-3.5\" stroke=\"#343a3f\" stroke-width=\".8\"/></defs><use x=\"50.836875\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#7298d997a34\"/><g transform=\"translate(37.474 277.11) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 204.84h357.12\" clip-path=\"url(#981ba6baa7c)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"204.844075\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#7298d997a34\"/><g transform=\"translate(24.749 208.64) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-35\" transform=\"scale(.015625)\" d=\"m691 4666h2478v-532h-1900v-1143q137 47 274 70 138 23 276 23 781 0 1237-428 457-428 457-1159 0-753-469-1171-469-417-1322-417-294 0-599 50-304 50-629 150v635q281-153 581-228t634-75q541 0 856 284 316 284 316 772 0 487-316 771-315 285-856 285-253 0-505-56-251-56-513-175v2344z\"/></defs><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 136.38h357.12\" clip-path=\"url(#981ba6baa7c)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"136.376151\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#7298d997a34\"/><g transform=\"translate(24.749 140.18) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-33\" transform=\"scale(.015625)\" d=\"m2597 2516q453-97 707-404 255-306 255-756 0-690-475-1069-475-378-1350-378-293 0-604 58t-642 174v609q262-153 574-231 313-78 654-78 593 0 904 234t311 681q0 413-289 645-289 233-804 233h-544v519h569q465 0 712 186t247 536q0 359-255 551-254 193-729 193-260 0-557-57-297-56-653-174v562q360 100 674 150t592 50q719 0 1137-327 419-326 419-882 0-388-222-655t-631-370z\"/></defs><use xlink:href=\"#DejaVuSans-33\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 67.908h357.12\" clip-path=\"url(#981ba6baa7c)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"67.908226\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#7298d997a34\"/><g transform=\"translate(24.749 71.707) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-34\" transform=\"scale(.015625)\" d=\"m2419 4116-1594-2491h1594v2491zm-166 550h794v-3041h666v-525h-666v-1100h-628v1100h-2106v609l1940 2957z\"/></defs><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><g transform=\"translate(17.838 161.04) rotate(-90) scale(.14 -.14)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-43\" transform=\"scale(.015625)\" d=\"m4122 4306v-665q-319 297-680 443-361 147-767 147-800 0-1225-489t-425-1414q0-922 425-1411t1225-489q406 0 767 147t680 444v-660q-331-225-702-338-370-112-782-112-1060 0-1670 648-609 649-609 1771 0 1125 609 1773 610 649 1670 649 418 0 788-111 371-111 696-333z\"/><path id=\"DejaVuSans-6f\" transform=\"scale(.015625)\" d=\"m1959 3097q-462 0-731-361t-269-989 267-989q268-361 733-361 460 0 728 362 269 363 269 988 0 622-269 986-268 364-728 364zm0 487q750 0 1178-488 429-487 429-1349 0-859-429-1349-428-489-1178-489-753 0-1180 489-426 490-426 1349 0 862 426 1349 427 488 1180 488z\"/><path id=\"DejaVuSans-75\" transform=\"scale(.015625)\" d=\"m544 1381v2119h575v-2097q0-497 193-746 194-248 582-248 465 0 735 297 271 297 271 810v1984h575v-3500h-575v538q-209-319-486-474-276-155-642-155-603 0-916 375-312 375-312 1097zm1447 2203z\"/><path id=\"DejaVuSans-6e\" transform=\"scale(.015625)\" d=\"m3513 2113v-2113h-575v2094q0 497-194 743-194 247-581 247-466 0-735-297-269-296-269-809v-1978h-578v3500h578v-544q207 316 486 472 280 156 646 156 603 0 912-373 310-373 310-1098z\"/><path id=\"DejaVuSans-74\" transform=\"scale(.015625)\" d=\"m1172 4494v-994h1184v-447h-1184v-1900q0-428 117-550t477-122h590v-481h-590q-666 0-919 248-253 249-253 905v1900h-422v447h422v994h578z\"/></defs><use xlink:href=\"#DejaVuSans-43\"/><use x=\"69.824219\" xlink:href=\"#DejaVuSans-6f\"/><use x=\"131.005859\" xlink:href=\"#DejaVuSans-75\"/><use x=\"194.384766\" xlink:href=\"#DejaVuSans-6e\"/><use x=\"257.763672\" xlink:href=\"#DejaVuSans-74\"/></g><path d=\"m67.07 273.31h108.22v-225.49h-108.22z\" clip-path=\"url(#981ba6baa7c)\" fill=\"#1192e8\"/><path d=\"m283.51 273.31h108.22v-241.92h-108.22z\" clip-path=\"url(#981ba6baa7c)\" fill=\"#1192e8\"/><path d=\"m50.837 273.31v-266.11\" fill=\"none\" stroke=\"#343a3f\" stroke-linecap=\"square\" stroke-width=\".8\"/><path d=\"m50.837 273.31h357.12\" fill=\"none\" stroke=\"#343a3f\" stroke-linecap=\"square\" stroke-width=\".8\"/><g transform=\"translate(111.63 34.47) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-39\" transform=\"scale(.015625)\" d=\"m703 97v575q238-113 481-172 244-59 479-59 625 0 954 420 330 420 377 1277-181-269-460-413-278-144-615-144-700 0-1108 423-408 424-408 1159 0 718 425 1152 425 435 1131 435 810 0 1236-621 427-620 427-1801 0-1103-524-1761-523-658-1407-658-238 0-482 47-243 47-506 141zm1256 1978q425 0 673 290 249 291 249 798 0 503-249 795-248 292-673 292t-673-292-248-795q0-507 248-798 248-290 673-290z\"/></defs><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-39\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-34\"/></g><g transform=\"translate(328.07 17.216) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-35\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-33\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><defs><clipPath id=\"981ba6baa7c\"><rect x=\"50.837\" y=\"7.2\" width=\"357.12\" height=\"266.11\"/></clipPath></defs></svg>"
|
|
],
|
|
"text/plain": [
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
]
|
|
},
|
|
"execution_count": 13,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Ideal simulator and execution\n",
|
|
"sim_ideal = AerSimulator()\n",
|
|
"result_ideal = sim_ideal.run(circ).result()\n",
|
|
"plot_histogram(result_ideal.get_counts(0))"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "dd61a153-cb72-40db-8673-fd3c323c3ab0",
|
|
"metadata": {
|
|
"slideshow": {
|
|
"slide_type": "subslide"
|
|
}
|
|
},
|
|
"source": [
|
|
"## Noise example 1: Basic bit-flip error noise model\n",
|
|
"\n",
|
|
"Let's consider a simple toy noise model example common in quantum information theory research:\n",
|
|
"\n",
|
|
"* When applying a single-qubit gate, flip the state of the qubit with probability `p_gate1`.\n",
|
|
"* When applying a two-qubit gate, apply single-qubit errors to each qubit.\n",
|
|
"* When resetting a qubit, reset to 1 instead of 0 with probability `p_reset`.\n",
|
|
"* When measuring a qubit, flip the state of the qubit with probability `p_meas`."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"id": "dbea22f5-4c5d-4727-b5cf-f8c3f488ef59",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:51.543615Z",
|
|
"start_time": "2019-08-19T17:00:51.536564Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"NoiseModel:\n",
|
|
" Basis gates: ['cx', 'id', 'rz', 'sx', 'u1', 'u2', 'u3']\n",
|
|
" Instructions with noise: ['cx', 'u1', 'reset', 'u3', 'u2', 'measure']\n",
|
|
" All-qubits errors: ['reset', 'measure', 'u1', 'u2', 'u3', 'cx']\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Example error probabilities\n",
|
|
"p_reset = 0.03\n",
|
|
"p_meas = 0.1\n",
|
|
"p_gate1 = 0.05\n",
|
|
"\n",
|
|
"# QuantumError objects\n",
|
|
"error_reset = pauli_error([(\"X\", p_reset), (\"I\", 1 - p_reset)])\n",
|
|
"error_meas = pauli_error([(\"X\", p_meas), (\"I\", 1 - p_meas)])\n",
|
|
"error_gate1 = pauli_error([(\"X\", p_gate1), (\"I\", 1 - p_gate1)])\n",
|
|
"error_gate2 = error_gate1.tensor(error_gate1)\n",
|
|
"\n",
|
|
"# Add errors to noise model\n",
|
|
"noise_bit_flip = NoiseModel()\n",
|
|
"noise_bit_flip.add_all_qubit_quantum_error(error_reset, \"reset\")\n",
|
|
"noise_bit_flip.add_all_qubit_quantum_error(error_meas, \"measure\")\n",
|
|
"noise_bit_flip.add_all_qubit_quantum_error(error_gate1, [\"u1\", \"u2\", \"u3\"])\n",
|
|
"noise_bit_flip.add_all_qubit_quantum_error(error_gate2, [\"cx\"])\n",
|
|
"\n",
|
|
"print(noise_bit_flip)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "15112a49-4353-46b8-8ddc-7060d01761a6",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Execute the noisy simulation"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"id": "e38e4581-7718-4dc0-a550-e6b3168bd400",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:52.951874Z",
|
|
"start_time": "2019-08-19T17:00:52.687440Z"
|
|
},
|
|
"slideshow": {
|
|
"slide_type": "-"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg width=\"415.16pt\" height=\"314.74pt\" version=\"1.1\" viewBox=\"0 0 415.16 314.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style></defs><path d=\"m0 314.74h415.16v-314.74h-415.16z\" fill=\"#ffffff\"/><path d=\"m50.837 273.31h357.12v-266.11h-357.12z\" fill=\"#ffffff\"/><defs><path id=\"33429957df4\" d=\"m0 0v3.5\" stroke=\"#343a3f\" stroke-width=\".8\"/></defs><use x=\"72.305966\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(70.742 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-30\" transform=\"scale(.015625)\" d=\"m2034 4250q-487 0-733-480-245-479-245-1442 0-959 245-1439 246-480 733-480 491 0 736 480 246 480 246 1439 0 963-246 1442-245 480-736 480zm0 500q785 0 1199-621 414-620 414-1801 0-1178-414-1799-414-620-1199-620-784 0-1198 620-414 621-414 1799 0 1181 414 1801 414 621 1198 621z\"/></defs><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"93.25142\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(91.687 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-31\" transform=\"scale(.015625)\" d=\"m794 531h1031v3560l-1122-225v575l1116 225h631v-4135h1031v-531h-2687v531z\"/></defs><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"114.196875\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(112.63 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"135.14233\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(133.58 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"156.087784\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(154.52 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"177.033239\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(175.47 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"197.978693\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(196.41 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"218.924148\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(217.36 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"239.869602\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(238.31 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"260.815057\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(259.25 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"281.760511\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(280.2 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"302.705966\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(301.14 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"323.65142\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(322.09 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"344.596875\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(343.03 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"365.54233\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(363.98 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"386.487784\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#33429957df4\"/><g transform=\"translate(384.92 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><path d=\"m50.837 273.31h357.12\" clip-path=\"url(#23631a8903b)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><defs><path id=\"eec7f68b4e8\" d=\"m0 0h-3.5\" stroke=\"#343a3f\" stroke-width=\".8\"/></defs><use x=\"50.836875\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#eec7f68b4e8\"/><g transform=\"translate(37.474 277.11) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 216.61h357.12\" clip-path=\"url(#23631a8903b)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"216.612\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#eec7f68b4e8\"/><g transform=\"translate(31.112 220.41) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-36\" transform=\"scale(.015625)\" d=\"m2113 2584q-425 0-674-291-248-290-248-796 0-503 248-796 249-292 674-292t673 292q248 293 248 796 0 506-248 796-248 291-673 291zm1253 1979v-575q-238 112-480 171-242 60-480 60-625 0-955-422-329-422-376-1275 184 272 462 417 279 145 613 145 703 0 1111-427 408-426 408-1160 0-719-425-1154-425-434-1131-434-810 0-1238 620-428 621-428 1799 0 1106 525 1764t1409 658q238 0 480-47t505-140z\"/></defs><use xlink:href=\"#DejaVuSans-36\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 159.91h357.12\" clip-path=\"url(#23631a8903b)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"159.912\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#eec7f68b4e8\"/><g transform=\"translate(24.749 163.71) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-32\" transform=\"scale(.015625)\" d=\"m1228 531h2203v-531h-2962v531q359 372 979 998 621 627 780 809 303 340 423 576 121 236 121 464 0 372-261 606-261 235-680 235-297 0-627-103-329-103-704-313v638q381 153 712 231 332 78 607 78 725 0 1156-363 431-362 431-968 0-288-108-546-107-257-392-607-78-91-497-524-418-433-1181-1211z\"/></defs><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-32\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 103.21h357.12\" clip-path=\"url(#23631a8903b)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"103.212\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#eec7f68b4e8\"/><g transform=\"translate(24.749 107.01) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-38\" transform=\"scale(.015625)\" d=\"m2034 2216q-450 0-708-241-257-241-257-662 0-422 257-663 258-241 708-241t709 242q260 243 260 662 0 421-258 662-257 241-711 241zm-631 268q-406 100-633 378-226 279-226 679 0 559 398 884 399 325 1092 325 697 0 1094-325t397-884q0-400-227-679-226-278-629-378 456-106 710-416 255-309 255-755 0-679-414-1042-414-362-1186-362-771 0-1186 362-414 363-414 1042 0 446 256 755 257 310 713 416zm-231 997q0-362 226-565 227-203 636-203 407 0 636 203 230 203 230 565 0 363-230 566-229 203-636 203-409 0-636-203-226-203-226-566z\"/></defs><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-38\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 46.512h357.12\" clip-path=\"url(#23631a8903b)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"46.512\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#eec7f68b4e8\"/><g transform=\"translate(24.749 50.311) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-34\" transform=\"scale(.015625)\" d=\"m2419 4116-1594-2491h1594v2491zm-166 550h794v-3041h666v-525h-666v-1100h-628v1100h-2106v609l1940 2957z\"/></defs><use xlink:href=\"#DejaVuSans-32\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-34\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><g transform=\"translate(17.838 161.04) rotate(-90) scale(.14 -.14)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-43\" transform=\"scale(.015625)\" d=\"m4122 4306v-665q-319 297-680 443-361 147-767 147-800 0-1225-489t-425-1414q0-922 425-1411t1225-489q406 0 767 147t680 444v-660q-331-225-702-338-370-112-782-112-1060 0-1670 648-609 649-609 1771 0 1125 609 1773 610 649 1670 649 418 0 788-111 371-111 696-333z\"/><path id=\"DejaVuSans-6f\" transform=\"scale(.015625)\" d=\"m1959 3097q-462 0-731-361t-269-989 267-989q268-361 733-361 460 0 728 362 269 363 269 988 0 622-269 986-268 364-728 364zm0 487q750 0 1178-488 429-487 429-1349 0-859-429-1349-428-489-1178-489-753 0-1180 489-426 490-426 1349 0 862 426 1349 427 488 1180 488z\"/><path id=\"DejaVuSans-75\" transform=\"scale(.015625)\" d=\"m544 1381v2119h575v-2097q0-497 193-746 194-248 582-248 465 0 735 297 271 297 271 810v1984h575v-3500h-575v538q-209-319-486-474-276-155-642-155-603 0-916 375-312 375-312 1097zm1447 2203z\"/><path id=\"DejaVuSans-6e\" transform=\"scale(.015625)\" d=\"m3513 2113v-2113h-575v2094q0 497-194 743-194 247-581 247-466 0-735-297-269-296-269-809v-1978h-578v3500h578v-544q207 316 486 472 280 156 646 156 603 0 912-373 310-373 310-1098z\"/><path id=\"DejaVuSans-74\" transform=\"scale(.015625)\" d=\"m1172 4494v-994h1184v-447h-1184v-1900q0-428 117-550t477-122h590v-481h-590q-666 0-919 248-253 249-253 905v1900h-422v447h422v994h578z\"/></defs><use xlink:href=\"#DejaVuSans-43\"/><use x=\"69.824219\" xlink:href=\"#DejaVuSans-6f\"/><use x=\"131.005859\" xlink:href=\"#DejaVuSans-75\"/><use x=\"194.384766\" xlink:href=\"#DejaVuSans-6e\"/><use x=\"257.763672\" xlink:href=\"#DejaVuSans-74\"/></g><path d=\"m67.07 273.31h10.473v-241.92h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m88.015 273.31h10.473v-52.92h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m108.96 273.31h10.473v-25.515h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m129.91 273.31h10.473v-24.57h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m150.85 273.31h10.473v-53.865h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m171.8 273.31h10.473v-16.065h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m192.74 273.31h10.473v-17.955h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m213.69 273.31h10.473v-40.635h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m234.63 273.31h10.473v-49.14h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m255.58 273.31h10.473v-17.01h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m276.52 273.31h10.473v-18.9h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m297.47 273.31h10.473v-41.58h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m318.42 273.31h10.473v-31.185h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m339.36 273.31h10.473v-40.635h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m360.31 273.31h10.473v-61.425h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m381.25 273.31h10.473v-234.36h-10.473z\" clip-path=\"url(#23631a8903b)\" fill=\"#1192e8\"/><path d=\"m50.837 273.31v-266.11\" fill=\"none\" stroke=\"#343a3f\" stroke-linecap=\"square\" stroke-width=\".8\"/><path d=\"m50.837 273.31h357.12\" fill=\"none\" stroke=\"#343a3f\" stroke-linecap=\"square\" stroke-width=\".8\"/><g transform=\"translate(62.762 17.216) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-35\" transform=\"scale(.015625)\" d=\"m691 4666h2478v-532h-1900v-1143q137 47 274 70 138 23 276 23 781 0 1237-428 457-428 457-1159 0-753-469-1171-469-417-1322-417-294 0-599 50-304 50-629 150v635q281-153 581-228t634-75q541 0 856 284 316 284 316 772 0 487-316 771-315 285-856 285-253 0-505-56-251-56-513-175v2344z\"/></defs><use xlink:href=\"#DejaVuSans-32\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-36\"/></g><g transform=\"translate(86.889 215.67) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-35\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-36\"/></g><g transform=\"translate(107.83 244.44) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-37\" transform=\"scale(.015625)\" d=\"m525 4666h3e3v-269l-1694-4397h-659l1594 4134h-2241v532z\"/></defs><use xlink:href=\"#DejaVuSans-32\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-37\"/></g><g transform=\"translate(128.78 245.43) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-32\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-36\"/></g><g transform=\"translate(149.73 214.67) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-35\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-37\"/></g><g transform=\"translate(170.67 254.36) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-37\"/></g><g transform=\"translate(191.62 252.38) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-39\" transform=\"scale(.015625)\" d=\"m703 97v575q238-113 481-172 244-59 479-59 625 0 954 420 330 420 377 1277-181-269-460-413-278-144-615-144-700 0-1108 423-408 424-408 1159 0 718 425 1152 425 435 1131 435 810 0 1236-621 427-620 427-1801 0-1103-524-1761-523-658-1407-658-238 0-482 47-243 47-506 141zm1256 1978q425 0 673 290 249 291 249 798 0 503-249 795-248 292-673 292t-673-292-248-795q0-507 248-798 248-290 673-290z\"/></defs><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-39\"/></g><g transform=\"translate(212.56 228.57) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-33\" transform=\"scale(.015625)\" d=\"m2597 2516q453-97 707-404 255-306 255-756 0-690-475-1069-475-378-1350-378-293 0-604 58t-642 174v609q262-153 574-231 313-78 654-78 593 0 904 234t311 681q0 413-289 645-289 233-804 233h-544v519h569q465 0 712 186t247 536q0 359-255 551-254 193-729 193-260 0-557-57-297-56-653-174v562q360 100 674 150t592 50q719 0 1137-327 419-326 419-882 0-388-222-655t-631-370z\"/></defs><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-33\"/></g><g transform=\"translate(233.51 219.64) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-35\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-32\"/></g><g transform=\"translate(254.45 253.37) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-38\"/></g><g transform=\"translate(275.4 251.39) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-32\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/></g><g transform=\"translate(296.34 227.57) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-34\"/></g><g transform=\"translate(317.29 238.49) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-33\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-33\"/></g><g transform=\"translate(338.23 228.57) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-33\"/></g><g transform=\"translate(359.18 206.74) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-36\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/></g><g transform=\"translate(376.94 25.154) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-32\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-34\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-38\"/></g><defs><clipPath id=\"23631a8903b\"><rect x=\"50.837\" y=\"7.2\" width=\"357.12\" height=\"266.11\"/></clipPath></defs></svg>"
|
|
],
|
|
"text/plain": [
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
]
|
|
},
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Create noisy simulator backend\n",
|
|
"sim_noise = AerSimulator(noise_model=noise_bit_flip)\n",
|
|
"\n",
|
|
"# Transpile circuit for noisy basis gates\n",
|
|
"passmanager = generate_preset_pass_manager(\n",
|
|
" optimization_level=3, backend=sim_noise\n",
|
|
")\n",
|
|
"circ_tnoise = passmanager.run(circ)\n",
|
|
"\n",
|
|
"# Run and get counts\n",
|
|
"result_bit_flip = sim_noise.run(circ_tnoise).result()\n",
|
|
"counts_bit_flip = result_bit_flip.get_counts(0)\n",
|
|
"\n",
|
|
"# Plot noisy output\n",
|
|
"plot_histogram(counts_bit_flip)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "cb0c808d-4988-4106-ba40-9205b78ebe5d",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Example 2: T1/T2 thermal relaxation\n",
|
|
"\n",
|
|
"Now consider a more realistic error model based on thermal relaxation with the qubit environment:\n",
|
|
"* Each qubit is parameterized by a thermal relaxation time constant $T_1$ and a dephasing time constant $T_2$.\n",
|
|
"* Note that we must have $T_2 \\le 2 T_1$.\n",
|
|
"* Error rates on instructions are determined by gate times and qubit $T_1$, $T_2$ values."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 16,
|
|
"id": "992aefee-7d14-43bb-986a-ecaf20d35fb8",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:54.577456Z",
|
|
"start_time": "2019-08-19T17:00:54.491018Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"NoiseModel:\n",
|
|
" Basis gates: ['cx', 'id', 'rz', 'sx', 'u2', 'u3']\n",
|
|
" Instructions with noise: ['cx', 'reset', 'u3', 'u2', 'measure']\n",
|
|
" Qubits with noise: [0, 1, 2, 3]\n",
|
|
" Specific qubit errors: [('reset', (0,)), ('reset', (1,)), ('reset', (2,)), ('reset', (3,)), ('measure', (0,)), ('measure', (1,)), ('measure', (2,)), ('measure', (3,)), ('u2', (0,)), ('u2', (1,)), ('u2', (2,)), ('u2', (3,)), ('u3', (0,)), ('u3', (1,)), ('u3', (2,)), ('u3', (3,)), ('cx', (0, 0)), ('cx', (0, 1)), ('cx', (0, 2)), ('cx', (0, 3)), ('cx', (1, 0)), ('cx', (1, 1)), ('cx', (1, 2)), ('cx', (1, 3)), ('cx', (2, 0)), ('cx', (2, 1)), ('cx', (2, 2)), ('cx', (2, 3)), ('cx', (3, 0)), ('cx', (3, 1)), ('cx', (3, 2)), ('cx', (3, 3))]\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# T1 and T2 values for qubits 0-3\n",
|
|
"T1s = np.random.normal(\n",
|
|
" 50e3, 10e3, 4\n",
|
|
") # Sampled from normal distribution mean 50 microsec\n",
|
|
"T2s = np.random.normal(\n",
|
|
" 70e3, 10e3, 4\n",
|
|
") # Sampled from normal distribution mean 50 microsec\n",
|
|
"\n",
|
|
"# Truncate random T2s <= T1s\n",
|
|
"T2s = np.array([min(T2s[j], 2 * T1s[j]) for j in range(4)])\n",
|
|
"\n",
|
|
"# Instruction times (in nanoseconds)\n",
|
|
"time_u1 = 0 # virtual gate\n",
|
|
"time_u2 = 50 # (single X90 pulse)\n",
|
|
"time_u3 = 100 # (two X90 pulses)\n",
|
|
"time_cx = 300\n",
|
|
"time_reset = 1000 # 1 microsecond\n",
|
|
"time_measure = 1000 # 1 microsecond\n",
|
|
"\n",
|
|
"# QuantumError objects\n",
|
|
"errors_reset = [\n",
|
|
" thermal_relaxation_error(t1, t2, time_reset) for t1, t2 in zip(T1s, T2s)\n",
|
|
"]\n",
|
|
"errors_measure = [\n",
|
|
" thermal_relaxation_error(t1, t2, time_measure) for t1, t2 in zip(T1s, T2s)\n",
|
|
"]\n",
|
|
"errors_u1 = [\n",
|
|
" thermal_relaxation_error(t1, t2, time_u1) for t1, t2 in zip(T1s, T2s)\n",
|
|
"]\n",
|
|
"errors_u2 = [\n",
|
|
" thermal_relaxation_error(t1, t2, time_u2) for t1, t2 in zip(T1s, T2s)\n",
|
|
"]\n",
|
|
"errors_u3 = [\n",
|
|
" thermal_relaxation_error(t1, t2, time_u3) for t1, t2 in zip(T1s, T2s)\n",
|
|
"]\n",
|
|
"errors_cx = [\n",
|
|
" [\n",
|
|
" thermal_relaxation_error(t1a, t2a, time_cx).expand(\n",
|
|
" thermal_relaxation_error(t1b, t2b, time_cx)\n",
|
|
" )\n",
|
|
" for t1a, t2a in zip(T1s, T2s)\n",
|
|
" ]\n",
|
|
" for t1b, t2b in zip(T1s, T2s)\n",
|
|
"]\n",
|
|
"\n",
|
|
"# Add errors to noise model\n",
|
|
"noise_thermal = NoiseModel()\n",
|
|
"for j in range(4):\n",
|
|
" noise_thermal.add_quantum_error(errors_reset[j], \"reset\", [j])\n",
|
|
" noise_thermal.add_quantum_error(errors_measure[j], \"measure\", [j])\n",
|
|
" noise_thermal.add_quantum_error(errors_u1[j], \"u1\", [j])\n",
|
|
" noise_thermal.add_quantum_error(errors_u2[j], \"u2\", [j])\n",
|
|
" noise_thermal.add_quantum_error(errors_u3[j], \"u3\", [j])\n",
|
|
" for k in range(4):\n",
|
|
" noise_thermal.add_quantum_error(errors_cx[j][k], \"cx\", [j, k])\n",
|
|
"\n",
|
|
"print(noise_thermal)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"id": "95144ee3-fe32-407a-94a1-f24e325f1ebb",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Execute the noisy simulation"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 17,
|
|
"id": "284e4fb1-726e-4ecf-a200-cbfae8baaef7",
|
|
"metadata": {
|
|
"ExecuteTime": {
|
|
"end_time": "2019-08-19T17:00:55.689241Z",
|
|
"start_time": "2019-08-19T17:00:55.515394Z"
|
|
}
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"image/svg+xml": [
|
|
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg width=\"415.16pt\" height=\"314.74pt\" version=\"1.1\" viewBox=\"0 0 415.16 314.74\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style></defs><path d=\"m0 314.74h415.16v-314.74h-415.16z\" fill=\"#ffffff\"/><path d=\"m50.837 273.31h357.12v-266.11h-357.12z\" fill=\"#ffffff\"/><defs><path id=\"56bc601931b\" d=\"m0 0v3.5\" stroke=\"#343a3f\" stroke-width=\".8\"/></defs><use x=\"76.618265\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(75.054 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-30\" transform=\"scale(.015625)\" d=\"m2034 4250q-487 0-733-480-245-479-245-1442 0-959 245-1439 246-480 733-480 491 0 736 480 246 480 246 1439 0 963-246 1442-245 480-736 480zm0 500q785 0 1199-621 414-620 414-1801 0-1178-414-1799-414-620-1199-620-784 0-1198 620-414 621-414 1799 0 1181 414 1801 414 621 1198 621z\"/></defs><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"114.812918\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(113.25 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-31\" transform=\"scale(.015625)\" d=\"m794 531h1031v3560l-1122-225v575l1116 225h631v-4135h1031v-531h-2687v531z\"/></defs><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"153.00757\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(151.44 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"191.202223\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(189.64 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"229.396875\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(227.83 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"267.591527\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(266.03 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"305.78618\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(304.22 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><use x=\"343.980832\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(342.42 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-30\"/></g><use x=\"382.175485\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#56bc601931b\"/><g transform=\"translate(380.61 306.83) rotate(-70) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-31\"/><use x=\"190.869141\" xlink:href=\"#DejaVuSans-31\"/></g><path d=\"m50.837 273.31h357.12\" clip-path=\"url(#a66ecdb3287)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><defs><path id=\"068a09cc224\" d=\"m0 0h-3.5\" stroke=\"#343a3f\" stroke-width=\".8\"/></defs><use x=\"50.836875\" y=\"273.312\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#068a09cc224\"/><g transform=\"translate(37.474 277.11) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 203.79h357.12\" clip-path=\"url(#a66ecdb3287)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"203.794759\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#068a09cc224\"/><g transform=\"translate(24.749 207.59) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-35\" transform=\"scale(.015625)\" d=\"m691 4666h2478v-532h-1900v-1143q137 47 274 70 138 23 276 23 781 0 1237-428 457-428 457-1159 0-753-469-1171-469-417-1322-417-294 0-599 50-304 50-629 150v635q281-153 581-228t634-75q541 0 856 284 316 284 316 772 0 487-316 771-315 285-856 285-253 0-505-56-251-56-513-175v2344z\"/></defs><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 134.28h357.12\" clip-path=\"url(#a66ecdb3287)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"134.277517\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#068a09cc224\"/><g transform=\"translate(24.749 138.08) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-33\" transform=\"scale(.015625)\" d=\"m2597 2516q453-97 707-404 255-306 255-756 0-690-475-1069-475-378-1350-378-293 0-604 58t-642 174v609q262-153 574-231 313-78 654-78 593 0 904 234t311 681q0 413-289 645-289 233-804 233h-544v519h569q465 0 712 186t247 536q0 359-255 551-254 193-729 193-260 0-557-57-297-56-653-174v562q360 100 674 150t592 50q719 0 1137-327 419-326 419-882 0-388-222-655t-631-370z\"/></defs><use xlink:href=\"#DejaVuSans-33\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><path d=\"m50.837 64.76h357.12\" clip-path=\"url(#a66ecdb3287)\" fill=\"none\" stroke=\"#dde1e6\" stroke-dasharray=\"2.96,1.28\" stroke-width=\".8\"/><use x=\"50.836875\" y=\"64.760276\" fill=\"#343a3f\" stroke=\"#343a3f\" stroke-width=\".8\" xlink:href=\"#068a09cc224\"/><g transform=\"translate(24.749 68.559) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-34\" transform=\"scale(.015625)\" d=\"m2419 4116-1594-2491h1594v2491zm-166 550h794v-3041h666v-525h-666v-1100h-628v1100h-2106v609l1940 2957z\"/></defs><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-30\"/></g><g transform=\"translate(17.838 161.04) rotate(-90) scale(.14 -.14)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-43\" transform=\"scale(.015625)\" d=\"m4122 4306v-665q-319 297-680 443-361 147-767 147-800 0-1225-489t-425-1414q0-922 425-1411t1225-489q406 0 767 147t680 444v-660q-331-225-702-338-370-112-782-112-1060 0-1670 648-609 649-609 1771 0 1125 609 1773 610 649 1670 649 418 0 788-111 371-111 696-333z\"/><path id=\"DejaVuSans-6f\" transform=\"scale(.015625)\" d=\"m1959 3097q-462 0-731-361t-269-989 267-989q268-361 733-361 460 0 728 362 269 363 269 988 0 622-269 986-268 364-728 364zm0 487q750 0 1178-488 429-487 429-1349 0-859-429-1349-428-489-1178-489-753 0-1180 489-426 490-426 1349 0 862 426 1349 427 488 1180 488z\"/><path id=\"DejaVuSans-75\" transform=\"scale(.015625)\" d=\"m544 1381v2119h575v-2097q0-497 193-746 194-248 582-248 465 0 735 297 271 297 271 810v1984h575v-3500h-575v538q-209-319-486-474-276-155-642-155-603 0-916 375-312 375-312 1097zm1447 2203z\"/><path id=\"DejaVuSans-6e\" transform=\"scale(.015625)\" d=\"m3513 2113v-2113h-575v2094q0 497-194 743-194 247-581 247-466 0-735-297-269-296-269-809v-1978h-578v3500h578v-544q207 316 486 472 280 156 646 156 603 0 912-373 310-373 310-1098z\"/><path id=\"DejaVuSans-74\" transform=\"scale(.015625)\" d=\"m1172 4494v-994h1184v-447h-1184v-1900q0-428 117-550t477-122h590v-481h-590q-666 0-919 248-253 249-253 905v1900h-422v447h422v994h578z\"/></defs><use xlink:href=\"#DejaVuSans-43\"/><use x=\"69.824219\" xlink:href=\"#DejaVuSans-6f\"/><use x=\"131.005859\" xlink:href=\"#DejaVuSans-75\"/><use x=\"194.384766\" xlink:href=\"#DejaVuSans-6e\"/><use x=\"257.763672\" xlink:href=\"#DejaVuSans-74\"/></g><path d=\"m67.07 273.31h19.097v-241.92h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m105.26 273.31h19.097v-0.46345h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m143.46 273.31h19.097v-1.3903h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m181.65 273.31h19.097v-3.2441h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m219.85 273.31h19.097v-0.46345h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m258.04 273.31h19.097v-5.5614h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m296.24 273.31h19.097v-5.0979h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m334.43 273.31h19.097v-4.6345h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m372.63 273.31h19.097v-211.8h-19.097z\" clip-path=\"url(#a66ecdb3287)\" fill=\"#1192e8\"/><path d=\"m50.837 273.31v-266.11\" fill=\"none\" stroke=\"#343a3f\" stroke-linecap=\"square\" stroke-width=\".8\"/><path d=\"m50.837 273.31h357.12\" fill=\"none\" stroke=\"#343a3f\" stroke-linecap=\"square\" stroke-width=\".8\"/><g transform=\"translate(67.075 17.216) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-32\" transform=\"scale(.015625)\" d=\"m1228 531h2203v-531h-2962v531q359 372 979 998 621 627 780 809 303 340 423 576 121 236 121 464 0 372-261 606-261 235-680 235-297 0-627-103-329-103-704-313v638q381 153 712 231 332 78 607 78 725 0 1156-363 431-362 431-968 0-288-108-546-107-257-392-607-78-91-497-524-418-433-1181-1211z\"/></defs><use xlink:href=\"#DejaVuSans-35\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-32\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-32\"/></g><g transform=\"translate(111.63 270.75) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/></g><g transform=\"translate(149.83 269.77) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-33\"/></g><g transform=\"translate(188.02 267.83) scale(.1 -.1)\" fill=\"#343a3f\"><defs><path id=\"DejaVuSans-37\" transform=\"scale(.015625)\" d=\"m525 4666h3e3v-269l-1694-4397h-659l1594 4134h-2241v532z\"/></defs><use xlink:href=\"#DejaVuSans-37\"/></g><g transform=\"translate(226.22 270.75) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/></g><g transform=\"translate(261.23 265.39) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-32\"/></g><g transform=\"translate(299.42 265.88) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-31\"/></g><g transform=\"translate(337.62 266.37) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-31\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-30\"/></g><g transform=\"translate(372.63 48.847) scale(.1 -.1)\" fill=\"#343a3f\"><use xlink:href=\"#DejaVuSans-34\"/><use x=\"63.623047\" xlink:href=\"#DejaVuSans-35\"/><use x=\"127.246094\" xlink:href=\"#DejaVuSans-37\"/></g><defs><clipPath id=\"a66ecdb3287\"><rect x=\"50.837\" y=\"7.2\" width=\"357.12\" height=\"266.11\"/></clipPath></defs></svg>"
|
|
],
|
|
"text/plain": [
|
|
"<Figure size 640x480 with 1 Axes>"
|
|
]
|
|
},
|
|
"execution_count": 17,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Run the noisy simulation\n",
|
|
"sim_thermal = AerSimulator(noise_model=noise_thermal)\n",
|
|
"\n",
|
|
"# Transpile circuit for noisy basis gates\n",
|
|
"passmanager = generate_preset_pass_manager(\n",
|
|
" optimization_level=3, backend=sim_thermal\n",
|
|
")\n",
|
|
"circ_tthermal = passmanager.run(circ)\n",
|
|
"\n",
|
|
"# Run and get counts\n",
|
|
"result_thermal = sim_thermal.run(circ_tthermal).result()\n",
|
|
"counts_thermal = result_thermal.get_counts(0)\n",
|
|
"\n",
|
|
"# Plot noisy output\n",
|
|
"plot_histogram(counts_thermal)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "fcb3baa7-36a7-423b-8d32-6f2ed2ecd5d2",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Next steps\n",
|
|
"\n",
|
|
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
|
|
" - To simulate noisy circuits, see [Exact and noisy simulation with Qiskit Aer primitives](./simulate-with-qiskit-sdk-primitives).\n",
|
|
" - Review the [Qiskit Aer noise module](https://qiskit.org/ecosystem/aer/apidocs/aer_noise.html) reference.\n",
|
|
"</Admonition>"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"description": "Build custom noise models for noisy simulation with Qiskit Aer",
|
|
"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": "Building noise models"
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 4
|
|
}
|