Skip to content

laboneq_applications.experiments.drag_q_scaling

This module defines the DRAG quadrature-scaling calibration experiment.

In this experiment, we determine the quadrature scaling factor, beta, of a DRAG pulse, which is optimal for cancelling dynamics phase errors that occur during the application of the pulse. The DRAG drive pulse has the following form:

v(t) = i(t) + q(t),

where the quadrature component is give by the derivative of the in-phase component, scaled by a scaling factor beta:

q(t) = beta * d(i(t)) / d(t)

In order to determine the optimal beta for compensating phase errors, we apply a pulse sequence that is sensitive to phase errors and sweep the value of beta for all the drive pulses in the sequence. In the experiment workflow defined in this file, we refer to the beta parameter as a q-scaling.

The DRAG quadrature-scaling calibration experiment has the following pulse sequence:

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

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

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

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

Creates a DRAG quadrature-scaling calibration 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
q_scalings QubitSweepPoints

The DRAG quadrature scaling factors to sweep over for each qubit (see docstring at the top of the module). If qubits is a single qubit, q_scalings must be a list of numbers or an array. Otherwise it must be a list of lists of numbers or arrays.

required
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 qubits and q_scalings are not of the same length.

ValueError

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

ValueError

If q_scalings is not a list of lists of numbers.

ValueError

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

Example
options = TuneupExperimentOptions()
options.count(10)
options.transition("ge")
qpu = QPU(
    qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
    quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
create_experiment(
    qpu=qpu,
    qubits=temp_qubits,
    q_scalings=[
        np.linspace(-0.05, 0.05, 11),
        np.linspace(-0.05, 0.05, 11),
    ],
    options=options,
)

experiment_workflow(session, qpu, qubits, q_scalings, temporary_parameters=None, options=None)

The DRAG quadrature-scaling calibration 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
q_scalings QubitSweepPoints

The DRAG quadrature scaling factors to sweep over for each qubit (see docstring at the top of the module). If qubits is a single qubit, q_scalings must be a list of numbers or an array. Otherwise it must be a list of lists of numbers or arrays.

required
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
WorkflowBuilder None

The builder of the experiment workflow.

Example
options = experiment_workflow()
options.count(10)
options.transition("ge")
qpu = QPU(
    qubits=[TunableTransmonQubit("q0"), TunableTransmonQubit("q1")],
    quantum_operations=TunableTransmonOperations(),
)
temp_qubits = qpu.copy_qubits()
result = experiment_workflow(
    session=session,
    qpu=qpu,
    qubits=temp_qubits,
    q_scalings=[
        np.linspace(-0.05, 0.05, 11),
        np.linspace(-0.04, 0.04, 11),
    ],
    options=options,
).run()