stanza.routines.builtins.health_check

Device health check routine for quantum dot devices.

Health Check is an improvement over: Kovach, T. et al. BATIS: Bootstrapping, Autonomous Testing, and Initialization System for Si/SiGe Multi-quantum Dot Devices. arXiv preprint arXiv:2412.07676 (2024). https://arxiv.org/abs/2412.07676

Module Contents

Functions

NameDescription
noise_floor_measurementMeasure the noise floor of the device to establish baseline current measurement statistics.
leakage_testTest for leakage between control gates by measuring inter-gate resistance across voltage ranges.
global_accumulationDetermine the global turn-on voltage by sweeping all control gates simultaneously.
reservoir_characterizationCharacterize individual reservoir gates by sweeping each while holding others in accumulation.
finger_gate_characterizationCharacterize individual finger gates by sweeping each while holding others in accumulation.
_calculate_leakage_matrixCalculate leakage resistance matrix from voltage change and current differences.
_check_leakage_thresholdCheck if leakage matrix exceeds threshold and log if it does.
_test_single_voltage_boundTest for leakage at a single voltage bound by sweeping gates incrementally.
analyze_single_gate_heuristicFit gate sweep data to extract cut-off voltage using a heuristic model.

Data

logger DEFAULT_SETTLING_TIME_S

API

1stanza.routines.builtins.health_check.logger

Value: getLogger(...)

1stanza.routines.builtins.health_check.DEFAULT_SETTLING_TIME_S

Value: 10

1stanza.routines.builtins.health_check.noise_floor_measurement(
2 ctx: stanza.routines.RoutineContext,
3 measure_electrode: str,
4 num_points: int = 100,
5 session: stanza.logger.session.LoggerSession | None = None,
6 **kwargs: typing.Any
7) -> dict[str, float]

Measure the noise floor of the device to establish baseline current measurement statistics.

This routine performs repeated current measurements on a specified electrode to characterize the measurement noise floor. The resulting mean and standard deviation are used to establish minimum current thresholds for subsequent health check sub-routines, helping to distinguish real signals from measurement noise.

Parameters:

ctx
stanza.routines.RoutineContext

Routine context containing device resources and previous results.

measure_electrode
str

Name of the electrode to measure current from.

num_points
intDefaults to 100

Number of current measurements to collect for statistical analysis. Default is 100.

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording measurements and analysis results.

Returns:

dict: Contains:

  • current_mean: Mean of measured currents (A)
  • current_std: Standard deviation of measured currents (A) Notes:
  • All measurements are taken at the device’s current voltage configuration
  • Results are automatically logged to session if provided
  • The current_std value is commonly used in leakage_test as min_current_threshold
1stanza.routines.builtins.health_check.leakage_test(
2 ctx: stanza.routines.RoutineContext,
3 leakage_threshold_resistance: int,
4 leakage_threshold_count: int = 0,
5 num_points: int = 10,
6 session: stanza.logger.session.LoggerSession | None = None,
7 **kwargs: typing.Any
8) -> dict[str, float]

Test for leakage between control gates by measuring inter-gate resistance across voltage ranges.

This routine systematically tests for electrical leakage between all pairs of control gates by sweeping each gate through its voltage range and measuring the current response on all other gates. Leakage is quantified as resistance (dV/dI) between gate pairs. Gates with resistance below the threshold indicate potential shorts or unwanted crosstalk.

The test sweeps both positive (max_voltage_bound) and negative (min_voltage_bound) directions from the initial voltages to detect asymmetric leakage behavior. Both bounds are tested independently, so failure at one bound does not prevent testing the other.

Parameters:

ctx
stanza.routines.RoutineContext

Routine context containing device resources. Uses ctx.results.get(“current_std”)

leakage_threshold_resistance
int

Maximum acceptable resistance (Ohms) between gate pairs.

leakage_threshold_count
intDefaults to 0

Maximum number of leaky gate pairs allowed before failing the test.

num_points
intDefaults to 10

Number of voltage steps to test in each direction. Default is 10.

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording leakage matrices and analysis results.

Returns:

dict: Contains the delta_V tested for each voltage bound:

  • max_voltage_bound: The voltage offset tested for max bound (V)
  • min_voltage_bound: The voltage offset tested for min bound (V) If leakage exceeds threshold, returns the offset where it was first detected. If no leakage detected, returns the final offset tested.

