nanotune.tuningstages.chargediagram
- class nanotune.tuningstages.chargediagram.ChargeDiagram(data_settings: DataSettings, setpoint_settings: SetpointSettings, readout: Readout, classifiers: Classifiers, target_regime: str = 'doubledot', range_change_settings: Optional[RangeChangeSettingsDict] = None)[source]
Bases:
TuningStage
Tuning stage measuring charge stability diagrams.
- Parameters
stage – String identifier indicating which stage it implements, e.g. gatecharacterization.
data_settings – Dictionary with information about data, e.g. where it should be saved and how it should be normalized. Required fields are ‘db_name’, ‘db_folder’ and ‘normalization_constants’, ‘segment_size’.
setpoint_settings – Dictionary with information about how to compute setpoints. Required keys are ‘parameters_to_sweep’, ‘safety_voltages’, ‘current_valid_ranges’ and ‘voltage_precision’.
readout –
current_valid_ranges – List of voltages ranges (tuples of floats) to measure.
safety_voltage_ranges – List of satefy voltages ranges, i.e. safety limits within the device stays alive.
target_regime – String indicating the desired final charge state/dot regime.
range_change_settings – Dictionary with keys ‘relative_range_change’, ‘min_change’, ‘max_change’. Used to determine new voltage ranges to sweep.
classifiers – Pre-trained nt.Classifiers predicting charge states and their quality.
fit_class – Returns the class used to perform data fitting, i.e. nanotune.fit.dotfit.Dotfit.
- property fit_class
Returns nanotune’s Dotfit
- conclude_iteration(tuning_result: TuningResult, current_valid_ranges: Sequence[Sequence[float]], safety_voltage_ranges: Sequence[Sequence[float]], current_iteration: int, max_n_iterations: int) Tuple[bool, Sequence[Sequence[float]], List[str]] [source]
Method checking if one iteration of a run_stage measurement cycle has been successful.
An iteration of such a measurement cycle takes data, performs a machine learning task, verifies and saves the machine learning result. If a repetition of this cycle is supported, then conclude_iteration determines whether another iteration should take place and which voltage ranges need to be measured. Each child class needs to implement the body of this method, tailoring it to the respective tuning stage.
- Parameters
tuning_result – Result of the last run_stage measurement cycle.
current_valid_ranges – Voltage ranges last swept.
safety_voltage_ranges – Safety voltage ranges, i.e. largest possible range that could be swept.
current_iteration – Number of current iteration.
max_n_iterations – Maximum number of iterations to perform before abandoning.
- Returns
bool – Whether this is the last iteration and the stage is done/to be stopped.
list – New voltage ranges to sweep if the stage is not done.
list – List of strings indicating failure modes.
- verify_machine_learning_result(ml_result: Dict[str, Any]) bool [source]
Verifies if the desired regime and quality have been found.
- Parameters
ml_result – Dictionary returned by
self.machine_learning_task
.- Returns
bool – Whether the desired outcome has been found.
- machine_learning_task(run_id: int) Dict[str, Any] [source]
Divides original measurement into segments, which are classified seperately. The overall outcome, i.e. regime and quality, are determined using
conclude_dot_classification
defined in .chargediagram_tasks. If the desired regime is not found, the overall regime is the most frequent one in the dot segments.- Parameters
run_id – QCoDeS data run ID.
- Returns
dict – The classification outcome, both segment wise under the key ‘dot_segments’ as well as the overall outcome under ‘regime’ and ‘quality’.
- get_range_update_directives(run_id: int, current_valid_ranges: Sequence[Sequence[float]], safety_voltage_ranges: Sequence[Sequence[float]]) Tuple[List[str], List[str]] [source]
Determines directives indicating if the current voltage ranges need to be extended or shifted. It first gets these directives from the data fit using
get_fit_range_update_directives
defined in .base_tasks.py and then checks if they can be put into action usingget_range_directives_chargediagram
defined in chargediagram_tasks.py. The check looks at whether safety ranges have been reached already, or whether a voltage range extension is possible.- Parameters
run_id – QCoDeS data run ID.
current_valid_ranges – Last voltage range swept.
safety_voltage_ranges – Safety range of gate swept.
- Returns
list – List with range update directives.
list – List with issues encountered.