nanotune.device_tuner.dottuner

class nanotune.device_tuner.dottuner.VoltageChangeDirection(value)[source]

Bases: Enum

Direction in which gate voltages can be changes.

Parameters
  • positive (0) – increase voltage.

  • negative (1) – decrease voltage.

positive = 0
negative = 1
class nanotune.device_tuner.dottuner.DeviceState(value)[source]

Bases: Enum

Possible device states.

Parameters
  • pinchedoff (0) – pinched off, no measurable current through the device.

  • opencurrent (1) – open regime, high current through the device (possibly no or few gates set to small voltages.)

  • singledot (2) – a single quantum dot is formed.

  • doubledot (3) – two dots next to each other are formed.

  • undefined (4) – either unknown regime, dots about to form or state at initialization.

pinchedoff = 0
opencurrent = 1
singledot = 2
doubledot = 3
undefined = 4
class nanotune.device_tuner.dottuner.RangeChangeSetting(relative_range_change: float = 0.1, max_range_change: float = 0.05, min_range_change: float = 0.01, tolerance: float = 0.1)[source]

Bases: object

Settings defining how voltage ranges should be updated when needed.

Parameters
  • relative_range_change (float) – percentage of previous range of how much the new range should differ/be moved towards either positive or negative values.

  • max_range_change (float) – absolute maximum range change in V, i.e. max of how much the range will change at once.

  • min_range_change (float) – absolute minimum range change in V, i.e. min of how much the range will change at once.

relative_range_change: float = 0.1
max_range_change: float = 0.05
min_range_change: float = 0.01
tolerance: float = 0.1
class nanotune.device_tuner.dottuner.DotTuner(name: str, data_settings: DataSettings, classifiers: Classifiers, setpoint_settings: SetpointSettings)[source]

Bases: Tuner

Tuner sub-class with dot tuning procedures.

Parameters
  • classifiers (Classifiers) – a setting.Classifiers instance holding all required classifiers. Eg. pinchoff.

  • data_settings (DataSettings) – A settings.DataSettings instance with data related information such as db_name and normalization_constants.

  • setpoint_settings (SetpointSettings) – A settings.SetpointSettings instance with setpoint related information such as voltage_precision.

  • tuning_history (TuningHistory) – A TuningHistory instance holding all tuning results.

tune(device: ~nanotune.device.device.Device, device_layout: ~typing.Type[~nanotune.device.device_layout.DeviceLayout] = <class 'nanotune.device.device_layout.DoubleDotLayout'>, target_state: ~nanotune.device_tuner.dottuner.DeviceState = DeviceState.doubledot, max_iter: int = 15, take_high_res: bool = False, continue_tuning: bool = False) Tuple[bool, MeasurementHistory][source]

Tunes a device into a target dot regime. It expects the device to have a helper gate such as a top barrier in a 2DEG device or a bottom gate below a 1D system. Any previous tuning is reset by ramping all gates to their heighest allowed values and the device’s normalization constants are updated. Then the helper gate is set before the regime its tuning using tune_dot_regime.

It appears that the first regime can often be improved by a few subsequent iterations of the algorithm, which can be achieved by setting continue_tuning to True. All measurements are saved in self.tuning_history under the device.name key.

Parameters
  • device (nt.Device) – device to tune.

  • device_layout (DeviceLayout) – device layout, default is DoubleDotLayout.

  • target_state (DeviceState) – target regime. Default is DeviceState.doubledot.

  • max_iter (int) – maximum number of iterations. Each iteration chooses new barrier gate voltage combinations based on previous measurement outcomes and takes a charge diagram.

  • take_high_res (bool) – whether high resolution diagram should be taken when the target regime is found.

  • continue_tuning (bool) – whether to continue tuning even if the target regime was found. Used when either classifiers are not reliable enough or when aiming for an even better regime.

Returns
  • bool – success of tuning.

  • MeasurementHistory – all tuning results of the device tuned.

