build_platform

qililab.build_platform(runcard, new_drivers=False)

Builds a Platform object, given a runcard.

Such runcard can be passed in one of the following two ways:
  • a path to a YAML file containing a dictionary of the serialized platform (runcard).

  • directly a dictionary of the serialized platform (runcard).


The dictionary should follow the next structure:

{
    "name": name,  # str
    "gates_settings": gates_settings,  # dict
    "chip": chip,  # dict
    "buses": buses,  # list[dict]
    "instruments": instruments,  # list[dict]
    "instrument_controllers": instrument_controllers,  # list[dict]
}

which contains the information the Platform class uses to connect, setup and control the actual chip, buses and instruments of the laboratory.

Note

You can find more information about the complete structure of such dictionary, in the Runcards section of the documentation.

Parameters:
  • runcard (str | dict) – Path to the platform’s runcard YAML file, or direct dictionary of the platform’s runcard info.

  • new_drivers (bool, optional) – Whether to use the new drivers or not. Defaults to False.

Returns:

Platform object.

Return type:

Platform

Examples

Passing the path of a YAML file containing a dictionary of the serialized platform, in the runcard argument:

>>> platform = ql.build_platform(runcard="runcards/galadriel.yml")
>>> platform.name
galadriel

Passing a dictionary of the serialized platform, in the runcard argument:

>>> platform = ql.build_platform(runcard=galadriel_dict)
>>> platform.name
galadriel