LayerError
class LayerError(circuit, qubits, error=None)
The error channel (in Pauli-Lindblad format) of a single layer of instructions.
Parameters
- circuit (
QuantumCircuit
) – A circuit whose noise has been learnt. - qubits (
Sequence
[int
]) – The labels of the qubits in thecircuit
. - error (
Optional
[PauliLindbladError
]) – The Pauli Lindblad error channel affecting thecircuit
, orNone
if the error channel is either unknown or explicitly disabled.
Raises
ValueError – If circuit
, qubits
, and error
have mismatching number of qubits.
Attributes
circuit
error
The error channel in this LayerError
, or None
if the error channel is either unknown or explicitly disabled.
Return type
Optional
[PauliLindbladError
]
generators
(DEPRECATED) The Pauli Lindblad generators of the error channel in this LayerError
.
Return type
num_qubits
qubits
The qubits in this LayerError
.
Return type
list
[int
]
rates
(DEPRECATED) The Lindblad generator rates of the error channel in this LayerError
.
Return type
Methods
draw_map
draw_map(embedding, colorscale='Bluered', color_no_data='lightgray', color_out_of_scale='lightgreen', num_edge_segments=16, edge_width=4, height=500, highest_rate=None, background_color='white', radius=0.25, width=800)
Draw a map view of a this layer error.
Parameters
-
embedding (
Union
[Embedding
,BackendV2
]) – AnEmbedding
object containing the coordinates and coupling map to draw the layer error on, or a backend to generate anEmbedding
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 thanhighest_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. IfNone
, it defaults to the highest value found in thelayer_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)
Return type
Figure