Your first experiment

Write, parameterise and run an experiment in simulation mode.

A minimal experiment

Put this file under the project’s experiments/ directory. Quatm discovers experiment classes from that tree.

from quatm.experiment import Experiment


class FirstExperiment(Experiment):
    def build(self):
        self.duration = self.NumberValue(100.0, unit='ms')
        self.enabled = self.BoolValue(True)
        self.phase = self.StringCombo('A', options=['A', 'B'])

    def run(self):
        if not self.enabled:
            return
        self.delay(self.duration)

build() is called once per experiment instance and declares the parameter panel. run() is called once per repetition.

Parameter types

TypePurpose
NumberValuenumeric value with optional unit, limits and step
BoolValueboolean toggle
StringComboselection from a fixed list
setattr_deviceregister an instrument for this experiment

Run it

  1. Open the Experiment Browser.
  2. Select FirstExperiment.py.
  3. Set duration and enabled in the parameter panel.
  4. Press Run.
  5. Watch the task in the Task Monitor; the Browser shows progress and results.

In simulation mode the run completes without hardware. Data, parameters and task metadata are archived to HDF5 under Data/.

Scans and repetitions

Use the browser’s scan controls to vary a parameter, set the number of repetitions, or submit a multi-dimensional scan. The framework expands the scan into individual runs and records the scan definition alongside the data.

Where to go next