tune_dot_regime(device: ~nanotune.device.device.Device, device_layout: ~typing.Type[~nanotune.device.device_layout.DeviceLayout] = <class 'nanotune.device.device_layout.DoubleDotLayout'>, target_state: ~nanotune.device_tuner.dottuner.DeviceState = DeviceState.doubledot, max_iter: int = 15, take_high_res: bool = False, continue_tuning: bool = False) bool[source]

Tunes a device into a target dot regime, either single or double. If tuning a device with a helper gate, it expects this gate to be set already. After setting the remaining barriers (central and outer), a tuning loop determines suitable plungers ranges for a charge diagram and takes this diagram. If the result is classified as the target regime, new barrier voltages are chosen. The loop then resumes.

It appears that the first regime can often be improved by a few subsequent iterations of the algorithm, which can be achieved by setting continue_tuning to True. All measurements are saved in self.tuning_history under the device.name key.

Parameters
  • device (nt.Device) – device to tune.

  • device_layout (DeviceLayout) – device layout, default is DoubleDotLayout.

  • target_state (DeviceState) – target regime. Default is DeviceState.doubledot.

  • max_iter (int) – maximum number of iterations. Each iteration chooses new barrier gate voltage combinations based on previous measurement outcomes and takes a charge diagram.

  • take_high_res (bool) – whether high resolution diagram should be taken when the target regime is found.

  • continue_tuning (bool) – whether to continue tuning even if the target regime was found. Used when either classifiers are not reliable enough or when aiming for an even better regime.

Returns

bool – success of tuning.

take_high_resolution_diagram(device, gate_ids: Sequence[int] = [2, 4], target_state: DeviceState = DeviceState.doubledot, take_segments: bool = True) None[source]

Takes high resolution diagram with optionally re-taking good segments at a different voltage precision.

Parameters
  • device (nt.Device) – device to tune.

  • gate_ids (Sequence[int]) – IDs of gates to sweep, default is DoubleDotLayout.plungers()

  • target_state (DeviceState) – target state, default is DeviceState.doubledot.

  • take_segments (bool) – whether or not to take individual segments at a potentially different resolution.

take_high_res_dot_segments(device, dot_segments: Dict[int, Any], gate_ids: Sequence[int] = [2, 4], target_state: DeviceState = DeviceState.doubledot, voltage_precision: float = 0.0001) None[source]

Takes high resolution charge diagrams of dot segments which have been classified to show the desired regime.

Parameters
  • device (nt.Device) – device to tune.

  • dot_segments (Dict[int, Any]) – dot segment information, e.g. compiled by DotFit and stored in tuningresult.ml_result[‘dot_segments’]. Maps run ids of segmented data onto a dict with “predicted_regime” and “voltage_ranges” keys.

  • gate_ids (Sequence[int]) – IDs of gates to sweep, default is DoubleDotLayout.plungers()

  • target_state (DeviceState) – target state, default is DeviceState.doubledot.

  • voltage_precision (float) – optional voltage precision, usually a smaller number than for other measurements.

set_valid_plunger_ranges(device, device_layout: Type[DeviceLayout]) None[source]

Determines and set current valid ranges for plungers. It characterizes each plunger to determine the ranges. If these reach their respective safety limits, adjust_outer_barriers_possibly_helper_gate is called in a loop until all barriers and plunger ranges can be set.

Parameters
  • device (nt.Device) – device to tune.

  • device_layout (DeviceLayout) – device layout, e.g. DoubleDotLayout.

adjust_outer_barriers_possibly_helper_gate(device, device_layout: Type[DeviceLayout], barrier_changes: Dict[int, VoltageChangeDirection]) None[source]

Adjusts outer barriers and if needed the helper gate. It first applies voltages changes specified by barrier_changes and if these are not successful, the helper gate is adjusted. This step is repeated until all barriers are set with a within their safety ranges.

Parameters
  • device (nt.Device) – device to tune.

  • device_layout (DeviceLayout) – device layout, e.g. DoubleDotLayout.

  • barrier_changes (Dict[int, VoltageChangeDirection]) – voltage change directions for barriers. Maps gate IDs into VoltageChangeDirection.

