Parametric provides a device-control framework for the other libraries in LabAPI, offering a standardized syntax for connecting to and communicating with experiments. Similar frameworks exist, notably QCoDeS, and the syntax here has been designed to allow compatibility.
A physical quantity or a knob on a device is represented by a Parameter:
from parametric import Parameter
x = Parameter('x')The parameter can be called to get or set its state:
x(3)
print(x())
>>> 3By default, the state is represented only internally. You can pass functions to the get_cmd and set_cmd arguments of the Parameter constructor to connect the class to your device drivers:
y = Parameter('y', get_cmd=measure_voltage, set_cmd=set_voltage)The Parameter class supports mathematical operations transparently:
voltage = Parameter('voltage', 1)
resistance = 50
power = voltage**2/resistance
print(power)
>> 0.02Parametric can also be used in conjunction with the Optimistic library to effortlessly optimize multiparameter experiments or simulations.