Skip to content
Draft
Show file tree
Hide file tree
Changes from 95 commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
26b38e9
Reorder toc, move hello world
kaelynj Jan 16, 2026
f6ed2d9
Merge branch 'main' into kjf/new-toc
kaelynj Jan 20, 2026
eef64fe
Add updated overview image
kaelynj Jan 23, 2026
50e9c21
Placate CI, add new overview image
kaelynj Jan 23, 2026
00452c3
Merge branch 'main' into kjf/new-toc
kaelynj Jan 23, 2026
9d9ede5
Give orphan page a home
kaelynj Jan 23, 2026
c627c81
Remove stale image
kaelynj Jan 23, 2026
e6c9ed9
Integrate feedback for page ordering
kaelynj Feb 4, 2026
fba7bf1
Move addons together, revamp their overview page
kaelynj Feb 4, 2026
d6445d0
Merge branch 'main' into kjf/new-toc
kaelynj Feb 4, 2026
2f4bc28
Merge branch 'main' into kjf/new-toc
abbycross Feb 5, 2026
4bd8970
move dev workflow pg to addl resources
abbycross Feb 5, 2026
d1fa590
move install to Qiskit
abbycross Feb 5, 2026
5df9974
Rename hello world and move. Update link names.
abbycross Feb 5, 2026
401fe89
move online environments to install
abbycross Feb 5, 2026
38f077b
change applications tools section name
abbycross Feb 5, 2026
c939d65
rename addon section and remove links to individ addons
abbycross Feb 5, 2026
4d1395a
rename platform access
abbycross Feb 5, 2026
3b18400
move SQD to applications research tools
abbycross Feb 5, 2026
47bb0c8
remove addons guides except sqd
abbycross Feb 5, 2026
6b0b803
delete images
abbycross Feb 5, 2026
87fa793
move advanced techniques up
abbycross Feb 5, 2026
5c8debe
clean up some links
abbycross Feb 5, 2026
8efed20
experiment with composer docs placement
abbycross Feb 5, 2026
f2eaa6a
unused images
abbycross Feb 5, 2026
3475b8d
Start adding new files
beckykd Feb 5, 2026
07c6e0c
Merge branch 'main' into kjf/new-toc
abbycross Feb 6, 2026
7d5a20f
maybe "with primitives"?
abbycross Feb 6, 2026
7fce910
update all broken links to point to github.io docs
abbycross Feb 6, 2026
051051d
Update notebook-testing.toml
abbycross Feb 6, 2026
3cdd7da
group together for quicker scan
abbycross Feb 6, 2026
cfa506e
More new files
beckykd Feb 6, 2026
2c0ebcd
Merge branch 'kjf/new-toc' of https://github.com/Qiskit/documentation…
beckykd Feb 6, 2026
d5cc2bd
capabilities in a table - one possibility
abbycross Feb 6, 2026
4fda3e1
update TOC
beckykd Feb 6, 2026
471e1b8
Update addons.mdx
abbycross Feb 6, 2026
8ed78c3
Start adding executor input
beckykd Feb 9, 2026
e85bdd4
More updates
beckykd Feb 10, 2026
2b0062b
Add titles to allowlists
beckykd Feb 11, 2026
40c9339
remove temporary table
abbycross Feb 11, 2026
9d5cd42
spelling
beckykd Feb 11, 2026
1fd3f36
Update qiskit_bot.yaml
beckykd Feb 11, 2026
9d1f115
Update qiskit_bot.yaml
beckykd Feb 11, 2026
af56691
no spaces in file names
beckykd Feb 11, 2026
4eefc16
fix links
beckykd Feb 11, 2026
66c630e
input and output
beckykd Feb 11, 2026
6584252
remove from qiskit-bot
beckykd Feb 12, 2026
c132cd0
Update qiskit_bot.yaml
beckykd Feb 12, 2026
3ec0990
links
beckykd Feb 12, 2026
eb7d975
run hello world
beckykd Feb 12, 2026
0497b8c
fix links
beckykd Feb 12, 2026
f721c0b
Merge branch 'main' into bd-new-toc
beckykd Feb 12, 2026
e6d2589
squeaky
beckykd Feb 12, 2026
ec5fa49
Merge branch 'bd-new-toc' of https://github.com/Qiskit/documentation …
beckykd Feb 12, 2026
0733815
fix links and image
beckykd Feb 12, 2026
a4a993c
change to avif
beckykd Feb 12, 2026
ba68516
squeaky
beckykd Feb 13, 2026
7941c26
Merge branch 'kjf/new-toc' of https://github.com/Qiskit/documentation…
beckykd Feb 13, 2026
3e0e3a5
rest api files
beckykd Feb 13, 2026
e39af4e
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Feb 13, 2026
f57e8c6
all the merge conflicts - friday fun!
beckykd Feb 16, 2026
19ba71b
delete
beckykd Feb 16, 2026
50c7b1f
title mismatches are ok
beckykd Feb 16, 2026
1a70173
Add broadcasting topics
beckykd Feb 16, 2026
c79086a
change the files to mdx that won't pass ci
beckykd Feb 17, 2026
320843f
Update allowLists.ts
beckykd Feb 17, 2026
d825555
spelling
beckykd Feb 17, 2026
122db99
finish input and output
beckykd Feb 17, 2026
01a852c
fixes
beckykd Feb 18, 2026
f7f9aaf
REST api isn't ready yet
beckykd Feb 18, 2026
956fd6b
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Feb 18, 2026
e52d181
Pull in working toc
beckykd Feb 18, 2026
7210da5
spelling
beckykd Feb 18, 2026
ceb14aa
fix links
beckykd Feb 18, 2026
db61b1f
fix links
beckykd Feb 18, 2026
4b5df2c
fix toc
beckykd Feb 18, 2026
a5e1613
Update qiskit_bot.yaml
beckykd Feb 18, 2026
2d95bb3
Update _toc.json
beckykd Feb 18, 2026
1f0092c
delete unused images
beckykd Feb 18, 2026
e454b39
Run linter
kaelynj Feb 18, 2026
d01ad8d
Update notebook-testing.toml
beckykd Feb 18, 2026
65bbf2a
squeaky
beckykd Feb 18, 2026
6e5b920
version info
beckykd Feb 18, 2026
b7b931a
change to markdown
beckykd Feb 18, 2026
a7cafb9
Delete sampler-rest-api.ipynb
beckykd Feb 18, 2026
8a59c9a
Extract images
frankharkins Feb 19, 2026
172d28a
Fix notebook testing config
frankharkins Feb 19, 2026
bb80ce2
Add options info
beckykd Feb 20, 2026
1f20e9b
links
beckykd Feb 20, 2026
32b6a0f
Apply suggestion from @beckykd
beckykd Feb 20, 2026
535a914
Apply suggestion from @beckykd
beckykd Feb 20, 2026
3180dd9
Apply suggestion from @beckykd
beckykd Feb 20, 2026
65fe542
links
beckykd Feb 20, 2026
6a75ead
code fix
beckykd Feb 20, 2026
aa950c7
squeaky clean
beckykd Feb 20, 2026
7d2381d
Apply suggestions from code review
beckykd Feb 23, 2026
519577e
Update docs/guides/estimator-examples.ipynb
beckykd Feb 23, 2026
98e92fa
Update docs/guides/get-started-with-estimator.ipynb
beckykd Feb 23, 2026
2465e68
Update docs/guides/get-started-with-estimator.ipynb
beckykd Feb 23, 2026
37bac5f
Update docs/guides/executor-options.mdx
beckykd Feb 23, 2026
13c0d4c
Update docs/guides/estimator-options.ipynb
beckykd Feb 23, 2026
c7bb82e
Update docs/guides/estimator-options.ipynb
beckykd Feb 23, 2026
6adaef6
Update docs/guides/estimator-options.ipynb
beckykd Feb 23, 2026
c05b09b
Update docs/guides/estimator-options.ipynb
beckykd Feb 23, 2026
922e593
review comments
beckykd Feb 23, 2026
58bff65
Apply suggestions from code review
beckykd Feb 23, 2026
838aad5
changes from review
beckykd Feb 23, 2026
05794d2
There is no precedence section!
beckykd Feb 24, 2026
7cceeda
Merge branch 'main' into bd-new-toc
beckykd Feb 24, 2026
e8f53a7
links should have the full path
beckykd Feb 24, 2026
d11b950
Merge branch 'bd-new-toc' of https://github.com/Qiskit/documentation …
beckykd Feb 24, 2026
5a9020e
Move stuff around
beckykd Feb 24, 2026
72957ee
Apply suggestions from code review
beckykd Feb 24, 2026
1a0fce3
merge conflicts
beckykd Feb 24, 2026
2a32a94
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Feb 26, 2026
745a26c
links
beckykd Feb 26, 2026
d07207e
squeaky clean
beckykd Feb 26, 2026
51dcbfc
Marry pubs and broadcasting topics
beckykd Feb 26, 2026
23d6da9
Update _toc.json
beckykd Feb 26, 2026
daae80d
Clean up the options overview
beckykd Feb 26, 2026
dfe2005
fix twisties
beckykd Feb 27, 2026
3339461
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Feb 27, 2026
ff86adb
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Feb 27, 2026
2963cf5
untangle toc
beckykd Feb 27, 2026
085d209
AC comments
beckykd Feb 27, 2026
b282918
title mismatch
beckykd Mar 2, 2026
460a27c
Capitalization
beckykd Mar 2, 2026
2a3d781
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Mar 2, 2026
4b68a9c
links
beckykd Mar 2, 2026
feb7505
Something fun
beckykd Mar 2, 2026
e565670
typo
beckykd Mar 2, 2026
b915ddb
Add PEA example
beckykd Mar 3, 2026
dd5f006
links
beckykd Mar 3, 2026
5a0d8c3
yarghhh
beckykd Mar 4, 2026
41e909f
remove unused images
beckykd Mar 5, 2026
6675bd4
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Mar 6, 2026
9bdfbe3
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd Mar 23, 2026
ca41e55
Pull in all updates, make copies of files previously modified
beckykd Mar 23, 2026
7a97913
put modified filkes in a different folder
beckykd Mar 23, 2026
aaa4c78
updates from previous work
beckykd Mar 24, 2026
88064be
Use full link path
beckykd Mar 24, 2026
ed28c49
Move periods outside links
beckykd Mar 24, 2026
d6893e8
Fix TOC
beckykd Mar 24, 2026
f3e8b90
fix links
beckykd Mar 24, 2026
64529b3
links
beckykd Mar 24, 2026
7942159
remove file
beckykd Mar 24, 2026
eb393e9
broken link
beckykd Mar 24, 2026
8e49e8f
link
beckykd Mar 24, 2026
8ceec65
replace pubs-broadcasting with primitives-input-output
beckykd Mar 25, 2026
1578621
linx
beckykd Mar 25, 2026
05786cb
edits
beckykd Mar 25, 2026
bd9f3bb
link
beckykd Mar 26, 2026
db6e971
fix the bot
beckykd Mar 26, 2026
800bbf2
fix
beckykd Mar 26, 2026
35bc9ae
Merge branch 'main' into bd-new-toc
beckykd Mar 26, 2026
87a1a9b
edits
beckykd Mar 27, 2026
14f6a34
Merge branch 'bd-new-toc' of https://github.com/Qiskit/documentation …
beckykd Mar 27, 2026
b532dd0
Merge branch 'main' into bd-new-toc
beckykd Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 137 additions & 22 deletions docs/guides/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,27 +215,138 @@
}
]
},
{
"title": "Primitives",
"children": [
{
"title": "Introduction to primitives",
"url": "/docs/guides/primitives"
},
{
"title": "Get started with primitives",
"url": "/docs/guides/get-started-with-primitives"
},
{
"title": "Primitive inputs and outputs",
"url": "/docs/guides/primitive-input-output"
},
{
"title": "Exact simulation with Qiskit SDK primitives",
"url": "/docs/guides/simulate-with-qiskit-sdk-primitives"
}
]
},
{
"title": "Execute with primitives",
"children": [
{
"title": "Introduction to primitives",
"url": "/docs/guides/primitives"
},
{
"title": "Introduction to PUBs",
"url": "/docs/guides/pubs"
},
{
"title": "Introduction to broadcasting",
"url": "/docs/guides/broadcasting"
},
{
"title": "Estimator",
"children": [
{
"title": "Get started",
"url": "/docs/guides/get-started-with-estimator"
},
{
"title": "Inputs and outputs",
"url": "/docs/guides/estimator-input-output"
},
{
"title": "Broadcasting",
"url": "/docs/guides/estimator-broadcasting"
},
{
"title": "Options",
"url": "/docs/guides/estimator-options"
},
{
"title": "Examples",
"url": "/docs/guides/estimator-examples"
},
{
"title": "REST API",
"url": "/docs/guides/estimator-rest-api"
}
]
},
{
"title": "Sampler",
"children": [
{
"title": "Get started",
"url": "/docs/guides/get-started-with-sampler"
},
{
"title": "Inputs and outputs",
"url": "/docs/guides/sampler-input-output"
},
{
"title": "Options",
"url": "/docs/guides/sampler-options"
},
{
"title": "Examples",
"url": "/docs/guides/sampler-examples"
},
{
"title": "REST API",
"url": "/docs/guides/sampler-rest-api"
}
]
},
{
"title": "Executor",
"children": [
{
"title": "Get started",
"url": "/docs/guides/get-started-with-executor"
},
{
"title": "Inputs and outputs",
"url": "/docs/guides/executor-input-output"
},
{
"title": "Broadcasting",
"url": "/docs/guides/executor-broadcasting"
},
{
"title": "Options",
"url": "/docs/guides/executor-options"
},
{
"title": "Examples",
"url": "/docs/guides/executor-examples"
} ]
},
{
"title": "Manage noise",
"children": [
{
"title": "Error mitigation and suppression",
"url": "/docs/guides/error-mitigation-and-suppression-techniques"
},
{
"title": "Noise learning",
"url": "/docs/guides/noise-learning"
},
{
"title": "Configure error mitigation",
"url": "/docs/guides/configure-error-mitigation"
},
{
"title": "Configure error suppression",
"url": "/docs/guides/configure-error-suppression"
}
]
},
{
"title": "Directed execution model (beta)",
"url": "/docs/guides/directed-execution-model"
},
{
"title": "Introduction to options",
"url": "/docs/guides/runtime-options-overview"
},
{
"title": "Specify options",
"url": "/docs/guides/specify-runtime-options"
},
{
"title": "Qiskit Runtime local testing mode",
"url": "/docs/guides/local-testing-mode"
}
]
},
{
"title": "Debugging",
"children": [
Expand All @@ -250,6 +361,10 @@
"title": "Exact and noisy simulation with Qiskit Aer primitives",
"url": "/docs/guides/simulate-with-qiskit-aer"
},
{
"title": "Exact simulation with Qiskit SDK primitives",
"url": "/docs/guides/simulate-with-qiskit-sdk-primitives"
},
{
"title": "Build noise models",
"url": "/docs/guides/build-noise-models"
Expand Down Expand Up @@ -916,4 +1031,4 @@
"url": "/docs/guides/composer"
}
]
}
}
2 changes: 1 addition & 1 deletion docs/guides/algorithmiq-tem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
"\n",
"Name | Type | Description | Required | Default | Example\n",
"-- | -- | -- | -- | -- | --\n",
"`pubs` | Iterable[EstimatorPubLike] | An iterable of PUB-like (primitive unified bloc) objects, such as tuples `(circuit, observables)` or `(circuit, observables, parameters, precision)`. See [Overview of PUBs](/docs/guides/primitive-input-output#overview-of-pubs) for more information. If a non-ISA circuit is passed, it will be transpiled with optimal settings. If an ISA circuit is passed, it will not be transpiled; in this case, the observable must be defined on the whole QPU. | Yes | N/A | (circuit, observables)\n",
"`pubs` | Iterable[EstimatorPubLike] | An iterable of PUB-like (primitive unified bloc) objects, such as tuples `(circuit, observables)` or `(circuit, observables, parameters, precision)`. See [Overview of PUBs](/docs/guides/pubs) for more information. If a non-ISA circuit is passed, it will be transpiled with optimal settings. If an ISA circuit is passed, it will not be transpiled; in this case, the observable must be defined on the whole QPU. | Yes | N/A | (circuit, observables)\n",
"`backend_name` | str | Name of the backend to make the query.| No | If not provided, the least-busy backend will be used. | \"ibm_fez\"\n",
"`options` | dict | Input options. See `Options` section for more details. | No | See `Options` section for more details.| \\{\"max_bond_dimension\": 100\\}\n",
"\n",
Expand Down
43 changes: 43 additions & 0 deletions docs/guides/broadcasting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Broadcasting
description: Understand how primitives handle array inputs and outputs using broadcasting semantics

