stanza.device
Module Contents
Classes
API
Interface for controlling quantum devices through voltage sweeps and current measurements.
The Device class provides a high-level abstraction for interacting with quantum devices by coordinating between control instruments (for setting voltages) and measurement instruments (for reading currents). It supports various sweep patterns (1D, 2D, N-dimensional) and manages the mapping between logical pad names and physical instrument channels.
The class distinguishes between different pad types (gates vs contacts) and electrode types (e.g., BARRIER, PLUNGER for gates; SOURCE, DRAIN for contacts), providing convenient properties and methods for filtering and accessing specific electrodes based on their characteristics.
List of all gate pad names in the device.
List of all contact pad names in the device.
List of gate pads that have a control channel configured.
List of contact pads that have a control channel configured.
List of gate pads that have a measurement channel configured.
List of contact pads that have a measurement channel configured.
Get the gate electrodes of a given type.
Filters all gate channels in the device to return only those matching the specified gate type (e.g., BARRIER, PLUNGER, SCREENING).
Parameters:
The type of gate electrodes to retrieve. Can be provided
Returns:
List of gate electrode names matching the specified type. Returns an empty list if no gates of the specified type are found.
Get the contact electrodes of a given type.
Filters all contact channels in the device to return only those matching the specified contact type (e.g., SOURCE, DRAIN, RESERVOIR).
Parameters:
The type of contact electrodes to retrieve. Can be
Returns:
List of contact electrode names matching the specified type. Returns an empty list if no contacts of the specified type are found.
Check if both instruments are configured.
Verifies that the device has both a control instrument (for setting voltages) and a measurement instrument (for reading currents) properly configured and available for use.
Returns:
True if both control_instrument and measurement_instrument are not None, False otherwise.
Set the voltage of a single gate
Set the voltages of the device.
Parameters:
A dictionary of pads and their voltages.
Whether to wait for the device to settle after setting the voltages.
Raises:
DeviceError: If the control instrument is not configured.
Measure the current of a single gate
Measure the current of the device.
Performs current measurement on one or more pads using the measurement instrument. For multiple pads, attempts to use the instrument’s batch measurement capability if available, otherwise measures sequentially.
Parameters:
Either a single pad name or a list of pad names to measure.
Returns:
If a single pad name is provided, returns a single float current value. If a list of pad names is provided, returns a list of float current values corresponding to each pad in the input list.
Raises:
DeviceError: If the measurement instrument is not configured, if a specified pad is not found in channel configs, or if a pad has no measure channel configured.
Check the current voltage of a single gate electrode.
Check the current voltage of the device.
Reads the current voltage setting from one or more pads using the control instrument. This returns the voltage that the control instrument believes it has set, not a measured value from the device itself.
Parameters:
Either a single pad name or a list of pad names to check.
Returns:
If a single pad name is provided, returns a single float voltage value. If a list of pad names is provided, returns a list of float voltage values corresponding to each pad in the input list.
Raises:
DeviceError: If the control instrument is not configured, if a specified pad is not found in channel configs, or if a pad has no control channel configured.
Sweep a single gate electrode and measure the current of a single contact electrode.
Performs a 1D voltage sweep by stepping through a list of voltages on a specified gate electrode while measuring the current through a contact electrode at each step. Optionally logs the sweep data to a session.
Parameters:
Name of the gate electrode to sweep
List of voltage values to apply to the gate electrode
Name of the contact electrode to measure current from
Optional LoggerSession to log the sweep data. If provided,
Returns:
Tuple of (voltage_measurements, current_measurements) where:
- voltage_measurements: List of actual voltages read from the gate
- current_measurements: List of measured current values at each voltage
Sweep two gate electrodes and measure the current of a single contact electrode.
Performs a 2D voltage sweep by iterating through all combinations of voltages on two gate electrodes while measuring current through a contact electrode. The sweep iterates through gate_1 voltages in the outer loop and gate_2 voltages in the inner loop.
Parameters:
Name of the first gate electrode to sweep
List of voltage values for the first gate electrode
Name of the second gate electrode to sweep
List of voltage values for the second gate electrode
Name of the contact electrode to measure current from
Optional LoggerSession to log the sweep data. If provided,
Returns:
Tuple of (voltage_measurements, current_measurements) where:
- voltage_measurements: List of [gate_1_voltage, gate_2_voltage] pairs
- current_measurements: List of measured current values at each voltage pair
Sweep all gate electrodes and measure the current of a single contact electrode.
Performs a voltage sweep by setting all control gates to the same voltage at each step, while measuring current through a contact electrode. This is useful for characterizing device response to overall gate bias.
Parameters:
List of voltage values to apply to all control gates simultaneously
Name of the contact electrode to measure current from
Optional LoggerSession to log the sweep data. If provided,
Returns:
Tuple of (voltage_measurements, current_measurements) where:
- voltage_measurements: List of lists, each containing voltage values for all control gates at that sweep step
- current_measurements: List of measured current values at each voltage
Sweep multiple gate electrodes and measure the current of a single contact electrode.
Performs an N-dimensional voltage sweep where each specified gate can have a different voltage at each sweep step. This provides maximum flexibility for arbitrary multi-gate sweeps and trajectories through voltage space.
Parameters:
List of gate electrode names to sweep
List of voltage lists, where each inner list contains the
Name of the contact electrode to measure current from
Optional LoggerSession to log the sweep data. If provided,
Returns:
Tuple of (voltage_measurements, current_measurements) where:
- voltage_measurements: List of lists, each containing the actual voltage values read from each gate at that sweep step
- current_measurements: List of measured current values at each voltage combination
Set all controllable gates and/or controllable contacts to 0V.
Safely brings specified electrodes to ground voltage (0V) with settling time and verification. This is typically used for device initialization or safe shutdown.
Parameters:
Specifies which pads to zero. Options are:
Raises:
DeviceError: If an invalid pad type is provided, or if any pad fails to reach 0V within tolerance (1e-6V) after the operation.