Skip to content

Parameter spaces

To simplify simulations, QruiseML groups drive parameters into a single parameter space. Drive channels are then used to keep track of which parameters belong to which drive, allowing multiple drives to reuse the same parameter names without conflicts.

Defining a parameter space

Drive channels and their associated parameters are passed to get_param_space as dictionaries of parameter–value pairs. The resulting parameter space is then passed to Parameters to create the parameter object used throughout the simulation:

from qruise.toolset import get_param_space, Parameters

ps = get_param_space(
    {
        "d1": {"p1": value1, "p2": value2, ...},
        "d2": {"p1": value3, "p2": value4, ...},
        ...
    }
)

ps = Parameters(*ps)

Here, the outer dictionary defines the drive channels, while the inner dictionaries define the parameters associated with each channel.

Let's assume we have a sinusoidal drive function and we want to create two drives with the same parameter names (a, w, p) but different parameter values. We can define two drive channels ("d1" and "d2") like so:

from qruise.toolset import Parameters, get_param_space

ps = get_param_space(
    {
        "d1": {"a": 1.0, "w": 2.0, "p": 0.01},
        "d2": {"a": 0.5, "w": 1.8, "p": -0.3},
    }
)

ps = Parameters(*ps)

The channel names are used to distinguish parameters with the same name: internally, the parameters become d1_a, d1_w, d1_p, d2_a, d2_w, and d2_p.

Defining drive functions

See our Drives building block page to learn how to define drive functions and associate them with channels.