Parameters¶
Station parameter aliases, virtual gates, and parameters that drive several
instrument channels together. Importing qanary also enables arithmetic
between QCoDeS Parameter objects; the derived parameter reads its operands
lazily.
- class qanary.parameters.ParameterMixin(param, name=None, label=None, param_type='gate')[source]¶
Bases:
objectAlias an existing QCoDeS parameter for station metadata.
The returned object keeps the original parameter class and state while optionally replacing its short name and label.
- class qanary.parameters.VirtualGate(gates, factors=None, offsets=None, rot_angle_deg=None, points=None, name=None, label=None, param_type='virtual_gate_linear', **kwargs)[source]¶
Bases:
ParameterLinear virtual coordinate composed from parameters on one instrument.
Create a virtual gate from coefficients, a rotation, or two points.
Setting virtual value
vwritesfactor * v + offsetto each underlying gate. Reading returns a tuple containing every physical gate value.- Parameters:
gates (list[Parameter]) – Underlying gate parameters. They must share one root instrument.
rot_angle_deg (float | None) – For exactly two gates, replace factors with the unit vector at this counter-clockwise angle and set both offsets to zero.
points (list[tuple[float, float]]) – For exactly two gates, use the first point as the offset and the normalized direction to the second point as the factors. This takes precedence when supplied together with a rotation.
name (str | None) – QCoDeS parameter name. Generated from gate names when omitted.
label (str | None) – Display label. Generated from gate names when omitted.
param_type (str) – Snapshot category. Defaults to
"virtual_gate_linear".**kwargs – Additional keyword arguments passed to QCoDeS
Parameter.
- Raises:
ValueError – If coefficient lengths differ from the gate count, a two-dimensional definition does not receive exactly two gates, the two points coincide, or gates have different roots.
- class qanary.parameters.MultiChannelParameter(param, name=None, label=None, param_type='gates', **kwargs)[source]¶
Bases:
ParameterExpose several channels on one instrument as a single parameter.
Create a parameter that writes the same value to every channel.
- Parameters:
param (Sequence[Parameter]) – One or more channels sharing a root instrument.
name (str) – Optional parameter name generated from channel names when omitted.
label (str) – Optional label generated from channel labels when omitted.
param_type (str) – Snapshot category. Defaults to
"gates".**kwargs – Additional keyword arguments passed to QCoDeS
Parameter.
- Raises:
ValueError – If no channels are supplied or their root instruments differ.