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_centersandiq_cluster_widthdefine the base IQ cluster centers and standard deviations for each qubit in aMockIQBackendinstance. These are used byiq_clusters()by default. Subclasses can overrideiq_clusters()to return a modified version ofiq_cluster_centersandiq_cluster_width. iq_cluster_centers is a list of tuples. For a given qubiti_qbtand computational statei_state(either 0 or 1), the centers of the IQ clusters are found by indexingiq_cluster_centersas follows:iq_center = helper.iq_cluster_centers[i_qbt][i_state] center_inphase = iq_center[0] center_quadrature = iq_center[1]
iq_cluster_widthis indexed similarly except that there is only one width per qubit: i.e., the standard deviation of the IQ cluster for qubiti_qbtisiq_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
The base cluster centers in the IQ plane.
The base cluster widths in the IQ plane.
Methods
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.