set_central_and_outer_barriers(device: ~nanotune.device.device.Device, device_layout: ~typing.Type[~nanotune.device.device_layout.DeviceLayout] = <class 'nanotune.device.device_layout.DoubleDotLayout'>, target_state: ~nanotune.device_tuner.dottuner.DeviceState = DeviceState.doubledot) None[source]

Sets central and outer barriers given a target state. The central barrier is set first, to higher voltages for single than for the double dot regime, before setting outer barriers. If the latter is not successful, a loop adjusting the helper gate as well as outer barriers is executed until all gates are happy.

Parameters
  • device (nt.Device) – device to tune.

  • device_layout (DeviceLayout) – device layout, default is DoubleDotLayout.

  • target_state (DeviceState) – target regime. Default is DeviceState.doubledot.

set_helper_gate(device: Device, helper_gate_id: int = 0, gates_for_init_range_measurement: Sequence[int] = [1, 3, 5]) None[source]

Sets the voltage of a device’s helper gate, such as the top_barrier in a 2D doubledot device. Typically used in the very beginning of a tuning process and thus using initial_valid_ranges. If these are not set/the same as the gate’s safety range, measure_initial_ranges_2D estimated a valid range. The gate’s current valid range is set to either its initial valid range or the newly determined range. The voltage is set to the upper limit of the new current valid range. Raises an error if helper_gate_id is not in the device’s gates list.

Parameters
  • device (nt.Device) – device to tune.

  • helper_gate_id (int) – gate ID of helper gate. Default is DoubleDotLayout.top_barrier().

  • gates_for_init_range_measurement (Sequence[int]) – list of gates coupled to the helper gate most, i.e which have the biggest influence on its valid range. Typically outer and central barriers.

update_gate_configuration(device: Device, last_result: TuningResult, target_state: DeviceState = DeviceState.doubledot, helper_gate_id: int = 0, central_barrier_id: int = 3, outer_barrier_ids: Sequence[int] = [1, 5], range_change_setting: RangeChangeSetting = RangeChangeSetting(relative_range_change=0.1, max_range_change=0.05, min_range_change=0.01, tolerance=0.1)) None[source]

Updates gate configuration based on last measurement result. If the previous measurement shows a good but not the target regime, the central barrier is adjusted. If the detected regime is poor, new outer barrier voltages are chosen. In both cases all barriers are adjusted using adjust_all_barriers_loop to ensure that the new settings sit well with all other barriers. Raises an error if no termination_reasons are found and the previous tuning result was poor.

Parameters
  • device (nt.Device) – device to tune.

  • last_result (TuningResult) – tuning result of last measurement/tuning stage.

  • target_state (DeviceState) – target regime. Default is DeviceState.doubledot. Raises an error for a state other than pinchedoff, singledot or doubledot.

  • helper_gate_id (int) – gate ID of helper gate. Default is DoubleDotLayout.top_barrier().

  • central_barrier_id (int) – gate ID of central barrier. Default is DoubleDotLayout.central_barrier()

  • outer_barriers_id (Sequence[int]) – gate IDs of outer barriers. Default is DoubleDotLayout.outer_barriers().

  • range_change_setting (RangeChangeSetting) – instance of RangeChangeSetting with relative, maximum and minimum range changes.

adjust_all_barriers_loop(device, target_state: DeviceState, initial_voltage_update: Dict[int, VoltageChangeDirection], helper_gate_id: int = 0, central_barrier_id: int = 3, outer_barriers_id: Sequence[int] = [1, 5], range_change_setting: RangeChangeSetting = RangeChangeSetting(relative_range_change=0.1, max_range_change=0.05, min_range_change=0.01, tolerance=0.1)) None[source]

Adjusts all barriers in a loop until a satisfying (within safety limits) is found. It first updates voltages as specified in initial_voltage_update and then uses adjust_all_barriers until no new voltage update is required.

