mjolnir.instruments.logical_instruments#

Classes

DetectionPath(*args, **kwargs)

Abstracts all instruments that are part of the detection path.

ExcitationPath(*args, **kwargs)

Abstracts all instruments that are part of the excitation path.

LogicalInstrument(*args, **kwargs)

A logical grouping of instruments that behaves like an Instrument.

Sample(*args, **kwargs)

An abstraction of a DUT.

Trap(*args, station[, parameters, channels, ...])

TrapSample(*args, **kwargs)

An abstraction of a membrane exciton trap sample.

class mjolnir.instruments.logical_instruments.DetectionPath(*args, **kwargs)[source]#

Bases: LogicalInstrument

Abstracts all instruments that are part of the detection path.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

active_detection_path#

The currently active detection path.

active_grating#

The currently active grating.

bandwidth#

The wavelength bandwidth of the monochromator.

ccd: AndorIDus4xx | None#
property ccd_calibration_handler: CcdCalibrationHandler#

The CCDCalibrationHandler.

ccd_calibration_max_age#

Oldest CCD calibration age.

ccd_calibration_oldest_datetime#

Oldest CCD calibration date.

ccd_calibration_update_mode#

The CCD calibration update mode.

  • ‘full’ performs a sweep of the laser’s wavelength to obtain a calibration function wavelength(pixel).

  • ‘fast’ only measures the central wavelength.

  • ‘dirty’ simply uses the current calibration and shifts it by the change in wavelength.

  • None does not perform any recalibration.

ccd_horizontal_axis_scale#

Set the unit of calibration for the horizontal axis of the CCD.

central_wavelength#

The spectrometer grating central wavelength.

property dispersion: float#

Wavelength resolution in nm per μm.

initialize_ccd(logical_station, cool=True, temperature=-70, block=True, target='reached', cooler_mode='maintain', horizontal_axis='energy', oldest_calibration_datetime=None, show_progress=True, **calibration_kwargs)[source]#

Initialize the CCD.

Parameters:
  • logical_station (Station) – The station hosting the logical instruments.

  • cool (bool) – Turn on the thermoelectric cooler of the CCD.

  • temperature (float) – The target temperature when cooling the CCD.

  • block (bool) – Block the interpreter during cooling.

  • target (Literal['reached', 'stabilized']) – The cooling target to reach.

  • cooler_mode (Literal['maintain', 'return']) – The CCD cooler mode.

  • horizontal_axis (Literal['wavelength', 'energy']) – Calibrate the CCD pixels in terms of wavelength or energy.

  • oldest_calibration_datetime (datetime | None) – Oldest CCD calibration date to accept before recalibrating.

  • show_progress (bool) – Show a progressbar during cooling.

  • **calibration_kwargs – Kwargs passed on to CCDCalibrationHandler.

initialize_spectrometer(detection_path='ccd', grating=600, central_wavelength=815.0, entrance_slit_width=50)[source]#

Initialize the spectrometer.

Parameters:
  • detection_path (Literal['ccd', 'apd']) – The active detection path to set.

  • grating (str | int) – The spectrometer grating to use.

  • central_wavelength (float) – The grating’s central wavelength to set.

  • entrance_slit_width (float) – The width of the entrance slit.

initialize_tagger(trigger_level=1.125)[source]#

Initialize the Time Tagger.

Parameters:

trigger_level (float) – The trigger level in volts to set for all channels.

spectrometer: HoribaFHR | None#
tagger: TimeTagger | None#
class mjolnir.instruments.logical_instruments.ExcitationPath(*args, **kwargs)[source]#

Bases: LogicalInstrument

Abstracts all instruments that are part of the excitation path.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

acquire_laser_lock(wavelength, max_attempts=10, show_progress=True)[source]#

Acquire the laser wavelength-lock.

Parameters:
  • wavelength (float) – The wavelength to set.

  • max_attempts (int) – The maximum number of attempts for acquiring the lock.

  • show_progress (bool) – Show a progressbar.

active_light_source#

The currently active light source.

chiller: ThermotekT255p | None#
close_shutter()[source]#

Temporarily close the shutter and restore the previous state.

disable_laser(shutter='close')[source]#

Turn of the pump laser and chiller.

Parameters:

shutter (str)

enable_laser(shutter='open', block=True, show_progress=True)[source]#

Turn on the pump laser.

Parameters:
  • shutter (str) – When done, leave the laser shutter open or closed.

  • block (bool) – Block the interpreter during ramping.

  • show_progress (bool) – Show a progressbar during ramping.

initialize_laser(shutter='close', block=True, show_progress=True, wavelength=None)[source]#

Initialize the lasers.

Parameters:
  • shutter (str) – When done, leave the laser shutter open or closed.

  • block (bool) – Block the interpreter during ramping.

  • show_progress (bool) – Show a progressbar during ramping.

  • wavelength (float | None) – Set the cw laser’s wavelength.

initialize_power(logical_station, oldest_calibration_datetime=None, update_calibration=False, averaging_time=0.001, **calibration_kwargs)[source]#

Initialize the power calibration.

Parameters:
  • logical_station (Station) – The station hosting the logical instruments.

  • oldest_calibration_datetime (datetime | None) – Oldest allowed datetime for the calibration. Defaults to the value of power_calibration_oldest_datetime.

  • update_calibration (bool | Literal['full', 'fast']) – Update the calibration on initalization.

  • averaging_time (float) – The power meter’s averaging time to set.

  • **calibration_kwargs – Kwargs passed on to PowerCalibrationHandler.

initialize_rejection_feedback(logical_station, **kwargs)[source]#

Initialize the excitation rejection handler.

Parameters:
laser: M2Solstis3 | None#
nd_filter: ThorlabsK10CR1 | None#
open_shutter()[source]#

