LinearIQDiscriminator

class LinearIQDiscriminator(cal_results, qubit_mask, expected_states=None, standardize=False, schedules=None, discriminator_parameters=None)[source]

Linear discriminant analysis discriminator for IQ data.

Parameters
  • cal_results (Union[Result, List[Result]]) – calibration results, Result or list of Result used to fit the discriminator.

  • qubit_mask (List[int]) – determines which qubit’s level 1 data to use in the discrimination process.

  • expected_states (List[str]) – a list that should have the same length as schedules. All results in cal_results are used if schedules is None. expected_states must have the corresponding length.

  • standardize (bool) – if true the discriminator will standardize the xdata using the internal method _scale_data.

  • schedules (Union[List[str], List[Schedule]]) – The schedules or a subset of schedules in cal_results used to train the discriminator. The user may also pass the name of the schedules instead of the schedules. If schedules is None, then all the schedules in cal_results are used.

  • discriminator_parameters (dict) – parameters for Sklearn’s LDA.

Attributes

LinearIQDiscriminator.expected_states

Returns the expected states used to train the discriminator.

LinearIQDiscriminator.fitted

True if the discriminator has been fitted to calibration data.

LinearIQDiscriminator.schedules

Returns the schedules with which the discriminator was fitted.

Methods

LinearIQDiscriminator.add_data(result, …)

type result

Result

LinearIQDiscriminator.discriminate(x_data)

Applies the discriminator to x_data.

LinearIQDiscriminator.fit()

Fits the discriminator using self._xdata and self._ydata.

LinearIQDiscriminator.format_iq_data(iq_data)

Takes IQ data obtained from get_memory(), applies the qubit mask and formats the data as a list of lists.

LinearIQDiscriminator.get_xdata(results, …)

Retrieves feature data (xdata) for the discriminator.

LinearIQDiscriminator.get_ydata(results, …)

Retrieves the expected states (ydata) for the discriminator.

LinearIQDiscriminator.is_calibration(result_name)

Identify if a name corresponds to a calibration name identified by the regex pattern self._cal_pattern.

LinearIQDiscriminator.plot([axs, …])

Creates a plot of the data used to fit the discriminator.

LinearIQDiscriminator.plot_xdata(axs, results)

Add the relevant IQ data from the Qiskit Result, or list thereof, to the given axes as a scatter plot.