Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

MockIQExperimentHelper

class MockIQExperimentHelper(iq_cluster_centers=None, iq_cluster_width=None)[source]

Abstract class for the MockIQ helper classes.

Different tests will use experiment specific helper classes which define the pattern of the IQ data that is then analyzed.

Create a MockIQBackend helper object to define how the backend functions.

iq_cluster_centers and iq_cluster_width define the base IQ cluster centers and standard deviations for each qubit in a MockIQBackend instance. These are used by iq_clusters() by default. Subclasses can override iq_clusters() to return a modified version of iq_cluster_centers and iq_cluster_width. iq_cluster_centers is a list of tuples. For a given qubit i_qbt and computational state i_state (either 0 or 1), the centers of the IQ clusters are found by indexing iq_cluster_centers as follows:

iq_center = helper.iq_cluster_centers[i_qbt][i_state]
center_inphase = iq_center[0]
center_quadrature = iq_center[1]

iq_cluster_width is indexed similarly except that there is only one width per qubit: i.e., the standard deviation of the IQ cluster for qubit i_qbt is

iq_width = helper.iq_cluster_width[i_qbt]

Subclasses must call super().__init__(iq_cluster_centers,iq_cluster_width) so that these properties are stored appropriately.

Parameters:
  • iq_cluster_centers (Optional[List[Tuple[Tuple[float, float], Tuple[float, float]]]]) – A list of tuples containing the clusters’ centers in the IQ plane. There are different centers for different logical values of the qubit. Defaults to a single qubit with clusters in quadrants 1 and 3.

  • iq_cluster_width (Optional[List[float]]) – A list of standard deviation values for the sampling of each qubit. Defaults to widths of 1.0 for each qubit in iq_cluster_centers.

Attributes

MockIQExperimentHelper.iq_cluster_centers

The base cluster centers in the IQ plane.

MockIQExperimentHelper.iq_cluster_width

The base cluster widths in the IQ plane.

Methods

MockIQExperimentHelper.compute_probabilities(...)

A function provided by the user which is used to determine the probability of each output of the circuit.

MockIQExperimentHelper.iq_clusters(circuits)

Returns circuit-specific IQ cluster centers and widths in the IQ plane.

MockIQExperimentHelper.iq_phase(circuits)

Sub-classes can override this method to introduce a phase in the IQ plane.