---

# Primitive broadcasting

The primitives aggregate elements from multiple arrays (observables and parameter values) by following the same broadcasting rules as NumPy. This section briefly summarizes those rules. For a detailed explanation, see the [NumPy broadcasting rules documentation](https://numpy.org/doc/stable/user/basics.broadcasting.html).

## Rules

* Input arrays do not need to have the same number of dimensions.
* The resulting array will have the same number of dimensions as the input array with the largest dimension.
* The size of each dimension is the largest size of the corresponding dimension.
* Missing dimensions are assumed to have size one.
* Shape comparisons start with the rightmost dimension and continue to the left.
* Two dimensions are compatible if their sizes are equal or if one of them is 1.

Examples of array pairs that broadcast:

```text
A1 (1d array): 1
A2 (2d array): 3 x 5
Result (2d array): 3 x 5


A1 (3d array): 11 x 2 x 7
A2 (3d array): 11 x 1 x 7
Result (3d array): 11 x 2 x 7
```

Examples of array pairs that do not broadcast:

```text
A1 (1d array): 5
A2 (1d array): 3

A1 (2d array): 2 x 1
A2 (3d array): 6 x 5 x 4 # This would work if the middle dimension were 2, but it is 5.
```

The primitives return one value for each element of the broadcasted shape.
14 changes: 5 additions & 9 deletions docs/guides/directed-execution-model.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Directed execution model (beta)
title: Directed execution model
description: Use this composable, explicit execution model with your utility-scale experiments to fine-tune error mitigation and other techniques.

---
Expand All @@ -26,7 +26,7 @@ To apply error mitigation to a circuit under the framework, your workflow will t

3. Build the template circuit and samplex from the boxed circuit.

4. Run the template circuit and samplex with the [Executor](#executor-primitive) primitive, which will generate and execute the circuit variants as instructed.
4. Run the template circuit and samplex with the [Executor](#executor) primitive, which will generate and execute the circuit variants as instructed.

5. Post-process execution results. For example, you can apply post-selection, or extrapolate mitigated expectation values from the execution results.

Expand All @@ -41,22 +41,18 @@ The following tools can be used together to implement an error mitigation techni

![Example of using boxes and twirling annotations](/docs/images/guides/directed-execution-model/execution-model.avif)

A circuit with annotated boxes can then be used to generate a *template circuit* and a *samplex*. The output template circuit is a parameterized circuit that will be executed without further alteration (other than having different parameter values assigned to it). The samplex, which is the core type of the Samplomatic library, represents a parametric probability distribution over the parameters of the template circuit and other array-valued fields. These fields can be used to post-process data collected from executing the bound template circuit. In other words, the template circuit and samplex pair tells the Executor primitive (described below) exactly what parameters to generate and what bound circuits to run. Because these two constructs are created on the client side, you can do local inspection and sampling to verify the outputs prior to sending it for hardware execution.
A circuit with annotated boxes can then be used to generate a *template circuit* and a *samplex*. The output template circuit is a parameterized circuit that will be executed without further alteration (other than having different parameter values assigned to it). The samplex, which is the core type of the Samplomatic library, represents a parametric probability distribution over the parameters of the template circuit and other array-valued fields. These fields can be used to post-process data collected from executing the bound template circuit. In other words, the template circuit and samplex pair tells the [Executor primitive](#executor) exactly what parameters to generate and what bound circuits to run. Because these two constructs are created on the client side, you can do local inspection and sampling to verify the outputs prior to sending it for hardware execution.

To simplify the process of generating annotated boxes, the Samplomatic library also provides transpiler passes that automatically group circuit instructions into annotated boxes, based on the strategies you provide.

To learn more about Samplomatic, visit the [guides](https://qiskit.github.io/samplomatic/guides/index.html) and [API reference](https://qiskit.github.io/samplomatic/) documentation. Feel free to submit feedback and report bugs in its [GitHub](https://github.com/Qiskit/samplomatic) repository.

<span id="executor"></span>
### Executor primitive

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.

To access `Executor`, install the `executor_preview` branch from `qiskit-ibm-runtime`:

```bash
pip install -U git+https://github.com/Qiskit/qiskit-ibm-runtime.git@executor_preview
```
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.
The inputs and output of the Executor primitive are very different from those of Sampler and Estimator. Refer to [Get started with Executor](/docs/guides/get-started-with-executor) for more information.

### NoiseLearnerV3

Expand Down
93 changes: 93 additions & 0 deletions docs/guides/estimator-broadcasting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
title: Broadcasting
description: How the Estimator handles array inputs and outputs using broadcasting semantics

---

# Estimator broadcasting semantics
When invoking an Estimator primitive's [`run()`](/docs/api/qiskit-ibm-runtime/estimator-v2#run) method, the main argument that is required is a tuple called a [PUB.](/docs/guides/pubs) The data provided to these tuples can be arranged in a variety of shapes to provide flexibility in a workload through [broadcasting.](/docs/guides/broadcasting) This guide explains how the Estimator handles array inputs and outputs using broadcasting semantics.

Following are some examples of common patterns expressed in terms of array broadcasting. Their accompanying visual representation is shown in the figure that follows:


Parameter value sets are represented by n x m arrays, and observable arrays are represented by one or more single-column arrays. For each example in the previous code, the parameter value sets are combined with their observable array to create the resulting expectation value estimates.

- *Example 1*: (broadcast single observable) has a parameter value set that is a 5x1 array and a 1x1 observables array. The one item in the observables array is combined with each item in the parameter value set to create a single 5x1 array where each item is a combination of the original item in the parameter value set with the item in the observables array.

- *Example 2*: (zip) has a 5x1 parameter value set and a 5x1 observables array. The output is a 5x1 array where each item is a combination of the nth item in the parameter value set with the nth item in the observables array.

- *Example 3*: (outer/product) has a 1x6 parameter value set and a 4x1 observables array. Their combination results in a 4x6 array that is created by combining each item in the parameter value set with *every* item in the observables array, and thus each parameter value becomes an entire column in the output.

- *Example 4*: (Standard nd generalization) has a 3x6 parameter value set array and two 3x1 observables array. These combine to create two 3x6 output arrays in a similar manner to the previous example.

![This image illustrates several visual representations of array broadcasting](/docs/images/guides/pubs/broadcasting.avif "Visual representation of broadcasting")

```python
# Broadcast single observable
parameter_values = np.random.uniform(size=(5,)) # shape (5,)
observables = SparsePauliOp("ZZZ") # shape ()
# >> pub result has shape (5,)

# Zip
parameter_values = np.random.uniform(size=(5,)) # shape (5,)
observables = [
SparsePauliOp(pauli) for pauli in ["III", "XXX", "YYY", "ZZZ", "XYZ"]
] # shape (5,)
# >> pub result has shape (5,)

# Outer/Product
parameter_values = np.random.uniform(size=(1, 6)) # shape (1, 6)
observables = [
[SparsePauliOp(pauli)] for pauli in ["III", "XXX", "YYY", "ZZZ"]
] # shape (4, 1)
# >> pub result has shape (4, 6)

# Standard nd generalization
parameter_values = np.random.uniform(size=(3, 6)) # shape (3, 6)
observables = [
[
[SparsePauliOp(["XII"])],
[SparsePauliOp(["IXI"])],
[SparsePauliOp(["IIX"])],
],
[
[SparsePauliOp(["ZII"])],
[SparsePauliOp(["IZI"])],
[SparsePauliOp(["IIZ"])],
],
] # shape (2, 3, 1)
# >> pub result has shape (2, 3, 6)
```

<Admonition type="tip" title="SparsePauliOp">
Each `SparsePauliOp` counts as a single element in this context, regardless of the number of Paulis contained in the `SparsePauliOp`. Thus, for the purpose of these broadcasting rules, all of the following elements have the same shape:

```python
# shape ()
a = SparsePauliOp("Z")

# shape ()
b = SparsePauliOp("IIIIZXYIZ")

# shape ()
c = SparsePauliOp.from_list(["XX", "XY", "IZ"])
```

The following lists of operators, while equivalent in terms of information contained, have different shapes:

```python
# shape ()
list1 = SparsePauliOp.from_list(["XX", "XY", "IZ"])

# shape (3, )
list2 = [SparsePauliOp("XX"), SparsePauliOp("XY"), SparsePauliOp("IZ")]
```
</Admonition>

## Next steps

<Admonition type="tip" title="Recommendations">
- See the [broadcasting guide](/docs/guides/broadcasting) for an overview of broadcasting.
- Learn about [PUBs.](/docs/guides/pubs)
- Understand [Estimator inputs and outputs.](/docs/guides/estimator-input-output)
</Admonition>
Loading
Loading