iqm.error_reduction_tools.readout_characterization.visualization.plot_covariance_in_topology

iqm.error_reduction_tools.readout_characterization.visualization.plot_covariance_in_topology#

iqm.error_reduction_tools.readout_characterization.visualization.plot_covariance_in_topology(covariance_data, topology, qubits_to_plot=None, thresholds=None, vmax=None, show_plot=True)#

Generate topology-based correlation plots for all error types.

Wrapper around visualize_qubit_correlations_on_grid() that creates one plot per error category from covariance analysis functions. Designed to accept direct outputs from compute_*_covariance functions.

Parameters:
  • covariance_data (SingleCovarianceData | StateCovarianceData) – Obtained from the compute_*_covariance functions.

  • topology (QPUTopology) – QPU topology for qubit positioning. Use topology_from_qc() to obtain a fully-populated instance from a connected quantum computer.

  • qubits_to_plot (list[str] | None) – Optional list of qubit labels to visualize. If None, uses measured_qubits from covariance_data.

  • thresholds (tuple[float, float] | None) – Optional (upper, lower) correlation thresholds for edge filtering.

  • vmax (float | None) – Colormap saturation value for correlation strength.

  • show_plot (bool) – If True, displays all plots. If False, returns Figure list.

Returns:

Matplotlib figures if show_plot=False, otherwise None.

Return type:

list[Figure] | None

Example

>>> corr, labels, qubits = compute_double_twirled_covariance(data)
>>> topology = topology_from_qc(client)
>>> plot_covariance_in_topology(corr, labels, qubits, topology=topology, vmax=0.005)
# Displays 3 topology plots (one per syndrome type)