Skip to content

[NO MERGE] [WIP] Add wrapper estimator guide - #3202

Draft
TsafrirA wants to merge 4 commits into
Qiskit:mainfrom
TsafrirA:ta-estimator-guide
Draft

[NO MERGE] [WIP] Add wrapper estimator guide#3202
TsafrirA wants to merge 4 commits into
Qiskit:mainfrom
TsafrirA:ta-estimator-guide

Conversation

@TsafrirA

Copy link
Copy Markdown
Collaborator

Summary

Fixes #3193

AI/LLM disclosure

  • I used the following tool to generate or modify code: IBM BOB

Comment thread qiskit_ibm_runtime/executor_estimator/__init__.py Outdated

@SamFerracin SamFerracin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, Tsafrir, looks great! I added some preliminary comments

client machine**. This includes circuit preparation (twirling, gate folding, dynamical decoupling,
noise injection) and result post-processing (TREX readout-error mitigation, ZNE extrapolation, PEC
quasi-probability weighting). Running these steps locally provides faster debugging feedback and
greater user control, at the cost of local compute during the preparation phase.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd remove this, since this page needs to get the prospective user excited 😄

Suggested change
greater user control, at the cost of local compute during the preparation phase.
greater user control.

Comment on lines +34 to +38
The end-to-end processing pipeline is:

1. :meth:`~.EstimatorV2.run` coerces PUBs, calls :meth:`~.EstimatorV2.finalize_options` to
resolve resilience-level defaults, and determines the shot count.
2. The ``prepare()`` pipeline converts the PUBs into a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some improvements:

Suggested change
The end-to-end processing pipeline is:
1. :meth:`~.EstimatorV2.run` coerces PUBs, calls :meth:`~.EstimatorV2.finalize_options` to
resolve resilience-level defaults, and determines the shot count.
2. The ``prepare()`` pipeline converts the PUBs into a
When a user runs a job via :meth:`~.EstimatorV2.run`, the end-to-end processing pipeline is as follows:
1. First, some preliminary operations: The PUBs are coerced, the resilience-level defaults are resolved via :meth:`~.EstimatorV2.finalize_options`, and the shot count is determined.
2. Then, the ``prepare`` method converts the PUBs into a

Comment on lines +161 to +174
Constructor
-----------

* **mode** (:class:`~qiskit.providers.BackendV2` | :class:`~qiskit_ibm_runtime.Session` |
:class:`~qiskit_ibm_runtime.Batch` | ``None``) —
The execution mode. Use a :class:`~qiskit.providers.BackendV2` for job mode, a
:class:`~qiskit_ibm_runtime.Session` for session mode, or a
:class:`~qiskit_ibm_runtime.Batch` for batch mode. Refer to the
`IBM Quantum Compute documentation <https://quantum.cloud.ibm.com/docs/guides/execution-modes>`_
for guidance on choosing an execution mode.

* **options** (:class:`~.EstimatorOptions` | ``dict`` | ``None``) —
Estimator options. If ``None``, a default :class:`~.EstimatorOptions` instance with
``resilience_level=1`` is used. A plain ``dict`` is coerced to :class:`~.EstimatorOptions`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This part is already documented on the class itself, I'd avoid duplication

Suggested change
Constructor
-----------
* **mode** (:class:`~qiskit.providers.BackendV2` | :class:`~qiskit_ibm_runtime.Session` |
:class:`~qiskit_ibm_runtime.Batch` | ``None``) —
The execution mode. Use a :class:`~qiskit.providers.BackendV2` for job mode, a
:class:`~qiskit_ibm_runtime.Session` for session mode, or a
:class:`~qiskit_ibm_runtime.Batch` for batch mode. Refer to the
`IBM Quantum Compute documentation <https://quantum.cloud.ibm.com/docs/guides/execution-modes>`_
for guidance on choosing an execution mode.
* **options** (:class:`~.EstimatorOptions` | ``dict`` | ``None``) —
Estimator options. If ``None``, a default :class:`~.EstimatorOptions` instance with
``resilience_level=1`` is used. A plain ``dict`` is coerced to :class:`~.EstimatorOptions`.

``run()``
---------

Each call to :meth:`~.EstimatorV2.run` takes a list of PUBs (Primitive Unified Blocs). Each PUB

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same for this section. Everything here is already explained, except perhaps the part about broadcasting rules--but I would rather mention it, and link to the docs page, in the doctring of run rather than here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write a detailed guide for the wrapper estimator

3 participants