class MockIQParallelExperimentHelper(exp_list, exp_helper_list)[source]

Helper for Parallel experiment.

Parallel Experiment Helper initializer. The class assumes exp_helper_list is ordered to match the corresponding experiment in exp_list.

Note that __init__() does not have iq_cluster_centers and iq_cluster_width as in MockIQExperimentHelper.__init__(). This is because the centers and widths for MockIQParallelBackend are stored in multiple experiment helpers in the list exp_helper_list.

  • exp_list (List) – List of experiments.

  • exp_helper_list (List) – Ordered list of MockIQExperimentHelper corresponding to the experiments in exp_list. Nested parallel experiment aren’t supported currently.

  • ValueError – Raised if the list are empty or if they don’t have the same length.

  • QiskitError – Raised if exp_helper_list contains an object of type MockIQParallelExperimentHelper, because the parallel mock backend currently does not support parallel sub-experiments.`.


Parallel experiment for Resonator Spectroscopy

To run a parallel experiment of Resonator Spectroscopy on two qubits we will create two instances of SpectroscopyHelper objects (for each experiment) and an instance of ParallelExperimentHelper with them.

iq_cluster_centers = [
    ((-1.0, 0.0), (1.0, 0.0)),
    ((0.0, -1.0), (0.0, 1.0)),
    ((3.0, 0.0), (5.0, 0.0)),

parallel_backend = MockIQParallelBackend(
parallel_backend._configuration.basis_gates = ["x"]
parallel_backend._configuration.timing_constraints = {"granularity": 16}

# experiment parameters
qubit1 = 0
qubit2 = 1
freq01 = parallel_backend.defaults().qubit_freq_est[qubit1]
freq02 = parallel_backend.defaults().qubit_freq_est[qubit2]

# experiments initialization
frequencies1 = np.linspace(freq01 - 10.0e6, freq01 + 10.0e6, 23)
frequencies2 = np.linspace(freq02 - 10.0e6, freq02 + 10.0e6, 21)

exp_list = [
    QubitSpectroscopy(qubit1, frequencies1),
    QubitSpectroscopy(qubit2, frequencies2),

exp_helper_list = [
parallel_helper = ParallelExperimentHelper(exp_list, exp_helper_list)

parallel_backend.experiment_helper = parallel_helper

# initializing the parallel experiment
par_experiment = ParallelExperiment(exp_list, backend=parallel_backend)
par_experiment.set_run_options(meas_level=MeasLevel.KERNELED, meas_return="single")

par_data =



The base cluster centers in the IQ plane.


The base cluster widths in the IQ plane.



Run the compute_probabilities for each helper.


circuits (List[QuantumCircuit]) – The quantum circuits for which the probabilities should be computed.


A list of dictionaries containing computed probabilities and data for the given


Return type:



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

Subclasses can override this function to modify the centers and widths of IQ clusters based on the circuits being simulated by a MockIQBackend. The base centers and widths are stored internally within the helper object, and can be set in __init__() or by modifying iq_cluster_centers and iq_cluster_width. The default behavior for iq_clusters() is to return the centers and widths unmodified for each circuit in circuits. Subclasses may return different centers and widths based on the circuits provided.

The returned list contains a tuple per circuit. Each tuple contains the IQ centers and widths in the same format as iq_cluster_centers and iq_cluster_width, passed as arguments to __init__(). The format of the centers and widths lists, in the argument list and in the returned tuples, must match the format of iq_cluster_centers and iq_cluster_width in qiskit_experiments.test.MockIQExperimentHelper.__init__().


circuits (List[QuantumCircuit]) – The quantum circuits for which the clusters should be modified.


A list of tuples containing the circuit-specific IQ centers and widths for the

provided circuits.

Return type:



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

This is needed, to test the resonator spectroscopy where the point in the IQ plane has a frequency-dependent phase rotation.

Return type: