qiskit-documentation/docs/api/qiskit-ibm-runtime/0.35/visualization-draw-layer-er...

48 lines
3.5 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: draw_layer_errors_swarm (v0.35)
description: API reference for qiskit_ibm_runtime.visualization.draw_layer_errors_swarm in qiskit-ibm-runtime v0.35
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit_ibm_runtime.visualization.draw_layer_errors_swarm
---
<span id="qiskit-ibm-runtime-visualization-draw-layer-errors-swarm" />
# qiskit\_ibm\_runtime.visualization.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/stable/0.35/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*](utils-noise-learner-result-layer-error "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, 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**
PlotlyFigure
</Function>