silq.parameters package¶
Submodules¶
silq.parameters.acquisition_parameters module¶
-
class
silq.parameters.acquisition_parameters.
AcquisitionParameter
(continuous=False, properties_attrs=None, wrap_set=False, save_traces=False, **kwargs)[source]¶ Bases:
silq.tools.general_tools.SettingsClass
,qcodes.instrument.parameter.MultiParameter
Parameter used for acquisitions involving a
PulseSequence
.Each AcquisitionParameter has an associated pulse sequence, which it directs to the Layout, after which it acquires traces and performs post-processing.
Generally, the flow of an AcquisitionParameter is as follows:
AcquisitionParameter.acquire
, which acquires traces. This stage can be subdivided into several steps:Generate PulseSequence if pulse sequence properties have changed Note that this is only necessary for a
PulseSequenceGenerator
, which is a more complicated pulse sequences that can be generated from properties.Target pulse sequence in
Layout
. This only happens ifLayout.pulse_sequence
differs from the pulse sequence used.Call
Layout.setup
which sets up instruments with new pulse sequence. Again, this is only done ifLayout.pulse_sequence
differs.Acquire traces using
Layout.acquisition
This in turn gets the traces fromm the acquisition instrument. The returned traces are segmented by pulse and acquisition channel.
AcquisitionParameter.analyse
, which analyses the traces This method differs per AcquisitionParameter.Perform ancillary actions such as saving traces, printing results
Return list of results for any measurement. The subset of results that are in
AcquisitionParameter.names
is returned.
- Parameters
continuous (bool) – If True, instruments keep running after acquisition
properties_attrs (List[str]) – attributes to match with
silq.config.properties
(see notes below).save_traces (bool) – Save acquired traces to disk
**kwargs – Additional kwargs passed to
MultiParameter
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs – Attributes to match with
silq.config.properties
See notes below for more info.save_traces – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
Notes
AcquisitionParameters are subclasses of the
MultiParameter
, and therefore always returns multiple valuesAcquisitionParameters are also subclasses of
SettingsClass
, which gives it the ability to temporarily override its attributes using methodssingle_settings
andtemporary_settings
. These overridden settings can be clear later on. This is useful if you temporarily want to change settings. SeeSettingsClass
for more info.When certain elements in
silq.config
are updated, this will also update the corresponding attributes in the AcquisitionParameter. Two config paths are monitored:silq.config.properties
, though only the attributes specified inproperties_attrs
.silq.parameters.{self.name}
.
-
acquire
(stop=None, setup=None, save_traces=None, **kwargs)[source]¶ Performs a
Layout.acquisition
.- Parameters
stop (
Optional
[bool
]) – Stop instruments after acquisition. If not specified, it will stop ifAcquisitionParameter.continuous
is False.setup (
Optional
[bool
]) – Whether to setup layout before acquisition. If not specified, it will setup if pulse_sequences are differentsave_traces (
Optional
[bool
]) – whether to save traces during**kwargs – Additional kwargs to be given to
Layout.acquisition
.
- Return type
- Returns
acquisition traces dictionary, segmented by pulse. dictionary has the following format: {pulse.full_name: {acquisition_channel_label: traces}} where acquisition_channel_label is specified in
Layout
.
-
formatter
= <qcodes.data.hdf5_format.HDF5Format object>¶
-
labels
¶
-
layout
= None¶
-
property
sample_rate
¶ Acquisition sample rate
-
set
(**kwargs)[source]¶ Perform an acquisition with temporarily modified settings
Shorthand for:
` AcquisitionParameter.single_settings(**kwargs) AcquisitionParameter() `
-
class
silq.parameters.acquisition_parameters.
DCParameter
(name='DC', unit='V', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Acquires DC voltage
The pulse sequence contains a single read pulse, the duration of which specifies how long should be averaged.
- Parameters
name (
str
) – Parameter name.unit (
str
) – Unit of DC voltage (e.g. can be changed to nA)pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
- Returns
Average DC voltage measured on the output channel DC_noise: noise standard deviation measured on the output channel
- Return type
DC_voltage
Notes
DCParameter.continuous
is True by default
Todo
implement continuous acquisition in the ATS interface
-
class
silq.parameters.acquisition_parameters.
TraceParameter
(name='trace_pulse', average_mode='none', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
An acquisition parameter for obtaining a trace or multiple traces of a given PulseSequence.
Example
>>> parameter.average_mode = 'none' >>> parameter.pulse_sequence = my_pulse_sequence
Note that for the above example, all pulses in my_pulse_sequence will be copied.
- Parameters
trace_pulse (Pulse) – Acquisition measurement pulse. Duration is dynamically set to the duration of acquired pulses.
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
-
acquire
(**kwargs)[source]¶ Acquires the number of traces defined in self.samples
- Parameters
**kwargs – kwargs passed to
AcquisitionParameter.acquire
- Returns
A tuple of data points. e.g. ((data_for_1st_output), (data_for_2nd_output), …)
-
property
average_mode
¶ Acquisition averaging mode.
The attribute
Pulse.average
is overridden.
-
labels
¶
-
names
¶
-
property
pulse_sequence
¶
-
setpoint_names
¶
-
setpoint_units
¶
-
setpoints
¶
-
setup
(start=None, **kwargs)[source]¶ Modifies provided pulse sequence by creating a single pulse which overlaps all other pulses with acquire=True and then acquires only this pulse.
-
shapes
¶
-
units
¶
-
class
silq.parameters.acquisition_parameters.
DCSweepParameter
(name='DC_sweep', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Perform 1D and 2D DC sweeps by rapidly varying AWG output voltages
Using this parameter, a 2D DC sweep of 100x100 points can be obtained in ~1 second. This does of course depend on the filtering of the lines, and the acquisition sampling rate. This is used in the
DCSweepPlot
to continuously update and display the charge stability diagram.The pulse sequence is created by first calling
DCSweepParameter.add_sweep
, which adds a dimension every time it’s called. After adding the sweeps,DCSweepParameter.generate
will create the correspondingPulseSequence
.- Parameters
name – parameter name
**kwargs – Additional kwargs passed to AcquisitionParameter
trace_pulse (Pulse) – Trace pulse at fixed voltage at the end of sweep. Can be turned off by
trace_pulse.enabled = False
.pulse_duration (float) – Duration of each point in DC sweep
final_delay (float) – Delay at end of pulse sequence.
inter_delay (float) – Delay after each row of DC points
use_ramp (bool) – Combine single row of DC points into a ramp pulse that will be segmented later. This saves number of waveforms sent, reduces triggers, and creates less
Pulse
objects.sweep_parameters (UpdateDotDict) – Sweep parameters. Every time an item is updated,
DCSweepParameter.generate
is called.pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
Note
Currently only works up to 2D.
Todo
Convert pulse sequence and generator into
PulseSequenceGenerator
-
add_sweep
(parameter_name, sweep_voltages=None, connection_label=None, offset_parameter=None)[source]¶ Add sweep to
DCSweepParameter.sweep_parameters
Each call will add a sweep as the outer dimension.
- Parameters
parameter_name (
str
) – Name of parameter (for axis labelling).sweep_voltages (
Optional
[ndarray
]) – List of sweep voltages. IfDCSweepParameter.use_ramp
is True, these must be equidistant.connection_label (
Optional
[str
]) – Connection label to target pulses to. For multiple sweeps, each connection label must be distinct. Connection labels are defined inLayout.acquisition_outputs
.offset_parameter (
Optional
[Parameter
]) – Parameter used for offsetting the sweep voltages. Usually this is the corresponding DC voltage parameter.
-
analyse
(traces=None)[source]¶ Analyse traces, ensuring resulting dimensionality is correct
- Parameters
traces (
Optional
[Dict
[str
,Dict
[str
,ndarray
]]]) – Traces returned byAcquisitionParameter.acquire
.- Returns
Dict containing:
- DC_voltage (np.ndarray)
DC voltages with dimensionality corresponding to number of sweeps.
- trace_voltage (np.ndarray)
voltage trace of final trace pulse. Only used if
DCSweepParameter.trace_pulse.enabled
. Trace inoutput
connection label is returned.
- Return type
(Dict[str, Any])
-
connect_to_config
= True¶
-
generate
()[source]¶ Generates pulse sequence using sweeps in
DCSweepParameter.add_sweep
Note
Currently only works for 1D and 2D
-
labels
¶
-
names
¶
-
setpoint_names
¶
-
setpoint_units
¶
-
setpoints
¶
-
shapes
¶
-
units
¶
-
class
silq.parameters.acquisition_parameters.
EPRParameter
(name='EPR', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter for an empty-plunge-read sequence.
- Parameters
name – Name of acquisition parameter
**kwargs – Additional kwargs passed to
AcquisitionParameter
.pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
t_skip (float) – initial part of read trace to ignore for measuring blips. Useful if there is a voltage spike at the start, which could otherwise be measured as a
blip
. Retrieved fromsilq.config.properties.t_skip
.t_read (float) – duration of read trace to include for measuring blips. Useful if latter half of read pulse is used for initialization. Retrieved from
silq.config.properties.t_read
.min_filter_proportion (float) – Minimum number of read traces needed in which the voltage starts low (loaded donor). Otherwise, most results are set to zero. Retrieved from
silq.config.properties.min_filter_proportion
.traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
Note
A
read_long
pulse is used instead ofread
because this allows comparison of the start and end of the pulse, giving thecontrast
.
-
class
silq.parameters.acquisition_parameters.
ESRParameter
(name='ESR', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter for most pulse sequences involving electron spin resonance.
This parameter can handle many of the simple pulse sequences involving ESR. It uses the
ESRPulseSequence
, which will generate a pulse sequence from settings (see parameters below).In general the pulse sequence is as follows:
Perform any pre_pulses defined in
ESRParameter.pre_pulses
.Perform stage pulse
ESRParameter.ESR['stage_pulse']
. By default, this is theplunge
pulse.Perform ESR pulse within plunge pulse, the delay from start of plunge pulse is defined in
ESRParameter.ESR['pulse_delay']
.Perform read pulse
ESRParameter.ESR['read_pulse']
.Repeat steps 2 and 3 for each ESR pulse in
ESRParameter.ESR['ESR_pulses']
, which by default contains single pulseESRParameter.ESR['ESR_pulse']
.Perform empty-plunge-read sequence (EPR), but only if
ESRParameter.EPR['enabled']
is True. EPR pulses are defined inESRParameter.EPR['pulses']
.Perform any post_pulses defined in
ESRParameter.post_pulses
.
A shorthand for using the default ESR pulse for multiple frequencies is by setting
ESRParameter.ESR_frequencies
. Settings this will create a copy of ESRParameter.ESR[‘ESR_pulse’] with the respective frequency.Examples
The following code measures two ESR frequencies and performs an EPR from which the contrast can be determined for each ESR frequency:
>>> ESR_parameter = ESRParameter() >>> ESR_parameter.ESR['pulse_delay'] = 5e-3 >>> ESR_parameter.ESR['stage_pulse'] = DCPulse['plunge'] >>> ESR_parameter.ESR['ESR_pulse'] = FrequencyRampPulse('ESR_adiabatic') >>> ESR_parameter.ESR_frequencies = [39e9, 39.1e9] >>> ESR_parameter.EPR['enabled'] = True >>> ESR_parameter.pulse_sequence.generate()
The total pulse sequence is plunge-read-plunge-read-empty-plunge-read with an ESR pulse in the first two plunge pulses, 5 ms after the start of the plunge pulse. The ESR pulses have different frequencies.
- Parameters
name – Name of acquisition parameter
**kwargs – Additional kwargs passed to
AcquisitionParameter
.ESR (dict) –
ESRPulseSequence
generator settings for ESR. Settings are:stage_pulse
,ESR_pulse
,ESR_pulses
,pulse_delay
,read_pulse
.EPR (dict) –
ESRPulseSequence
generator settings for EPR. This is optional and can be toggled inEPR['enabled']
. If disabled, contrast is not calculated. Settings are:enabled
,pulses
.pre_pulses (List[Pulse]) – Pulses to place at the start of the sequence.
post_pulses (List[Pulse]) – Pulses to place at the end of the sequence.
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
t_skip (float) – initial part of read trace to ignore for measuring blips. Useful if there is a voltage spike at the start, which could otherwise be measured as a
blip
. Retrieved fromsilq.config.properties.t_skip
.t_read (float) – duration of read trace to include for measuring blips. Useful if latter half of read pulse is used for initialization. Retrieved from
silq.config.properties.t_read
.min_filter_proportion (float) – Minimum number of read traces needed in which the voltage starts low (loaded donor). Otherwise, most results are set to zero. Retrieved from
silq.config.properties.min_filter_proportion
.traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
. See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
Notes
All pulse settings are copies of
ESRParameter.pulse_sequence.pulse_settings
.For given pulse settings,
ESRParameter.pulse_sequence.generate
will recreate the pulse sequence from settings.
-
property
ESR_frequencies
¶ Apply default ESR pulse for each ESR frequency given.
-
analyse
(traces=None, plot=False)[source]¶ Analyse ESR traces.
If there is only one ESR pulse, returns
up_proportion_{pulse.name}
. If there are several ESR pulses, adds a zero-based suffix at the end for each ESR pulse. IfESRParameter.EPR['enabled'] == True
, the results fromanalyse_EPR
are also added, as well ascontrast_{pulse.name}
(plus a suffix if there are several ESR pulses).
-
property
names
¶
-
shapes
¶
-
units
¶
-
class
silq.parameters.acquisition_parameters.
NMRParameter
(name='NMR', names=['flips', 'flip_probability', 'up_proportions'], **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter for most measurements involving an NMR pulse.
This parameter can apply several NMR pulses, and also measure several ESR frequencies. It uses the
NMRPulseSequence
, which will generate a pulse sequence from settings (see parameters below).In general, the pulse sequence is as follows:
Perform any pre_pulses defined in
NMRParameter.pre_pulses
.Perform NMR sequence
Perform stage pulse
NMRParameter.NMR['stage_pulse']
. Default is ‘empty’DCPulse
.Perform NMR pulses within the stage pulse. The NMR pulses defined in
NMRParameter.NMR['NMR_pulses']
are applied successively. The delay after start of the stage pulse isNMRParameter.NMR['pre_delay']
, delays between NMR pulses isNMRParameter.NMR['inter_delay']
, and the delay after the final NMR pulse isNMRParameter.NMR['post_delay']
.
Perform ESR sequence
Perform stage pulse
NMRParameter.ESR['stage_pulse']
. Default is ‘plunge’DCPulse
.Perform ESR pulse within stage pulse for first pulse in
NMRParameter.ESR['ESR_pulses']
.Perform
NMRParameter.ESR['read_pulse']
, and acquire trace.Repeat steps 1 - 3 for each ESR pulse. The different ESR pulses usually correspond to different ESR frequencies (see
NMRParameter
.ESR_frequencies).Repeat steps 1 - 4 for
NMRParameter.ESR['shots_per_frequency']
This effectively interleaves the ESR pulses, which counters effects of the nucleus flipping within an acquisition.
This acquisition is repeated
NMRParameter.samples
times. If the nucleus is in one of the states for which an ESR frequency is on resonance, a highup_proportion
is measured, while for the other frequencies a lowup_proportion
is measured. By looking over successive samples and measuring how often theup_proportions
switch between above/belowNMRParameter.threshold_up_proportion
, nuclear flips can be measured (seeNMRParameter.analyse
andanalyse_flips
).- Parameters
name (
str
) – Parameter name**kwargs – Additional kwargs passed to
AcquisitionParameter
NMR (dict) –
NMRPulseSequence
pulse settings for NMR. Settings are:stage_pulse
,NMR_pulse
,NMR_pulses
,pre_delay
,inter_delay
,post_delay
.ESR (dict) –
NMRPulseSequence
pulse settings for ESR. Settings are:ESR_pulse
,stage_pulse
,ESR_pulses
,read_pulse
,pulse_delay
.EPR (dict) –
PulseSequenceGenerator
settings for EPR. This is optional and can be toggled inEPR['enabled']
. If disabled, contrast is not calculated.pre_pulses (List[Pulse]) – Pulses to place at the start of the sequence.
post_pulses (List[Pulse]) – Pulses to place at the end of the sequence.
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
ESR_frequencies (List[float]) – List of ESR frequencies to use. When set, a copy of
NMRParameter.ESR['ESR_pulse']
is created for each frequency, and added toNMRParameter.ESR['ESR_pulses']
.samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
t_skip (float) – initial part of read trace to ignore for measuring blips. Useful if there is a voltage spike at the start, which could otherwise be measured as a
blip
. Retrieved fromsilq.config.properties.t_skip
.t_read (float) – duration of read trace to include for measuring blips. Useful if latter half of read pulse is used for initialization. Retrieved from
silq.config.properties.t_read
.threshold_up_proportion (Union[float, Tuple[float, float]) – threshold for up proportions needed to determine ESR pulse to be on-resonance. If tuple, first element is threshold below which ESR pulse is off-resonant, and second element is threshold above which ESR pulse is on-resonant. Useful for filtering of up proportions at boundary. Retrieved from
silq.config.properties.threshold_up_proportion
.traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
Note
The
NMRPulseSequence
does not have an empty-plunge-read (EPR) sequence, and therefore does not add a contrast or dark counts. Verifying that the system is in tune is therefore a little bit tricky.
-
property
ESR_frequencies
¶ ESR frequencies to measure.
For each ESR frequency,
NMRParameter.ESR['shots_per_read']
reads are performed.
-
analyse
(traces=None)[source]¶ Analyse flipping events between nuclear states
- Returns
Dict containing:
- results_read (dict)
analyse_traces
results for each read trace- up_proportions_{idx} (np.ndarray)
Up proportions, the dimensionality being equal to
NMRParameter.samples
.{idx}
is replaced with the zero-based ESR frequency index.- Results from
analyse_flips
. These are flips_{idx},
flip_probability_{idx}
combined_flips_{idx1}{idx2}
combined_flip_probability_{idx1}{idx2}
Additionally, each of the above results will have another result with the same name, but prepended with
filtered_
, and appended with_{idx1}{idx2}
if not already present. Here, all the values are filtered out where the corresponding pair of up_proportion samples do not have exactly one high and one low for each sample. The values that do not satisfy the filter are set tonp.nan
.- filtered_scans_{idx1}{idx2}
- Return type
(Dict[str, Any])
-
property
names
¶
-
shapes
¶
-
units
¶
-
class
silq.parameters.acquisition_parameters.
VariableReadParameter
(name='variable_read', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter for measuring spin tails.
The pulse sequence is
plunge
-read
-empty
. By varying the read amplitude, the voltage should transition between high voltage (empty
) to low voltage (plunge
), and somewhere in between an increased voltage should be visible at the start, indicating spin-dependent tunneling.- Parameters
name – Parameter name
**kwargs – Additional kwargs passed to AcquisitionParameter
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples to average over.
results (dict) – Results obtained after analysis of traces.
traces (dict) – Acquisition traces segmented by pulse and acquisition label
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
-
setpoints
¶
-
shapes
¶
-
class
silq.parameters.acquisition_parameters.
BlipsParameter
(name='count_blips', duration=None, pulse_name='DC_trace', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter that measures properties of blips in a trace
The
PulseSequence
consists of a single read pulse. From this trace, the number of blips per second is counted, as well as the mean time inlow
andhigh
voltage state. This parameter can be used in retuning sequence.- Parameters
name (
str
) – Parameter name.pulse_name (
str
) – Name of read pulse**kwargs – Additional kwargs passed to
AcquisitionParameter
.threshold_voltage (float) – Threshold voltage for a blip in voltage.
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
t_skip (float) – initial part of read trace to ignore for measuring blips. Useful if there is a voltage spike at the start, which could otherwise be measured as a
blip
. Retrieved fromsilq.config.properties.t_skip
.t_read (float) – duration of read trace to include for measuring blips. Useful if latter half of read pulse is used for initialization. Retrieved from
silq.config.properties.t_read
.min_filter_proportion (float) – Minimum number of read traces needed in which the voltage starts low (loaded donor). Otherwise, most results are set to zero. Retrieved from
silq.config.properties.min_filter_proportion
.traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
See also
-
analyse
(traces=None)[source]¶ count_blips
analysis.
-
property
duration
¶ Shorthand for read pulse duration.
-
class
silq.parameters.acquisition_parameters.
FlipNucleusParameter
(name='flip_nucleus', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
-
class
silq.parameters.acquisition_parameters.
FlipFlopParameter
(name='flip_flop', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter for performing flip-flopping, not meant for acquiring data
-
class
silq.parameters.acquisition_parameters.
NeuralNetworkParameter
(target_parameter, input_names, output_names=None, model_filepath=None, include_target_output=None, **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Base parameter for neural networks
Todo
Needs to be updated
Transform into a
MeasurementParameter
.
-
acquire
()[source]¶ Performs a
Layout.acquisition
.- Parameters
stop – Stop instruments after acquisition. If not specified, it will stop if
AcquisitionParameter.continuous
is False.setup – Whether to setup layout before acquisition. If not specified, it will setup if pulse_sequences are different
save_traces – whether to save traces during
**kwargs – Additional kwargs to be given to
Layout.acquisition
.
- Returns
acquisition traces dictionary, segmented by pulse. dictionary has the following format: {pulse.full_name: {acquisition_channel_label: traces}} where acquisition_channel_label is specified in
Layout
.
-
names
¶
-
pulse_sequence
¶
-
class
silq.parameters.acquisition_parameters.
NeuralRetuneParameter
(target_parameter, output_parameters, update=False, **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.NeuralNetworkParameter
Parameter that uses neural network for retuning.
Todo
Needs to be updated
Transform into a
MeasurementParameter
.
-
property
base_folder
¶
-
names
¶
-
class
silq.parameters.acquisition_parameters.
ESRRamseyDetuningParameter
(name='ESRRamsey', **kwargs)[source]¶ Bases:
silq.parameters.acquisition_parameters.AcquisitionParameter
Parameter for most pulse sequences involving electron spin resonance.
This parameter can handle many of the simple pulse sequences involving ESR. It uses the
ESRPulseSequence
, which will generate a pulse sequence from settings (see parameters below).In general the pulse sequence is as follows:
Perform any pre_pulses defined in
ESRParameter.pre_pulses
.Perform stage pulse
ESRParameter.ESR['stage_pulse']
. By default, this is theplunge
pulse.Perform ESR pulse within plunge pulse, the delay from start of plunge pulse is defined in
ESRParameter.ESR['pulse_delay']
.Perform read pulse
ESRParameter.ESR['read_pulse']
.Repeat steps 2 and 3 for each ESR pulse in
ESRParameter.ESR['ESR_pulses']
, which by default contains single pulseESRParameter.ESR['ESR_pulse']
.Perform empty-plunge-read sequence (EPR), but only if
ESRParameter.EPR['enabled']
is True. EPR pulses are defined inESRParameter.EPR['pulses']
.Perform any post_pulses defined in
ESRParameter.post_pulses
.
A shorthand for using the default ESR pulse for multiple frequencies is by setting
ESRParameter.ESR_frequencies
. Settings this will create a copy of ESRParameter.ESR[‘ESR_pulse’] with the respective frequency.Examples
The following code measures two ESR frequencies and performs an EPR from which the contrast can be determined for each ESR frequency:
>>> ESR_parameter = ESRParameter() >>> ESR_parameter.ESR['pulse_delay'] = 5e-3 >>> ESR_parameter.ESR['stage_pulse'] = DCPulse['plunge'] >>> ESR_parameter.ESR['ESR_pulse'] = FrequencyRampPulse('ESR_adiabatic') >>> ESR_parameter.ESR_frequencies = [39e9, 39.1e9] >>> ESR_parameter.EPR['enabled'] = True >>> ESR_parameter.pulse_sequence.generate()
The total pulse sequence is plunge-read-plunge-read-empty-plunge-read with an ESR pulse in the first two plunge pulses, 5 ms after the start of the plunge pulse. The ESR pulses have different frequencies.
- Parameters
name – Name of acquisition parameter
**kwargs – Additional kwargs passed to
AcquisitionParameter
.ESR (dict) –
ESRPulseSequence
generator settings for ESR. Settings are:stage_pulse
,ESR_pulse
,ESR_pulses
,pulse_delay
,read_pulse
.EPR (dict) –
ESRPulseSequence
generator settings for EPR. This is optional and can be toggled inEPR['enabled']
. If disabled, contrast is not calculated. Settings are:enabled
,pulses
.pre_pulses (List[Pulse]) – Pulses to place at the start of the sequence.
post_pulses (List[Pulse]) – Pulses to place at the end of the sequence.
pulse_sequence (PulseSequence) – Pulse sequence used for acquisition.
samples (int) – Number of acquisition samples
results (dict) – Results obtained after analysis of traces.
t_skip (float) – initial part of read trace to ignore for measuring blips. Useful if there is a voltage spike at the start, which could otherwise be measured as a
blip
. Retrieved fromsilq.config.properties.t_skip
.t_read (float) – duration of read trace to include for measuring blips. Useful if latter half of read pulse is used for initialization. Retrieved from
silq.config.properties.t_read
.min_filter_proportion (float) – Minimum number of read traces needed in which the voltage starts low (loaded donor). Otherwise, most results are set to zero. Retrieved from
silq.config.properties.min_filter_proportion
.traces (dict) – Acquisition traces segmented by pulse and acquisition label
silent (bool) – Print results after acquisition
continuous (bool) – If True, instruments keep running after acquisition. Useful if stopping/starting instruments takes a considerable amount of time.
properties_attrs (List[str]) – Attributes to match with
silq.config.properties
. See notes below for more info.save_traces (bool) – Save acquired traces to disk. If the acquisition has been part of a measurement, the traces are stored in a subfolder of the corresponding data set. Otherwise, a new dataset is created.
dataset (DataSet) – Traces DataSet
base_folder (str) – Base folder in which to save traces. If not specified, and acquisition is part of a measurement, the base folder is the folder of the measurement data set. Otherwise, the base folder is the default data folder
subfolder (str) – Subfolder within the base folder to save traces.
Notes
All pulse settings are copies of
ESRParameter.pulse_sequence.pulse_settings
.For given pulse settings,
ESRParameter.pulse_sequence.generate
will recreate the pulse sequence from settings.
-
property
ESR_frequencies
¶ Apply default ESR pulse for each ESR frequency given.
-
analyse
(traces=None, plot=False)[source]¶ Analyse ESR traces.
If there is only one ESR pulse, returns
up_proportion_{pulse.name}
. If there are several ESR pulses, adds a zero-based suffix at the end for each ESR pulse. IfESRParameter.EPR['enabled'] == True
, the results fromanalyse_EPR
are also added, as well ascontrast_{pulse.name}
(plus a suffix if there are several ESR pulses).
-
property
names
¶
-
shapes
¶
-
units
¶
silq.parameters.acquisition_parameters_composite module¶
silq.parameters.general_parameters module¶
-
class
silq.parameters.general_parameters.
CombinedParameter
(parameters, name=None, label='', unit=None, offsets=None, scales=None, full_label=True, **kwargs)[source]¶ Bases:
qcodes.instrument.parameter.Parameter
Combines multiple parameters into a single parameter.
Setting this parameter sets all underlying parameters to this value, after applying possible scale and offset in that order. Getting this parameter gets the value of the first parameter, and applies offset and scale in that order.
- Parameters
name (
Optional
[str
]) – Name ofCombinedParameter
, by default equal to the names of the composed parameters separated by underscores.label (
str
) – Label ofCombinedParameter
, by default equal to the labels of the composed parameters separated byand
. Also includes any scale and offset.offsets (
Optional
[List
[float
]]) – Optional offset for parameters. If set, must have equal number of elements as parametersscales (
Optional
[List
[float
]]) – Optional scale for parameters. If set, must have equal number of elements as parameters.full_label (
bool
) – Add scales and offsets for all parameters to the label**kwargs – Additional kwargs passed to
Parameter
.
Note
All args are also attributes.
While QCoDeS already has a
CombinedParameter
, it has some shortcomings which are addressed here. Maybe in the future this will be PR’ed to the main QCoDeS repository.
-
calculate_individual_values
(value)[source]¶ Calulate values of parameters from a combined value
- Parameters
value – combined value
- Returns
list of values for each parameter
-
property
label
¶
-
class
silq.parameters.general_parameters.
AttributeParameter
(object, attribute, name=None, is_key=None, **kwargs)[source]¶ Bases:
qcodes.instrument.parameter.Parameter
Creates a parameter that can set/get an attribute from an object.
- Parameters
silq.parameters.measurement_parameters module¶
-
class
silq.parameters.measurement_parameters.
MeasurementParameter
(name, acquisition_parameter=None, discriminant=None, silent=True, **kwargs)[source]¶ Bases:
silq.tools.general_tools.SettingsClass
,qcodes.instrument.parameter.MultiParameter
Base class for parameters that perform measurements.
A
MeasurementParameter
usually consists of several acquisitions, which it uses for complex sequences.A
MeasurementParameter
usually uses aqcodes.Loop
or aqcodes.Measure
or several in succession. The results in theDataSet
are analysed and often some post-action is performed.Example
An example of a
MeasurementParameter
is a retuning sequence, which uses anAcquisitionParameter
, and from that determines how much voltages have to be modified to retune the system (e.g.RetuneBlipsParameter
).Note
The MeasurementParameter needs to be updated. It was originally created to be used with the
MeasurementSequence
, but this class turned out to be too rigid. Instead, measurements should be programmed by subclassing the MeasurementParameter.- Parameters
Name – Parameter name
acquisition_parameter – Acquisition_parameter to use. Fails in case of multiple or no acquisition parameters
discriminant – data array in dataset to discriminate. Fails if there is no single discriminant.
silent (str) – Print results during .get()
Todo
Clean up MeasurementParameter, remove attributes
MeasurementParameter.discriminant
andMeasurementParameter.acquisition_parameter
.
-
property
acquisition_parameter_name
¶
-
property
base_folder
¶ Obtain measurement base folder (if any).
- Returns
If in a measurement, the base folder is the relative path of the data folder. Otherwise None
-
property
discriminant
¶
-
property
discriminant_idx
¶
-
layout
= None¶
-
property
loc_provider
¶
-
class
silq.parameters.measurement_parameters.
RetuneBlipsParameter
(name='retune_blips', coulomb_peak_parameter=None, blips_parameter=None, sweep_parameter=None, sweep_vals=None, tune_to_coulomb_peak=True, tune_to_optimum=True, optimum_DC_offset=None, model_filepath=None, voltage_limit=None, optimum_method='neural_network', **kwargs)[source]¶ Bases:
silq.parameters.measurement_parameters.MeasurementParameter
Parameter that retunes by analysing blips using a neural network
The first (optional) stage is to use a CoulombPeakParameter to find the center of the Coulomb peak.
Second, a sweep parameter is varied for a range of sweep values. For each sweep point, a trace is acquired, and its blips measured in a BlipsParameter. This information is then analysed by a neural network, from which the optimal tuning position is predicted.
The Neural network is a Keras model that needs to be pre-trained with data. More info: Experiments/personal/Serwan/Neural networks/Retune blips.ipynb The following Neural Network seems to produce decent results:
>>> model = Sequential() >>> model.add(Dense(3, activation='linear', input_shape=(21,3))) >>> model.add(Flatten()) >>> model.add(Dense(1, activation='linear'))
-
calculate_optimum
()[source]¶ Calculate optimum of dataset from neural network Returns: optimal voltage of combined set parameter
-
create_loop
()[source]¶ Create loop that sweep sweep_parameter over sweep_vals and measures blips_parameter at each sweep point. Returns: loop
-
shapes
¶
-
-
class
silq.parameters.measurement_parameters.
CoulombPeakParameter
(name='coulomb_peak', sweep_parameter=None, acquisition_parameter=None, combined_set_parameter=None, DC_peak_offset=None, tune_to_peak=True, min_voltage=0.5, interpolate=True, **kwargs)[source]¶ Bases:
silq.parameters.measurement_parameters.MeasurementParameter
Parameter that finds Coulomb peak and can tune to it. Finding the Coulomb peak is done by sweeping a gate and measuring the DC voltage at each point.
-
names
¶
-
shapes
¶
-
-
class
silq.parameters.measurement_parameters.
DCMultisweepParameter
(name, acquisition_parameter, x_gate, y_gate, **kwargs)[source]¶ Bases:
silq.parameters.measurement_parameters.MeasurementParameter
-
property
AC_x_vals
¶
-
property
AC_y_vals
¶
-
property
DC_x_vals
¶
-
property
DC_y_vals
¶
-
formatter
= None¶
-
setpoints
¶
-
shapes
¶
-
property
x_sweep_range
¶
-
property
x_sweeps
¶
-
property
y_sweep_range
¶
-
property
y_sweeps
¶
-
property
-
class
silq.parameters.measurement_parameters.
MeasurementSequenceParameter
(name, measurement_sequence=None, set_parameters=None, discriminant=None, start_condition=None, **kwargs)[source]¶ Bases:
silq.parameters.measurement_parameters.MeasurementParameter
-
class
silq.parameters.measurement_parameters.
SelectFrequencyParameter
(threshold=0.5, discriminant=None, frequencies=None, mode=None, acquisition_parameter=None, update_frequency=True, **kwargs)[source]¶ Bases:
silq.parameters.measurement_parameters.MeasurementParameter
-
property
spin_states
¶
-
property
-
class
silq.parameters.measurement_parameters.
TrackPeakParameter
(name, set_parameter=None, acquisition_parameter=None, step_percentage=None, peak_width=None, points=None, discriminant=None, threshold=None, **kwargs)[source]¶ Bases:
silq.parameters.measurement_parameters.MeasurementParameter
-
property
set_vals
¶
-
property
shapes
¶
-
property