---
title: visualization (latest version)
description: API reference for qiskit_addon_slc.visualization in the latest version of qiskit-addon-slc
source: https://quantum.cloud.ibm.com/docs/en/api/qiskit-addon-slc/visualization
---

# Visualization Tools

`qiskit_addon_slc.visualization`

Visualization methods for shaded lightcones.

This module provides visualization methods for shaded lightcones.

### draw\_shaded\_lightcone

`draw_shaded_lightcone(circuit, bounds, noise_model_paulis, *, pauli_filter=None, include_empty_boxes=True, **rendering_kwargs)`

[GitHub](https://github.com/Qiskit/qiskit-addon-slc/tree/main/qiskit_addon_slc/visualization/__init__.py#L44-L76)

Draws a shaded lightcone.

First, the provided `bounds` are accumulated and filtered according to `pauli_filter`. See also [`accumulate_filtered_bounds()`](#qiskit_addon_slc.visualization.accumulate_filtered_bounds "qiskit_addon_slc.visualization.accumulate_filtered_bounds"). Then, the resulting bounds are overlaid onto the provided `circuit` (see [`overlay_bounds_onto_circuit()`](#qiskit_addon_slc.visualization.overlay_bounds_onto_circuit "qiskit_addon_slc.visualization.overlay_bounds_onto_circuit")) and subsequently rendered (see [`render_bounds()`](#qiskit_addon_slc.visualization.render_bounds "qiskit_addon_slc.visualization.render_bounds")).

**Parameters**

- **circuit** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – the circuit whose shaded lightcone to draw.
- **bounds** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*,* [*PauliLindbladMap*](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap)*]*) – the bounds to use for the shaded lightcone.
- **noise\_model\_paulis** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*,* [*QubitSparsePauliList*](/docs/api/qiskit/qiskit.quantum_info.QubitSparsePauliList)*]*) – the Pauli error terms of the circuit’s noise models.
- **pauli\_filter** ([*Pauli*](/docs/api/qiskit/qiskit.quantum_info.Pauli)  *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – the optional Pauli type by which the bounds were filtered.
- **include\_empty\_boxes** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – whether to include empty boxes or not.
- **rendering\_kwargs** – any additional keyword arguments are forwarded to `QuantumCircuit.draw()`.

**Returns**

The `mpl` figure.

**Return type**

*Figure*

### accumulate\_filtered\_bounds

`accumulate_filtered_bounds(circuit, bounds, noise_model_paulis, pauli_filter=None)`

[GitHub](https://github.com/Qiskit/qiskit-addon-slc/tree/main/qiskit_addon_slc/visualization/accumulate_filtered_bounds.py#L31-L98)

Accumulates the bound values filtered by a specified Pauli type.

**Parameters**

- **circuit** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – the circuit whose bounds to accumulate.
- **bounds** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*,* [*PauliLindbladMap*](/docs/api/qiskit/qiskit.quantum_info.PauliLindbladMap)*]*) – the bounds whose values to accumulate.
- **noise\_model\_paulis** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*,* [*QubitSparsePauliList*](/docs/api/qiskit/qiskit.quantum_info.QubitSparsePauliList)*]*) – the Pauli noise terms for each noise model.
- **pauli\_filter** ([*Pauli*](/docs/api/qiskit/qiskit.quantum_info.Pauli)  *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – the optional Pauli type to filter by. It behaves as follows: - `None`: accumulates all noise term bounds of equal support. - `int`: only accumulates noise term bounds of the specified Pauli weight. - `str`: selects this specific Pauli noise term. - `Pauli`: selects this specific Pauli noise term.

**Returns**

A nested dictionary. The outer most key is the `InjectNoise.modifier_ref` (same as the original `bounds`). The next key is the support of the accumulated and filtered bound value (i.e. a tuple of integers). This maps to the actual bound value as a float.

**Return type**

[dict](https://docs.python.org/3/library/stdtypes.html#dict)\[[str](https://docs.python.org/3/library/stdtypes.html#str), [dict](https://docs.python.org/3/library/stdtypes.html#dict)\[[tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[int](https://docs.python.org/3/library/functions.html#int), …], [float](https://docs.python.org/3/library/functions.html#float)]]

### overlay\_bounds\_onto\_circuit

`overlay_bounds_onto_circuit(pauli_bounds, circuit, *, include_empty_boxes=True)`

[GitHub](https://github.com/Qiskit/qiskit-addon-slc/tree/main/qiskit_addon_slc/visualization/overlay_bounds.py#L31-L79)

Overlays the bounds onto the circuit.

This produces a new “QuantumCircuit” with “fake” gates reproducing those `BoxOp` instructions from the original `circuit` that had an `InjectNoise` annotation. Those boxes are replaced by visual representations of the computed bounds for Pauli errors of their respective support (see also [`accumulate_filtered_bounds()`](#qiskit_addon_slc.visualization.accumulate_filtered_bounds "qiskit_addon_slc.visualization.accumulate_filtered_bounds")).

**Parameters**

- **pauli\_bounds** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*,* [*dict*](https://docs.python.org/3/library/stdtypes.html#dict)*\[*[*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*, ...],* [*float*](https://docs.python.org/3/library/functions.html#float)*]]*) – the accumulated and filtered bounds.
- **circuit** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – the circuit on which to overlay the bounds.
- **include\_empty\_boxes** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – whether to include empty boxes or not.

**Returns**

A “fake” quantum circuit with “Gate” instructions displaying the computed bound values. The returned quantum circuit’s `QuantumCircuit.metadata` contains the maximum bound value under “max\_bound”.

**Return type**

[*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)

### render\_bounds

`render_bounds(bounds_circuit, *, pauli_filter=None, **kwargs)`

[GitHub](https://github.com/Qiskit/qiskit-addon-slc/tree/main/qiskit_addon_slc/visualization/render_bounds.py#L31-L80)

Renders a quantum circuit with overlaid bounds and according styling.

**Parameters**

- **bounds\_circuit** ([*QuantumCircuit*](/docs/api/qiskit/qiskit.circuit.QuantumCircuit)) – the quantum circuit with overlaid bounds. See also [`overlay_bounds_onto_circuit()`](#qiskit_addon_slc.visualization.overlay_bounds_onto_circuit "qiskit_addon_slc.visualization.overlay_bounds_onto_circuit").
- **pauli\_filter** ([*Pauli*](/docs/api/qiskit/qiskit.quantum_info.Pauli)  *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – the optional Pauli type by which the bounds were filtered. This will be indicated in the produced figure’s title.
- **kwargs** – any additional keyword arguments are forwarded to `QuantumCircuit.draw()`.

**Returns**

The `mpl` figure.

**Return type**

*Figure*
