plot_discriminator

qctrlvisualizer.plot_discriminator(discriminator: Any, axs=None, show_boundary: bool = False, show_fitting_data: bool = True, flag_misclassified: bool = False, qubits_to_plot: Optional[List[int]] = None, title: bool = True)Tuple

Creates plots for a specified discriminator.

Parameters
  • discriminator (Union[IQDiscriminationFitter, List[IQDiscriminationFitter]]) – A discriminator or list of discriminators.

  • axs (np.ndarray, optional) – Axes from a Matplotlib figure. Defaults to None.

  • show_boundary (bool, optional) – Whether to show decision boundary. Defaults to False.

  • show_fitting_data (bool, optional) – Whether to show data used to fit the discriminator. Defaults to True.

  • flag_misclassified (bool, optional) – Whether to plot misclassified points. Defaults to False.

  • qubits_to_plot (List[int], optional) – Which qubits to include. Defaults to None.

  • title (bool, optional) – Whether to include title in plots. Defaults to True.

Returns

A tuple containing the axes object used for the plot as well as the figure handle. The figure handle returned is None if and only if axs is passed.

Return type

Tuple[Union[List[axes], axes], figure]

Raises
  • ValueError – If qubit is not in the qubit_mask.

  • ValueError – If you don’t pass enough axes instances. Requires 1 per qubit.

  • ValueError – If show_boundary is True for multi-qubit cases.

  • ValueError – If expected state labels cannot be cast to floats.