Skip to content

laboneq.core

laboneq.core.types.compiled_experiment

CompiledExperiment dataclass

Data structure to store the output of the compiler.

Attributes:

Name Type Description
device_setup DeviceSetup

The device setup the experiment was compiled for.

experiment Experiment

The (uncompiled) experiment.

experiment_dict deprecated

Deprecated. A representation of the source experiment, using primitive Python datatypes only (dicts, lists, etc). Use .experiment instead.

scheduled_experiment internal

Internal. The internal representation of the compiled experiment. Available for debugging but subject to change in any LabOne Q release.

Deprecated in version 2.14.0

The .experiment_dict attribute was deprecated in version 2.14.0. Use .experiment instead.

Changed in version 2.14.0

The .scheduled_experiment attribute was documented to be internal and subject to change.

command_tables: list[dict] property

A list of command tables used by Sequence C programs.

Deprecated in version 2.14.0

For debugging, use .scheduled_experiment.command_tables instead.

Command table entries define custom real-time operations for the compiled program. The details of command table entries are an implementation detail that may change.

Each element of the list is a dictionary with the keys:

  • seqc (str): The filename of one of the Sequence C programs.
  • ct (list): A list of command table entries. Each entry is a dictionary. The contents of the dictionary are an internal implementation detail.

estimated_runtime: float property

An estimation of the total runtime of the experiment in seconds.

DISCLAIMER: This estimation does not include any overhead from network, IO, or python runtime.

recipe: Recipe property

A part of the internal representation of the compiled experiment.

Deprecated in version 2.14.0

For debugging, use .scheduled_experiment.recipe instead.

schedule: None property

Deprecated. Previously returned the internal scheduling information used by the compiler to generate Sequencer C for the devices.

Deprecated in version 2.14.0

The schedule property returns None since version 2.14.0. For debugging, use .scheduled_experiment instead.

src: list[dict] property

The list of generated Sequencer C sources with one element for each sequencer core.

Deprecated in version 2.14.0

For debugging, use .scheduled_experiment.src instead.

Each element of the list is a dictionary with the keys:

  • filename (str): The filename of the generated source.
  • text (str): The generated source.

wave_indices: list[dict] property

A list of which waves are used by each Sequence C program.

Deprecated in version 2.14.0

For debugging, use .scheduled_experiment.wave_indices instead.

Each element of the list is a dictionary with the keys:

  • filename (str): The filename of one of the Sequence C programs.
  • value (dict): A mapping from the names of waves to pairs of (channel, type) where channel is an integer specifying the channel to play the wave samples on and type is either "float" or "complex" and specifies the type of the samples.

waves: dict[str, CodegenWaveform] property

The list of sampled pulses generated for use within the Sequencer C programs.

Deprecated in version 2.14.0

For debugging, use .scheduled_experiment.waves instead.

Each element of the list is a dictionary with the keys:

  • filename (str): The filename of the generated sample data.
  • samples (numpy.ndarray): A one dimensional numpy array containing the sample data which may be either float or complex.

load(filename) classmethod

Load a compiled experiment from a JSON file.

Parameters:

Name Type Description Default
filename str

The file to load the compiled experiment from.

required

replace_phase_increment(parameter, new_value)

Permanently replaces the phase increment driven by the specified parameter with the new value. Previous pulse data is lost.

Parameters:

Name Type Description Default
parameter str | Parameter

The Parameter to replace.

required
new_value int | float

Replacement value in radians

required

replace_pulse(pulse_uid, pulse_or_array)

Permanently replaces specific pulse with the new sample data in the compiled experiment. Previous pulse data is lost.

Parameters:

Name Type Description Default
pulse_uid str | Pulse

Pulse to replace, can be Pulse object or uid of the pulse

required
pulse_or_array ArrayLike | Pulse

Replacement pulse. May be a Pulse object or an array of values (see sampled_pulse_* from pulse_library)

required

save(filename)

Store a compiled experiment in a JSON file.

Parameters:

Name Type Description Default
filename str

The file to save the compiled experiment to.

required

laboneq.core.exceptions.laboneq_exception

LabOneQException

Bases: Exception

Base class for exceptions raised by LabOne Q.

Where appropriate, LabOne Q also raises built-in Python exceptions such as ValueError, TypeError and RuntimeError.