Parameters
  • device (nt.Device) – device to tune.

  • target_state (DeviceState) – target regime. Raises an error for a state other than pinchedoff, singledot or doubledot, although only singledot or doubledot make sense here.

  • initial_voltage_update (Dict[int, VoltageChangeDirection]) – dict mapping gate IDs onto direction in which their voltages need to be changed.

  • helper_gate_id (int) – gate ID of helper gate. Default is DoubleDotLayout.top_barrier().

  • central_barrier_id (int) – gate ID of central barrier. Default is DoubleDotLayout.central_barrier()

  • outer_barriers_id (Sequence[int]) – gate IDs of outer barriers. Default is DoubleDotLayout.outer_barriers().

  • range_change_setting (RangeChangeSetting) – instance of RangeChangeSetting with relative, maximum and minimum range changes.

adjust_all_barriers(device, target_state: DeviceState, voltage_change_direction: VoltageChangeDirection, helper_gate_id: int = 0, central_barrier_id: int = 3, outer_barriers_id: Sequence[int] = [1, 5], range_change_setting: RangeChangeSetting = RangeChangeSetting(relative_range_change=0.1, max_range_change=0.05, min_range_change=0.01, tolerance=0.1)) Optional[VoltageChangeDirection][source]

Adjusts all barriers of a device based on a voltage change direction. Typically used when a device is too closed/pinched off or too open. It first updates the helper gate, then the central barrier and finally the outer barriers. If the outer barriers can not be updated, a voltage change direction is returned.

Parameters
  • device (nt.Device) – device to tune.

  • target_state (DeviceState) – target regime. Default is DeviceState.doubledot. Raises an error for a state other than pinchedoff, singledot or doubledot.

  • voltage_change_direction (VoltageChangeDirection) – general direction in which voltages need to change. Either VoltageChangeDirection.positive or VoltageChangeDirection.negative.

  • helper_gate_id (int) – gate ID of helper gate. Default is DoubleDotLayout.top_barrier().

  • central_barrier_id (int) – gate ID of central barrier. Default is DoubleDotLayout.central_barrier()

  • outer_barriers_id (Sequence[int]) – gate IDs of outer barriers. Default is DoubleDotLayout.outer_barriers().

  • range_change_setting (RangeChangeSetting) – instance of RangeChangeSetting with relative, maximum and minimum range changes.

Returns

Optional[VoltageChangeDirection] – None is voltage updates have been successful, a new voltage change direction if not.

set_outer_barriers(device: Device, gate_ids: Sequence[int] = [1, 5], tolerance: float = 0.1) Optional[VoltageChangeDirection][source]

Sets outer barriers. Each barrier is characterized and a new voltage chosen based on the extracted features low_voltage (L), high_voltage (H) and transition_voltage (T). The new voltage, new_voltage = T + 2 / 3 * abs(T - H) is checked and set if the check is passes (not too close to safety limits). The central barrier’s current valid range is updated to [L, H] and transition voltage to T.

Parameters
  • device (nt.Device) – device to tune.

  • gate_ids (Sequence[int]) – barrier gate IDs, default is DoubleDotLayout.outer_barriers().

  • tolerance (float) – minimal voltage difference to keep to safety ranges. Default is 0.1.

Returns

Optional[VoltageChangeDirection] – None is voltage updates have been successful, a new voltage change direction if not.

set_central_barrier(device: Device, target_state: DeviceState = DeviceState.doubledot, gate_id: int = 3) None[source]

Sets the central barrier. The voltage chosen depends on the target state, with a more positive value when aiming for a single and a more negative one for a double dot. It characterizes the barrier chooses a value based on the determined high_voltage or signal strengths. For a double dot regime, the central barrier is set to the highest voltage at which the device show 2/3 of its open signal.

Parameters
  • device (nt.Device) – device to tune.

  • target_state (DeviceState) – target regime. Default is DeviceState.doubledot. Raises an error for a state other than pinchedoff, singledot or doubledot.

  • gate_id (int) – Default is DoubleDotLayout.central_barrier().

