Skip to content

Commit e85bdd4

Browse files
committed
More updates
1 parent 8ed78c3 commit e85bdd4

File tree

7 files changed

+257
-610
lines changed

7 files changed

+257
-610
lines changed

docs/guides/_toc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@
347347
"title": "Introduction to primitives",
348348
"url": "/docs/guides/primitives"
349349
},
350+
{
351+
"title": "Introduction to PUBs",
352+
"url": "/docs/guides/ppubs"
353+
},
350354
{
351355
"title": "Estimator",
352356
"children": [

docs/guides/directed-execution-model.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To learn more about Samplomatic, visit the [guides](https://qiskit.github.io/sam
5252

5353
Executor is a new Qiskit Runtime primitive that takes the template circuit and samplex pair as the input, generates and binds parameter values according to the samplex, executes the bound circuits on the hardware, and returns the execution results and metadata. It follows the directives of the input pair and does not make any implicit decisions for you, so that the process is transparent yet performant.
5454

55-
The inputs and output of the Executor primitive are very different from those of Sampler and Estimator. Refer to the [Executor API reference](https://qiskit.github.io/qiskit-ibm-runtime/stubs/qiskit_ibm_runtime.Executor.html) for more information. In addition, the [Executor quickstart guide](https://qiskit.github.io/qiskit-ibm-runtime/guides/executor_basic.html) provides an overview and code examples.
55+
The inputs and output of the Executor primitive are very different from those of Sampler and Estimator. Refer to the [Executor input and output topic](/docs/guides/executor-input-output.ipynb) for more information. In addition, the [Executor quickstart guide](https://qiskit.github.io/qiskit-ibm-runtime/guides/executor_basic.html) provides an overview and code examples.
5656

5757
### NoiseLearnerV3
5858

docs/guides/estimator-input-output.ipynb

Lines changed: 6 additions & 305 deletions
Large diffs are not rendered by default.

docs/guides/executor-input-output.ipynb

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"---\n",
99
"title: Inputs and outputs\n",
10-
"description: Understand the inputs and outputs to the Executor primitive\n",
10+
"description: Understand the inputs and outputs to the Executor primitive.\n",
1111
"---\n",
1212
"\n",
1313
"\n",
@@ -45,31 +45,29 @@
4545
},
4646
{
4747
"cell_type": "markdown",
48-
"id": "6962c44c-da86-45ac-a70f-bd4ceb2c262b",
4948
"metadata": {},
5049
"source": [
51-
"This page gives an overview of the inputs and outputs of the Qiskit Runtime primitives that execute workloads on IBM Quantum® compute resources. These primitives provide you with the ability to efficiently define vectorized workloads by using a data structure known as a **Primitive Unified Bloc (PUB)**. These PUBs are the fundamental unit of work a QPU needs to execute these workloads. They are used as inputs to the [`run()`](/docs/api/qiskit-ibm-runtime/estimator-v2#run) method for the Sampler and Estimator primitives, which execute the defined workload as a job. Then, after the job has completed, the results are returned in a format that is dependent on both the PUBs used as well as the runtime options specified from the Sampler or Estimator primitives."
50+
"The inputs and output of the Executor primitive are very different from those of the Sampler and Estimator primitives. As part of the [directed execution model,](/docs/guides/directed-execution-model) the Executor primitive helps provide more flexibility when customizing your error mitigation workflow. This primitive takes a `QuantumProgram` as input, and outputs a Qiskit Runtime job, which is then run on an IBM quantum computer."
5251
]
5352
},
5453
{
5554
"cell_type": "markdown",
5655
"metadata": {},
5756
"source": [
58-
"The inputs to the Executor: Quantum Programs\n",
59-
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n",
57+
"## Quantum programs\n",
6058
"\n",
61-
"A :class:`~.QuantumProgram` is an iterable of\n",
62-
":class:`~.qiskit_ibm_runtime.quantum_program.QuantumProgramItem`\\s. Each of these items represents a\n",
63-
"different task for the :class:`~.Executor` to perform. Typically, each item owns:\n",
59+
"The input to Executor primitives is a [`QuantumProgram`](https://qiskit.github.io/qiskit-ibm-runtime/stubs/qiskit_ibm_runtime.quantum_program.QuantumProgram.html#qiskit_ibm_runtime.quantum_program.QuantumProgram), which is an iterable of a \n",
60+
"`qiskit_ibm_runtime.quantum_program.QuantumProgramItem`. Each of these items represents a\n",
61+
"different task for the Executor to perform. Typically, each item owns:\n",
6462
"\n",
65-
"* a :class:`~qiskit.circuit.QuantumCircuit` with static, non-parametrized gates;\n",
66-
"* or a parametrized :class:`~qiskit.circuit.QuantumCircuit`, together with an array of parameter values;\n",
67-
"* or a parametrized :class:`~qiskit.circuit.QuantumCircuit`, together with a\n",
68-
" :class:`~samplomatic.samplex.Samplex` to generate randomize arrays of parameter values.\n",
63+
"* a `qiskit.circuit.QuantumCircuit` with static, non-parametrized gates;\n",
64+
"* or a parametrized `qiskit.circuit.QuantumCircuit`, together with an array of parameter values;\n",
65+
"* or a parametrized `qiskit.circuit.QuantumCircuit`, together with a\n",
66+
" `samplomatic.samplex.Samplex` to generate randomize arrays of parameter values.\n",
6967
"\n",
70-
"Let us take a closer look at each of these items and how to add them to a :class:`~.QuantumProgram`\\.\n",
68+
"Let us take a closer look at each of these items and how to add them to a `QuantumProgram`\\.\n",
7169
"\n",
72-
"In the cell below, we initialize a :class:`~.QuantumProgram` and specify that we wish to perform ``1024``\n",
70+
"In the cell below, we initialize a `QuantumProgram` and specify that we wish to perform ``1024``\n",
7371
"shots for every configuration of each item in the program. Next, we append a version of our target circuit with set parameters,\n",
7472
"transpiled according to the backend's ISA.\n",
7573
"\n",
@@ -102,7 +100,7 @@
102100
" # Append the circuit to the program\n",
103101
" program.append_circuit_item(isa_circuit)\n",
104102
"\n",
105-
"We proceed to append a second item that contains a parametrized :class:`~qiskit.circuit.QuantumCircuit`\n",
103+
"We proceed to append a second item that contains a parametrized `qiskit.circuit.QuantumCircuit`\n",
106104
"and an array containing ``10`` sets of parameter values. This amounts to a circuit task requiring a total\n",
107105
"of ``10240`` shots (namely ``1024`` per set of parameter values).\n",
108106
"\n",
@@ -135,18 +133,18 @@
135133
" circuit_arguments=np.random.rand(10, 3), # 10 sets of parameter values\n",
136134
" )\n",
137135
"\n",
138-
"Finally, in the next cell we append a parametrized :class:`~qiskit.circuit.QuantumCircuit` and a\n",
139-
":class:`~samplomatic.samplex.Samplex`, which is responsible for generating randomized sets of\n",
140-
"parameters for the given circuit. As part of the :class:`~samplomatic.samplex.Samplex` arguments,\n",
136+
"Finally, in the next cell we append a parametrized `qiskit.circuit.QuantumCircuit` and a\n",
137+
"`samplomatic.samplex.Samplex`, which is responsible for generating randomized sets of\n",
138+
"parameters for the given circuit. As part of the `samplomatic.samplex.Samplex` arguments,\n",
141139
"we provide ``10`` sets of parameters for the parametric gates in the original circuit.\n",
142140
"Additionally, we use the ``shape`` request argument to request an extension of the implicit shape\n",
143-
"defined by the :class:`~samplomatic.samplex.Samplex` arguments. In particular, by setting ``shape``\n",
141+
"defined by the `samplomatic.samplex.Samplex` arguments. In particular, by setting ``shape``\n",
144142
"to ``(2, 14, 10)`` we request to randomize each of the ``10`` sets of parameters ``28`` times, and\n",
145143
"to arrange the randomized parameter sets in an array of be arranged in an array of shape\n",
146144
"``(2, 14, 10)``.\n",
147145
"\n",
148-
" We refer the reader to :mod:`~samplomatic` and its documentation for more details on the\n",
149-
" :class:`~samplomatic.samplex.Samplex` and its arguments.\n",
146+
" We refer the reader to :mod`~samplomatic` and its documentation for more details on the\n",
147+
" `samplomatic.samplex.Samplex` and its arguments.\n",
150148
"\n",
151149
".. code-block:: python\n",
152150
"\n",
@@ -190,7 +188,7 @@
190188
" shape=(2, 14, 10),\n",
191189
" )\n",
192190
"\n",
193-
"Now that we have populated our :class:`~.QuantumProgram`, we can proceed with execution."
191+
"Now that we have populated our `QuantumProgram`, we can proceed with execution."
194192
]
195193
}
196194
],

docs/guides/primitives.ipynb

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"metadata": {},
5050
"source": [
5151
"<Admonition type=\"note\" title=\"New execution model, now in beta release\">\n",
52-
"The beta release of a new execution model is now available. The directed execution model provides more flexibility when customizing your error mitigation workflow. See the [Directed execution model](/docs/guides/directed-execution-model) guide for more information.\n",
52+
"The beta release of a new execution model ([Directed execution model](/docs/guides/directed-execution-model)) is now available. This model provides more flexibility when customizing your error mitigation workflow. The [Executor primitive](#executor) is part of this model, but is very different from the Estimator and Sampler primatives. Most of the information in this topic applies to those primitives.\n",
5353
"</Admonition>\n",
5454
"\n",
5555
"\n",
@@ -264,6 +264,18 @@
264264
")"
265265
]
266266
},
267+
{
268+
"cell_type": "markdown",
269+
"metadata": {},
270+
"source": [
271+
"<span id=\"executor\"></span>\n",
272+
"### Executor (beta)\n",
273+
"\n",
274+
"Executor is a new Qiskit Runtime primitive that takes the template circuit and samplex pair as the input, generates and binds parameter values according to the samplex, executes the bound circuits on the hardware, and returns the execution results and metadata. It follows the directives of the input pair and does not make any implicit decisions for you, so that the process is transparent yet performant. The Executor primitive is part of the [directed execution model.](/docs/guides/directed-execution-model.mdx)\n",
275+
"\n",
276+
"The inputs and output of the Executor primitive are very different from those of Sampler and Estimator. Refer to the [Executor input and output topic](/docs/guides/executor-input-output.ipynb) for more information."
277+
]
278+
},
267279
{
268280
"cell_type": "markdown",
269281
"id": "02dbbc7d-76e7-4a89-8739-ba7f3a5a05b8",
@@ -272,11 +284,10 @@
272284
"## Next steps\n",
273285
"\n",
274286
"<Admonition type=\"tip\" title=\"Recommendations\">\n",
275-
" - Read [Get started with primitives](get-started-with-primitives) to implement primitives in your work.\n",
276-
" - Review detailed [primitives examples.](primitives-examples)\n",
287+
" - Read [Get started with Estimator,](get-started-with-estimator) [Get started with Sampler,](get-started-with-sampler) and [Get started with Executor,](get-started-with-executor) to implement primitives in your work.\n",
277288
" - Practice with primitives by working through the [Cost function lesson](/learning/courses/variational-algorithm-design/cost-functions) in IBM Quantum Learning.\n",
278-
" - See the [EstimatorV2 API reference](/docs/api/qiskit-ibm-runtime/estimator-v2) and [SamplerV2 API reference](/docs/api/qiskit-ibm-runtime/sampler-v2).\n",
279-
" - Read [Migrate to V2 primitives](/docs/guides/v2-primitives).\n",
289+
" - See the [EstimatorV2 API reference](/docs/api/qiskit-ibm-runtime/estimator-v2), [SamplerV2 API reference](/docs/api/qiskit-ibm-runtime/sampler-v2), and [Executor API reference.](https://qiskit.github.io/qiskit-ibm-runtime/stubs/qiskit_ibm_runtime.Executor.html)\n",
290+
" - Read [Migrate to V2 primitives.](/docs/guides/v2-primitives)\n",
280291
"</Admonition>"
281292
]
282293
}

0 commit comments

Comments
 (0)