-
Notifications
You must be signed in to change notification settings - Fork 175
Add executor information #4640
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
Draft
beckykd
wants to merge
158
commits into
main
Choose a base branch
from
bd-new-toc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add executor information #4640
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 f6ed2d9
Merge branch 'main' into kjf/new-toc
kaelynj eef64fe
Add updated overview image
kaelynj 50e9c21
Placate CI, add new overview image
kaelynj 00452c3
Merge branch 'main' into kjf/new-toc
kaelynj 9d9ede5
Give orphan page a home
kaelynj c627c81
Remove stale image
kaelynj e6c9ed9
Integrate feedback for page ordering
kaelynj fba7bf1
Move addons together, revamp their overview page
kaelynj d6445d0
Merge branch 'main' into kjf/new-toc
kaelynj 2f4bc28
Merge branch 'main' into kjf/new-toc
abbycross 4bd8970
move dev workflow pg to addl resources
abbycross d1fa590
move install to Qiskit
abbycross 5df9974
Rename hello world and move. Update link names.
abbycross 401fe89
move online environments to install
abbycross 38f077b
change applications tools section name
abbycross c939d65
rename addon section and remove links to individ addons
abbycross 4d1395a
rename platform access
abbycross 3b18400
move SQD to applications research tools
abbycross 47bb0c8
remove addons guides except sqd
abbycross 6b0b803
delete images
abbycross 87fa793
move advanced techniques up
abbycross 5c8debe
clean up some links
abbycross 8efed20
experiment with composer docs placement
abbycross f2eaa6a
unused images
abbycross 3475b8d
Start adding new files
beckykd 07c6e0c
Merge branch 'main' into kjf/new-toc
abbycross 7d5a20f
maybe "with primitives"?
abbycross 7fce910
update all broken links to point to github.io docs
abbycross 051051d
Update notebook-testing.toml
abbycross 3cdd7da
group together for quicker scan
abbycross cfa506e
More new files
beckykd 2c0ebcd
Merge branch 'kjf/new-toc' of https://github.com/Qiskit/documentation…
beckykd d5cc2bd
capabilities in a table - one possibility
abbycross 4fda3e1
update TOC
beckykd 471e1b8
Update addons.mdx
abbycross 8ed78c3
Start adding executor input
beckykd e85bdd4
More updates
beckykd 2b0062b
Add titles to allowlists
beckykd 40c9339
remove temporary table
abbycross 9d5cd42
spelling
beckykd 1fd3f36
Update qiskit_bot.yaml
beckykd 9d1f115
Update qiskit_bot.yaml
beckykd af56691
no spaces in file names
beckykd 4eefc16
fix links
beckykd 66c630e
input and output
beckykd 6584252
remove from qiskit-bot
beckykd c132cd0
Update qiskit_bot.yaml
beckykd 3ec0990
links
beckykd eb7d975
run hello world
beckykd 0497b8c
fix links
beckykd f721c0b
Merge branch 'main' into bd-new-toc
beckykd e6d2589
squeaky
beckykd ec5fa49
Merge branch 'bd-new-toc' of https://github.com/Qiskit/documentation …
beckykd 0733815
fix links and image
beckykd a4a993c
change to avif
beckykd ba68516
squeaky
beckykd 7941c26
Merge branch 'kjf/new-toc' of https://github.com/Qiskit/documentation…
beckykd 3e0e3a5
rest api files
beckykd e39af4e
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd f57e8c6
all the merge conflicts - friday fun!
beckykd 19ba71b
delete
beckykd 50c7b1f
title mismatches are ok
beckykd 1a70173
Add broadcasting topics
beckykd c79086a
change the files to mdx that won't pass ci
beckykd 320843f
Update allowLists.ts
beckykd d825555
spelling
beckykd 122db99
finish input and output
beckykd 01a852c
fixes
beckykd f7f9aaf
REST api isn't ready yet
beckykd 956fd6b
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd e52d181
Pull in working toc
beckykd 7210da5
spelling
beckykd ceb14aa
fix links
beckykd db61b1f
fix links
beckykd 4b5df2c
fix toc
beckykd a5e1613
Update qiskit_bot.yaml
beckykd 2d95bb3
Update _toc.json
beckykd 1f0092c
delete unused images
beckykd e454b39
Run linter
kaelynj d01ad8d
Update notebook-testing.toml
beckykd 65bbf2a
squeaky
beckykd 6e5b920
version info
beckykd b7b931a
change to markdown
beckykd a7cafb9
Delete sampler-rest-api.ipynb
beckykd 8a59c9a
Extract images
frankharkins 172d28a
Fix notebook testing config
frankharkins bb80ce2
Add options info
beckykd 1f20e9b
links
beckykd 32b6a0f
Apply suggestion from @beckykd
beckykd 535a914
Apply suggestion from @beckykd
beckykd 3180dd9
Apply suggestion from @beckykd
beckykd 65fe542
links
beckykd 6a75ead
code fix
beckykd aa950c7
squeaky clean
beckykd 7d2381d
Apply suggestions from code review
beckykd 519577e
Update docs/guides/estimator-examples.ipynb
beckykd 98e92fa
Update docs/guides/get-started-with-estimator.ipynb
beckykd 2465e68
Update docs/guides/get-started-with-estimator.ipynb
beckykd 37bac5f
Update docs/guides/executor-options.mdx
beckykd 13c0d4c
Update docs/guides/estimator-options.ipynb
beckykd c7bb82e
Update docs/guides/estimator-options.ipynb
beckykd 6adaef6
Update docs/guides/estimator-options.ipynb
beckykd c05b09b
Update docs/guides/estimator-options.ipynb
beckykd 922e593
review comments
beckykd 58bff65
Apply suggestions from code review
beckykd 838aad5
changes from review
beckykd 05794d2
There is no precedence section!
beckykd 7cceeda
Merge branch 'main' into bd-new-toc
beckykd e8f53a7
links should have the full path
beckykd d11b950
Merge branch 'bd-new-toc' of https://github.com/Qiskit/documentation …
beckykd 5a9020e
Move stuff around
beckykd 72957ee
Apply suggestions from code review
beckykd 1a0fce3
merge conflicts
beckykd 2a32a94
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd 745a26c
links
beckykd d07207e
squeaky clean
beckykd 51dcbfc
Marry pubs and broadcasting topics
beckykd 23d6da9
Update _toc.json
beckykd daae80d
Clean up the options overview
beckykd dfe2005
fix twisties
beckykd 3339461
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd ff86adb
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd 2963cf5
untangle toc
beckykd 085d209
AC comments
beckykd b282918
title mismatch
beckykd 460a27c
Capitalization
beckykd 2a3d781
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd 4b68a9c
links
beckykd feb7505
Something fun
beckykd e565670
typo
beckykd b915ddb
Add PEA example
beckykd dd5f006
links
beckykd 5a0d8c3
yarghhh
beckykd 41e909f
remove unused images
beckykd 6675bd4
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd 9bdfbe3
Merge branch 'main' of https://github.com/Qiskit/documentation into b…
beckykd ca41e55
Pull in all updates, make copies of files previously modified
beckykd 7a97913
put modified filkes in a different folder
beckykd aaa4c78
updates from previous work
beckykd 88064be
Use full link path
beckykd ed28c49
Move periods outside links
beckykd d6893e8
Fix TOC
beckykd f3e8b90
fix links
beckykd 64529b3
links
beckykd 7942159
remove file
beckykd eb393e9
broken link
beckykd 8e49e8f
link
beckykd 8ceec65
replace pubs-broadcasting with primitives-input-output
beckykd 1578621
linx
beckykd 05786cb
edits
beckykd bd9f3bb
link
beckykd db6e971
fix the bot
beckykd 800bbf2
fix
beckykd 35bc9ae
Merge branch 'main' into bd-new-toc
beckykd 87a1a9b
edits
beckykd 14f6a34
Merge branch 'bd-new-toc' of https://github.com/Qiskit/documentation …
beckykd b532dd0
Merge branch 'main' into bd-new-toc
beckykd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
beckykd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
beckykd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - *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. | ||
beckykd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - *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. | ||
beckykd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| ```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> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.