class ResonatorSpectroscopy(physical_qubits, backend=None, frequencies=None, absolute=True, **experiment_options)[source]#

An experiment to perform frequency spectroscopy of the readout resonator.


Some backends may not have the required functionality to properly support resonator spectroscopy experiments. The experiment may not work or the resulting resonance may not properly reflect the properties of the readout resonator.


This experiment does spectroscopy on the readout resonator. It applies the following circuit

  q: ┤M├
c: 1/═╩═

where a spectroscopy pulse is attached to the measurement instruction. An initial circuit can be added before the measurement by setting the initial_circuit experiment option. If set, the experiment applies the following circuit:

  q: ┤ initial_circuit ├┤M├
c: 1/════════════════════╩═

Side note 1: when doing readout resonator spectroscopy, each measured IQ point has a frequency dependent phase. Close to the resonance, the IQ points start rotating around in the IQ plan. This effect must be accounted for in the data processing to produce a meaningful signal. The default data processing workflow will therefore reduce the two- dimensional IQ data to one-dimensional data using the magnitude of each IQ point.

Side node 2: when running readout resonator spectroscopy in a parallel experiment the user will need to specify the memory slot to use. This can easily be done with the code shown below.

specs = []
for slot, qubit in enumerate(qubits):

exp = ParallelExperiment(specs, backend=backend2)

Analysis class reference


Experiment options

These options can be set by the set_experiment_options() method.

  • Defined in the class ResonatorSpectroscopy:

    • amp (float)

      Default value: 1
      The amplitude of the spectroscopy pulse. Defaults to 1 and must be between 0 and 1.
    • duration (float)

      Default value: 4.8e-07
      The duration in seconds of the spectroscopy pulse.
    • sigma (float)

      Default value: 6e-08
      The standard deviation of the spectroscopy pulse in seconds.
    • width (float)

      Default value: 3.6e-07
      The width of the flat-top part of the GaussianSquare pulse in seconds.
    • initial_circuit (QuantumCircuit)

      Default value: None
      A single-qubit initial circuit to run before the measurement/spectroscopy pulse. The circuit must contain only a single qubit and zero classical bits. If None, no circuit is appended before the measurement. Defaults to None.
    • memory_slot (int)

      Default value: 0
      The memory slot that the acquire instruction uses in the pulse schedule. The default value is 0. This argument allows the experiment to function in a ParallelExperiment.
  • Defined in the class BaseExperiment:

    • max_circuits (Optional[int])

      Default value: None
      The maximum number of circuits per job when running an experiment on a backend.


The resonator spectroscopy experiment can be run by doing:

qubit = 1
spec = ResonatorSpectroscopy([qubit], backend)
exp_data =

This will measure the resonator attached to qubit 1 and report the resonance frequency as well as the kappa, i.e. the line width, of the resonator.

See also

  • Superclass qiskit_experiments.library.characterization.spectroscopy.Spectroscopy


Initialize a resonator spectroscopy experiment.

A spectroscopy experiment run by setting the frequency of the readout drive. The parameters of the GaussianSquare spectroscopy pulse can be specified at run-time through the experiment options.

  • physical_qubits (Sequence[int]) – List containing the resonator on which to run readout spectroscopy.

  • backend (Backend | None) – Optional, the backend to run the experiment on.

  • frequencies (Iterable[float] | None) – The frequencies to scan in the experiment, in Hz. The default values range from -20 MHz to 20 MHz in 51 steps. If the absolute variable is set to True then a center frequency obtained from the backend’s defaults is added to each value of this range.

  • absolute (bool) – Boolean to specify if the frequencies are absolute or relative to the resonator frequency in the backend. The default value is True.

  • experiment_options – Key word arguments used to set the experiment options.


QiskitError – If no frequencies are given and absolute frequencies are desired and no backend is given or the backend does not have default measurement frequencies.



Return the analysis instance for the experiment


Return the backend for the experiment


Return the options for the experiment.


Return experiment type.


Return the number of qubits for the experiment.


Return the device qubits for the experiment.


Return options values for the experiment run() method.


Return the transpiler options for the run() method.



Create the circuit for the spectroscopy experiment.

The circuits are based on a GaussianSquare pulse and a frequency_shift instruction encapsulated in a measurement instruction.


The circuits that will run the spectroscopy experiment.

Return type:



Return the config dataclass for this experiment

Return type:



Return a copy of the experiment

Return type:


classmethod from_config(config)#

Initialize an experiment from experiment config

Return type:



Get information about job distribution for the experiment on a specific backend.


backend (Backend) – Optional, the backend for which to get job distribution information. If not specified, the experiment must already have a set backend.


A dictionary containing information about job distribution.

  • ”Total number of circuits in the experiment”: Total number of circuits in the experiment.

  • ”Maximum number of circuits per job”: Maximum number of circuits in one job based on backend and experiment settings.

  • ”Total number of jobs”: Number of jobs needed to run this experiment on the currently set backend.

Return type:



QiskitError – if backend is not specified.

run(backend=None, analysis='default', timeout=None, **run_options)#

Run an experiment and perform analysis.

  • backend (Backend | None) – Optional, the backend to run the experiment on. This will override any currently set backends for the single execution.

  • analysis (BaseAnalysis | None) – Optional, a custom analysis instance to use for performing analysis. If None analysis will not be run. If "default" the experiments analysis() instance will be used if it contains one.

  • timeout (float | None) – Time to wait for experiment jobs to finish running before cancelling.

  • run_options – backend runtime options used for circuit execution.


The experiment data object.


QiskitError – If experiment is run with an incompatible existing ExperimentData container.

Return type:



Set the experiment options.


fields – The fields to update the options


AttributeError – If the field passed in is not a supported options


Set options values for the experiment run() method.


fields – The fields to update the options

See also

The Setting options for your experiment guide for code example.


Set the transpiler options for run() method.


fields – The fields to update the options


QiskitError – If initial_layout is one of the fields.

See also

The Setting options for your experiment guide for code example.