{
  "cells": [
    {
      "cell_type": "markdown",
      "id": "d2c31ae8",
      "metadata": {},
      "source": [
        "---\n",
        "title: \"Attenuazione degli errori su scala industriale mediante amplificazione probabilistica degli errori\"\n",
        "description: \"Eseguire un esperimento di mitigazione degli errori su scala industriale con estrapolazione del rumore zero e amplificazione probabilistica degli errori.\"\n",
        "---\n",
        "\n",
        "{/* cspell:ignore mapsto multigraph inds extrap sharex sharey pidx */}\n",
        "\n",
        "<span id=\"utility-scale-error-mitigation-with-probabilistic-error-amplification\" />\n",
        "\n",
        "# Attenuazione degli errori su scala industriale mediante amplificazione probabilistica degli errori\n",
        "\n",
        "*Stima della durata: 14 minuti su un processore Heron r3 (NOTA: si tratta solo di una stima). (La durata potrebbe variare.)*\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "8bf80006",
      "metadata": {},
      "source": [
        "<span id=\"learning-outcomes\" />\n",
        "\n",
        "## Risultati di apprendimento\n",
        "\n",
        "Dopo aver seguito questo tutorial, gli utenti dovrebbero aver compreso:\n",
        "\n",
        "* La teoria alla base *dell'estrapolazione a rumore zero* (ZNE), i diversi metodi per amplificare il rumore e i motivi per cui *l'amplificazione probabilistica dell'errore* (PEA) è preferita per gli esperimenti su scala industriale.\n",
        "* Come implementare ZNE con PEA nella pratica utilizzando Qiskit.\n",
        "\n",
        "<span id=\"prerequisites\" />\n",
        "\n",
        "## Prerequisiti\n",
        "\n",
        "Consigliamo agli utenti di acquisire familiarità con i seguenti argomenti prima di seguire questo tutorial:\n",
        "\n",
        "* [La lezione](/learning/courses/utility-scale-quantum-computing/error-mitigation) sulla mitigazione degli errori del corso *sul calcolo quantistico su larga scala,* dedicata alle nozioni di base sull'uso della mitigazione degli errori in Qiskit.\n",
        "* [La lezione \"Utility-I](/learning/courses/utility-scale-quantum-computing/utility-i) \" del corso *sul calcolo quantistico su scala industriale,* per ulteriori informazioni sull'esperimento su scala industriale utilizzato come esempio in questo tutorial.\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "a929ccce",
      "metadata": {},
      "source": [
        "<span id=\"background\" />\n",
        "\n",
        "## Sfondo\n",
        "\n",
        "Questo tutorial illustra come eseguire un esperimento di mitigazione degli errori su scala industriale con il servizio Compute di IBM Quantum, utilizzando una versione sperimentale *dell'estrapolazione* a rumore zero (ZNE) con *amplificazione probabilistica dell'errore* (PEA).\n",
        "\n",
        "![kim\\_nature\\_fig.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/e1e67c34-9d4d-4a88-9340-f0b2f3676770.avif)\n",
        "\n",
        "**Riferimento**\n",
        ": Y. Kim e altri *Prove dell'utilità dell'informatica quantistica prima dell'introduzione della tolleranza ai guasti.* [Nature 618.7965 (2023)](https://www.nature.com/articles/s41586-023-06096-3)\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "a89ed8dd",
      "metadata": {},
      "source": [
        "<span id=\"zero-noise-extrapolation-zne\" />\n",
        "\n",
        "### Estrapolazione a rumore zero (ZNE)\n",
        "\n",
        "L'estrapolazione a rumore zero (ZNE) è una tecnica di mitigazione degli errori che rimuove gli effetti di un rumore *sconosciuto* durante l'esecuzione del circuito che può essere scalato in modo *noto*.\n",
        "\n",
        "Assume che i valori di aspettativa scalino con il rumore mediante una funzione nota\n",
        "\n",
        "$$\n",
        "\\langle A(\\lambda) \\rangle = \\langle A(0) \\rangle + \\sum_{k=0}^{m} a_k \\lambda^k + R\n",
        "$$\n",
        "\n",
        "dove $\\lambda$ parametrizza l'intensità del rumore e può essere amplificato.\n",
        "\n",
        "Possiamo implementare la ZNE con i seguenti passi:\n",
        "\n",
        "1. Amplificare il rumore del circuito per diversi fattori di rumore $\\lambda_1, \\lambda_2, ... $\n",
        "2. Eseguire ogni circuito amplificato dal rumore per misurare $\\langle A(\\lambda_1)\\rangle, ...$\n",
        "3. Estrapolare fino al limite di rumore zero $\\langle A(0)\\rangle$\n",
        "\n",
        "![zne\\_stages.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/5e63d706-82d8-4212-b802-c9191ce53341.avif)\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "5db985b9",
      "metadata": {},
      "source": [
        "<span id=\"amplify-noise-for-zne\" />\n",
        "\n",
        "#### Amplificare il rumore per ZNE\n",
        "\n",
        "La sfida principale nell'implementazione di ZNE consiste nel disporre di un modello accurato per il rumore nel valore di aspettativa e nell'amplificare il rumore in modo noto.\n",
        "\n",
        "L'amplificazione degli errori viene attuata in tre modi comuni per le ZNE.\n",
        "\n",
        "| **Stretching a impulsi**                                                                                                                                                                           | **Cancello pieghevole**                                                                                                                                                                        | **Amplificazione probabilistica degli errori**                                                                                                                                       |\n",
        "| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n",
        "| Scala della durata dell'impulso tramite calibrazione                                                                                                                                               | Ripetere le porte in cicli di identità $U\\mapsto U(U^{-1}U)^{\\lambda-1}/2$                                                                                                                     | Aggiungere rumore tramite il campionamento dei canali Pauli                                                                                                                          |\n",
        "| ![zne\\_pulse\\_stretching.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/83188b57-e88f-43a1-a7bd-29327f46ecf5.avif) | ![zne\\_gate\\_folding.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/e1358d08-2632-4fd2-bf0f-f9384a2d3340.avif) | ![zne\\_pea.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/3d69d5bd-70e5-4eeb-aa02-fc0a62043010.avif) |\n",
        "| Kandala et al. Natura (2019)                                                                                                                                                                       | Shultz et al. PRA (2022)                                                                                                                                                                       | Li & Benjamin PRX (2017)                                                                                                                                                             |\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "c23e43ee",
      "metadata": {},
      "source": [
        "Per gli esperimenti su scala industriale, l' *amplificazione probabilistica degli errori* (PEA) è la più interessante.\n",
        "\n",
        "* L'allungamento degli impulsi presuppone che il rumore del gate sia proporzionale alla durata, cosa che in genere non è vera. Anche la calibrazione è costosa.\n",
        "* La piegatura dei gate richiede grandi fattori di stiramento che limitano notevolmente la profondità dei circuiti che possono essere eseguiti.\n",
        "* La PEA può essere applicata a qualsiasi circuito che può essere eseguito con il fattore di rumore nativo ( $\\lambda=1$ ), ma richiede l'apprendimento del modello di rumore.\n",
        "\n",
        "<span id=\"learn-the-noise-model-for-pea\" />\n",
        "\n",
        "### Impara il modello di rumore per PEA\n",
        "\n",
        "Il PEA assume lo stesso modello di rumore a strati della *cancellazione probabilistica degli errori* (PEC); tuttavia, evita l'overhead di campionamento che scala esponenzialmente con il rumore del circuito.\n",
        "\n",
        "| **Passo 1**                                                                                                                                                                                      | **Passo 2**                                                                                                                                                                                   | **Passo 3**                                                                                                                                                                                     |\n",
        "| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n",
        "| Strati di Pauli di porte a due equbit                                                                                                                                                            | Ripetere l'identità di coppie di strati e imparare il rumore                                                                                                                                  | Derivare una fedeltà (errore per ogni canale di rumore)                                                                                                                                         |\n",
        "| ![pec\\_pauli\\_twirling.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/2eab5ff4-40fa-4a41-9f2c-74f5e22c4643.avif) | ![pec\\_learn\\_layer.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/8d0d64c3-65ad-4419-8ac9-4ec9633d39a0.avif) | ![pec\\_curve\\_fitting.png](https://quantum.cloud.ibm.com/docs/images/tutorials/utility-scale-error-mitigation-with-probabilistic-error-amplification/c51bd42d-2463-4c78-807b-d284ca79296f.avif) |\n",
        "\n",
        "**Riferimento** : E. van den Berg, Z. Minev, A. Kandala, e K. Temme, *Cancellazione probabilistica degli errori con modelli di Pauli-Lindblad sparsi su processori quantistici rumorosi* [arXiv:2201.09866](https://arxiv.org/abs/2201.09866)\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "55b94021",
      "metadata": {},
      "source": [
        "<span id=\"requirements\" />\n",
        "\n",
        "## Requisiti\n",
        "\n",
        "Prima di iniziare questo tutorial, assicurati di avere installato quanto segue:\n",
        "\n",
        "* Qiskit SDK v2.0 o versioni successive, con supporto [alla visualizzazione](/docs/api/qiskit/visualization)\n",
        "* Qiskit Runtime v0.22 o successivamente (`pip install qiskit-ibm-runtime`)\n",
        "\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "id": "7db2e559",
      "metadata": {},
      "source": [
        "<span id=\"setup\" />\n",
        "\n",
        "## Configura\n",
        "\n",
        "Nella cella sottostante, importiamo i pacchetti necessari e creiamo alcune funzioni di supporto per costruire i circuiti relativi all'evoluzione temporale secondo il metodo di Trotter di un modello di Ising bidimensionale a campo trasversale che rispetta la topologia del backend.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "id": "779bbc51",
      "metadata": {},
      "outputs": [],
      "source": [
        "from __future__ import annotations\n",
        "from collections.abc import Sequence\n",
        "from collections import defaultdict\n",
        "import numpy as np\n",
        "import rustworkx\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "from qiskit.circuit import QuantumCircuit, Parameter\n",
        "from qiskit.circuit.library import CXGate, CZGate, ECRGate\n",
        "from qiskit.providers import Backend\n",
        "from qiskit.visualization import plot_error_map\n",
        "from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager\n",
        "from qiskit.quantum_info import SparsePauliOp\n",
        "from qiskit.primitives import PubResult\n",
        "\n",
        "from qiskit_ibm_runtime import QiskitRuntimeService\n",
        "from qiskit_ibm_runtime import EstimatorV2 as Estimator\n",
        "\n",
        "\n",
        "\"\"\"Trotter circuit generation\"\"\"\n",
        "\n",
        "\n",
        "def remove_qubit_couplings(\n",
        "    couplings: Sequence[tuple[int, int]], qubits: Sequence[int] | None = None\n",
        ") -> list[tuple[int, int]]:\n",
        "    \"\"\"Remove qubits from a coupling list.\n",
        "\n",
        "    Args:\n",
        "        couplings: A sequence of qubit couplings.\n",
        "        qubits: Optional, the qubits to remove.\n",
        "\n",
        "    Returns:\n",
        "        The input couplings with the specified qubits removed.\n",
        "    \"\"\"\n",
        "    if qubits is None:\n",
        "        return couplings\n",
        "    qubits = set(qubits)\n",
        "    return [edge for edge in couplings if not qubits.intersection(edge)]\n",
        "\n",
        "\n",
        "def coupling_qubits(\n",
        "    *couplings: Sequence[tuple[int, int]],\n",
        "    allowed_qubits: Sequence[int] | None = None,\n",
        ") -> list[int]:\n",
        "    \"\"\"Return a sorted list of all qubits involved in one or more couplings lists.\n",
        "\n",
        "    Args:\n",
        "        couplings: one or more coupling lists.\n",
        "        allowed_qubits: Optional, the allowed qubits to include. If None all\n",
        "            qubits are allowed.\n",
        "\n",
        "    Returns:\n",
        "        The intersection of all qubits in the couplings and the allowed qubits.\n",
        "    \"\"\"\n",
        "    qubits = set()\n",
        "    for edges in couplings:\n",
        "        for edge in edges:\n",
        "            qubits.update(edge)\n",
        "    if allowed_qubits is not None:\n",
        "        qubits = qubits.intersection(allowed_qubits)\n",
        "    return list(qubits)\n",
        "\n",
        "\n",
        "def construct_layer_couplings(\n",
        "    backend: Backend,\n",
        ") -> list[list[tuple[int, int]]]:\n",
        "    \"\"\"Separate a coupling map into disjoint 2-qubit gate layers.\n",
        "\n",
        "    Args:\n",
        "        backend: A backend to construct layer couplings for.\n",
        "\n",
        "    Returns:\n",
        "        A list of disjoint layers of directed couplings for the input coupling map.\n",
        "    \"\"\"\n",
        "    coupling_graph = backend.coupling_map.graph.to_undirected(\n",
        "        multigraph=False\n",
        "    )\n",
        "    edge_coloring = rustworkx.graph_bipartite_edge_color(coupling_graph)\n",
        "\n",
        "    layers = defaultdict(list)\n",
        "    for edge_idx, color in edge_coloring.items():\n",
        "        layers[color].append(\n",
        "            coupling_graph.get_edge_endpoints_by_index(edge_idx)\n",
        "        )\n",
        "    layers = [sorted(layers[i]) for i in sorted(layers.keys())]\n",
        "\n",
        "    return layers\n",
        "\n",
        "\n",
        "def entangling_layer(\n",
        "    gate_2q: str,\n",
        "    couplings: Sequence[tuple[int, int]],\n",
        "    qubits: Sequence[int] | None = None,\n",
        ") -> QuantumCircuit:\n",
        "    \"\"\"Generating a entangling layer for the specified couplings.\n",
        "\n",
        "    This corresponds to a Trotter layer for a ZZ Ising term with angle Pi/2.\n",
        "\n",
        "    Args:\n",
        "        gate_2q: The 2-qubit basis gate for the layer, should be \"cx\", \"cz\", or \"ecr\".\n",
        "        couplings: A sequence of qubit couplings to add CX gates to.\n",
        "        qubits: Optional, the physical qubits for the layer. Any couplings involving\n",
        "            qubits not in this list will be removed. If None the range up to the largest\n",
        "            qubit in the couplings will be used.\n",
        "\n",
        "    Returns:\n",
        "        The QuantumCircuit for the entangling layer.\n",
        "    \"\"\"\n",
        "    # Get qubits and convert to set to order\n",
        "    if qubits is None:\n",
        "        qubits = range(1 + max(coupling_qubits(couplings)))\n",
        "    qubits = set(qubits)\n",
        "\n",
        "    # Mapping of physical qubit to virtual qubit\n",
        "    qubit_mapping = {q: i for i, q in enumerate(qubits)}\n",
        "\n",
        "    # Convert couplings to indices for virtual qubits\n",
        "    indices = [\n",
        "        [qubit_mapping[i] for i in edge]\n",
        "        for edge in couplings\n",
        "        if qubits.issuperset(edge)\n",
        "    ]\n",
        "\n",
        "    # Layer circuit on virtual qubits\n",
        "    circuit = QuantumCircuit(len(qubits))\n",
        "\n",
        "    # Get 2-qubit basis gate and pre and post rotation circuits\n",
        "    gate2q = None\n",
        "    pre = QuantumCircuit(2)\n",
        "    post = QuantumCircuit(2)\n",
        "\n",
        "    if gate_2q == \"cx\":\n",
        "        gate2q = CXGate()\n",
        "        # Pre-rotation\n",
        "        pre.sdg(0)\n",
        "        pre.z(1)\n",
        "        pre.sx(1)\n",
        "        pre.s(1)\n",
        "        # Post-rotation\n",
        "        post.sdg(1)\n",
        "        post.sxdg(1)\n",
        "        post.s(1)\n",
        "    elif gate_2q == \"ecr\":\n",
        "        gate2q = ECRGate()\n",
        "        # Pre-rotation\n",
        "        pre.z(0)\n",
        "        pre.s(1)\n",
        "        pre.sx(1)\n",
        "        pre.s(1)\n",
        "        # Post-rotation\n",
        "        post.x(0)\n",
        "        post.sdg(1)\n",
        "        post.sxdg(1)\n",
        "        post.s(1)\n",
        "    elif gate_2q == \"cz\":\n",
        "        gate2q = CZGate()\n",
        "        # Identity pre-rotation\n",
        "        # Post-rotation\n",
        "        post.sdg([0, 1])\n",
        "    else:\n",
        "        raise ValueError(\n",
        "            f\"Invalid 2-qubit basis gate {gate_2q}, should be 'cx', 'cz', or 'ecr'\"\n",
        "        )\n",
        "\n",
        "    # Add 1Q pre-rotations\n",
        "    for inds in indices:\n",
        "        circuit.compose(pre, qubits=inds, inplace=True)\n",
        "\n",
        "    # Use barriers around 2-qubit basis gate to specify a layer for PEA noise learning\n",
        "    circuit.barrier()\n",
        "    for inds in indices:\n",
        "        circuit.append(gate2q, (inds[0], inds[1]))\n",
        "    circuit.barrier()\n",
        "\n",
        "    # Add 1Q post-rotations after barrier\n",
        "    for inds in indices:\n",
        "        circuit.compose(post, qubits=inds, inplace=True)\n",
        "\n",
        "    # Add physical qubits as metadata\n",
        "    circuit.metadata[\"physical_qubits\"] = tuple(qubits)\n",
        "\n",
        "    return circuit\n",
        "\n",
        "\n",
        "def trotter_circuit(\n",
        "    theta: Parameter | float,\n",
        "    layer_couplings: Sequence[Sequence[tuple[int, int]]],\n",
        "    num_steps: int,\n",
        "    gate_2q: str | None = \"cx\",\n",
        "    backend: Backend | None = None,\n",
        "    qubits: Sequence[int] | None = None,\n",
        ") -> QuantumCircuit:\n",
        "    \"\"\"Generate a Trotter circuit for the 2D Ising\n",
        "\n",
        "    Args:\n",
        "        theta: The angle parameter for X.\n",
        "        layer_couplings: A list of couplings for each entangling layer.\n",
        "        num_steps: the number of Trotter steps.\n",
        "        gate_2q: The 2-qubit basis gate to use in entangling layers.\n",
        "            Can be \"cx\", \"cz\", \"ecr\", or None if a backend is provided.\n",
        "        backend: A backend to get the 2-qubit basis gate from, if provided\n",
        "            will override the basis_gate field.\n",
        "        qubits: Optional, the allowed physical qubits to truncate the\n",
        "            couplings to. If None the range up to the largest\n",
        "            qubit in the couplings will be used.\n",
        "\n",
        "    Returns:\n",
        "        The Trotter circuit.\n",
        "    \"\"\"\n",
        "    if backend is not None:\n",
        "        try:\n",
        "            basis_gates = backend.configuration().basis_gates\n",
        "        except AttributeError:\n",
        "            basis_gates = backend.basis_gates\n",
        "        for gate in [\"cx\", \"cz\", \"ecr\"]:\n",
        "            if gate in basis_gates:\n",
        "                gate_2q = gate\n",
        "                break\n",
        "\n",
        "    # If no qubits, get the largest qubit from all layers and\n",
        "    # specify the range so the same one is used for all layers.\n",
        "    if qubits is None:\n",
        "        qubits = range(1 + max(coupling_qubits(layer_couplings)))\n",
        "\n",
        "    # Generate the entangling layers\n",
        "    layers = [\n",
        "        entangling_layer(gate_2q, couplings, qubits=qubits)\n",
        "        for couplings in layer_couplings\n",
        "    ]\n",
        "\n",
        "    # Construct the circuit for a single Trotter step\n",
        "    num_qubits = len(qubits)\n",
        "    trotter_step = QuantumCircuit(num_qubits)\n",
        "    trotter_step.rx(theta, range(num_qubits))\n",
        "    for layer in layers:\n",
        "        trotter_step.compose(layer, range(num_qubits), inplace=True)\n",
        "\n",
        "    # Construct the circuit for the specified number of Trotter steps\n",
        "    circuit = QuantumCircuit(num_qubits)\n",
        "    for _ in range(num_steps):\n",
        "        circuit.rx(theta, range(num_qubits))\n",
        "        for layer in layers:\n",
        "            circuit.compose(layer, range(num_qubits), inplace=True)\n",
        "\n",
        "    circuit.metadata[\"physical_qubits\"] = tuple(qubits)\n",
        "    return circuit\n",
        "\n",
        "\n",
        "\"\"\"Result visualization functions\"\"\"\n",
        "\n",
        "\n",
        "def plot_trotter_results(\n",
        "    pub_result: PubResult,\n",
        "    angles: Sequence[float],\n",
        "    plot_noise_factors: Sequence[float] | None = None,\n",
        "    plot_extrapolator: Sequence[str] | None = None,\n",
        "    exact: np.ndarray = None,\n",
        "    close: bool = True,\n",
        "):\n",
        "    \"\"\"Plot average magnetization from ZNE result data.\n",
        "    Args:\n",
        "        pub_result: The Estimator PubResult for the PEA experiment.\n",
        "        angles: The Rx angle values for the experiment.\n",
        "        plot_raw: If provided plot the unextrapolated data for the noise factors.\n",
        "        plot_extrapolator: If provided plot all extrapolators, if False only plot\n",
        "            the Automatic method.\n",
        "        exact: Optional, the exact values to include in the plot. Should be a 1D\n",
        "            array-like where the values represent exact magnetization.\n",
        "        close: Close the Matplotlib figure before returning.\n",
        "    Returns:\n",
        "        The figure.\n",
        "    \"\"\"\n",
        "    data = pub_result.data\n",
        "\n",
        "    evs = data.evs\n",
        "    num_qubits = evs.shape[0]\n",
        "    num_params = evs.shape[1]\n",
        "    angles = np.asarray(angles).ravel()\n",
        "    if angles.shape != (num_params,):\n",
        "        raise ValueError(\n",
        "            f\"Incorrect number of angles for input data {angles.size} != {num_params}\"\n",
        "        )\n",
        "\n",
        "    # Take average magnetization of qubits and its standard error\n",
        "    x_vals = angles / np.pi\n",
        "    y_vals = np.mean(evs, axis=0)\n",
        "    y_errs = np.std(evs, axis=0) / np.sqrt(num_qubits)\n",
        "\n",
        "    fig, _ = plt.subplots(1, 1)\n",
        "\n",
        "    # Plot auto method\n",
        "    plt.errorbar(x_vals, y_vals, y_errs, fmt=\"o-\", label=\"ZNE (automatic)\")\n",
        "\n",
        "    # Plot individual extrapolator results\n",
        "    if plot_extrapolator:\n",
        "        y_vals_extrap = np.mean(data.evs_extrapolated, axis=0)\n",
        "        y_errs_extrap = np.std(data.evs_extrapolated, axis=0) / np.sqrt(\n",
        "            num_qubits\n",
        "        )\n",
        "        for i, extrap in enumerate(plot_extrapolator):\n",
        "            plt.errorbar(\n",
        "                x_vals,\n",
        "                y_vals_extrap[:, i, 0],\n",
        "                y_errs_extrap[:, i, 0],\n",
        "                fmt=\"s-.\",\n",
        "                alpha=0.5,\n",
        "                label=f\"ZNE ({extrap})\",\n",
        "            )\n",
        "\n",
        "    # Plot raw results\n",
        "    if plot_noise_factors:\n",
        "        y_vals_raw = np.mean(data.evs_noise_factors, axis=0)\n",
        "        y_errs_raw = np.std(data.evs_noise_factors, axis=0) / np.sqrt(\n",
        "            num_qubits\n",
        "        )\n",
        "        for i, nf in enumerate(plot_noise_factors):\n",
        "            plt.errorbar(\n",
        "                x_vals,\n",
        "                y_vals_raw[:, i],\n",
        "                y_errs_raw[:, i],\n",
        "                fmt=\"d:\",\n",
        "                alpha=0.5,\n",
        "                label=f\"Raw (nf={nf:.1f})\",\n",
        "            )\n",
        "\n",
        "    # Plot exact data\n",
        "    if exact is not None:\n",
        "        plt.plot(x_vals, exact, \"--\", color=\"black\", alpha=0.5, label=\"Exact\")\n",
        "\n",
        "    plt.ylim(-0.1, 1.2)\n",
        "    plt.xlabel(\"θ/π\")\n",
        "    plt.ylabel(r\"$\\overline{\\langle Z \\rangle}$\")\n",
        "    plt.legend()\n",
        "    plt.title(\n",
        "        f\"Error Mitigated Average Magnetization for Rx(θ) [{num_qubits}-qubit]\"\n",
        "    )\n",
        "    if close:\n",
        "        plt.close(fig)\n",
        "    return fig\n",
        "\n",
        "\n",
        "def plot_qubit_zne_data(\n",
        "    pub_result: PubResult,\n",
        "    angles: Sequence[float],\n",
        "    qubit: int,\n",
        "    noise_factors: Sequence[float],\n",
        "    extrapolator: Sequence[str] | None = None,\n",
        "    extrapolated_noise_factors: Sequence[float] | None = None,\n",
        "    num_cols: int | None = None,\n",
        "    close: bool = True,\n",
        "):\n",
        "    \"\"\"Plot ZNE extrapolation data for specific virtual qubit\n",
        "    Args:\n",
        "        pub_result: The Estimator PubResult for the PEA experiment.\n",
        "        angles: The Rx theta angles used for the experiment.\n",
        "        qubit: The virtual qubit index to plot.\n",
        "        noise_factors: the raw noise factors.\n",
        "        extrapolator: The extrapolator metadata for multiple extrapolators.\n",
        "        extrapolated_noise_factors: The noise factors used for extrapolation.\n",
        "        num_cols: The number of columns for the generated subplots.\n",
        "        close: Close the Matplotlib figure before returning.\n",
        "    Returns:\n",
        "        The Matplotlib figure.\n",
        "    \"\"\"\n",
        "    data = pub_result.data\n",
        "\n",
        "    evs_auto = data.evs[qubit]\n",
        "    stds_auto = data.stds[qubit]\n",
        "    evs_extrap = data.evs_extrapolated[qubit]\n",
        "    stds_extrap = data.stds_extrapolated[qubit]\n",
        "    evs_raw = data.evs_noise_factors[qubit]\n",
        "    stds_raw = data.stds_noise_factors[qubit]\n",
        "\n",
        "    num_params = evs_auto.shape[0]\n",
        "    angles = np.asarray(angles).ravel()\n",
        "    if angles.shape != (num_params,):\n",
        "        raise ValueError(\n",
        "            f\"Incorrect number of angles for input data {angles.size} != {num_params}\"\n",
        "        )\n",
        "\n",
        "    # Make a square subplot\n",
        "    num_cols = num_cols or int(np.ceil(np.sqrt(num_params)))\n",
        "    num_rows = int(np.ceil(num_params / num_cols))\n",
        "    fig, axes = plt.subplots(\n",
        "        num_rows, num_cols, sharex=True, sharey=True, figsize=(12, 5)\n",
        "    )\n",
        "    fig.suptitle(f\"ZNE data for virtual qubit {qubit}\")\n",
        "\n",
        "    for pidx, ax in zip(range(num_params), axes.flat):\n",
        "        # Plot auto extrapolated\n",
        "        ax.errorbar(\n",
        "            0,\n",
        "            evs_auto[pidx],\n",
        "            stds_auto[pidx],\n",
        "            fmt=\"o\",\n",
        "            label=\"PEA (automatic)\",\n",
        "        )\n",
        "\n",
        "        # Plot extrapolators\n",
        "        if (\n",
        "            extrapolator is not None\n",
        "            and extrapolated_noise_factors is not None\n",
        "        ):\n",
        "            for i, method in enumerate(extrapolator):\n",
        "                ax.errorbar(\n",
        "                    extrapolated_noise_factors,\n",
        "                    evs_extrap[pidx, i],\n",
        "                    stds_extrap[pidx, i],\n",
        "                    fmt=\"-\",\n",
        "                    alpha=0.5,\n",
        "                    label=f\"PEA ({method})\",\n",
        "                )\n",
        "\n",
        "        # Plot raw\n",
        "        ax.errorbar(\n",
        "            noise_factors, evs_raw[pidx], stds_raw[pidx], fmt=\"d\", label=\"Raw\"\n",
        "        )\n",
        "\n",
        "        ax.set_yticks([0, 0.5, 1, 1.5, 2])\n",
        "        ax.set_ylim(0, max(1, 1.1 * max(evs_auto)))\n",
        "\n",
        "        ax.set_xticks([0, *noise_factors])\n",
        "        ax.set_title(f\"θ/π = {angles[pidx]/np.pi:.2f}\")\n",
        "        if pidx == 0:\n",
        "            ax.set_ylabel(r\"$\\langle Z_{\" + str(qubit) + r\"} \\rangle$\")\n",
        "        if pidx == num_params - 1:\n",
        "            ax.set_xlabel(\"Noise Factor\")\n",
        "            ax.legend()\n",
        "    plt.tight_layout()\n",
        "    if close:\n",
        "        plt.close(fig)\n",
        "    return fig"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "431a5bd2-e6ed-471b-ad9e-c4edd27784a8",
      "metadata": {},
      "source": [
        "<span id=\"small-scale-simulator-example\" />\n",
        "\n",
        "## Esempio di simulatore su piccola scala\n",
        "\n",
        "Salteremo questo passaggio poiché la mitigazione degli errori di runtime non è supportata sui simulatori.\n",
        "\n",
        "<span id=\"large-scale-hardware-example\" />\n",
        "\n",
        "## Esempio di hardware su larga scala\n",
        "\n"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "id": "988ee237",
      "metadata": {},
      "source": [
        "<span id=\"step-1-map-classical-inputs-to-a-quantum-problem\" />\n",
        "\n",
        "### Fase 1: mappare gli input classici su un problema quantistico\n",
        "\n",
        "<span id=\"create-a-parameterized-ising-model-circuit\" />\n",
        "\n",
        "#### Creare un circuito modello Ising parametrizzato\n",
        "\n",
        "<span id=\"establish-a-backend\" />\n",
        "\n",
        "##### Configurare il backend\n",
        "\n",
        "Per prima cosa, scegliete un backend su cui eseguire l'operazione. Questa dimostrazione viene eseguita con un backend a 127 qubit, ma è possibile modificarla con qualsiasi backend disponibile.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "id": "a3debf65-06df-4277-933e-14b6f6170756",
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<IBMBackend('ibm_fez')>"
            ]
          },
          "execution_count": 2,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "service = QiskitRuntimeService()\n",
        "backend = service.least_busy(\n",
        "    operational=True, simulator=False, min_num_qubits=127\n",
        ")\n",
        "backend"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "c13564d0",
      "metadata": {},
      "source": [
        "<span id=\"define-entangling-layer-couplings\" />\n",
        "\n",
        "##### Definire gli accoppiamenti degli strati di entanglement\n",
        "\n",
        "Per implementare la simulazione Ising trotterizzata, si definiscono tre strati di accoppiamenti di gate a due qubit per il dispositivo, da ripetere a ogni passo di Trotter. Questi definiscono i tre livelli di rotazione per i quali è necessario imparare il rumore per implementare la mitigazione.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "id": "0211a3f8",
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Layer 0:\n",
            "[(2, 3), (4, 5), (6, 7), (8, 9), (10, 11), (12, 13), (14, 15), (16, 23), (18, 31), (19, 35), (20, 21), (25, 37), (26, 27), (28, 29), (33, 39), (36, 41), (38, 49), (42, 43), (45, 46), (47, 57), (51, 52), (53, 54), (56, 63), (58, 71), (59, 75), (61, 62), (64, 65), (66, 67), (68, 69), (72, 73), (76, 81), (79, 93), (82, 83), (84, 85), (86, 87), (88, 89), (91, 98), (94, 95), (97, 107), (99, 115), (100, 101), (102, 103), (105, 117), (108, 109), (110, 111), (113, 114), (116, 121), (118, 129), (123, 136), (124, 125), (126, 127), (130, 131), (132, 133), (135, 139), (138, 151), (142, 143), (144, 145), (146, 147), (152, 153), (154, 155)]\n",
            "\n",
            "Layer 1:\n",
            "[(0, 1), (3, 16), (5, 6), (7, 8), (11, 18), (13, 14), (17, 27), (21, 22), (23, 24), (25, 26), (29, 38), (30, 31), (32, 33), (34, 35), (39, 53), (41, 42), (43, 56), (44, 45), (47, 48), (49, 50), (51, 58), (54, 55), (57, 67), (60, 61), (62, 63), (65, 66), (69, 78), (70, 71), (73, 79), (74, 75), (77, 85), (80, 81), (83, 84), (87, 97), (89, 90), (91, 92), (93, 94), (96, 103), (101, 116), (104, 105), (106, 107), (109, 118), (111, 112), (113, 119), (114, 115), (117, 125), (121, 122), (123, 124), (127, 137), (128, 129), (131, 138), (133, 134), (136, 143), (139, 155), (140, 141), (145, 146), (147, 148), (149, 150), (151, 152)]\n",
            "\n",
            "Layer 2:\n",
            "[(1, 2), (3, 4), (7, 17), (9, 10), (11, 12), (15, 19), (21, 36), (22, 23), (24, 25), (27, 28), (29, 30), (31, 32), (33, 34), (37, 45), (40, 41), (43, 44), (46, 47), (48, 49), (50, 51), (52, 53), (55, 59), (61, 76), (63, 64), (65, 77), (67, 68), (69, 70), (71, 72), (73, 74), (78, 89), (81, 82), (83, 96), (85, 86), (87, 88), (90, 91), (92, 93), (95, 99), (98, 111), (101, 102), (103, 104), (105, 106), (107, 108), (109, 110), (112, 113), (119, 133), (120, 121), (122, 123), (125, 126), (127, 128), (129, 130), (131, 132), (134, 135), (137, 147), (141, 142), (143, 144), (148, 149), (150, 151), (153, 154)]\n",
            "\n"
          ]
        }
      ],
      "source": [
        "layer_couplings = construct_layer_couplings(backend)\n",
        "for i, layer in enumerate(layer_couplings):\n",
        "    print(f\"Layer {i}:\\n{layer}\\n\")"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "d320e933",
      "metadata": {},
      "source": [
        "<span id=\"remove-bad-qubits\" />\n",
        "\n",
        "##### Rimuovi i qubit difettosi\n",
        "\n",
        "Guardare la mappa degli accoppiamenti per il backend e vedere se qualche qubit si connette ad accoppiamenti con un errore elevato. Eliminate questi qubit \"cattivi\" dal vostro esperimento.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "id": "fccef708",
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<Image src=\"/docs/images/tutorials/probabilistic-error-amplification/extracted-outputs/fccef708-0.avif\" alt=\"Output of the previous code cell\" />"
            ]
          },
          "execution_count": 4,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "# Plot gate error map\n",
        "# NOTE: These can change over time, so your results may look different\n",
        "plot_error_map(backend)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 5,
      "id": "5973c90b",
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Physical qubits:\n",
            " [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155]\n"
          ]
        }
      ],
      "source": [
        "bad_qubits = {\n",
        "    32,\n",
        "    33,\n",
        "    71,\n",
        "    72,\n",
        "    73,\n",
        "    102,\n",
        "    103,\n",
        "}  # qubits removed based on high coupling error (1.00)\n",
        "good_qubits = list(set(range(backend.num_qubits)).difference(bad_qubits))\n",
        "print(\"Physical qubits:\\n\", good_qubits)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "180c4cb5",
      "metadata": {},
      "source": [
        "<span id=\"main-trotter-circuit-generation\" />\n",
        "\n",
        "##### Generazione del circuito principale Trotter\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "id": "f814ca82",
      "metadata": {},
      "outputs": [],
      "source": [
        "num_steps = 6\n",
        "theta = Parameter(\"theta\")\n",
        "circuit = trotter_circuit(\n",
        "    theta, layer_couplings, num_steps, qubits=good_qubits, backend=backend\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "7b86b867",
      "metadata": {},
      "source": [
        "<span id=\"create-a-list-of-parameter-values-to-be-assigned-later\" />\n",
        "\n",
        "#### Creare un elenco di valori dei parametri da assegnare in seguito\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "id": "5da6e991",
      "metadata": {},
      "outputs": [],
      "source": [
        "num_params = 12\n",
        "\n",
        "# 12 parameter values for Rx between [0, pi/2].\n",
        "# Reshape to outer product broadcast with observables\n",
        "parameter_values = np.linspace(0, np.pi / 2, num_params).reshape(\n",
        "    (num_params, 1)\n",
        ")\n",
        "num_params = parameter_values.size"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "ac6f36e3",
      "metadata": {},
      "source": [
        "<span id=\"step-2-optimize-problem-for-quantum-hardware-execution\" />\n",
        "\n",
        "### Fase 2: Ottimizzazione del problema per l'esecuzione su hardware quantistico\n",
        "\n",
        "<span id=\"isa-circuit\" />\n",
        "\n",
        "#### Circuito ISA\n",
        "\n",
        "Prima di eseguire il circuito su hardware, ottimizzarlo per l'esecuzione su hardware. Questo processo prevede alcune fasi:\n",
        "\n",
        "* Scegliete un layout di qubit che mappa i qubit virtuali del vostro circuito con i qubit fisici dell'hardware.\n",
        "* Inserire porte di scambio se necessario per instradare le interazioni tra qubit non collegati.\n",
        "* Tradurre le porte del nostro circuito in istruzioni [ISA (Instruction Set Architecture)](/docs/guides/transpile#instruction-set-architecture) che possono essere eseguite direttamente sull'hardware.\n",
        "* Eseguire ottimizzazioni del circuito per ridurre al minimo la profondità del circuito e il numero di porte.\n",
        "\n",
        "Sebbene il transpiler integrato in Qiskit sia in grado di eseguire tutti questi passaggi, questo tutorial mostra la costruzione del circuito Trotter su scala industriale in modo autonomo. Selezionare i qubit fisici buoni e definire strati di entangling su coppie di qubit connessi da questi qubit selezionati. Tuttavia, è ancora necessario tradurre le porte nonISA nel circuito e avvalersi di qualsiasi ottimizzazione del circuito offerta dal transpiler.\n",
        "\n",
        "Transpilare il circuito per il backend scelto creando un pass manager e poi eseguendo il pass manager sul circuito. Inoltre, fissare il layout iniziale del circuito al sito `good_qubits` già selezionato. Un modo semplice per creare un gestore di pass è usare la funzione [`generate_preset_pass_manager`](/docs/api/qiskit/qiskit.transpiler.generate_preset_pass_manager) funzione. Per una spiegazione più dettagliata del transpiling [con i gestori di passaggi, vedere Transpile](/docs/guides/transpile-with-pass-managers) con i gestori di passaggi.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "id": "1834cb22",
      "metadata": {},
      "outputs": [],
      "source": [
        "pm = generate_preset_pass_manager(\n",
        "    backend=backend,\n",
        "    initial_layout=good_qubits,\n",
        "    layout_method=\"trivial\",\n",
        "    optimization_level=1,\n",
        ")\n",
        "\n",
        "isa_circuit = pm.run(circuit)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "d395c8cf",
      "metadata": {},
      "source": [
        "<span id=\"isa-observables\" />\n",
        "\n",
        "#### Osservabili ISA\n",
        "\n",
        "Quindi, creare tutte le osservabili weight-1 $\\langle Z \\rangle$ per ogni qubit virtuale, aggiungendo il numero necessario di termini $\\langle I \\rangle$.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "id": "cc5ab1ed",
      "metadata": {},
      "outputs": [],
      "source": [
        "observables = []\n",
        "num_qubits = len(good_qubits)\n",
        "for q in range(num_qubits):\n",
        "    observables.append(\n",
        "        SparsePauliOp(\"I\" * (num_qubits - q - 1) + \"Z\" + \"I\" * q)\n",
        "    )"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "030db4ed",
      "metadata": {},
      "source": [
        "Il processo di transpilazione ha mappato i qubit virtuali del circuito in qubit fisici sull'hardware. Le informazioni sulla disposizione dei qubit sono memorizzate nell'attributo `layout` del circuito transpilato. Anche l'osservabile è definito in termini di qubit virtuali, quindi è necessario applicare questa disposizione all'osservabile. Questo viene fatto utilizzando il metodo `apply_layout` di `SparsePauliOp`.\n",
        "\n",
        "Si noti che nel blocco di codice seguente ogni osservabile è racchiuso in una lista. Ciò viene fatto per *eseguire la trasmissione* con i valori dei parametri, in modo che ogni osservabile del qubit venga misurato per ciascun valore di theta. Consulta le regole di trasmissione per le primitive nella [documentazione](/docs/guides/primitives) relativa alle primitive.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "id": "95fd2908",
      "metadata": {},
      "outputs": [],
      "source": [
        "isa_observables = [\n",
        "    [obs.apply_layout(layout=isa_circuit.layout)] for obs in observables\n",
        "]"
      ]
    },
    {
      "attachments": {},
      "cell_type": "markdown",
      "id": "b4d480b3",
      "metadata": {},
      "source": [
        "<span id=\"step-3-execute-using-qiskit-primitives\" />\n",
        "\n",
        "### Passaggio 3: eseguire utilizzando Qiskit primitives\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "id": "b22a1b00",
      "metadata": {},
      "outputs": [],
      "source": [
        "pub = (isa_circuit, isa_observables, parameter_values)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "4ace7773",
      "metadata": {},
      "source": [
        "<span id=\"configure-estimator-options\" />\n",
        "\n",
        "#### Configurare le opzioni dello strumento di stima\n",
        "\n",
        "Configurare quindi le opzioni di `Estimator` necessarie per eseguire l'esperimento di mitigazione. Questo include opzioni per l'apprendimento del rumore degli strati entangling e per l'estrapolazione ZNE.\n",
        "\n",
        "Utilizziamo la seguente configurazione:\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "id": "ad4a4f1c",
      "metadata": {},
      "outputs": [],
      "source": [
        "# Experiment options\n",
        "num_randomizations = 700\n",
        "num_randomizations_learning = 40\n",
        "max_batch_circuits = 3 * num_params\n",
        "shots_per_randomization = 64\n",
        "learning_pair_depths = [0, 1, 2, 4, 6, 12, 24]\n",
        "noise_factors = [1, 1.3, 1.6]\n",
        "extrapolated_noise_factors = np.linspace(0, max(noise_factors), 20)\n",
        "\n",
        "# Base option formatting\n",
        "options = {\n",
        "    # Builtin resilience settings for ZNE\n",
        "    \"resilience\": {\n",
        "        \"measure_mitigation\": True,\n",
        "        \"zne_mitigation\": True,\n",
        "        # TREX noise learning configuration\n",
        "        \"measure_noise_learning\": {\n",
        "            \"num_randomizations\": num_randomizations_learning,\n",
        "            \"shots_per_randomization\": 1024,\n",
        "        },\n",
        "        # PEA noise model configuration\n",
        "        \"layer_noise_learning\": {\n",
        "            \"max_layers_to_learn\": 3,\n",
        "            \"layer_pair_depths\": learning_pair_depths,\n",
        "            \"shots_per_randomization\": shots_per_randomization,\n",
        "            \"num_randomizations\": num_randomizations_learning,\n",
        "        },\n",
        "        \"zne\": {\n",
        "            \"amplifier\": \"pea\",\n",
        "            \"noise_factors\": noise_factors,\n",
        "            \"extrapolator\": (\"exponential\", \"linear\"),\n",
        "            \"extrapolated_noise_factors\": extrapolated_noise_factors.tolist(),\n",
        "        },\n",
        "    },\n",
        "    # Randomization configuration\n",
        "    \"twirling\": {\n",
        "        \"num_randomizations\": num_randomizations,\n",
        "        \"shots_per_randomization\": shots_per_randomization,\n",
        "        \"strategy\": \"active-circuit\",\n",
        "    },\n",
        "    # Optional Dynamical Decoupling (DD)\n",
        "    \"dynamical_decoupling\": {\"enable\": True, \"sequence_type\": \"XY4\"},\n",
        "    # Job tag\n",
        "    \"environment\": {\"job_tags\": [\"TUT_PEA\"]},\n",
        "}"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "3f9fd4c4",
      "metadata": {},
      "source": [
        "<span id=\"explanation-of-zne-options\" />\n",
        "\n",
        "##### Spiegazione delle opzioni ZNE\n",
        "\n",
        "Di seguito vengono fornite informazioni sulle opzioni aggiuntive del ramo sperimentale. Si noti che le opzioni e i nomi non sono definitivi e che tutto ciò che è riportato è soggetto a modifiche prima del rilascio ufficiale.\n",
        "\n",
        "* **amplificatore** : il metodo da utilizzare per amplificare il rumore fino ai livelli desiderati.\n",
        "  I valori ammessi sono `\"gate_folding\"`, che amplifica ripetendo porte su basi a due qubit,\n",
        "  e `\"pea\"`, che amplifica tramite campionamento probabilistico dopo aver appreso il modello di rumore con rotazione di Pauli\n",
        "  per strati di porte su basi a due qubit con rotazione. Altre opzioni disponibili sono `\"gate_folding_front\"` e `\"gate_folding_back\"`, descritte nella [documentazione](/docs/api/qiskit-ibm-runtime/options-zne-options#amplifier) dell'API.\n",
        "* **fattori di rumore estrapolati** : Specificare uno o più valori del fattore di rumore a cui valutare i modelli modelli estrapolati. Se si tratta di una sequenza di valori, i risultati restituiti saranno valutati come array con il fattore di rumore specificato, valutato per il modello di estrapolazione. Un valore 0 corrisponde a un'estrapolazione a rumore zero.\n",
        "\n",
        "<span id=\"run-the-experiment\" />\n",
        "\n",
        "#### Esegui l'esperimento\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "id": "3cf72c8c",
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "Job ID d7fa8oe2cugc739qbb10\n"
          ]
        }
      ],
      "source": [
        "estimator = Estimator(mode=backend, options=options)\n",
        "job = estimator.run([pub])\n",
        "print(f\"Job ID {job.job_id()}\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "id": "1eea9c17",
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/plain": [
              "'DONE'"
            ]
          },
          "execution_count": 14,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "job.status()"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "50b94af2",
      "metadata": {},
      "source": [
        "<span id=\"step-4-post-process-and-return-result-in-desired-classical-format\" />\n",
        "\n",
        "### Fase 4: Post-elaborazione e restituzione del risultato nel formato classico desiderato\n",
        "\n",
        "Una volta terminato l'esperimento, è possibile visualizzare i risultati. Si recuperano i valori di aspettativa grezzi e attenuati e li si confronta con i risultati esatti. Quindi, tracciare i valori di aspettativa, sia attenuati (estrapolati) che grezzi, mediati su tutti i qubit per ciascun parametro. Infine, tracciare i valori di aspettativa per la scelta dei singoli qubit.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "id": "31dc35ea-6554-4ca7-9c3b-0b5394c46e4e",
      "metadata": {},
      "outputs": [],
      "source": [
        "primitive_result = job.result()"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "fbf7ec8d",
      "metadata": {},
      "source": [
        "<span id=\"general-result-shapes-and-metadata\" />\n",
        "\n",
        "#### Forme generali dei risultati e metadati\n",
        "\n",
        "L'oggetto `PrimitiveResult` contiene una struttura simile a un elenco, denominata `PubResult`. Poiché si invia un solo PUB allo stimatore, il `PrimitiveResult` contiene un solo oggetto `PubResult` .\n",
        "\n",
        "I valori attesi e gli errori standard del risultato PUB (blocco unificato primitivo) sono valori array. Per i lavori di stima con ZNE, nel contenitore `PubResult``DataBin` 's sono disponibili diversi campi di dati relativi ai valori attesi e agli errori standard. Discuteremo brevemente i campi dati relativi ai valori attesi (campi dati simili sono disponibili anche per gli errori standard (`stds`) ).\n",
        "\n",
        "1. `pub_result.data.evs`: Valori di aspettativa corrispondenti al rumore nullo (basati sull'estrapolazione euristicamente migliore).\n",
        "   * Il primo asse è l'indice dei qubit virtuali per l'osservabile $\\langle Z_i\\rangle$ ( $124$ virtual-qubit/osservabili)\n",
        "   * Il secondo asse indicizza il valore del parametro per $\\theta$ (valori del parametro $12$ )\n",
        "2. `pub_result.data.evs_extrapolated`: Valori di aspettativa per i fattori di rumore estrapolati per ogni estrapolatore. Questa matrice ha due assi aggiuntivi.\n",
        "   * Il terzo asse indicizza i metodi di estrapolazione (estrapolatori $2$, `exponential` e `linear`)\n",
        "   * L'ultimo asse indicizza i `extrapolated_noise_factors` ( $20$ punti di estrapolazione specificati nell'opzione)\n",
        "3. `pub_result.data.evs_noise_factors`: Valori di aspettativa grezzi per ciascun fattore di rumore.\n",
        "   * Il terzo asse indicizza i fattori grezzi `noise_factors` ( $3$ )\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "id": "e3aa4fc9",
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "pub_result.data.evs.shape=(149, 12)\n",
            "pub_result.data.evs_extrapolated.shape=(149, 12, 2, 20)\n",
            "pub_result.data.evs_noise_factors.shape=(149, 12, 3)\n",
            "\n"
          ]
        }
      ],
      "source": [
        "pub_result = primitive_result[0]\n",
        "\n",
        "print(\n",
        "    f\"{pub_result.data.evs.shape=}\\n\"\n",
        "    f\"{pub_result.data.evs_extrapolated.shape=}\\n\"\n",
        "    f\"{pub_result.data.evs_noise_factors.shape=}\\n\"\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "4c5cc6ee",
      "metadata": {},
      "source": [
        "Diversi campi di metadati sono disponibili anche nel sito `PrimitiveResult`. I metadati includono\n",
        "\n",
        "* `resilience/zne/noise_factors`: I fattori di rumore grezzi\n",
        "* `resilience/zne/extrapolator`: Gli estrapolatori utilizzati per ogni risultato\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "id": "1c77d83a",
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/plain": [
              "{'dynamical_decoupling': {'enable': True,\n",
              "  'sequence_type': 'XY4',\n",
              "  'extra_slack_distribution': 'middle',\n",
              "  'scheduling_method': 'alap'},\n",
              " 'twirling': {'enable_gates': True,\n",
              "  'enable_measure': True,\n",
              "  'num_randomizations': 700,\n",
              "  'shots_per_randomization': 64,\n",
              "  'interleave_randomizations': True,\n",
              "  'strategy': 'active-circuit'},\n",
              " 'resilience': {'measure_mitigation': True,\n",
              "  'zne_mitigation': True,\n",
              "  'pec_mitigation': False,\n",
              "  'zne': {'noise_factors': [1.0, 1.3, 1.6],\n",
              "   'extrapolator': ['exponential', 'linear'],\n",
              "   'extrapolated_noise_factors': [0.0,\n",
              "    0.08421052631578947,\n",
              "    0.16842105263157894,\n",
              "    0.25263157894736843,\n",
              "    0.3368421052631579,\n",
              "    0.42105263157894735,\n",
              "    0.5052631578947369,\n",
              "    0.5894736842105263,\n",
              "    0.6736842105263158,\n",
              "    0.7578947368421053,\n",
              "    0.8421052631578947,\n",
              "    0.9263157894736842,\n",
              "    1.0105263157894737,\n",
              "    1.0947368421052632,\n",
              "    1.1789473684210525,\n",
              "    1.263157894736842,\n",
              "    1.3473684210526315,\n",
              "    1.431578947368421,\n",
              "    1.5157894736842106,\n",
              "    1.6]},\n",
              "  'layer_noise_model': [LayerError(circuit=<qiskit.circuit.quantumcircuit.QuantumCircuit object at 0x1354890f0>, qubits=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], error=PauliLindbladError(generators=['IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...', ...], rates=[0.00155, 0.00144, 0.00637, 0.00023, 0.0, 0.0, 0.00018, 0.00035, 0.0, 0.00014, 5e-05, 0.00041, 0.0, 0.0, 0.0, 0.0001, 0.0001, 0.0, 9e-05, 6e-05, 0.0, 7e-05, 0.0001, 0.00013, 0.00018, 1e-05, 5e-05, 7e-05, 6e-05, 6e-05, 0.00029, 0.00016, 6e-05, 6e-05, 0.00046, 0.00073, 0.00031, 0.00025, 0.00018, 0.00022, 0.0, 8e-05, 0.00012, 0.00015, 0.00012, 0.0, 0.0, 0.00023, 5e-05, 5e-05, 7e-05, 0.00064, 4e-05, 2e-05, 0.00072, 0.00037, 2e-05, 4e-05, 0.00077, 0.0003, 0.00042, 0.00027, 0.00016, 0.0, 8e-05, 5e-05, 0.00019, 0.0, 0.0, 0.00021, 0.00014, 0.00061, 0.0, 0.00016, 3e-05, 0.00053, 0.00013, 0.0, 0.00068, 0.00011, 0.0, 0.00013, 0.00078, 0.01885, 0.00032, 0.00034, 0.00035, 0.00052, 3e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00028, 0.00123, 0.0, 0.0, 0.0, 0.00034, 0.00011, 0.0001, 0.00076, 0.00041, 0.0001, 0.00011, 0.00082, 0.0, 0.00066, 0.0, 0.00055, 7e-05, 0.00018, 0.00011, 0.00024, 3e-05, 0.00015, 0.00014, 0.0, 0.00076, 9e-05, 0.00016, 8e-05, 0.00132, 0.0, 0.00019, 0.00215, 0.00109, 0.00019, 0.0, 0.00201, 0.00021, 0.0006, 0.00032, 0.00046, 0.00027, 0.0, 8e-05, 0.0001, 0.00027, 0.0, 0.00015, 0.00018, 0.0, 0.00026, 0.00024, 5e-05, 0.00031, 0.0, 0.00034, 0.00039, 9e-05, 0.00034, 0.0, 0.00078, 0.00794, 0.00045, 0.00061, 0.00066, 0.0, 0.0, 0.00032, 6e-05, 5e-05, 7e-05, 0.0, 0.0001, 0.00036, 0.0, 0.00037, 0.00013, 0.00016, 3e-05, 8e-05, 0.00067, 0.00024, 8e-05, 3e-05, 0.00074, 0.00224, 0.00029, 0.00026, 0.00031, 0.00076, 5e-05, 0.0, 2e-05, 0.00072, 0.0, 1e-05, 0.00011, 0.00027, 0.0, 0.00017, 0.0, 0.0, 0.00012, 0.0, 0.0, 0.0, 0.0, 0.00067, 0.00063, 0.0, 0.0, 0.0, 0.00102, 0.0, 0.00011, 0.00026, 4e-05, 1e-05, 0.0002, 0.0, 0.00011, 0.0, 0.00021, 0.00015, 0.0005, 0.00011, 0.00013, 0.0, 0.0002, 0.00016, 0.00015, 8e-05, 2e-05, 7e-05, 0.00023, 0.00042, 0.0, 0.00049, 0.00056, 0.00372, 0.00017, 0.00012, 0.0, 0.00026, 0.00021, 0.0, 0.00012, 0.00046, 0.00305, 0.0005, 0.00057, 9e-05, 0.0009, 0.0, 7e-05, 0.00011, 0.00084, 0.0, 0.0, 0.0001, 0.00067, 0.0, 0.0, 0.0, 4e-05, 0.0, 1e-05, 0.00053, 0.0, 9e-05, 0.00021, 0.0, 1e-05, 0.0, 8e-05, 0.0, 0.0, 0.0, 9e-05, 0.00083, 0.00084, 0.00038, 9e-05, 3e-05, 0.00039, 0.02059, 0.0, 0.0, 0.0, 0.01787, 0.00012, 0.00024, 0.0, 0.00401, 0.0, 0.0, 0.0, 4e-05, 0.0, 0.0, 0.00018, 0.0, 0.00031, 0.00018, 0.0, 0.0, 0.0, 0.0, 0.00013, 0.0, 0.00027, 1e-05, 0.0, 0.00021, 0.0, 0.0, 0.00029, 0.00159, 0.0, 0.0, 0.00052, 0.0079, 0.0, 0.0002, 0.00147, 0.00048, 4e-05, 0.00976, 0.00957, 0.0011, 0.0, 0.0, 4e-05, 0.00048, 0.01068, 0.00487, 0.00225, 0.0, 0.0, 0.00026, 0.00052, 0.00033, 0.0, 0.00019, 0.0, 0.0, 0.00038, 0.0, 0.0, 0.0, 0.00154, 0.0, 0.0, 0.0, 0.00046, 0.0, 9e-05, 0.00077, 0.0002, 9e-05, 0.0, 0.00077, 0.00061, 6e-05, 0.00045, 0.00081, 0.00016, 0.0, 0.0, 0.0001, 0.00064, 4e-05, 0.0002, 0.0, 0.00056, 7e-05, 0.0, 0.0, 0.00066, 5e-05, 0.00025, 0.00077, 0.00011, 0.0, 0.0, 0.00065, 0.00025, 5e-05, 0.00082, 6e-05, 0.0, 0.00011, 0.00354, 0.00027, 0.00039, 0.00046, 0.00014, 0.0, 0.00013, 0.00067, 0.00064, 0.0006, 0.00053, 2e-05, 0.00016, 0.00067, 0.0, 0.00013, 0.0, 0.00047, 0.00016, 2e-05, 0.00067, 4e-05, 0.0, 0.00015, 0.00028, 0.00044, 0.00041, 0.00014, 0.00011, 0.0, 0.0, 5e-05, 0.0, 0.00017, 0.00022, 9e-05, 6e-05, 0.0, 0.00021, 0.0007, 3e-05, 0.0, 0.0, 0.0002, 0.00012, 3e-05, 0.0002, 0.0001, 3e-05, 0.00012, 0.00026, 0.00033, 0.00053, 0.00037, 0.00039, 9e-05, 6e-05, 7e-05, 0.00012, 0.00012, 0.0, 0.00022, 0.0, 0.00034, 0.00014, 8e-05, 0.0001, 0.00179, 0.00186, 0.00096, 0.00028, 0.00051, 0.00033, 0.0, 0.0, 0.00015, 0.0004, 0.0, 8e-05, 0.00015, 2e-05, 0.00015, 0.0, 0.00045, 0.0002, 0.0, 0.0, 0.00063, 0.00044, 0.00036, 0.00064, 0.0003, 2e-05, 0.0, 0.00124, 0.0, 0.0, 0.0, 0.00169, 0.00032, 0.00018, 0.0, 0.00147, 0.0, 0.0, 0.00037, 0.00095, 0.0, 0.00051, 0.00182, 0.00088, 0.00051, 0.0, 0.00116, 0.00093, 0.00124, 0.00219, 0.00052, 0.00072, 4e-05, 0.0, 0.0, 4e-05, 0.0, 0.00025, 0.00013, 0.0001, 0.00031, 0.0, 0.00027, 0.00022, 0.0, 0.00016, 0.0, 1e-05, 0.0001, 0.0, 3e-05, 0.0, 0.0, 2e-05, 6e-05, 0.0, 0.00021, 0.00251, 0.0, 0.0, 7e-05, 0.0, 0.0, 0.0, 0.00047, 5e-05, 2e-05, 0.00062, 0.00038, 2e-05, 5e-05, 0.00055, 0.00125, 0.00049, 0.00033, 0.00031, 0.00015, 0.0, 0.00015, 7e-05, 0.00047, 0.0, 1e-05, 3e-05, 1e-05, 0.00014, 0.0, 0.00026, 0.00092, 0.0, 0.0, 0.0, 0.00048, 0.00011, 4e-05, 0.0, 0.00077, 0.00013, 0.00014, 0.00031, 0.00048, 0.0, 0.0001, 0.00066, 6e-05, 2e-05, 0.0, 0.00029, 0.0001, 0.0, 0.00065, 0.0, 0.00013, 3e-05, 0.0, 0.00033, 0.00034, 0.00019, 2e-05, 0.0, 0.00015, 0.00046, 0.0, 2e-05, 1e-05, 0.00046, 8e-05, 6e-05, 0.0, 0.00035, 1e-05, 0.0001, 0.0, 1e-05, 0.0, 0.00012, 8e-05, 7e-05, 5e-05, 0.0, 0.00013, 0.0, 0.0, 0.0, 0.0, 0.00022, 0.0, 0.00013, 0.00028, 0.00014, 0.00013, 0.0, 0.00042, 0.00055, 0.00054, 0.00036, 5e-05, 0.0002, 0.0, 0.0, 0.00014, 1e-05, 0.00019, 2e-05, 6e-05, 0.00026, 0.0001, 0.0, 5e-05, 8e-05, 0.0, 0.00073, 7e-05, 0.0, 0.0, 1e-05, 0.0, 0.0, 6e-05, 4e-05, 0.00018, 0.00046, 0.00016, 0.00018, 4e-05, 0.00053, 0.0002, 0.00057, 0.00055, 0.00042, 0.00077, 6e-05, 0.00025, 5e-05, 0.00062, 0.00026, 0.00012, 4e-05, 0.00033, 8e-05, 0.0, 0.0004, 0.00036, 0.00016, 0.0, 0.0, 4e-05, 0.0, 4e-05, 0.0002, 4e-05, 0.00036, 0.0, 4e-05, 0.00024, 0.0, 0.0002, 0.00044, 0.00017, 0.0002, 0.0, 0.00051, 0.00059, 0.00061, 0.00069, 0.00064, 0.0006, 0.0, 7e-05, 4e-05, 0.00085, 0.0, 4e-05, 0.0, 0.00031, 0.00033, 0.0, 0.0001, 0.00037, 3e-05, 0.0, 0.0, 0.00018, 0.0, 0.00015, 4e-05, 0.00044, 9e-05, 2e-05, 2e-05, 0.00067, 0.00048, 6e-05, 0.0, 0.0, 0.0, 0.00028, 0.0, 1e-05, 0.0, 0.0, 0.00112, 0.0, 0.0, 0.00018, 0.00016, 0.0, 0.00018, 0.00055, 9e-05, 0.00018, 0.0, 0.00028, 0.00254, 0.00064, 0.00025, 0.00045, 0.00072, 7e-05, 6e-05, 0.00114, 0.00026, 0.00013, 0.0, 0.00081, 6e-05, 7e-05, 0.00139, 0.00014, 0.0, 0.00026, 0.00097, 0.00053, 0.00029, 0.00044, 0.0, 6e-05, 0.0, 0.00011, 3e-05, 0.0, 0.0002, 0.00024, 0.0, 5e-05, 5e-05, 5e-05, 0.0, 0.00014, 0.00025, 0.00032, 0.00011, 5e-05, 0.00067, 4e-05, 5e-05, 0.00011, 0.00061, 0.00015, 0.00035, 0.00035, 0.0003, 0.0006, 0.0, 0.00017, 0.0001, 0.0003, 0.00012, 8e-05, 0.00015, 7e-05, 0.0001, 5e-05, 0.00057, 0.0003, 9e-05, 0.00023, 0.0, 0.0001, 0.00015, 0.00073, 0.0, 0.0, 0.00012, 0.00041, 0.00015, 0.0001, 0.00079, 0.0003, 0.00011, 0.0, 0.00042, 0.00088, 0.00066, 0.00062, 0.00051, 0.0, 0.0, 0.00013, 0.00028, 8e-05, 0.00022, 0.0, 0.00044, 0.0, 0.00013, 0.0, 0.0, 0.0002, 0.00014, 0.00062, 0.00022, 0.00014, 0.0002, 0.0005, 4e-05, 0.00064, 0.00058, 0.00046, 0.00055, 0.0, 8e-05, 0.00012, 0.00067, 0.0, 0.0, 0.00014, 0.00095, 0.00025, 0.0, 0.00016, 0.00058, 0.00041, 0.00052, 0.00022, 6e-05, 0.0, 0.00034, 0.00011, 0.0, 0.0, 0.00015, 0.0, 6e-05, 0.00034, 0.0, 0.00016, 4e-05, 0.00126, 0.00041, 0.00037, 0.00015, 0.0, 0.0, 0.0, 0.00011, 0.0, 0.00024, 5e-05, 0.00029, 1e-05, 2e-05, 0.0, 0.00033, 0.00036, 4e-05, 0.00024, 0.001, 0.0, 0.0, 0.0, 0.00046, 0.0, 0.00028, 2e-05, 0.0009, 0.00012, 0.0, 0.00032, 0.00428, 0.00026, 9e-05, 0.0, 0.00372, 0.0, 9e-05, 0.0, 0.00107, 0.00018, 0.0, 0.00047, 0.00025, 0.00031, 0.00024, 0.00068, 0.00063, 0.00052, 4e-05, 0.00011, 0.00011, 0.00044, 7e-05, 4e-05, 4e-05, 5e-05, 0.00011, 0.00011, 0.00034, 0.0, 0.00017, 0.0, 0.00051, 0.00041, 0.00032, 0.00022, 0.0, 0.0, 9e-05, 6e-05, 7e-05, 0.00011, 2e-05, 0.00052, 0.0, 0.0, 0.0, 0.00731, 0.00017, 0.0, 0.0, 0.00026, 0.0, 0.00031, 0.0005, 0.0, 0.00031, 0.0, 0.00063, 0.0, 0.00026, 0.00052, 0.0, 0.0, 4e-05, 0.0, 0.00024, 7e-05, 9e-05, 6e-05, 3e-05, 0.0, 0.0, 0.00025, 0.00029, 0.00025, 0.00012, 4e-05, 5e-05, 0.00014, 4e-05, 0.00091, 9e-05, 0.0, 7e-05, 0.00019, 4e-05, 0.00014, 0.00085, 0.00037, 6e-05, 4e-05, 0.0001, 0.00025, 0.00026, 0.00013, 0.00026, 0.00014, 0.0, 2e-05, 0.00023, 0.0, 0.00021, 0.0, 0.0, 0.00031, 0.00031, 0.0001, 0.00013, 6e-05, 0.00013, 0.00071, 0.00048, 0.00013, 6e-05, 0.00076, 0.00018, 0.00042, 0.00044, 0.00018, 0.00014, 0.0, 0.00013, 9e-05, 0.0003, 0.0, 0.0, 1e-05, 0.0, 0.00019, 0.0, 7e-05, 1e-05, 9e-05, 0.0, 0.00011, 0.0, 7e-05, 0.00041, 0.0, 0.0, 0.00032, 0.0, 7e-05, 0.0, 0.00034, 0.0014, 0.0, 0.0002, 6e-05, 0.00036, 0.00031, 0.00039, 0.00042, 7e-05, 0.0, 0.0, 0.00014, 0.00011, 0.0, 2e-05, 0.00024, 0.0, 9e-05, 0.00036, 0.00023, 0.00012, 0.00011, 0.0, 0.00052, 5e-05, 0.0, 4e-05, 0.00033, 1e-05, 0.0, 9e-05, 0.00064, 0.0, 7e-05, 0.0, 0.00044, 0.00016, 0.0, 0.0, 0.00029, 0.0, 0.0, 0.00012, 0.00021, 0.0, 0.00017, 0.00068, 7e-05, 0.0, 0.00014, 0.00027, 0.00017, 0.0, 0.0006, 9e-05, 1e-05, 0.0, 0.00064, 0.00025, 0.00031, 0.00019, 0.0, 0.0, 0.00013, 0.00056, 0.0, 0.00017, 0.0, 0.00053, 7e-05, 0.0, 6e-05, 0.00029, 0.00018, 6e-05, 3e-05, 0.00027, 0.0, 6e-05, 0.00058, 0.00044, 6e-05, 0.0, 0.00052, 0.0004, 0.00073, 0.00066, 3e-05, 0.0004, 9e-05, 0.0, 0.00021, 0.00048, 0.0, 0.00016, 0.0, 0.00257, 0.0, 0.00021, 0.00024, 0.00012, 0.0, 0.00015, 8e-05, 0.00025, 0.00012, 0.0, 0.0, 0.00025, 0.00028, 0.0, 0.00014, 0.0, 7e-05, 0.00017, 0.00029, 0.0, 0.00017, 7e-05, 0.00024, 0.0, 0.00061, 0.00068, 0.0, 0.00018, 0.0, 7e-05, 1e-05, 0.0, 0.00017, 0.0, 0.0, 0.0003, 0.00013, 1e-05, 0.00024, 0.00098, 0.00071, 0.00142, 9e-05, 0.00011, 0.0, 0.00056, 0.00042, 0.0, 0.00011, 0.00064, 0.00085, 0.00098, 0.00071, 0.00018, 0.00085, 0.00081, 0.00016, 0.0, 0.0, 0.0, 7e-05, 0.0, 0.0, 0.0, 0.0, 0.00036, 0.00012, 0.0, 0.0, 0.00048, 0.00021, 0.00031, 6e-05, 0.00059, 0.00041, 0.00028, 7e-05, 0.00026, 0.0004, 0.00036, 0.00016, 0.00014, 9e-05, 6e-05, 0.00043, 0.0, 8e-05, 7e-05, 0.00036, 6e-05, 9e-05, 0.00055, 6e-05, 0.0, 3e-05, 0.00032, 0.00036, 0.00036, 0.00017, 0.0, 0.0, 1e-05, 0.00038, 0.0, 8e-05, 5e-05, 0.00026, 0.00014, 3e-05, 5e-05, 0.0, 0.0, 0.0, 0.00017, 0.00027, 0.0, 0.00019, 0.00063, 4e-05, 0.00019, 0.0, 0.00077, 0.00116, 0.00051, 0.00048, 0.00036, 8e-05, 0.0, 0.00011, 0.0001, 0.00013, 7e-05, 0.0, 0.0, 0.0, 0.0, 0.00028, 0.00026, 0.00014, 0.0003, 0.00011, 5e-05, 6e-05, 0.00017, 0.0007, 0.0, 0.0, 0.00011, 0.00063, 0.00017, 6e-05, 0.00079, 0.0, 0.0, 5e-05, 9e-05, 0.00029, 0.00021, 0.00048, 0.00072, 0.0, 0.0, 0.0, 0.00034, 9e-05, 4e-05, 0.0, 0.00013, 0.0, 5e-05, 0.00037, 0.0, 0.00011, 0.0, 0.00034, 0.0, 0.0, 7e-05, 0.0, 0.00605, 0.0, 0.00011, 0.00012, 0.00012, 0.00023, 0.0, 0.00026, 0.00016, 0.0, 0.00023, 0.00031, 0.00078, 0.0006, 0.00026, 0.00055, 0.00043, 0.00012, 0.0001, 0.00052, 8e-05, 0.0, 0.0, 0.00033, 0.0001, 0.00012, 0.00051, 5e-05, 0.00012, 0.0, 0.00105, 0.00028, 0.00018, 0.00023, 0.0, 2e-05, 0.0, 0.0, 0.00019, 0.0, 0.00015, 0.00013, 0.00018, 2e-05, 0.0, 7e-05, 0.0001, 0.0002, 0.00014, 0.00029, 0.0, 8e-05, 0.0005, 0.0002, 8e-05, 0.0, 0.00046, 0.0017, 0.00108, 0.00089, 0.00035, 0.0, 0.00016, 1e-05, 9e-05, 0.00024, 0.0, 1e-05, 8e-05, 0.00024, 0.00013, 0.00032, 8e-05, 0.00127, 4e-05, 0.0, 0.0, 0.00095, 0.0, 0.00017, 0.0, 0.00052, 0.00017, 2e-05, 0.00029, 0.00036, 0.00049, 0.00056, 2e-05, 0.00026, 3e-05, 0.00048, 0.0, 3e-05, 0.00014, 0.00024, 3e-05, 0.00026, 0.0006, 2e-05, 0.00015, 5e-05, 0.0, 0.00025, 0.00038, 0.00034, 4e-05, 0.0, 0.00029, 0.00044, 0.00024, 0.0, 0.0, 0.00046, 5e-05, 0.0001, 0.0, 0.00048, 0.0, 4e-05, 0.00028, 0.0, 0.00026, 0.0, 3e-05, 1e-05, 0.0, 0.0, 0.00027, 0.00034, 0.0, 0.00016, 9e-05, 0.00013, 0.00019, 0.0, 0.0, 0.00014, 0.0, 0.0001, 3e-05, 0.00031, 5e-05, 0.00026, 0.00022, 0.0001, 0.00022, 0.0, 5e-05, 0.00012, 0.0, 0.00056, 0.0, 0.0, 0.00023, 0.0, 0.0, 0.00012, 0.00064, 0.00059, 0.0, 2e-05, 0.0, 0.00033, 0.00028, 0.00017, 0.00025, 3e-05, 1e-05, 6e-05, 0.00011, 0.0, 8e-05, 6e-05, 3e-05, 0.00016, 0.00034, 0.0, 0.00011, 0.00015, 0.0, 0.00044, 0.00028, 0.0, 0.00015, 0.00062, 0.00203, 0.00035, 0.00025, 0.00049, 0.00037, 0.0001, 2e-05, 0.0, 0.0003, 7e-05, 8e-05, 0.0, 0.00074, 9e-05, 0.0, 9e-05, 0.00016, 3e-05, 0.00013, 0.00079, 6e-05, 6e-05, 1e-05, 0.0, 0.00013, 3e-05, 0.00076, 0.0, 0.00017, 5e-05, 0.00031, 0.00025, 0.00035, 0.00023, 0.0, 2e-05, 0.0002, 0.00015, 9e-05, 1e-05, 0.00017, 0.0001, 0.00011, 6e-05, 1e-05, 0.00041, 0.0003, 0.00048, 0.0, 0.00017, 4e-05, 0.00025, 0.00063, 0.00018, 0.00025, 4e-05, 0.00065, 0.0019, 0.00043, 0.00028, 0.00033, 0.0, 1e-05, 0.00012, 0.0001, 0.00019, 3e-05, 0.0, 5e-05, 0.00038, 0.00012, 0.0, 0.0, 0.00025, 6e-05, 9e-05, 0.0, 0.00017, 1e-05, 0.0006, 0.00019, 0.0001, 0.00013, 0.0, 1e-05, 0.00017, 0.00068, 0.0, 3e-05, 0.0, 0.00021, 0.00019, 0.00029, 0.00041, 0.00073, 0.00011, 0.0, 0.0, 0.00064, 0.0, 0.00026, 5e-05, 0.00044, 0.0001, 0.0, 0.0002, 0.00037, 6e-05, 0.0, 8e-05, 0.00026, 0.0, 0.00019, 8e-05, 0.00017, 0.0, 0.0, 0.00021, 0.00023, 0.00016, 1e-05, 0.00037, 0.00041, 1e-05, 0.00016, 0.00044, 0.00046, 0.00054, 0.00065, 0.00033, 0.00033, 8e-05, 0.0, 8e-05, 0.00046, 0.0, 0.0001, 0.0, 0.00023, 0.0, 0.00015, 3e-05, 2e-05, 2e-05, 0.00031, 0.00012, 0.00028, 1e-05, 4e-05, 4e-05, 0.00038, 0.00027, 0.0, 0.0, 0.00073, 0.0002, 7e-05, 0.00076, 0.00063, 7e-05, 0.0002, 0.00086, 4e-05, 0.00052, 0.00053, 0.00012, 0.00068, 0.00068, 0.00019, 0.00063, 0.0, 1e-05, 5e-05, 0.00058, 0.0, 0.0, 0.0001, 0.00059, 0.00011, 0.0, 0.0, 0.00024, 0.00012, 0.0, 0.0, 0.00036, 0.0, 2e-05, 1e-05, 0.00021, 0.0, 0.00012, 0.0, 0.00031, 9e-05, 0.0, 0.0, 0.0, 8e-05, 0.00054, 6e-05, 0.0, 0.0, 0.00026, 8e-05, 0.0, 0.00056, 0.00078, 5e-05, 2e-05, 4e-05, 0.00036, 0.0004, 0.00015, 8e-05, 5e-05, 0.00012, 6e-05, 0.00017, 5e-05, 1e-05, 0.0, 0.0, 5e-05, 0.00011, 7e-05, 0.00033, 5e-05, 7e-05, 0.00042, 0.00042, 7e-05, 5e-05, 0.00042, 0.00015, 0.00031, 0.00023, 1e-05, 0.00012, 0.0, 0.0, 0.00013, 0.00022, 2e-05, 0.0, 0.0, 0.00062, 7e-05, 0.0, 0.0, 0.00024, 0.0001, 0.0, 0.0, 1e-05, 6e-05, 0.00046, 0.0, 0.0, 3e-05, 0.00018, 6e-05, 1e-05, 0.00042, 0.00019, 5e-05, 3e-05, 0.0, 0.00026, 0.00024, 0.00016, 0.00029, 5e-05, 0.0, 9e-05, 0.00082, 0.0, 8e-05, 5e-05, 0.00037, 5e-05, 0.00016, 0.0, 0.00147, 0.00017, 5e-05, 0.0, 0.00051, 0.0, 0.0, 4e-05, 0.00646, 0.00045, 0.0, 0.0, 0.00097, 0.0001, 0.00017, 0.00029, 0.00072, 0.00015, 0.00018, 6e-05, 0.0038, 0.00059, 0.00069, 0.00314, 0.00027, 1e-05, 6e-05, 0.0006, 2e-05, 0.0, 0.0, 0.0, 6e-05, 1e-05, 0.00043, 0.0, 0.00027, 8e-05, 0.00024, 0.00048, 0.00037, 0.00034, 0.0, 0.0, 0.00021, 0.00046, 0.0, 0.0, 0.0, 0.00019, 5e-05, 0.00012, 0.0, 0.00017, 0.00025, 0.0, 0.0002, 0.00013, 9e-05, 6e-05, 0.00046, 0.00043, 6e-05, 9e-05, 0.00048, 0.00046, 0.00046, 0.00036, 7e-05, 0.00028, 1e-05, 5e-05, 0.0, 0.00025, 0.0, 0.0, 0.0001, 6e-05, 0.00032, 0.0, 0.0, 0.00036, 4e-05, 7e-05, 7e-05, 1e-05, 0.00012, 0.00053, 0.00044, 0.0, 0.00015, 0.00022, 0.00012, 1e-05, 0.00081, 0.00177, 0.0, 0.0, 0.00021, 0.00035, 0.00034, 0.00039]))),\n",
              "   LayerError(circuit=<qiskit.circuit.quantumcircuit.QuantumCircuit object at 0x1351d9710>, qubits=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], error=PauliLindbladError(generators=['IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...', ...], rates=[0.00087, 0.00084, 0.00784, 0.0, 0.0, 0.00028, 0.00012, 0.0001, 0.00028, 0.0, 0.00029, 0.0096, 0.00087, 0.00084, 0.0, 0.00054, 0.0, 0.0, 0.0, 0.0, 0.00021, 0.0, 5e-05, 0.00034, 0.0, 0.00019, 0.0, 0.0, 0.00016, 0.0, 9e-05, 0.0, 0.0, 0.0, 0.00018, 0.0, 0.0, 0.0, 6e-05, 0.00017, 0.00011, 0.0, 0.0, 0.00012, 0.0, 0.00014, 0.0, 0.00062, 0.00011, 6e-05, 3e-05, 0.00167, 0.00017, 0.0, 0.0, 0.00174, 0.0, 0.00014, 0.0, 0.00211, 0.0, 0.0, 0.0, 0.00028, 0.00024, 0.00016, 0.0003, 0.0, 0.00016, 0.00024, 0.0001, 3e-05, 0.00184, 0.00188, 0.00039, 0.0, 0.0, 0.0, 0.0004, 0.00065, 0.0, 0.00011, 0.0, 0.005, 0.0, 5e-05, 9e-05, 0.00029, 0.00024, 0.0, 0.00044, 0.00022, 0.0, 0.00024, 0.00043, 0.00068, 0.00102, 0.00088, 0.0005, 0.00055, 0.00015, 0.0, 0.00013, 0.00062, 0.0, 0.0, 7e-05, 0.00038, 0.0, 0.0002, 1e-05, 0.00025, 0.0, 6e-05, 5e-05, 0.00062, 0.0, 0.0, 0.0, 0.00034, 6e-05, 0.0, 3e-05, 0.0, 0.0, 0.00012, 0.00042, 0.00072, 0.00012, 0.0, 3e-05, 0.0005, 7e-05, 0.0, 0.00012, 0.00038, 0.0, 1e-05, 0.0003, 0.00053, 0.00016, 0.0, 0.0, 0.00027, 0.00034, 0.0, 0.0, 0.00011, 0.00012, 7e-05, 7e-05, 0.00021, 0.0, 0.00014, 1e-05, 0.00141, 4e-05, 0.0, 0.00035, 5e-05, 0.00012, 1e-05, 0.00026, 0.0001, 1e-05, 0.00012, 0.00026, 0.00011, 0.00037, 0.00035, 0.00045, 0.00036, 0.0, 5e-05, 5e-05, 0.0005, 4e-05, 7e-05, 5e-05, 0.00014, 0.00017, 4e-05, 0.0001, 0.00014, 0.00015, 1e-05, 0.00027, 0.00023, 1e-05, 0.00015, 0.00035, 0.00086, 0.0005, 0.00032, 0.00036, 0.00082, 0.0, 0.00011, 0.0, 0.0, 0.00064, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4e-05, 0.00015, 0.00036, 1e-05, 0.00015, 4e-05, 0.00034, 0.00067, 0.001, 0.00089, 0.0009, 0.00042, 0.0, 1e-05, 8e-05, 0.00042, 7e-05, 0.0, 0.0, 0.00025, 9e-05, 0.0, 0.0, 0.0005, 0.00106, 0.00168, 0.00024, 0.0, 0.0, 0.0, 0.0, 5e-05, 7e-05, 0.00015, 0.00053, 0.0001, 0.0, 0.00012, 0.00035, 0.0, 0.0, 0.00061, 0.00064, 0.0, 0.0, 0.00071, 0.00061, 0.00049, 0.00049, 0.00091, 0.0, 0.0, 0.00012, 0.0, 7e-05, 7e-05, 1e-05, 0.00053, 0.0, 0.0, 0.00014, 0.0, 0.0, 0.0, 0.0057, 0.00013, 0.0, 0.0, 0.00019, 0.0, 0.0, 0.00818, 0.0, 4e-05, 0.00844, 0.00635, 4e-05, 0.0, 0.00647, 0.00203, 0.00024, 0.00068, 0.00159, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.00015, 0.0, 0.0, 0.0, 0.00011, 0.00012, 0.0, 0.00051, 0.00033, 0.00025, 0.00051, 5e-05, 0.00025, 0.00033, 0.00038, 0.0001, 0.00032, 0.0004, 0.0, 0.00967, 0.00039, 3e-05, 0.00967, 0.0, 0.0, 0.0, 0.01187, 3e-05, 0.00039, 0.01275, 0.0, 0.0, 0.00042, 0.00994, 0.0012, 0.0002, 0.00248, 0.0, 0.00033, 0.0, 0.00086, 0.0, 0.0, 0.0, 0.00087, 0.0, 0.0, 0.0, 0.00093, 0.0, 0.00045, 0.0, 0.0, 2e-05, 0.00031, 0.00021, 0.0, 0.00021, 9e-05, 0.00014, 0.0, 6e-05, 8e-05, 0.00038, 0.00023, 0.0, 0.0, 0.0, 0.00019, 5e-05, 0.0, 0.0, 0.00021, 0.0, 0.00012, 0.00015, 0.00028, 0.00038, 0.0, 0.00017, 0.00024, 1e-05, 0.00083, 0.00072, 1e-05, 0.00024, 0.0, 1e-05, 0.00024, 0.00098, 0.00278, 0.0, 7e-05, 7e-05, 0.00023, 0.00025, 0.00042, 0.00039, 0.00028, 0.00038, 0.00015, 5e-05, 4e-05, 0.00012, 4e-05, 7e-05, 0.00036, 0.00025, 0.0, 3e-05, 9e-05, 7e-05, 4e-05, 0.00037, 0.00025, 0.00019, 2e-05, 0.0, 0.00039, 0.00028, 6e-05, 0.00035, 7e-05, 0.0, 0.00014, 0.00055, 0.00016, 7e-05, 0.0, 0.0, 0.0, 0.00018, 0.00045, 0.00027, 0.0, 7e-05, 0.0, 0.00014, 0.00018, 7e-05, 0.0, 0.00014, 0.0001, 8e-05, 0.0, 0.00016, 4e-05, 7e-05, 0.00042, 9e-05, 7e-05, 4e-05, 0.00021, 0.0, 0.00053, 0.00053, 5e-05, 0.00074, 0.00073, 0.00078, 0.00033, 0.00048, 0.0002, 0.0, 7e-05, 0.00013, 6e-05, 1e-05, 0.0, 0.00015, 0.00016, 7e-05, 3e-05, 2e-05, 4e-05, 5e-05, 0.0, 0.00071, 0.00014, 0.0, 0.00022, 0.00016, 0.0, 0.00024, 0.0002, 0.0001, 0.0, 0.00066, 0.00088, 0.0, 0.0001, 0.00096, 0.00215, 0.0004, 0.00036, 0.00041, 0.00125, 8e-05, 8e-05, 4e-05, 0.00165, 0.00038, 0.0, 0.0, 0.00243, 0.0, 0.0, 0.00011, 0.00023, 0.0, 0.00016, 0.00029, 0.00013, 0.00031, 0.0, 0.0, 0.00072, 0.00016, 0.0001, 0.0, 0.0, 0.0, 0.00018, 0.0, 0.0, 0.0002, 0.0004, 0.00013, 3e-05, 0.0, 0.00016, 0.0002, 0.0, 0.00059, 0.00123, 2e-05, 0.0, 0.0, 0.00068, 0.00044, 0.00014, 0.0007, 7e-05, 5e-05, 0.0, 0.00069, 0.00018, 0.0, 0.0, 0.0014, 0.0, 0.00021, 0.0, 0.0, 0.0001, 0.00016, 8e-05, 0.0, 0.0, 6e-05, 0.00023, 0.0, 0.0, 0.0, 2e-05, 0.00016, 0.0, 0.00011, 0.00033, 3e-05, 0.00011, 0.0, 0.00033, 0.00049, 0.00062, 0.00072, 0.00067, 0.00086, 1e-05, 6e-05, 0.0, 2e-05, 7e-05, 0.0, 0.00032, 0.0, 7e-05, 0.00043, 3e-05, 0.0, 0.00017, 0.0, 0.00026, 0.0, 0.0, 3e-05, 0.00014, 0.00029, 0.0, 0.00018, 0.00016, 0.00044, 0.00018, 0.00016, 0.00018, 0.00034, 0.0, 0.00101, 0.00102, 0.00052, 0.00022, 0.00011, 0.0, 9e-05, 0.00014, 0.0001, 0.0001, 0.00013, 0.00012, 0.00027, 2e-05, 0.00023, 0.0003, 0.0, 0.00016, 0.0, 0.00036, 0.00022, 0.0, 5e-05, 0.00059, 6e-05, 0.00015, 0.0, 0.0, 2e-05, 0.00016, 0.00108, 0.0, 0.0002, 0.00031, 0.0, 0.00016, 2e-05, 0.00047, 0.00015, 0.0, 0.0, 0.00809, 0.00074, 0.00073, 0.00068, 8e-05, 0.0, 0.0, 8e-05, 0.00022, 0.00019, 2e-05, 0.00012, 0.0001, 9e-05, 0.00023, 5e-05, 0.00028, 6e-05, 0.0, 0.0006, 6e-05, 0.00017, 0.00064, 0.00027, 0.00017, 6e-05, 0.00061, 0.00039, 0.00051, 0.00053, 0.00025, 0.0, 0.0, 0.00029, 0.00032, 0.00019, 0.00029, 0.0, 0.0004, 0.00019, 0.00192, 0.00229, 0.00056, 0.00034, 0.0, 2e-05, 8e-05, 0.00019, 0.00025, 0.00013, 0.00012, 0.00246, 4e-05, 0.0003, 0.00062, 0.00037, 0.0, 0.00012, 0.00037, 0.00032, 0.00012, 0.0, 0.00032, 0.00095, 0.00071, 0.00078, 0.00025, 0.00085, 4e-05, 0.0, 0.0, 0.00045, 0.0, 1e-05, 0.00013, 0.00012, 0.0, 0.00033, 6e-05, 0.00023, 0.0004, 0.00042, 2e-05, 0.0, 0.0, 0.0003, 0.0, 0.0, 0.0, 0.00022, 0.00055, 0.00023, 0.0004, 0.00044, 0.00011, 0.00017, 0.0, 0.0, 0.00028, 0.0, 0.0, 1e-05, 0.0057, 0.0, 0.00032, 0.0, 0.00088, 2e-05, 0.00021, 0.00022, 9e-05, 0.0, 0.00135, 0.00142, 4e-05, 0.0, 0.0, 0.0, 9e-05, 0.00161, 0.00155, 0.00026, 0.0, 9e-05, 0.00028, 0.00029, 0.00021, 0.00054, 0.0, 0.0, 0.00029, 0.00024, 3e-05, 1e-05, 0.0, 0.00018, 0.0, 0.00014, 0.00013, 0.00028, 0.0001, 0.0, 0.0, 0.0, 0.0, 0.00046, 1e-05, 0.00141, 0.0, 0.0, 0.00026, 0.00076, 0.00014, 0.0, 0.00096, 0.0, 0.0, 0.00014, 0.00052, 0.00061, 0.00068, 0.00077, 0.00079, 0.0, 0.00049, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00049, 0.0013, 0.0, 0.00073, 0.0, 0.02919, 0.00044, 0.00069, 0.00012, 0.0, 0.00014, 0.00025, 0.00141, 0.00072, 0.0, 0.0, 0.0008, 0.0, 0.00061, 0.00012, 0.0012, 1e-05, 0.0, 0.0, 0.0, 0.00011, 0.0, 0.00028, 0.0, 0.00043, 0.0, 0.0, 0.00108, 0.00033, 0.0, 0.00014, 0.0006, 0.0, 0.00011, 1e-05, 0.0007, 0.0, 0.0, 0.0, 0.00103, 0.00016, 0.0, 0.0, 0.00032, 0.00031, 0.00036, 0.00034, 5e-05, 0.0, 7e-05, 0.00014, 0.0, 0.00046, 0.00026, 2e-05, 6e-05, 1e-05, 0.0, 0.00014, 0.00035, 0.00093, 0.0, 2e-05, 0.0, 0.00032, 0.00031, 6e-05, 0.00042, 0.0, 0.0, 0.00029, 0.00011, 2e-05, 0.0, 0.00017, 0.00041, 9e-05, 5e-05, 0.0002, 2e-05, 0.00018, 0.0, 0.00025, 0.0, 0.0, 0.00035, 0.0001, 0.00087, 9e-05, 2e-05, 0.00026, 0.0016, 0.0, 0.0001, 0.00173, 0.0013, 0.0001, 0.0, 0.00142, 0.00111, 0.00057, 0.00044, 0.00047, 0.00051, 0.00041, 0.00034, 0.00034, 0.00038, 0.00035, 0.0, 0.0, 0.0, 0.00013, 0.00016, 0.00016, 0.00031, 0.0, 9e-05, 0.00016, 0.0, 0.00016, 0.00016, 0.00035, 0.0, 0.0, 9e-05, 1e-05, 0.00034, 0.00038, 0.00027, 0.0, 0.0, 0.0, 3e-05, 0.00098, 0.00031, 0.00011, 0.0, 0.00973, 0.0, 0.0, 0.00017, 0.0, 0.00024, 0.0, 0.00012, 0.00017, 0.00022, 0.0, 0.0, 0.00021, 5e-05, 4e-05, 4e-05, 0.00013, 7e-05, 0.00018, 0.00029, 0.00018, 0.00018, 7e-05, 0.00026, 0.00033, 0.00023, 0.00095, 0.00018, 0.0002, 9e-05, 2e-05, 0.00045, 1e-05, 0.0, 0.00011, 0.00012, 2e-05, 9e-05, 0.00042, 0.0, 8e-05, 4e-05, 0.00228, 0.00051, 0.00039, 0.00025, 0.00016, 0.0, 0.00015, 0.00021, 0.0001, 0.0, 0.0001, 0.00053, 0.0, 0.0001, 0.0, 0.0006, 0.0, 4e-05, 0.0, 9e-05, 0.0, 0.0001, 0.00011, 0.0, 0.00018, 0.0, 8e-05, 0.00063, 4e-05, 0.0, 0.0, 0.00032, 0.0, 0.00015, 0.0, 0.00043, 7e-05, 2e-05, 0.0, 3e-05, 0.00011, 0.0, 0.0001, 0.00026, 0.0001, 0.0, 3e-05, 0.0, 0.0, 5e-05, 0.00033, 3e-05, 0.00012, 0.0, 1e-05, 0.0, 0.0, 0.00064, 0.0, 0.0, 0.0, 0.0, 0.00012, 0.0001, 0.0001, 0.0, 5e-05, 0.00035, 0.00011, 5e-05, 0.0, 0.00032, 0.00017, 0.00044, 0.00048, 0.00017, 0.0001, 0.00018, 0.0, 0.00012, 0.00021, 0.0, 0.00015, 0.0001, 8e-05, 6e-05, 4e-05, 0.0, 0.00011, 0.00013, 2e-05, 0.00042, 4e-05, 2e-05, 0.00013, 0.00018, 0.00038, 0.00066, 0.00062, 0.00022, 0.00024, 0.0, 0.0, 0.0, 0.0, 0.00014, 0.00021, 0.0001, 0.00014, 0.00018, 0.0, 0.00018, 0.0, 0.0, 0.00155, 0.0, 0.0, 0.0001, 0.00013, 0.0, 0.00012, 0.00036, 0.00011, 0.00013, 0.0005, 0.00034, 0.00013, 0.00011, 0.00046, 0.00041, 0.00059, 0.00061, 0.00026, 0.00065, 1e-05, 1e-05, 8e-05, 0.00045, 0.0, 2e-05, 0.00013, 0.0004, 0.00013, 0.0001, 7e-05, 0.00027, 0.0, 1e-05, 5e-05, 0.00069, 0.0, 0.00015, 0.0, 0.00115, 0.0, 0.00033, 0.0, 0.00021, 0.0, 0.00013, 0.0003, 0.00019, 0.00013, 0.0, 0.0003, 9e-05, 0.00048, 0.00041, 5e-05, 0.00019, 0.0, 3e-05, 0.00012, 0.0004, 0.00014, 8e-05, 0.0, 0.00063, 0.00012, 4e-05, 0.00022, 0.00023, 0.0, 0.00013, 0.0, 0.00024, 4e-05, 0.0, 0.0, 0.00052, 6e-05, 0.0, 1e-05, 0.002, 0.00128, 0.00096, 0.0004, 0.0, 0.0, 5e-05, 0.00034, 0.0, 3e-05, 0.00013, 0.00066, 0.0, 4e-05, 0.0, 0.0005, 0.00037, 0.00029, 0.00018, 2e-05, 3e-05, 0.00055, 0.00034, 3e-05, 2e-05, 0.00068, 0.00077, 0.0005, 0.00037, 0.00018, 0.00033, 0.0, 0.0, 0.00013, 0.0003, 7e-05, 5e-05, 0.0, 0.00021, 9e-05, 8e-05, 0.0, 0.0002, 0.0, 0.00012, 2e-05, 0.0, 3e-05, 0.00038, 0.00021, 6e-05, 0.0, 2e-05, 3e-05, 0.0, 0.00042, 0.00076, 3e-05, 0.0, 5e-05, 0.00046, 0.00042, 0.0002, 0.00054, 0.0, 1e-05, 0.0, 0.00071, 4e-05, 5e-05, 0.0, 0.00032, 0.0, 7e-05, 2e-05, 0.00034, 4e-05, 0.0, 4e-05, 0.00019, 5e-05, 7e-05, 0.0, 0.00125, 3e-05, 0.0, 8e-05, 0.00026, 0.0, 0.00014, 0.0, 0.00048, 0.0, 0.0, 3e-05, 0.00026, 6e-05, 0.0, 0.00021, 5e-05, 0.00016, 0.0, 0.00024, 5e-05, 0.0, 6e-05, 0.00023, 1e-05, 7e-05, 0.0, 0.00011, 0.0, 0.0, 0.0004, 6e-05, 0.0, 0.00023, 8e-05, 0.0, 0.00021, 0.00011, 0.0, 0.00013, 0.00025, 0.00022, 0.00013, 0.0, 0.00029, 0.0007, 0.00056, 0.00042, 0.00045, 0.00021, 8e-05, 0.0, 0.0, 0.0001, 3e-05, 7e-05, 0.0001, 0.00176, 3e-05, 0.0, 0.0, 0.0, 0.0, 3e-05, 0.00029, 0.00023, 0.0001, 0.0, 0.0, 0.00036, 0.00018, 9e-05, 0.00011, 0.00038, 4e-05, 4e-05, 0.0, 8e-05, 9e-05, 0.00045, 0.00046, 0.00012, 2e-05, 0.0, 9e-05, 8e-05, 0.0006, 0.00023, 0.0, 0.0, 0.00018, 0.00029, 0.00034, 0.00038, 0.0, 6e-05, 4e-05, 0.00035, 4e-05, 4e-05, 6e-05, 0.00029, 0.0, 0.00045, 0.00051, 0.00014, 0.00017, 3e-05, 0.00011, 3e-05, 0.00033, 0.0, 0.0001, 2e-05, 0.00137, 0.00017, 0.0, 0.00037, 0.00031, 8e-05, 0.0, 0.00037, 0.0, 0.0, 8e-05, 0.0003, 0.0, 0.00048, 0.00045, 0.00034, 0.0003, 0.00013, 7e-05, 0.00052, 0.00049, 7e-05, 0.00013, 0.00054, 0.00061, 0.00058, 0.00042, 0.00012, 0.0005, 0.00029, 0.00037, 0.0, 0.00012, 0.00012, 0.00012, 0.0, 0.00021, 3e-05, 9e-05, 6e-05, 0.0001, 0.00014, 4e-05, 0.0, 0.00016, 0.00122, 0.00018, 3e-05, 0.00016, 4e-05, 5e-05, 0.00019, 5e-05, 7e-05, 0.00013, 0.00047, 0.00031, 0.00013, 7e-05, 0.00034, 0.00044, 0.0006, 0.0006, 0.00055, 0.00034, 8e-05, 2e-05, 5e-05, 6e-05, 0.00019, 0.0, 0.00027, 0.00031, 0.00015, 1e-05, 0.0003, 0.00016, 0.00014, 3e-05, 0.00037, 0.00035, 3e-05, 0.00014, 0.00041, 0.0, 0.00071, 0.00077, 0.00011, 0.00036, 5e-05, 9e-05, 0.00067, 0.00018, 0.0, 0.0, 0.00016, 9e-05, 5e-05, 0.00072, 0.0, 6e-05, 0.00023, 0.00597, 0.00035, 0.00044, 0.00102, 3e-05, 0.0, 0.00052, 0.00043, 4e-05, 7e-05, 0.0, 0.00044, 9e-05, 0.0, 0.0, 0.0, 0.0, 0.0002, 0.00035, 0.0, 0.00017, 5e-05, 0.0, 0.0, 0.0, 1e-05, 0.00025, 0.00048, 0.0, 5e-05, 0.00012, 0.00035, 0.0001, 0.0, 0.0, 4e-05, 0.00012, 9e-05, 5e-05, 6e-05, 3e-05, 0.00022, 0.00017, 0.00013, 0.0, 8e-05, 0.00013, 5e-05, 3e-05, 0.00051, 0.0002, 2e-05, 0.0002, 0.0002, 3e-05, 5e-05, 0.00064, 0.0, 1e-05, 9e-05, 0.00018, 0.00046, 0.00031, 0.00025, 0.00063, 0.0, 0.0, 0.0, 0.0006, 6e-05, 2e-05, 3e-05, 0.00051, 0.00011, 0.0, 0.00016, 0.0, 0.0, 0.0, 0.00031, 0.00028, 0.00011, 0.0, 0.0, 0.0006, 5e-05, 1e-05, 0.0, 0.00022, 0.0, 0.00013, 9e-05, 0.00063, 0.0, 0.0, 2e-05, 0.0, 0.00026, 0.0, 0.0, 0.00028, 0.0, 2e-05, 7e-05, 0.0, 0.0, 0.00017, 0.00022, 5e-05, 4e-05, 4e-05, 0.0, 0.0, 0.00015, 9e-05, 0.00017, 0.0, 0.00012, 0.0001, 1e-05, 0.00013, 0.00035, 0.0, 8e-05, 0.00045, 0.00014, 8e-05, 0.0, 0.0004, 1e-05, 0.00054, 0.00049, 0.00031, 0.00078, 0.0, 6e-05, 0.00015, 0.00054, 0.0, 0.0002, 0.00019, 0.0, 0.0001, 0.0, 0.00022, 0.00016, 6e-05, 0.0, 0.00018, 7e-05, 0.00013, 0.00012, 0.0, 0.0003, 3e-05, 0.00013, 0.00019, 0.00016, 9e-05, 0.0, 0.00037, 0.00018, 0.0, 9e-05, 0.00025, 0.00054, 0.00047, 0.00052, 0.00025, 0.00026, 0.0, 4e-05, 0.00055, 0.00017, 4e-05, 0.0, 0.00049, 0.0001, 0.00048, 0.00055, 3e-05, 0.00039, 3e-05, 0.00027, 0.0, 0.00041, 0.0, 0.00015, 0.0, 0.00042, 0.00018, 0.0, 0.00024, 0.00036, 0.00031, 0.00026, 0.00039, 5e-05, 0.0, 0.00053, 0.00038, 0.0, 5e-05, 0.0005, 0.00051, 0.00036, 0.00031, 4e-05, 0.00058, 0.0, 0.0, 1e-05, 0.00024, 0.0, 9e-05, 0.0, 0.00027, 0.00013, 3e-05, 4e-05, 0.00023, 0.00018, 0.0, 0.00044, 1e-05, 5e-05, 4e-05, 0.00026, 0.0, 0.00018, 0.0005, 0.0, 5e-05, 0.0, 0.00049, 0.0004, 0.00033, 0.00018, 2e-05, 1e-05, 0.0, 0.00051, 9e-05, 4e-05, 0.0, 0.00016, 2e-05, 6e-05, 6e-05, 0.00029, 0.0, 9e-05, 0.00011, 0.00027, 2e-05, 6e-05, 0.0, 0.00028, 4e-05, 0.0, 9e-05, 0.00013, 0.0, 0.0, 0.00015, 8e-05, 1e-05, 6e-05, 0.00022, 8e-05, 6e-05, 1e-05, 0.00021, 0.00047, 0.00034, 0.00041, 0.00019, 0.00029, 6e-05, 5e-05, 0.0001, 7e-05, 0.0, 0.0, 0.00024, 3e-05, 3e-05, 8e-05, 0.0, 2e-05, 0.00013, 0.00032, 0.00013, 0.0, 0.0, 6e-05, 0.00011, 0.0, 0.00033, 0.0002, 7e-05, 0.00071, 0.00044, 7e-05, 0.0002, 0.00066, 0.00058, 0.00056, 0.00053, 0.00019, 0.00117, 0.0, 0.00022, 0.00042, 0.00183, 0.00029, 0.0, 0.00029, 0.00916, 8e-05, 0.0, 0.0, 0.00012, 0.00026, 0.00038, 0.00064, 0.0003, 0.00038, 0.00026, 0.00097, 0.00262, 0.00181, 0.00241, 0.00299, 0.0, 2e-05, 0.00022, 0.00054, 0.00028, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.00038, 0.0, 0.00042, 2e-05, 0.0, 0.00018, 0.0001, 0.00018, 0.00023, 0.00025, 0.0, 0.00025, 5e-05, 0.00016, 0.00042, 9e-05, 0.00016, 5e-05, 0.00034, 0.00049, 0.00102, 0.00086, 0.00073, 0.0005, 0.0, 0.00024, 0.0, 0.0004, 6e-05, 0.0, 0.0001, 0.00049, 0.00011, 0.0, 0.0002, 0.00049, 3e-05, 0.0, 0.0, 0.00037, 5e-05, 0.0001, 0.0, 0.00037, 0.0, 0.0, 0.00015, 0.00036, 0.0, 0.00017, 0.00048, 0.0, 0.00011, 0.0, 0.0004, 0.00017, 0.0, 0.00049, 6e-05, 0.0, 3e-05, 0.00124, 0.00069, 0.00056, 0.00014, 1e-05, 0.0, 0.0]))),\n",
              "   LayerError(circuit=<qiskit.circuit.quantumcircuit.QuantumCircuit object at 0x1351d90f0>, qubits=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], error=PauliLindbladError(generators=['IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...',\n",
              "    'IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...', ...], rates=[0.00135, 0.001, 0.00567, 0.0004, 0.0, 7e-05, 0.0, 9e-05, 0.0, 7e-05, 0.00013, 0.00241, 5e-05, 0.0, 0.0, 0.00014, 0.00013, 3e-05, 0.00036, 2e-05, 3e-05, 0.00013, 0.00029, 0.0, 0.00051, 0.00034, 0.0001, 0.00019, 6e-05, 0.00018, 0.0, 0.00018, 9e-05, 9e-05, 8e-05, 0.00214, 7e-05, 0.0, 0.00027, 0.0, 0.0, 7e-05, 0.0002, 0.0, 7e-05, 0.0, 0.00017, 0.0, 0.00043, 0.00044, 0.00016, 0.0011, 0.00014, 0.00012, 0.00012, 0.00111, 7e-05, 0.00014, 0.00018, 0.00109, 0.00013, 0.0, 0.00027, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00054, 0.0, 0.0, 0.0, 0.0005, 0.0, 0.0, 0.0, 0.00089, 0.0, 0.0, 0.0, 0.0, 0.00028, 0.00028, 7e-05, 0.0, 0.00028, 0.00028, 0.00016, 0.0, 0.00054, 0.0005, 0.00042, 0.00096, 0.0, 5e-05, 6e-05, 0.00077, 0.0002, 0.0, 0.0, 0.00072, 0.0, 0.00014, 0.0, 0.0003, 0.00014, 0.0, 0.00048, 0.00023, 0.0, 0.00014, 0.00044, 0.00054, 0.00135, 0.00142, 0.00023, 0.00031, 1e-05, 7e-05, 0.00011, 0.00047, 0.00018, 0.0, 0.0, 0.00011, 0.0, 0.00014, 3e-05, 0.00029, 0.0, 4e-05, 0.0, 0.00014, 6e-05, 8e-05, 9e-05, 0.00014, 0.00011, 0.00016, 2e-05, 0.00029, 0.0, 0.0, 0.00017, 0.00024, 9e-05, 3e-05, 0.0, 0.00036, 5e-05, 1e-05, 0.0, 0.00025, 0.0, 0.0, 0.0, 0.0002, 0.0, 0.0, 0.0, 0.00058, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.37843, 0.0, 0.0, 0.53164, 0.5365, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00028, 9e-05, 9e-05, 4e-05, 7e-05, 0.0, 0.0, 0.00025, 0.00011, 0.0, 0.00012, 7e-05, 4e-05, 0.00035, 0.00015, 4e-05, 7e-05, 0.00029, 0.0, 0.00047, 0.00036, 9e-05, 0.00164, 0.00232, 0.0028, 0.00131, 0.0, 0.0, 0.0, 0.00148, 0.0, 0.0, 0.0, 0.00084, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00521, 0.00527, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.40338, 0.0, 0.0, 0.0, 0.30521, 0.09093, 0.09126, 0.14967, 0.0, 0.0, 0.0, 0.0, 0.0, 0.25536, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.70904, 0.0, 0.0, 0.0, 0.0, 0.44482, 0.05059, 1.98941, 2.66137, 1.82174, 1.98941, 0.0, 1.82174, 2.66137, 0.0, 0.0, 0.10991, 0.02851, 1.35927, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00581, 0.0, 0.0, 0.0, 0.00042, 0.00025, 0.00021, 0.00026, 0.0, 0.0, 0.00084, 0.00058, 0.00021, 0.00019, 0.00022, 0.0, 0.0, 0.00072, 0.0, 9e-05, 0.00016, 0.00029, 0.0, 0.0, 0.0005, 0.00067, 0.00059, 0.00051, 0.00058, 0.00013, 0.0, 0.00015, 2e-05, 0.0, 1e-05, 0.00032, 3e-05, 0.00015, 0.0002, 0.0, 0.00011, 0.0, 0.00022, 7e-05, 0.0, 0.00015, 0.0, 0.0, 7e-05, 0.00035, 0.0, 0.0, 0.00077, 0.00017, 0.0, 0.0, 0.00066, 0.00234, 0.00131, 0.00148, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00214, 0.0, 0.0, 0.0, 0.00178, 0.0, 0.0, 0.0, 0.00307, 0.0, 0.0, 0.0, 0.00178, 0.00165, 0.00056, 0.00035, 0.00033, 0.00061, 0.0, 0.00028, 4e-05, 9e-05, 0.0, 0.0, 0.00052, 0.0, 8e-05, 0.00017, 0.0002, 0.0, 0.0, 0.00038, 0.00022, 6e-05, 0.00029, 0.0, 0.00035, 0.00033, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1e-05, 0.0, 0.00043, 0.00147, 0.00019, 0.0, 0.0001, 0.01096, 0.0, 0.00027, 4e-05, 0.01189, 0.0, 0.00048, 0.0, 0.0, 0.00088, 0.0, 0.0, 0.00084, 0.00106, 0.00067, 0.00119, 0.00069, 0.00067, 0.00106, 0.00117, 0.0048, 0.0117, 0.0124, 0.00417, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00051, 0.0, 0.0, 0.0, 0.00035, 0.00048, 0.00099, 5e-05, 0.0, 0.0, 0.00043, 0.0, 0.0, 0.0, 0.00067, 0.00087, 0.0, 0.0, 0.00021, 0.00031, 0.00016, 0.00031, 0.00044, 0.00017, 0.00031, 0.00016, 0.00047, 1e-05, 0.00073, 0.00086, 0.00056, 0.00019, 0.0, 0.0, 0.0, 0.00016, 0.0, 0.0, 0.0, 0.00108, 4e-05, 0.00021, 0.00028, 0.0, 0.00023, 0.00044, 0.00039, 0.0, 0.0, 0.00012, 0.0, 0.00042, 0.00034, 0.00032, 0.0, 0.0, 0.00017, 0.0, 0.00069, 0.00049, 0.00032, 0.00019, 0.00016, 0.0, 0.00032, 0.0, 0.0, 0.0, 0.00035, 0.0, 0.0, 0.0, 0.00013, 0.0, 0.0, 0.0, 0.00013, 0.0, 5e-05, 0.00056, 0.00032, 5e-05, 0.0, 0.00059, 0.00053, 0.00032, 0.00035, 9e-05, 0.00029, 0.0, 7e-05, 0.0001, 0.00019, 1e-05, 0.0, 0.00015, 0.0002, 0.0003, 0.0, 0.0, 0.0, 8e-05, 0.0, 0.00023, 0.0, 8e-05, 0.00067, 0.00015, 0.0, 9e-05, 1e-05, 8e-05, 0.0, 0.00048, 0.00075, 0.0, 1e-05, 0.0, 0.00045, 0.00035, 0.00013, 0.00063, 2e-05, 9e-05, 3e-05, 0.00059, 0.0, 8e-05, 0.00012, 0.00045, 0.00035, 5e-05, 0.0, 0.00013, 5e-05, 0.0, 0.00028, 0.00025, 3e-05, 0.00018, 0.0, 0.00042, 0.0, 1e-05, 9e-05, 0.0, 0.0, 2e-05, 0.001, 0.0, 0.00043, 1e-05, 0.0, 0.0, 0.0, 0.0, 7e-05, 0.00027, 6e-05, 0.0, 0.0, 0.00098, 1e-05, 8e-05, 0.0, 0.00539, 2e-05, 0.0, 0.0, 0.00051, 0.0, 0.00015, 0.0, 0.00053, 0.0, 0.0, 9e-05, 0.00072, 0.00012, 5e-05, 0.0, 6e-05, 0.0001, 9e-05, 0.00036, 0.00021, 9e-05, 0.0001, 0.00035, 0.00017, 0.00047, 0.00047, 0.00014, 0.00044, 0.00029, 0.00075, 0.0, 0.0, 1e-05, 0.0, 0.0, 8e-05, 0.0, 0.00013, 0.0007, 9e-05, 0.0, 6e-05, 0.00074, 0.00022, 9e-05, 0.0003, 0.0, 0.0, 0.0, 0.0, 0.00177, 0.00024, 0.00027, 0.0002, 0.00866, 0.0, 0.0002, 0.0, 8e-05, 1e-05, 0.0, 0.00901, 0.0, 0.00042, 0.00042, 0.0, 0.00057, 0.0, 0.00748, 0.0, 0.0, 0.00116, 6e-05, 0.0, 0.00055, 0.0, 0.00082, 0.00104, 0.00061, 0.00124, 0.00104, 0.00082, 0.00129, 0.00317, 0.00896, 0.01041, 0.00599, 0.00052, 0.0, 0.0, 0.0, 0.00039, 5e-05, 0.0, 8e-05, 0.00468, 0.00064, 0.0, 0.0, 0.0009, 0.0, 0.00013, 0.00028, 0.00097, 0.00033, 5e-05, 0.0, 0.0004, 0.00021, 0.00017, 0.00014, 0.0, 0.0, 0.0, 0.00036, 7e-05, 0.0, 0.00014, 0.0, 0.0, 0.0, 0.00026, 0.0, 6e-05, 3e-05, 0.00043, 0.0, 0.0, 0.00038, 0.00027, 0.00016, 5e-05, 0.00031, 7e-05, 0.0, 0.00045, 0.00028, 0.0, 7e-05, 0.0004, 0.00059, 0.00054, 0.0003, 0.00045, 0.00064, 0.0, 0.0, 0.0, 0.00026, 4e-05, 0.0, 0.00034, 0.0007, 0.00011, 0.00012, 0.0, 0.00056, 0.0, 0.0002, 0.00057, 0.00065, 0.0002, 0.0, 0.00066, 0.00067, 0.00121, 0.00123, 0.00025, 0.00043, 0.00044, 0.0005, 0.00075, 0.0, 0.00014, 0.00022, 0.0, 6e-05, 7e-05, 0.00083, 0.00028, 0.0, 0.0, 0.00013, 0.0, 0.0, 0.00099, 2e-05, 0.0, 0.0, 2e-05, 0.0, 2e-05, 0.00024, 0.0001, 4e-05, 0.00038, 0.00026, 4e-05, 0.0001, 0.00031, 0.00026, 0.00045, 0.00054, 0.0004, 0.00023, 0.00026, 0.0002, 0.00047, 0.0, 0.0002, 0.00026, 0.0003, 0.00087, 0.00106, 0.00088, 0.00097, 0.00151, 0.0, 6e-05, 0.00023, 0.00137, 0.00015, 0.0, 0.0, 0.00016, 0.00042, 0.00053, 0.00013, 0.00075, 0.00043, 0.00018, 0.00075, 0.00062, 0.00051, 0.0, 0.00015, 0.0, 0.0, 3e-05, 0.00012, 0.0, 0.0, 0.0, 5e-05, 0.00015, 0.0, 6e-05, 0.00021, 0.0, 0.0, 0.0, 8e-05, 2e-05, 0.0, 0.00015, 0.00011, 7e-05, 9e-05, 0.00039, 0.00028, 9e-05, 7e-05, 0.00057, 0.00552, 0.00028, 0.00045, 0.00041, 0.0, 0.0, 0.00029, 0.0, 0.0, 0.00018, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.00036, 0.00033, 0.0, 0.00011, 0.0, 0.00015, 0.00013, 0.0, 0.0, 0.00036, 0.0, 0.00012, 5e-05, 0.00022, 0.0, 0.00018, 7e-05, 5e-05, 7e-05, 0.0, 0.00032, 8e-05, 5e-05, 0.0, 4e-05, 1e-05, 8e-05, 0.00027, 0.00016, 7e-05, 0.00018, 0.0, 3e-05, 0.00027, 0.00034, 3e-05, 7e-05, 0.00048, 0.00045, 7e-05, 3e-05, 0.00053, 0.00018, 0.00058, 0.00057, 8e-05, 0.0, 8e-05, 0.0, 0.00016, 0.0, 0.0, 7e-05, 0.00014, 0.0, 6e-05, 1e-05, 0.0, 0.00022, 0.00011, 0.0, 0.00022, 0.00026, 0.0, 0.00011, 0.00035, 0.00033, 0.00045, 0.00032, 0.00016, 0.0005, 0.00027, 3e-05, 0.0008, 0.0, 0.0, 0.0, 0.0003, 3e-05, 0.00027, 0.00083, 0.0, 0.0, 0.0, 2e-05, 0.00181, 0.00152, 0.00038, 0.0, 9e-05, 0.0, 0.0, 0.00012, 0.00011, 7e-05, 7e-05, 4e-05, 0.00014, 0.00012, 0.0, 0.00014, 0.00029, 0.00012, 0.00039, 0.0, 0.00032, 0.00066, 0.00032, 0.00032, 0.0, 0.0009, 0.00201, 0.00021, 0.00041, 0.00014, 6e-05, 3e-05, 0.00021, 0.0, 0.0002, 0.0, 0.0, 0.00011, 0.00028, 2e-05, 0.0, 0.0, 9e-05, 4e-05, 9e-05, 9e-05, 0.0, 0.0001, 0.0005, 0.0002, 0.0, 0.0, 0.0, 0.0001, 0.0, 0.00039, 0.00028, 0.0, 0.0, 6e-05, 0.0003, 0.00031, 0.0001, 0.00092, 0.0, 0.00012, 4e-05, 0.00098, 4e-05, 7e-05, 4e-05, 0.00062, 0.00015, 0.0, 0.0, 0.00049, 5e-05, 0.0, 0.0, 0.00029, 6e-05, 0.0, 8e-05, 0.00102, 0.0, 0.0, 0.0001, 0.00037, 1e-05, 0.00021, 0.00038, 6e-05, 0.00021, 1e-05, 7e-05, 0.00062, 0.00026, 0.00036, 0.0003, 0.00045, 1e-05, 0.0, 0.0, 0.00047, 0.0, 3e-05, 9e-05, 0.00057, 0.00022, 8e-05, 6e-05, 0.0, 2e-05, 0.00036, 0.0, 0.00021, 0.0, 0.0, 0.0001, 0.0005, 0.00019, 1e-05, 0.0, 4e-05, 8e-05, 3e-05, 0.00028, 0.00013, 3e-05, 8e-05, 0.00021, 0.0, 0.00054, 0.00044, 0.0002, 0.00148, 0.00101, 0.00116, 0.00033, 0.00012, 0.0, 0.0, 0.00034, 0.0, 7e-05, 0.0001, 0.00066, 2e-05, 0.0, 0.0, 0.00079, 0.00061, 9e-05, 0.00011, 0.0, 0.0, 0.00012, 0.0001, 3e-05, 0.0, 7e-05, 0.00019, 3e-05, 3e-05, 0.0, 0.00027, 0.0001, 0.0, 0.00037, 0.00012, 0.0, 0.0001, 0.0003, 0.0002, 0.00043, 0.00033, 0.00018, 0.00033, 0.0, 3e-05, 0.0001, 0.0, 0.0, 4e-05, 0.00025, 0.0, 0.0, 0.0, 0.0, 4e-05, 0.0, 0.00028, 6e-05, 5e-05, 0.0, 0.0001, 0.00014, 0.0, 0.00033, 0.0, 3e-05, 0.00042, 0.00025, 3e-05, 0.0, 0.0003, 0.00054, 0.00049, 0.0003, 0.00081, 0.00041, 0.0, 0.0, 0.0, 0.00022, 0.0, 0.0, 0.0, 0.00184, 9e-05, 5e-05, 0.0, 3e-05, 6e-05, 0.0001, 0.00032, 7e-05, 0.0001, 6e-05, 0.0002, 0.00062, 0.00045, 0.00037, 0.00015, 0.00043, 0.0, 0.0001, 0.00073, 0.0, 0.0, 7e-05, 0.00029, 0.0001, 0.0, 0.00076, 0.00015, 0.0, 0.00015, 0.0, 0.00028, 0.00036, 0.00014, 0.00014, 0.00013, 0.0, 7e-05, 0.0, 1e-05, 9e-05, 4e-05, 2e-05, 0.0001, 0.0002, 0.0002, 0.00021, 4e-05, 2e-05, 0.00041, 0.0001, 0.00016, 0.00083, 0.00013, 0.00016, 0.0001, 0.00051, 0.00138, 0.00017, 0.00036, 0.00048, 0.0005, 0.0, 7e-05, 0.0, 0.00032, 0.0, 0.0, 0.00015, 0.00028, 6e-05, 8e-05, 0.00035, 0.00059, 5e-05, 0.0, 0.0002, 0.0, 0.0, 0.0, 0.00051, 0.0, 8e-05, 8e-05, 1e-05, 0.0, 0.00011, 0.00027, 0.00019, 1e-05, 6e-05, 6e-05, 0.0001, 0.0, 0.0003, 7e-05, 0.0, 0.00011, 0.00023, 0.00016, 2e-05, 0.0, 0.00016, 0.0, 0.00012, 7e-05, 0.00038, 0.0, 0.0, 7e-05, 0.00058, 7e-05, 0.0, 0.0, 0.00119, 0.00013, 0.00013, 0.0, 0.00019, 3e-05, 1e-05, 3e-05, 0.00045, 0.0, 5e-05, 0.00012, 0.00067, 1e-05, 7e-05, 0.0, 0.00038, 0.00019, 0.0, 0.0, 0.00026, 0.00015, 1e-05, 0.0, 0.00041, 0.0, 0.00021, 0.00053, 0.00021, 0.00027, 0.00033, 7e-05, 0.00014, 0.0, 0.00013, 1e-05, 5e-05, 0.00061, 0.0, 0.0, 2e-05, 0.00016, 5e-05, 1e-05, 0.00039, 0.0, 0.0, 5e-05, 5e-05, 0.00021, 0.00027, 9e-05, 0.0003, 0.0001, 4e-05, 0.0, 0.00027, 2e-05, 0.0, 8e-05, 0.00019, 0.00014, 0.00026, 0.00019, 0.00023, 6e-05, 1e-05, 0.00068, 0.00018, 1e-05, 6e-05, 0.00057, 0.00117, 0.00044, 0.00037, 0.00034, 0.00046, 0.0, 2e-05, 0.0, 0.00028, 6e-05, 0.0, 0.00011, 0.00014, 9e-05, 0.00017, 9e-05, 0.00021, 3e-05, 4e-05, 8e-05, 9e-05, 0.0, 0.0, 0.00037, 0.0, 0.0, 1e-05, 0.0, 4e-05, 6e-05, 0.00054, 0.00021, 0.0, 0.0, 3e-05, 8e-05, 3e-05, 0.00012, 0.00015, 1e-05, 0.00033, 8e-05, 1e-05, 0.00015, 0.00027, 0.0, 0.00046, 0.00049, 0.00027, 0.0, 0.00012, 0.0, 0.00023, 3e-05, 9e-05, 0.00012, 0.0, 0.0, 0.0, 8e-05, 4e-05, 0.00019, 0.00015, 0.00011, 0.00025, 9e-05, 0.00011, 0.00015, 0.00037, 0.00042, 0.00061, 0.00043, 0.00033, 0.0, 0.0, 0.0, 0.00023, 0.0, 0.00015, 0.00014, 0.0, 5e-05, 0.00012, 3e-05, 3e-05, 0.00013, 0.0, 0.0, 4e-05, 0.0, 0.00034, 4e-05, 0.0, 0.00011, 0.00028, 4e-05, 0.00011, 0.00039, 0.00032, 0.00011, 4e-05, 0.00032, 0.00012, 0.00044, 0.00038, 0.0003, 0.0, 0.0, 0.0, 0.00026, 0.00032, 0.00011, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0002, 6e-05, 1e-05, 7e-05, 0.00024, 6e-05, 7e-05, 1e-05, 0.00039, 0.00021, 0.00032, 0.00049, 0.0003, 0.00028, 0.00017, 7e-05, 0.00064, 0.00018, 0.0, 0.0, 0.0, 7e-05, 0.00017, 0.00078, 0.0, 0.00021, 0.00021, 0.00043, 0.00059, 0.00045, 0.00036, 0.0, 0.00011, 2e-05, 0.0002, 0.00017, 0.0, 0.0, 8e-05, 0.0, 7e-05, 0.00024, 0.00041, 0.0, 0.00032, 5e-05, 0.00042, 4e-05, 6e-05, 0.00049, 0.0, 6e-05, 4e-05, 0.0002, 0.001, 0.00037, 0.0004, 0.00021, 0.0005, 0.0, 0.0, 0.0, 0.00027, 9e-05, 1e-05, 0.00011, 0.00032, 0.00021, 0.00019, 7e-05, 0.0, 8e-05, 0.00013, 0.00012, 0.00019, 2e-05, 0.0, 7e-05, 0.0, 0.00015, 7e-05, 0.00014, 0.00051, 0.00016, 3e-05, 0.0, 0.00078, 0.0, 0.0, 7e-05, 0.00041, 0.0, 0.0, 0.00014, 0.00253, 4e-05, 0.0001, 0.0, 0.00224, 0.0, 0.0, 4e-05, 8e-05, 0.0, 0.00019, 0.00018, 0.00057, 0.00048, 0.0003, 0.00032, 8e-05, 1e-05, 3e-05, 0.00036, 0.0, 2e-05, 0.0, 0.00048, 0.0, 0.0, 9e-05, 0.00035, 3e-05, 3e-05, 0.00042, 0.00031, 3e-05, 3e-05, 0.00032, 0.00024, 0.00044, 0.00039, 0.00018, 0.00032, 1e-05, 0.0, 0.00014, 0.0, 0.0, 0.0, 0.00043, 5e-05, 0.0, 0.0, 4e-05, 1e-05, 0.0, 0.00069, 0.0, 6e-05, 8e-05, 3e-05, 0.0, 4e-05, 0.00019, 6e-05, 2e-05, 0.00028, 0.00013, 2e-05, 6e-05, 0.00021, 0.0, 0.00047, 0.00053, 6e-05, 0.00036, 5e-05, 0.0, 0.00024, 0.00063, 0.0, 5e-05, 6e-05, 0.00032, 4e-05, 3e-05, 0.0, 0.00022, 0.0, 0.0, 0.0, 0.00033, 0.0, 0.0, 3e-05, 0.00033, 0.00011, 6e-05, 7e-05, 0.00046, 8e-05, 7e-05, 0.00067, 0.0, 0.0, 7e-05, 0.00036, 7e-05, 8e-05, 0.00066, 0.0, 3e-05, 4e-05, 0.0, 0.00032, 0.00028, 5e-05, 6e-05, 0.0, 0.0, 0.00033, 0.0, 0.0, 0.00012, 0.00039, 0.0, 5e-05, 5e-05, 0.00099, 0.00013, 0.00017, 9e-05, 0.00052, 0.0, 0.00024, 0.00095, 0.00046, 0.00024, 0.0, 0.00118, 0.01194, 0.00045, 0.0005, 0.0, 0.0, 0.0, 1e-05, 0.00057, 0.00038, 0.0, 0.00022, 0.0, 0.00398, 0.00042, 0.00049, 0.0016, 0.0, 6e-05, 0.0, 0.0001, 4e-05, 0.0, 0.00031, 0.00013, 0.0, 0.0001, 0.0, 0.0, 4e-05, 0.00044, 0.0, 0.0, 6e-05, 8e-05, 0.0003, 0.00077, 0.00031, 0.00038, 2e-05, 0.0, 0.0, 0.00029, 0.0, 7e-05, 0.0, 0.00034, 0.00018, 0.00012, 2e-05, 0.00028, 0.00011, 0.0, 0.0, 0.0003, 5e-05, 0.0, 4e-05, 0.00045, 0.0, 4e-05, 0.0, 0.00031, 0.00012, 0.00011, 0.00031, 7e-05, 0.00011, 0.00012, 0.00028, 0.0003, 0.00039, 0.00039, 0.00017, 0.00096, 0.0, 1e-05, 0.0, 0.0, 2e-05, 9e-05, 0.00075, 0.0, 5e-05, 0.0001, 0.0, 5e-05, 2e-05, 0.00012, 9e-05, 9e-05, 9e-05, 0.0, 0.00015, 0.0])))]},\n",
              " 'version': 2}"
            ]
          },
          "execution_count": 17,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "primitive_result.metadata"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "69f5426e",
      "metadata": {},
      "source": [
        "L'oggetto `PubResult` contiene metadati aggiuntivi di resilienza sui modelli di rumore appresi utilizzati per la mitigazione.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "id": "52482e42",
      "metadata": {},
      "outputs": [
        {
          "name": "stdout",
          "output_type": "stream",
          "text": [
            "noise_overhead: 9.2584227461744e+229\n",
            "total_mitigated_layers: 18\n",
            "unique_mitigated_layers: 3\n",
            "unique_mitigated_layers_noise_overhead: [2.0713004613510885e+36, 10.600275591731494, 9.687147432958504]\n"
          ]
        }
      ],
      "source": [
        "# Print learned layer noise metadata\n",
        "for field, value in pub_result.metadata[\"resilience\"][\"layer_noise\"].items():\n",
        "    print(f\"{field}: {value}\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "id": "2b96bdd2",
      "metadata": {},
      "outputs": [],
      "source": [
        "# Exact data computed using the methods described in the original reference\n",
        "# Y. Kim et al. \"Evidence for the utility of quantum computing before fault tolerance\" (Nature 618,\n",
        "# 500–505 (2023)) Directly used here for brevity\n",
        "exact_data = np.array(\n",
        "    [\n",
        "        1,\n",
        "        0.9899,\n",
        "        0.9531,\n",
        "        0.8809,\n",
        "        0.7536,\n",
        "        0.5677,\n",
        "        0.3545,\n",
        "        0.1607,\n",
        "        0.0539,\n",
        "        0.0103,\n",
        "        0.0012,\n",
        "        0.0,\n",
        "    ]\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "f6dfbb9a",
      "metadata": {},
      "source": [
        "<span id=\"plot-trotter-simulation-results\" />\n",
        "\n",
        "### Risultati della simulazione Plot Trotter\n",
        "\n",
        "Il codice seguente crea un grafico per confrontare i risultati dell'esperimento grezzo e attenuato con la soluzione esatta.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 20,
      "id": "e466736a",
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<Image src=\"/docs/images/tutorials/probabilistic-error-amplification/extracted-outputs/e466736a-0.avif\" alt=\"Output of the previous code cell\" />"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "zne_metadata = primitive_result.metadata[\"resilience\"][\"zne\"]\n",
        "# Plot Trotter simulation results\n",
        "fig = plot_trotter_results(\n",
        "    pub_result,\n",
        "    parameter_values,\n",
        "    plot_extrapolator=zne_metadata[\"extrapolator\"],\n",
        "    plot_noise_factors=zne_metadata[\"noise_factors\"],\n",
        "    exact=exact_data,\n",
        ")\n",
        "display(fig)"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "1cd46c88",
      "metadata": {},
      "source": [
        "Mentre i valori rumorosi (fattore di rumore `nf=1.0`) mostrano un'elevata deviazione dai valori esatti, i valori mitigati si avvicinano ai valori esatti, dimostrando l'utilità della tecnica di mitigazione basata sulla PEA.\n",
        "\n",
        "<span id=\"plot-extrapolation-results-for-individual-qubits\" />\n",
        "\n",
        "### Risultati dell'estrapolazione del grafico per singoli qubit\n",
        "\n",
        "Infine, il codice seguente crea un grafico per mostrare le curve di estrapolazione per diversi valori di theta su un qubit specifico.\n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 21,
      "id": "bea9695a",
      "metadata": {},
      "outputs": [
        {
          "data": {
            "text/plain": [
              "<Image src=\"/docs/images/tutorials/probabilistic-error-amplification/extracted-outputs/bea9695a-0.avif\" alt=\"Output of the previous code cell\" />"
            ]
          },
          "execution_count": 21,
          "metadata": {},
          "output_type": "execute_result"
        }
      ],
      "source": [
        "virtual_qubit = 1\n",
        "plot_qubit_zne_data(\n",
        "    pub_result=pub_result,\n",
        "    angles=parameter_values,\n",
        "    qubit=virtual_qubit,\n",
        "    noise_factors=zne_metadata[\"noise_factors\"],\n",
        "    extrapolator=zne_metadata[\"extrapolator\"],\n",
        "    extrapolated_noise_factors=zne_metadata[\"extrapolated_noise_factors\"],\n",
        ")"
      ]
    },