Skip to content

laboneq_applications.experiments.resonator_spectroscopy

This module defines the resonator spectroscopy experiment.

In this experiment, we sweep the resonator frequency of a measure pulse to characterize the resonators coupled to the qubits.

The resonator spectroscopy experiment has the following pulse sequence:

qb --- [ measure ]

If multiple qubits are passed to the experiment_workflow, the above sequence is applied in parallel on all the qubits. Since this experiment sweeps the frequency of the hardware oscillator of the readout line, it can only be run in parallel on qubits whose measure lines use distinct QA channels.

create_experiment(qpu, qubits, frequencies, options=None)

Creates a Resonator Spectroscopy Experiment.

Changed in version 26.10.0

The qubit argument was renamed to qubits and now also accepts multiple qubits. The frequencies of multiple qubits are swept in parallel.

Parameters:

Name Type Description Default
qpu QPU

The qpu consisting of the original qubits and quantum operations.

required
qubits QuantumElements

The qubits to run the experiments on. May be either a single qubit or a list of qubits.

required
frequencies QubitSweepPoints

The resonator frequencies to sweep over for each qubit. If qubits is a single qubit, frequencies must be a list of numbers or an array. Otherwise it must be a list of lists of numbers or arrays. The frequencies of all the qubits must contain the same number of sweep points.

required
options ResonatorSpectroscopyExperimentOptions | None

The options for building the experiment. See ResonatorSpectroscopyExperimentOptions and BaseExperimentOptions for accepted options. Overwrites the options from BaseExperimentOptions.

None

Returns:

Name Type Description
experiment Experiment

The generated LabOne Q experiment instance to be compiled and executed.

Raises:

Type Description
ValueError

If the acquisition_type is neither AcquisitionType.SPECTROSCOPY nor AcquisitionType.INTEGRATION.

ValueError

If the frequencies of the qubits do not contain the same number of sweep points.

Example
options = {
    "count": 10,
    "spectroscopy_reset_delay": 3e-6,
}
options = ResonatorSpectroscopyExperimentOptions(**options)
# QPU from a single-qubit device setup
qpu = QPU(
    quantum_elements=TunableTransmonQubit.from_device_setup(setup),
    quantum_operations=TunableTransmonOperations(),
)
q0 = qpu["q0"]
create_experiment(
    qpu=qpu,
    qubits=q0,
    frequencies=np.linspace(7.1e9, 7.6e9, 501),
    options=options,
)

evaluate_experiment(analysis_results, qubits, evaluation_parameters=None)

Evaluates the resonator spectroscopy analysis workflow result.

Changed in version 26.10.0

The qubit argument was renamed to qubits and now also accepts multiple qubits.

Parameters:

Name Type Description Default
analysis_results WorkflowResult

The analysis workflow results.

required
qubits QuantumElements

The qubits to run the experiments on. May be either a single qubit or a list of qubits.

required
evaluation_parameters dict[str, Any] | None

The evaluation parameters.

None

Returns:

Type Description
dict[str, dict[str, bool]]

The evaluation flags.

experiment_workflow(session, qpu, qubits=None, *, frequencies, qubit=None, evaluation_parameters=None, temporary_parameters=None, options=None)

The Resonator Spectroscopy Workflow.

The workflow consists of the following steps:

Deprecated in version 26.10.0

The qubit argument is deprecated. Please use qubits instead.

Changed in version 26.10.0

The qubit argument was renamed to qubits and now also accepts multiple qubits, passed as a list of UIDs. The frequencies of multiple qubits are swept in parallel, which is only possible if the measure lines of the qubits use distinct QA channels.

Removed in version 26.7.0

The qubit argument of type QuantumElement has been removed. Please pass qubit of type str instead, i.e., the quantum element UID instead of the quantum element instance.

Changed in version 26.4.0

The evaluation_parameters argument has been added, which is the dictionary of parameters used for the newly added evaluation task. All arguments apart from session, qpu, and qubits are now keyword arguments.

Parameters:

Name Type Description Default
session Session

The connected session to use for running the experiment.

required
qpu QPU

The qpu consisting of the original qubits and quantum operations.

required
qubits list[str] | str | None

The qubits to run the experiments on, passed by UID. May be either a single qubit or a list of qubits. The measure lines of the qubits must use distinct QA channels, because this experiment sweeps the frequency of the hardware oscillator of the readout line, which is shared by all qubits multiplexed on the same QA channel.

None
frequencies QubitSweepPoints

The resonator frequencies to sweep over for the readout pulse (or CW) sent to the resonator of each qubit. If qubits is a single qubit, frequencies must be a list of numbers or an array. Otherwise it must be a list of lists of numbers or arrays.

required
evaluation_parameters dict[str, Any] | None

The dictionary of parameters used for the evaluation task. The default evaluation parameters are defined in the evaluate_experiment task.

None
temporary_parameters dict[str | tuple[str, str, str], dict | QuantumParameters] | None

The temporary parameters with which to update the quantum elements and topology edges. For quantum elements, the dictionary key is the quantum element UID. For topology edges, the dictionary key is the edge tuple (tag, source node UID, target node UID).

None
qubit str | None

Deprecated. The single qubit to run on, passed by UID for the experiment workflows (quantum element for the analysis). Use qubits instead.

None
options TuneUpWorkflowOptions | None

The options for building the workflow. In addition to options from WorkflowOptions, the following custom options are supported:

  • create_experiment: The options for creating the experiment.
None

Returns:

Name Type Description
result None

The result of the workflow.

Example
options = experiment_workflow.options()
options.count(10)
# QPU from a single-qubit device setup
qpu = QPU(
    quantum_elements=TunableTransmonQubit.from_device_setup(setup),
    quantum_operations=TunableTransmonOperations(),
)
result = experiment_workflow(
    session=session,
    qpu=qpu,
    qubits="q0",
    frequencies=np.linspace(7.1e9, 7.6e9, 501),
    options=options,
).run()