update_voltages_based_on_directives(device: Device, voltage_changes: Dict[int, VoltageChangeDirection], range_change_setting: RangeChangeSetting = RangeChangeSetting(relative_range_change=0.1, max_range_change=0.05, min_range_change=0.01, tolerance=0.1)) Optional[VoltageChangeDirection][source]

Updates voltages based on VoltageChangeDirection. Mainly used to update top or outer barriers. In case of outer barriers reaching limits, there is only one other gate (helper gate) to change. Returning only one direction is sufficient. In the current algorithm, it does not happen that one barrier requires the helper gate to be more positive and the other more negative.

Parameters
  • device (nt.Device) – device to tune.

  • voltage_changes (Dict[int, VoltageChangeDirection]) – dict mapping gate IDs onto a direction in which the voltage should be changed.

  • range_change_setting (RangeChangeSetting) – instance of RangeChangeSetting with relative, maximum and minimum range changes.

Returns

Optional[VoltageChangeDirection] – None is voltage updates have been successful, a new voltage change direction if not.

set_new_plunger_ranges(device: Device, plunger_barrier_pairs: List[Tuple[int, int]] = [(2, 1), (4, 5)]) Optional[Dict[int, VoltageChangeDirection]][source]

Determines and sets new valid ranges for plungers. It characterizes each plunger individually using characterize_plunger, checking if a nearby barrier needs to adjusted.

Parameters
  • device (nt.Device) – device to tune.

  • plunger_barrier_pairs (List[Tuple[int, int]]) – list of tuples, where the first tuple item is plunger gate_id and the second a barrier gate_id, indicating which barrier needs to be changed if a plunger’s range can not be updated. Ex: [(left_plunger.gate_id, left_barrier.gate_id)]

Returns

Optional[Dict[int, VoltageChangeDirection]] – if required (plunger range updates were not successful), the required changes to be applied to barrier voltages are returned. If a dict is returned, it maps gate ID onto VoltageChangeDirection. The new direction is None if new ranges have been set successfully.

characterize_plunger(device: Device, plunger: DeviceChannel) Tuple[Tuple[float, float], DeviceState][source]

Characterizes a plunger of a device by performing a gate characterization and checking whether the measured (normalized) signal is neither to high nor too low, i.e. whether the device is pinched off or in the open regime. A dot regime is found in-between these two regimes.

Parameters
  • device (nt.Device) – device to tune.

  • plunger (DeviceChannel) – DeviceChannel instance of a plunger.

Returns
  • Tuple[float, float]

  • DeviceState – state of the device, undefined if the characterization was successful. If the measured signal is below data_settings.noise_floor, DeviceState.pinchedoff is returned. If the signal is too high, the value is DeviceState.opencurrent.

choose_new_gate_voltage(device: Device, gate_id: int, voltage_change_direction: VoltageChangeDirection, range_change_setting: RangeChangeSetting = RangeChangeSetting(relative_range_change=0.1, max_range_change=0.05, min_range_change=0.01, tolerance=0.1)) float[source]

based on current_valid_range or safety_voltage_range if no current_valid_range is set

Parameters
  • device (nt.Device) – device to tune.

  • gate_id (int) – ID of gate to set.

  • voltage_change_direction (VoltageChangeDirection) – direction in which the voltage should be adjusted. Positive or negative.

  • range_change_setting (RangeChangeSetting) – instance of RangeChangeSetting with relative, maximum and minimum range changes.

Returns

float – new gate voltage to set on gate with ID gate_id.

nanotune.device_tuner.dottuner.check_new_voltage(new_voltage: float, gate: DeviceChannel, tolerance: float = 0.1) Optional[VoltageChangeDirection][source]

Checks whether a voltage can be set on a gate. If not, a VoltageChangeDirection indicating how other gates need to be updated is returned.

Parameters
  • new_voltage (float) – voltage to check before it is set.

  • gate (DeviceChannel) – gate whose voltage should be set.

  • tolerance (float) – minimal voltage difference to keep to safety ranges. Default is 0.1.

Returns

VoltageChangeDirection – Direction in which other gates should be changed if the new voltage can not be set.