
    {
      "cell_type": "markdown",
      "id": "75f48e6a-c7e4-46f3-9d39-a7a877427a04",
      "metadata": {},
      "source": [
        "<span id=\"next-steps\" />\n",
        "\n",
        "## Passi successivi\n",
        "\n",
        "<Admonition type=\"tip\" title=\"Suggerimenti\">\n",
        "  Se questo lavoro ti è sembrato interessante, potrebbero interessarti anche i seguenti contenuti:\n",
        "\n",
        "  * Un [tutorial](/docs/tutorials/combine-error-mitigation-techniques) incentrato sulla combinazione di tecniche di mitigazione degli errori.\n",
        "  * [Documentazione](/docs/guides/error-mitigation-and-suppression-techniques) dettagliata sulle tecniche di mitigazione degli errori disponibili in Qiskit.\n",
        "  * Lezioni aggiuntive dedicate agli esperimenti su scala industriale: [Utility II](/learning/courses/utility-scale-quantum-computing/utility-ii) e [Utility III](/learning/courses/utility-scale-quantum-computing/utility-iii).\n",
        "</Admonition>\n",
        "\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "id": "a1b8767d",
      "source": "© IBM Corp., 2017-2026"
    }
  ],
  "metadata": {
    "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"
    },
    "hours": 1.5,
    "qpuSeconds": 840
  },
  "nbformat": 4,
  "nbformat_minor": 5
}