ResonatorSpectroscopy

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

An experiment to perform frequency spectroscopy of the readout resonator.

Warning

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.

Overview

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

     ┌─┐
  q: ┤M├
     └╥┘
c: 1/═╩═
      0

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/════════════════════╩═
                         0

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):
    specs.append(ResonatorSpectroscopy(
        physical_qubits=[qubit],
        backend=backend2,
        memory_slot=slot,
    ))

exp = ParallelExperiment(specs, backend=backend2)

Analysis class reference

ResonatorSpectroscopyAnalysis

Experiment options

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

Options
  • 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.

Example

The resonator spectroscopy experiment can be run by doing:

qubit = 1
spec = ResonatorSpectroscopy([qubit], backend)
exp_data = spec.run().block_for_results()
exp_data.figure(0)

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

Initialization

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.

Parameters:
  • 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.

Raises:

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.

Attributes

analysis

Return the analysis instance for the experiment

backend

Return the backend for the experiment

experiment_options

Return the options for the experiment.

experiment_type

Return experiment type.

num_qubits

Return the number of qubits for the experiment.

physical_qubits

Return the device qubits for the experiment.

run_options

Return options values for the experiment run() method.

transpile_options

Return the transpiler options for the run() method.

Methods

circuits()[source]

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.

Returns:

The circuits that will run the spectroscopy experiment.

Return type:

circuits

config()

Return the config dataclass for this experiment

Return type:

ExperimentConfig

copy()

Return a copy of the experiment

Return type:

BaseExperiment

classmethod from_config(config)

Initialize an experiment from experiment config

Return type:

BaseExperiment

job_info(backend=None)

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

Parameters:

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

Returns:

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:

dict

Raises:

QiskitError – if backend is not specified.

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

Run an experiment and perform analysis.

Parameters:
  • backend (Backend | None) – Optional, the backend to run on. Will override existing backend settings.

  • sampler (BaseSamplerV2 | None) – Optional, the sampler to run the experiment on. If None then a sampler will be invoked from previously set backend

  • 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.

  • backend_run (bool | None) – Use backend run (temp option for testing)

  • run_options – backend runtime options used for circuit execution.

Returns:

The experiment data object.

Raises:

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

Return type:

ExperimentData

set_experiment_options(**fields)[source]

Set the experiment options.

Parameters:

fields – The fields to update the options

Raises:

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

set_run_options(**fields)

Set options values for the experiment run() method.

Parameters:

fields – The fields to update the options

See also

The Setting options for your experiment guide for code example.

set_transpile_options(**fields)

Set the transpiler options for run() method.

Parameters:

fields – The fields to update the options

Raises:

QiskitError – If initial_layout is one of the fields.

See also

The Setting options for your experiment guide for code example.