silq.instrument_interfaces package

Subpackages

Submodules

silq.instrument_interfaces.chip_interface module

class silq.instrument_interfaces.chip_interface.ChipInterface(instrument_name, **kwargs)[source]

Bases: silq.instrument_interfaces.interface.InstrumentInterface

Interface for the Chip meta-instrument.

The Chip and its interface don’t have real functionality, but are used for connections that lead to/from the chip.

When a PulseSequence is targeted in the Layout, the pulses are directed to the appropriate interface. Each interface is responsible for translating all pulses directed to it into instrument commands. During the actual measurement, the instrument’s operations will correspond to that required by the pulse sequence.

The interface also contains a list of all available channels in the instrument.

Parameters

instrument_name – name of instrument for which this is an interface

Note

For a given instrument, its associated interface can be found using

get_instrument_interface

setup(**kwargs)[source]

Set up instrument after layout has been targeted by pulse sequence.

Does nothing in this case.

Parameters

**kwargs – Ignored kwargs passed by layout.

start()[source]

Start instrument (ignored).

stop()[source]

Stop instrument (ignored).

class silq.instrument_interfaces.chip_interface.MeasurementPulseImplementation(pulse_requirements=[])[source]

Bases: silq.pulses.pulse_modules.PulseImplementation

implement(instrument, sampling_rates, threshold)[source]

Implements a targeted pulse for an InstrumentInterface.

This method is called during InstrumentInterface.setup.

Implementation of a targeted pulse is very dependent on the interface. For an AWG, this method may return a list of waveform points. For a triggering source, this method may return the triggering time. In very simple cases, this method may not even be necessary.

Parameters
  • *args – Interface-specific args to use

  • **kwargs – Interface-specific kwargs to use

Returns

Instrument-specific return values.

See also

Other interface source codes may serve as a guide for this method.

pulse_class

alias of silq.pulses.pulse_types.MeasurementPulse

silq.instrument_interfaces.interface module

class silq.instrument_interfaces.interface.Channel(instrument_name, name, id=None, input=False, output=False, input_trigger=False, input_TTL=False, output_TTL=False, invert=False)[source]

Bases: object

Instrument channel, specified in InstrumentInterface

A channel usually corresponds to a physical channel in the instrument, such as an input/output channel, triggering channel, etc.

Parameters
  • instrument_name (str) – Name of instrument.

  • name (str) – Channel name, usually specified on the instrument.

  • id (Optional[int]) – Channel id, usually zero-based index.

  • input (bool) – Channel is an input channel.

  • output (bool) – Channel is an output channel.

  • input_trigger (bool) – Channel is used as instrument trigger.

  • input_TTL (bool) – Channel input signal must be TTL

  • output_TTL (Tuple[float, float]) – Channel output signal is TTL with (low, high) voltage

  • invert (bool) – Channel signal is inverted: on is low signal, off is high signal

class silq.instrument_interfaces.interface.InstrumentInterface(instrument_name, **kwargs)[source]

Bases: qcodes.instrument.base.Instrument

Interface between the Layout and instruments

When a PulseSequence is targeted in the Layout, the pulses are directed to the appropriate interface. Each interface is responsible for translating all pulses directed to it into instrument commands. During the actual measurement, the instrument’s operations will correspond to that required by the pulse sequence.

The interface also contains a list of all available channels in the instrument.

Parameters

instrument_name (str) – name of instrument for which this is an interface

Note

For a given instrument, its associated interface can be found using

get_instrument_interface()

get_additional_pulses(connections)[source]

Additional pulses needed by instrument after targeting of main pulses

Parameters

connections – List of all connections in the layout

Return type

List[Pulse]

Returns

List of additional pulses, empty by default.

get_channel(channel_name)[source]

Get channel by its name.

Parameters

channel_name (str) – name of channel

Return type

Channel

Returns

Channel whose name corresponds to channel_name

get_pulse_implementation(pulse, connections=None)[source]

Get a target implementation of a pulse if it exists.

If no implementation can be found for the pulse, or if the pulse properties are out of the implementation’s bounds, None is returned.

Parameters
  • pulse (Pulse) – pulse to be targeted

  • connections (Optional[list]) – List of all connections in Layout, which might be used by the implementation.

Return type

Optional[Pulse]

Returns

Targeted pulse if it can be implemented. Otherwise None

initialize()[source]

This method gets called at the start of targeting a pulse sequence :returns: None

setup(samples=None, input_connections=[], output_connections=[], repeat=True, **kwargs)[source]

Set up instrument after layout has been targeted by pulse sequence.

Needs to be implemented in subclass.

Parameters
  • samples (Optional[int]) – Number of acquisition samples. If None, it will use the previously set value.

  • input_connections (list) – Input Connection list of instrument, needed by some interfaces to setup the instrument.

  • output_connections (list) – Output Connection list of instrument, needed by some interfaces to setup the instrument.

  • repeat (bool) – Repeat the pulse sequence indefinitely. If False, calling Layout.start() will only run the pulse sequence once.

  • **kwargs – Additional interface-specific kwarg.

Return type

Dict[str, Any]

Returns

setup flags (see Layout.flags)

start()[source]

Start instrument

Note

Acquisition instruments usually don’t need to be started

stop()[source]

Stop instrument

Module contents

silq.instrument_interfaces.get_instrument_interface(instrument, *args, **kwargs)[source]