Raises:

Exception: Re-raises any exceptions encountered during testing after logging. Notes:

  • Device is always returned to initial voltages in the finally block
  • Leakage matrix is symmetric, only upper triangle is checked
  • Both voltage bounds are tested regardless of failures
  • Current differences below min_current_threshold are skipped to avoid noise
  • Voltage bounds are determined from device channel configurations
1stanza.routines.builtins.health_check.global_accumulation(
2 ctx: stanza.routines.RoutineContext,
3 measure_electrode: str,
4 step_size: float,
5 bias_gate: str,
6 bias_voltage: float,
7 session: stanza.logger.session.LoggerSession | None = None,
8 **kwargs: typing.Any
9) -> dict[str, float]

Determine the global turn-on voltage by sweeping all control gates simultaneously.

This health check routine sweeps all control gates together from minimum to maximum voltage while measuring current at a specified electrode. The sweep data is analyzed using a pinch-off heuristic to identify the voltage at which the device transitions from depletion to accumulation (turn-on). After finding this voltage, all gates are set to the cut-off voltage.

This global characterization establishes a baseline operating point before individual gate characterization in subsequent routines.

Parameters:

ctx
stanza.routines.RoutineContext

Routine context containing device resources and previous results. Requires

measure_electrode
str

Name of the electrode to measure current from during the sweep.

step_size
float

Voltage increment (V) between sweep points. Smaller values provide

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording sweep measurements and analysis results.

Returns:

dict: Contains:

  • global_turn_on_voltage: The cut-off voltage (cutoff_voltage) where current begins to flow through the device (V) Notes:
  • All control gates are swept together (global sweep)
  • Device is automatically set to cutoff_voltage after analysis
  • The cutoff_voltage value is used by subsequent characterization routines (reservoir, finger gates)
  • step_size is converted to num_points based on voltage range
1stanza.routines.builtins.health_check.reservoir_characterization(
2 ctx: stanza.routines.RoutineContext,
3 measure_electrode: str,
4 step_size: float,
5 bias_gate: str,
6 bias_voltage: float,
7 session: stanza.logger.session.LoggerSession | None = None,
8 **kwargs: typing.Any
9) -> dict[str, dict[str, typing.Any]]

Characterize individual reservoir gates by sweeping each while holding others in accumulation.

This health check routine determines the cut-off voltage (cutoff_voltage) for each reservoir gate individually. For each reservoir under test, all other reservoirs are set to 120% of the global turn-on voltage (to ensure they’re fully conducting), while the target reservoir is swept from minimum to maximum voltage. This isolates the behavior of each reservoir and identifies its individual pinch-off characteristics.

Parameters:

ctx
stanza.routines.RoutineContext

Routine context containing device resources and previous results. Requires:

measure_electrode
str

Name of the electrode to measure current from during sweeps.

step_size
float

Voltage increment (V) between sweep points. Smaller values provide

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording sweep measurements and analysis results.

Returns:

dict: Contains:

  • reservoir_characterization: Dictionary mapping each reservoir name to its cut-off voltage (cutoff_voltage) in volts. Notes:
  • Each reservoir is tested sequentially
  • Other reservoirs are biased at min(1.2 * global_turn_on_voltage, max_voltage_bound)
  • Target reservoir starts at 0V before sweeping
  • 10 second settling time is used between voltage changes
  • Pinch-off analysis may raise ValueError if curve fit fails
1stanza.routines.builtins.health_check.finger_gate_characterization(
2 ctx: stanza.routines.RoutineContext,
3 measure_electrode: str,
4 step_size: float,
5 bias_gate: str,
6 bias_voltage: float,
7 session: stanza.logger.session.LoggerSession | None = None,
8 **kwargs: typing.Any
9) -> dict[str, dict[str, typing.Any]]

Characterize individual finger gates by sweeping each while holding others in accumulation.

This health check routine determines the cut-off voltage for each finger gate individually. For each finger gate under test, all other finger gates are set to 120% of the global turn-on voltage (to ensure they’re fully accumulated), while the target gate is swept from minimum to maximum voltage. This isolates the behavior of each finger gate and identifies its individual pinch-off characteristics.

