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 Parameters as dictionaries of parameter–value pairs to create the parameter object used throughout the simulation:
from qruise.toolset import Parameters
ps = Parameters(
{
"d1": {"p1": value1, "p2": value2, ...},
"d2": {"p1": value3, "p2": value4, ...},
...
}
)
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
ps = Parameters(
{
"d1": {"a": 1.0, "w": 2.0, "p": 0.01},
"d2": {"a": 0.5, "w": 1.8, "p": -0.3},
}
)
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.
Parameter bounds for optimal control¶
For optimal control, each parameter is specified as a tuple containing its initial value and the optimisation bounds:
ps = Parameters(
{
"d1": {
"a": (1.0, 0.5, 2.0),
"w": (2.0, 1.5, 2.5),
"p": (0.01, -0.5, 0.5),
}
}
)
Each tuple has the form (value, lower_bound, upper_bound). During optimisation, the parameters are constrained to remain within these bounds.