Skip to content

add noisy results #2842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 15, 2025
Merged

add noisy results #2842

merged 4 commits into from
Apr 15, 2025

Conversation

assafb
Copy link
Contributor

@assafb assafb commented Mar 24, 2025

No description provided.

@qiskit-bot
Copy link
Contributor

Thanks for contributing to Qiskit documentation!

Before your PR can be merged, it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. Thanks! 🙌

One or more of the following people are relevant to this code:

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Eric-Arellano
Copy link
Collaborator

Hey @assafb, thanks! This looks good. There are some formatting issues that can be fixed by either running ./fix in the repository or by applying this Git diff:

diff --git a/docs/guides/qedma-qesem.ipynb b/docs/guides/qedma-qesem.ipynb
index e00aa40984..ccb9587bdb 100644
--- a/docs/guides/qedma-qesem.ipynb
+++ b/docs/guides/qedma-qesem.ipynb
@@ -167,12 +167,12 @@
     ")\n",
     "\n",
     "job = qesem_function.run(\n",
-    "    pubs = [(circ, [avg_magnetization, other_observable])],\n",
-    "    options =  {\n",
+    "    pubs=[(circ, [avg_magnetization, other_observable])],\n",
+    "    options={\n",
     "        \"estimate_time_only\": \"analytical\",\n",
     "    },\n",
-    "    instance = instance,\n",
-    "    backend_name = backend_name,  # E.g. \"ibm_brisbane\"\n",
+    "    instance=instance,\n",
+    "    backend_name=backend_name,  # E.g. \"ibm_brisbane\"\n",
     ")"
    ]
   },
@@ -192,9 +192,9 @@
    "outputs": [],
    "source": [
     "job = qesem_function.run(\n",
-    "    pubs = [(circ, [avg_magnetization, other_observable])],\n",
-    "    instance = instance,\n",
-    "    backend_name = backend_name,  # E.g. \"ibm_brisbane\"\n",
+    "    pubs=[(circ, [avg_magnetization, other_observable])],\n",
+    "    instance=instance,\n",
+    "    backend_name=backend_name,  # E.g. \"ibm_brisbane\"\n",
     ")"
    ]
   },
@@ -328,7 +328,9 @@
     }
    ],
    "source": [
-    "print(f\"The estimated QPU time for this PUB is: \\n{result[0].metadata['time_estimation_sec']}\")"
+    "print(\n",
+    "    f\"The estimated QPU time for this PUB is: \\n{result[0].metadata['time_estimation_sec']}\"\n",
+    ")"
    ]
   },
   {
@@ -363,9 +365,11 @@
    ],
    "source": [
     "print(f\"The result of the submitted job had {len(result)} PUB\")\n",
-    "print(f\"The expectation values measured from this PUB are: \\n{result[0].data.evs}\")\n",
+    "print(\n",
+    "    f\"The expectation values measured from this PUB are: \\n{result[0].data.evs}\"\n",
+    ")\n",
     "print(f\"The error-bar values are: \\n{result[0].data.stds}\")\n",
-    "noisy_results = result[0].metadata['noisy_results']\n",
+    "noisy_results = result[0].metadata[\"noisy_results\"]\n",
     "print(f\"Noisy expectation values: \\n{noisy_results.evs}\")\n",
     "print(f\"Noisy error-bar: \\n{noisy_results.stds}\")"
    ]
@@ -445,7 +449,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.10.11"
+   "version": "3"
   },
   "title": "QESEM - A Qiskit Function by Qedma"
  },

Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good to me too, provided that the formatting suggestion is applied, thanks! We might want to do a more general functions documentation content review in a follow-up, but I think it's best to merge this PR first.

Copy link
Collaborator

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@Eric-Arellano Eric-Arellano added this pull request to the merge queue Apr 15, 2025
Merged via the queue into Qiskit:main with commit 86c6408 Apr 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants