Skip to content

Commit

Permalink
Sync latest dev docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 13, 2024
1 parent 3b53138 commit f69321c
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 30 deletions.
4 changes: 4 additions & 0 deletions docs/api/qiskit-ibm-runtime/dev/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@
{
"title": "draw_layer_error_map",
"url": "/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.visualization.draw_layer_error_map"
},
{
"title": "draw_layer_errors_swarm",
"url": "/api/qiskit-ibm-runtime/dev/qiskit_ibm_runtime.visualization.draw_layer_errors_swarm"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,40 +93,47 @@ python_api_name: qiskit_ibm_runtime.utils.noise_learner_result.LayerError
**Parameters**

* **embedding** (`Union`\[`Embedding`, [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "(in Qiskit v1.2)")]) – An `Embedding` object containing the coordinates and coupling map to draw the layer error on, or a backend to generate an `Embedding` for.

* **colorscale** (`str`) – The colorscale used to show the rates of this layer error.

* **color\_no\_data** (`str`) – The color used for qubits and edges for which no data is available.

* **color\_out\_of\_scale** (`str`) – The color used for rates with value greater than `highest_rate`.

* **num\_edge\_segments** (`int`) – The number of equal-sized segments that edges are made of.

* **edge\_width** (`float`) – The line width of the edges in pixels.

* **height** (`int`) – The height of the returned figure.

* **highest\_rate** (`Optional`\[`float`]) – The highest rate, used to normalize all other rates before choosing their colors. If `None`, it defaults to the highest value found in the `layer_error`.

* **background\_color** (`str`) – The background color.

* **radius** (`float`) – The radius of the pie charts representing the qubits.

* **width** (`int`) – The width of the returned figure.

* **code:** (*..*) –

python: from qiskit import QuantumCircuit from qiskit.quantum\_info import PauliList from qiskit\_ibm\_runtime.utils.embeddings import Embedding from qiskit\_ibm\_runtime.utils.noise\_learner\_result import LayerError, PauliLindbladError

\# A five-qubit 1-D embedding with nearest neighbouring connectivity coordinates1 = \[(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5)] coupling\_map1 = \[(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)] embedding1 = Embedding(coordinates1, coupling\_map1)

\# A six-qubit horseshoe-shaped embedding with nearest neighbouring connectivity coordinates2 = \[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)] coupling\_map2 = \[(0, 1), (1, 2), (0, 3), (3, 4), (4, 5)] embedding2 = Embedding(coordinates2, coupling\_map2)

\# A LayerError object circuit = QuantumCircuit(4) qubits = \[1, 2, 3, 4] generators = PauliList(\[“IIIX”, “IIXI”, “IXII”, “YIII”, “ZIII”, “XXII”, “ZZII”]) rates = \[0.01, 0.01, 0.01, 0.005, 0.02, 0.01, 0.01] error = PauliLindbladError(generators, rates) layer\_error = LayerError(circuit, qubits, error)

\# Draw the layer error on embedding1 layer\_error.draw\_map(embedding1)

\# Draw the layer error on embedding2 layer\_error.draw\_map(embedding2)
```python
from qiskit import QuantumCircuit
from qiskit.quantum_info import PauliList
from qiskit_ibm_runtime.utils.embeddings import Embedding
from qiskit_ibm_runtime.utils.noise_learner_result import LayerError, PauliLindbladError

# A five-qubit 1-D embedding with nearest neighbouring connectivity
coordinates1 = [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5)]
coupling_map1 = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)]
embedding1 = Embedding(coordinates1, coupling_map1)

# A six-qubit horseshoe-shaped embedding with nearest neighbouring connectivity
coordinates2 = [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)]
coupling_map2 = [(0, 1), (1, 2), (0, 3), (3, 4), (4, 5)]
embedding2 = Embedding(coordinates2, coupling_map2)

# A LayerError object
circuit = QuantumCircuit(4)
qubits = [1, 2, 3, 4]
generators = PauliList(["IIIX", "IIXI", "IXII", "YIII", "ZIII", "XXII", "ZZII"])
rates = [0.01, 0.01, 0.01, 0.005, 0.02, 0.01, 0.01]
error = PauliLindbladError(generators, rates)
layer_error = LayerError(circuit, qubits, error)

# Draw the layer error on embedding1
layer_error.draw_map(embedding1)

# Draw the layer error on embedding2
layer_error.draw_map(embedding2)
```

**Return type**

Expand All @@ -141,7 +148,7 @@ python_api_name: qiskit_ibm_runtime.utils.noise_learner_result.LayerError
This function plots the rates along a vertical axes, offsetting the rates along the `x` axis so that they do not overlap with each other.

<Admonition title="Note" type="note">
To draw multiple layer errors at once, consider calling `draw_layer_errors_swarm()` directly.
To draw multiple layer errors at once, consider calling [`draw_layer_errors_swarm()`](qiskit_ibm_runtime.visualization.draw_layer_errors_swarm "qiskit_ibm_runtime.visualization.draw_layer_errors_swarm") directly.
</Admonition>

**Parameters**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: draw_layer_errors_swarm (dev version)
description: API reference for qiskit_ibm_runtime.visualization.draw_layer_errors_swarm in the dev version of qiskit-ibm-runtime
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit_ibm_runtime.visualization.draw_layer_errors_swarm
---

<span id="draw-layer-errors-swarm" />

# draw\_layer\_errors\_swarm

<Function id="qiskit_ibm_runtime.visualization.draw_layer_errors_swarm" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/main/qiskit_ibm_runtime/visualization/draw_layer_error.py#L267-L421" signature="draw_layer_errors_swarm(layer_errors, num_bodies=None, max_rate=None, min_rate=None, connected=None, colors=None, num_bins=None, opacities=0.4, names=None, x_coo=None, marker_size=None, height=500, width=800)">
Draw a swarm plot for the given list of layer errors.

This function plots the rates of each of the given layer errors along a vertical axes, offsetting the rates along the `x` axis to minimize the overlap between the markers. It helps visualizing the distribution of errors for different layer errors, as well as to track (using the `connected` argument) the evolution of specific generators across different layers.

<Admonition title="Note" type="note">
To calculate the offsets, this arranges the rates in `num_bins` equally-spaced bins, and then it assigns the `x` coordinates so that all the rates in the same bins are spaced around the vertical axis. Thus, a higher value of `num_bins` will result in higher overlaps between the markers.
</Admonition>

**Parameters**

* **layer\_errors** (`list`\[[`LayerError`](qiskit_ibm_runtime.utils.noise_learner_result.LayerError "qiskit_ibm_runtime.utils.noise_learner_result.LayerError")]) – The layer errors to draw.
* **num\_bodies** (`Optional`\[`int`]) – The weight of the generators to include in the plot, or `None` if all the generators should be included.
* **max\_rate** (`Optional`\[`float`]) – The largest rate to include in the plot, or `None` if no upper limit should be set.
* **min\_rate** (`Optional`\[`float`]) – The smallest rate to include in the plot, or `None` if no lower limit should be set.
* **connected** (`Optional`\[`list`\[`Union`\[[`Pauli`](/api/qiskit/qiskit.quantum_info.Pauli "(in Qiskit v1.2)"), `str`]]]) – A list of generators whose markers are to be connected by lines.
* **colors** (`Optional`\[`list`\[`str`]]) – A list of colors for the markers in the plot, or `None` if these colors are to be chosen automatically.
* **num\_bins** (`Optional`\[`int`]) – The number of bins to place the rates into when calculating the `x`-axis offsets.
* **opacities** (`Union`\[`float`, `list`\[`float`]]) – A list of opacities for the markers.
* **names** (`Optional`\[`list`\[`str`]]) – The names of the various layers as displayed in the legend. If `None`, default names are assigned based on the layers’ position inside the `layer_errors` list.
* **x\_coo** (`Optional`\[`list`\[`float`]]) – The `x`-axis coordinates of the vertical axes that the markers are drawn around, or `None` if these axes should be placed at regular intervals.
* **marker\_size** (`Optional`\[`float`]) – The size of the marker in the plot.
* **height** (`int`) – The height of the returned figure.
* **width** (`int`) – The width of the returned figure.

**Raises**

* **ValueError** – If an invalid grouping option is given.
* **ValueError** – If `colors` is given but its length is incorrect.

**Return type**

`Figure`
</Function>

9 changes: 5 additions & 4 deletions docs/api/qiskit-ibm-runtime/dev/visualization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ A suite of functions for visualizing qiskit-ibm-runtime’s objects.

## Functions

| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`draw_execution_spans`](qiskit_ibm_runtime.visualization.draw_execution_spans "qiskit_ibm_runtime.visualization.draw_execution_spans")(\*spans\[, names, ...]) | Draw one or more [`ExecutionSpans`](qiskit_ibm_runtime.execution_span.ExecutionSpans "qiskit_ibm_runtime.execution_span.ExecutionSpans") on a bar plot. |
| [`draw_layer_error_map`](qiskit_ibm_runtime.visualization.draw_layer_error_map "qiskit_ibm_runtime.visualization.draw_layer_error_map")(layer\_error, embedding) | Draw a map view of a [`LayerError`](qiskit_ibm_runtime.utils.noise_learner_result.LayerError "qiskit_ibm_runtime.utils.noise_learner_result.LayerError"). |
| | |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`draw_execution_spans`](qiskit_ibm_runtime.visualization.draw_execution_spans "qiskit_ibm_runtime.visualization.draw_execution_spans")(\*spans\[, names, ...]) | Draw one or more [`ExecutionSpans`](qiskit_ibm_runtime.execution_span.ExecutionSpans "qiskit_ibm_runtime.execution_span.ExecutionSpans") on a bar plot. |
| [`draw_layer_error_map`](qiskit_ibm_runtime.visualization.draw_layer_error_map "qiskit_ibm_runtime.visualization.draw_layer_error_map")(layer\_error, embedding) | Draw a map view of a [`LayerError`](qiskit_ibm_runtime.utils.noise_learner_result.LayerError "qiskit_ibm_runtime.utils.noise_learner_result.LayerError"). |
| [`draw_layer_errors_swarm`](qiskit_ibm_runtime.visualization.draw_layer_errors_swarm "qiskit_ibm_runtime.visualization.draw_layer_errors_swarm")(layer\_errors\[, ...]) | Draw a swarm plot for the given list of layer errors. |

Binary file modified public/api/qiskit-ibm-runtime/dev/objects.inv
Binary file not shown.
Binary file modified public/images/api/qiskit-ibm-runtime/dev/fake_provider-1_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion scripts/config/api-html-artifacts.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"0.19": "https://ibm.box.com/shared/static/wjoea4x5tnxd0l4lgo2v3kxnx6btxvvl.zip"
},
"qiskit-ibm-runtime": {
"dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/2173495540/zip",
"dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/2178981798/zip",
"0.33": "https://ibm.box.com/shared/static/dpyhy6pa4xcmdz1881bjq7fkmcc47nuh.zip",
"0.32": "https://ibm.box.com/shared/static/enr0tnwaxzpvrypzjav4f1vjip3yfqcy.zip",
"0.31": "https://ibm.box.com/shared/static/z19dt14je6cz69oi4knraitjglzo29w7.zip",
Expand Down
4 changes: 3 additions & 1 deletion scripts/config/historical-pages-to-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19258,7 +19258,9 @@
},
"0.31": {},
"0.32": {},
"dev": {}
"dev": {
"qiskit_ibm_runtime.visualization.draw_layer_errors_swarm": "/"
}
},
"qiskit-ibm-transpiler": {
"0.3": {
Expand Down

0 comments on commit f69321c

Please sign in to comment.