Skip to content

laboneq_applications.experiments.ramsey

This module defines the Ramsey experiment.

In this experiment, we sweep the wait time between two x90 pulses on a given qubit transition in order to determine the T2 time of the qubit.

The Ramsey experiment has the following pulse sequence:

qb --- [ prep transition ] --- [ x90_transition ] --- [ delay ] ---
[ x90_transition ] --- [ measure ]

The second x90 pulse has a delay dependent phase that generates an oscillation of the qubit population at the frequency detuning.

If multiple qubits are passed to the run workflow, the above pulses are applied in parallel on all the qubits.

create_experiment(qpu, qubits, delays, detunings=None, options=None)

Creates a Ramsey Experiment.

Parameters:

Name Type Description Default
qpu QPU

The qpu consisting of the original qubits and quantum operations.

required
qubits Qubits

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

required
delays QubitSweepPoints

The delays (in seconds) of the second x90 pulse to sweep over for each qubit. If qubits is a single qubit, delays must be a list of numbers or an array. Otherwise, it must be a list of lists of numbers or arrays.

required
detunings float | Sequence[float] | None

The detuning in Hz introduced in order to generate oscillations of the qubit state vector around the Bloch sphere. This detuning and the frequency of the fitted oscillations is used to calculate the true qubit resonance frequency. detunings is a list of float values for each qubit following the order in qubits.

None
options TuneupExperimentOptions | None

The options for building the experiment. See [TuneupExperimentOptions] and [BaseExperimentOptions] for accepted options. Overwrites the options from [TuneupExperimentOptions] and [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 lengths of qubits and delays do not match.

ValueError

If delays is not a list of numbers when a single qubit is passed.

ValueError

If delays is not a list of lists of numbers when a list of qubits is passed.

ValueError

If the experiment uses calibration traces and the averaging mode is sequential.

Example
options = TuneupExperimentOptions()
qpu = QPU(
    qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
    quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
create_experiment(
    qpu=qpu,
    qubits=temp_qubits,
    delays=[
        np.linspace(0, 20e-6, 51),
        np.linspace(0, 30e-6, 52),
    ],
    detunings = [1e6, 1.346e6],
    options=options,
)

experiment_workflow(session, qpu, qubits, delays, detunings=None, temporary_parameters=None, options=None)

The Ramsey Workflow.

The workflow consists of the following steps:

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 Qubits

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

required
delays QubitSweepPoints

The delays (in seconds) of the second x90 pulse to sweep over for each qubit. If qubits is a single qubit, delays must be a list of numbers or an array. Otherwise, it must be a list of lists of numbers or arrays.

required
detunings float | Sequence[float] | None

The detuning in Hz to generate oscillating qubit occupations. detunings is a list of float values for each qubits following the order in qubits.

None
temporary_parameters dict[str, dict | TransmonParameters] | None

The temporary parameters to update the qubits with.

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.create_experiment.count(10)
options.create_experiment.transition("ge")
qpu = QPU(
    setup=DeviceSetup("my_device"),
    qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
    quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
result = experiment_workflow(
    session=session,
    qpu=qpu,
    qubits=temp_qubits,
    delays=[[0.1, 0.5, 1], [0.1, 0.5, 1]],
    detunings = {'q0':1e6,'q1':1.346e6},
    options=options,
).run()