Temporarily open the shutter and restore the previous state.

power#

The power at the optical head.

The setter inverts the power calibration handled by power_calibration_handler.

power_at_sample#

The power at the sample.

power_at_sample_avg#

A tuple of (mean, std) of average power at the sample.

property power_calibration_handler: PowerCalibrationHandler#

The power calibration handler.

power_calibration_max_age#

Oldest power calibration age.

power_calibration_oldest_datetime#

Oldest power calibration date.

power_calibration_strategy#

The power calibration update strategy.

Only applies to calibration mode ‘full’.

  • ‘sequential’ performs a equidistant sweep between bounds.

  • ‘adaptive’ uses adaptive to perform adaptive sampling.

power_calibration_tolerance#

Relative tolerance of power setting.

Used to determine whether power is satisfactorily close to the desired value.

power_calibration_update_mode#

The power calibration update mode.

  • ‘full’ performs a sweep of the ND-filter’s angle to obtain a calibration function power(angle).

  • ‘fast’ uses noisy optimization to minimize the difference between the current power and the setpoint.

power_n_avg#

Number of samples to average power over.

powermeter: ThorlabsPM100D | None#
pump_laser: LighthousePhotonicsSproutG | None#
rejection_feedback#

If active excitation rejection is on.

property rejection_feedback_handler: RejectionFeedbackHandler#

The excitation rejection handler.

rotators: AttocubeAMC100 | None#
shutter: ThorlabsMFF10x | None#
switch_active_light_source()[source]#

Switches between laser and white light, does nothing else.

wait_for_power_to_settle(slope=0.01, n_samples=None)[source]#

Block the interpreter until the power readings stabilize.

Parameters:
  • slope (float) – The maximum slope of the fitted line to accept.

  • n_samples (int | None) – The number of rolling samples to use for fitting.

Returns:

The last n_samples data points acquired.

Return type:

data

wavelength#

The cw-laser’s wavelength.

wavelength_constant_power#

The cw-laser’s wavelength, where on each set the power is retuned either to the value of the previous point, or to the value of wavelength_constant_power_setpoint.

wavelength_constant_power_setpoint#

The power setpoint used for wavelength_constant_power.

white_light: IP_Power_9258S.PowerChannel | None#
class mjolnir.instruments.logical_instruments.LogicalInstrument(*args, **kwargs)[source]#

Bases: Instrument

A logical grouping of instruments that behaves like an Instrument.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

close(close_physical_instruments=False)[source]#

Overrides instrument close to offer the possibility to close child instruments.

Parameters:

close_physical_instruments (bool)

Return type:

None

get_idn()[source]#

Parse a standard VISA *IDN? response into an ID dict.

Even though this is the VISA standard, it applies to various other types as well, such as IPInstruments, so it is included here in the Instrument base class.

Override this if your instrument does not support *IDN? or returns a nonstandard IDN string. This string is supposed to be a comma-separated list of vendor, model, serial, and firmware, but semicolon and colon are also common separators so we accept them here as well.

Returns:

A dict containing vendor, model, serial, and firmware.

Return type:

dict[str, str | None]

class mjolnir.instruments.logical_instruments.Sample(*args, **kwargs)[source]#

Bases: LogicalInstrument

An abstraction of a DUT.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

bob: BreakoutBox | None#
dac: QDAC2.QDac2 | None#
fridge: OxfordTriton | None#
property gates: dict[str, Parameter]#

All DC voltages connected to gates.

initialize_dac(reset_voltages=False, output_range=None, output_filter=None, measurement_range=None, dc_slew_rate_V_per_s=None, step=None, step_delay=None)[source]#

Initialize the QDAC-II connected to the device.

Parameters:
  • reset_voltages (bool) – Set voltages to zero before doing anything.

  • output_range (Literal['low', 'high'] | float) – Output range of the DAC channels.

  • output_filter (Literal['dc', 'med', 'high'] | None) – Output filter of the DAC channels.

  • measurement_range (Literal['low', 'high'] | None) – Measurement range of the DAC channels.

  • dc_slew_rate_V_per_s (float | None) – Slew rate in V/s of the DAC channels.

  • step (float | None) – Voltage step size for each set.

  • step_delay (float | None) – Delay after each step.

magnet: OxfordMercuryiPS | None#
class mjolnir.instruments.logical_instruments.Trap(*args, station, parameters=None, channels=None, grouped_parameter_names=None, grouped_parameter_class=<class 'qcodes.parameters.grouped_parameter.GroupedParameter'>, grouped_parameter_kwargs=None, initial_values=None, set_initial_values_on_load=False, setters=None, units=None, metadata=None, **kwargs)[source]#

Bases: DelegateInstrumentChannel

Parameters:
  • station (Station)

  • parameters (None | (Mapping[str, Sequence[str]] | Mapping[str, str]))

  • channels (None | (Mapping[str, Mapping[str, Any]] | Mapping[str, str]))

  • grouped_parameter_names (None | Mapping[str, Sequence[str] | str | None])

  • grouped_parameter_class (None | type[ParameterBase])

  • grouped_parameter_kwargs (None | Mapping[str, Any])

  • initial_values (Mapping[str, Any] | None)

  • set_initial_values_on_load (bool)

  • setters (Mapping[str, MutableMapping[str, Any]] | None)

  • units (Mapping[str, str] | None)

  • metadata (Mapping[Any, Any] | None)

class mjolnir.instruments.logical_instruments.TrapSample(*args, **kwargs)[source]#

Bases: Sample

An abstraction of a membrane exciton trap sample.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

Any

blocking_ramps#

Replace the dc_constant_V param with one that waits for the voltage to settle at a given threshold.

property trap: Trap#

The currently selected trap.