Parameters:

ctx
stanza.routines.RoutineContext

Routine context containing device resources and previous results. Requires:

measure_electrode
str

Name of the electrode to measure current from during sweeps.

step_size
float

Voltage increment (V) between sweep points. Smaller values provide

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording sweep measurements and analysis results.

Returns:

dict: Contains:

  • finger_gate_characterization: Dictionary mapping each finger gate name to its cut-off voltage (cutoff_voltage) in volts. Notes:
  • Each finger gate is tested sequentially
  • Other finger gates are biased at min(1.2 * global_turn_on_voltage, max_voltage_bound)
  • Target gate starts at 0V before sweeping
  • 10 second settling time is used after setting target gate to 0V
  • Pinch-off analysis may raise ValueError if curve fit fails
1stanza.routines.builtins.health_check._calculate_leakage_matrix(
2 delta_V: float, current_diff: numpy.ndarray
3) -> numpy.ndarray

Calculate leakage resistance matrix from voltage change and current differences.

Parameters:

delta_V
float

Voltage change applied (V).

current_diff
numpy.ndarray

Array of current differences for each gate (A).

Returns:

Leakage resistance matrix (Ohms) where leakage_matrix[i,j] = |delta_V / (I_j - I_j_prev)| when gate i was swept. Inf values indicate no measurable current change.

1stanza.routines.builtins.health_check._check_leakage_threshold(
2 leakage_matrix: numpy.ndarray,
3 leakage_threshold_resistance: int,
4 leakage_threshold_count: int,
5 control_gates: list[str],
6 delta_V: float,
7 session: stanza.logger.session.LoggerSession | None
8) -> bool

Check if leakage matrix exceeds threshold and log if it does.

Parameters:

leakage_matrix
numpy.ndarray

Resistance matrix between gate pairs (Ohms).

leakage_threshold_resistance
int

Maximum acceptable resistance threshold (Ohms).

leakage_threshold_count
int

Maximum number of leaky gate pairs allowed.

control_gates
list[str]

List of control gate names for reporting.

delta_V
float

Current voltage offset being tested (V).

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording leakage analysis.

Returns:

True if leakage threshold is exceeded, False otherwise.

1stanza.routines.builtins.health_check._test_single_voltage_bound(
2 ctx: stanza.routines.RoutineContext,
3 voltage_bound: float,
4 control_gates: list[str],
5 initial_voltages: list[float],
6 initial_currents: list[float],
7 leakage_threshold_resistance: int,
8 leakage_threshold_count: int,
9 min_current_threshold: float,
10 num_points: int,
11 session: stanza.logger.session.LoggerSession | None
12) -> tuple[float, bool]

Test for leakage at a single voltage bound by sweeping gates incrementally.

Parameters:

ctx
stanza.routines.RoutineContext

Routine context containing device resources.

voltage_bound
float

Target voltage bound to test (V).

control_gates
list[str]

List of control gate names to test.

initial_voltages
list[float]

Initial voltage for each gate (V).

initial_currents
list[float]

Initial current for each gate (A).

leakage_threshold_resistance
int

Maximum acceptable resistance between gates (Ohms).

leakage_threshold_count
int

Maximum number of leaky gate pairs allowed.

min_current_threshold
float

Minimum current change to consider for resistance calculation (A).

num_points
int

Number of voltage steps to test.

session
stanza.logger.session.LoggerSession | None

Optional logger session for recording measurements.

Returns:

Tuple of (delta_V, leaked) where:

  • delta_V: The voltage offset tested (V). If leakage detected, the offset where it occurred.
  • leaked: True if leakage threshold was exceeded, False otherwise.
1stanza.routines.builtins.health_check.analyze_single_gate_heuristic(
2 voltages: numpy.ndarray, currents: numpy.ndarray
3) -> dict[str, typing.Any]

Fit gate sweep data to extract cut-off voltage using a heuristic model.

Parameters:

voltages
numpy.ndarray

Array of gate voltages (V) from the sweep.

currents
numpy.ndarray

Array of measured currents (A) corresponding to each voltage.

Returns:

dict: Contains cutoff_voltage (cut-off voltage) and other fit parameters.

Raises:

ValueError: If the curve fit quality is poor based on R² and NRMSE metrics.