create_node

The Q-CTRL Experiment Scheduler is currently in alpha phase of development. Breaking changes may be introduced.

CalibrationGraph.create_node(calibration_function, dependencies=None, name=None, timeout=None, check_data_function=None)

Add a node to the calibration graph.

Parameters:
  • calibration_function (Callable[[CalibrationGraph], CalibrationStatus]) – The callable that runs the calibration. The exact form of this function can vary a lot depending on the architecture that the calibration will run on, so don’t assume anything about the function other than its input parameters and output return type.

  • dependencies (list[CalibrationNode] or None, optional) – A list of nodes that represent calibrations that this calibration depends on. They must belong to the same calibration as this node. These dependencies will be added to the graph in the alphabetical order by their names. Defaults to no dependencies.

  • name (str or None, optional) – The name of the node. Each node name has to be unique in a given graph. Defaults to None, in which case a random name is assigned to the node.

  • timeout (float or None, optional) – The time (in seconds) after which this calibration has to be redone, typically due to system drifts. If provided, must be grater than zero. Defaults to None, in which case the the node doesn’t time out.

  • check_data_function (Callable[[CalibrationGraph], CheckDataStatus] or None, optional) – The callable that runs the experiment to check data. This is an experiment to check if the calibration is capable of succeeding under the present conditions, and should be faster than a full calibration. The exact form of this form can vary depending on the architecture, so we don’t assume anything besides the input and output types. If not provided, the calibration function is used to check data, if it is safe to run it (that is, if all the dependencies are in SUCCESS status). If that is not the case, it fails.

Returns:

The object representing the node created by this method.

Return type:

CalibrationNode