qibolab.instruments package#

Subpackages#

Submodules#

qibolab.instruments.abstract module#

class qibolab.instruments.abstract.InstrumentSettings[source]#

Bases: object

Container of settings that are dumped in the platform runcard json.

dump()[source]#

Dictionary containing the settings.

Useful when dumping the instruments to the runcard JSON.

class qibolab.instruments.abstract.Instrument(name, address)[source]#

Bases: ABC

Parent class for all the instruments connected via TCPIP.

Parameters:
  • name (str) – Instrument name.

  • address (str) – Instrument network address.

property signature#
abstract connect()[source]#

Establish connection to the physical instrument.

abstract disconnect()[source]#

Close connection to the physical instrument.

abstract setup(*args, **kwargs)[source]#

Set instrument settings.

class qibolab.instruments.abstract.Controller(name, address)[source]#

Bases: Instrument

Instrument that can play pulses (using waveform generator).

PortType#

Class used by the instrument to instantiate ports.

alias of Port

bounds: Bounds#

Estimated limitations of the device memory.

setup(bounds)[source]#

Set unrolling batch bounds.

dump()[source]#

Dump unrolling batch bounds.

abstract property sampling_rate#

Sampling rate of control electronics in giga samples per second (GSps).

ports(port_name, *args, **kwargs)[source]#

Get ports associated to this controller.

Parameters:

port_name – Identifier for the port. The type of the identifier depends on the specialized port defined for each instrument.

Returns:

qibolab.instruments.port.Port object providing the interface for setting instrument parameters.

abstract play(*args, **kwargs)[source]#

Play a pulse sequence and retrieve feedback.

Returns:

(Dict[ResultType]) mapping the serial of the readout pulses used to the acquired qibolab.result.ExecutionResults object.

abstract sweep(*args, **kwargs)[source]#

Play a pulse sequence while sweeping one or more parameters.

Returns:

(dict) mapping the serial of the readout pulses used to the acquired qibolab.result.ExecutionResults object.

exception qibolab.instruments.abstract.InstrumentException(instrument: Instrument, message: str)[source]#

Bases: Exception

qibolab.instruments.bluefors module#

class qibolab.instruments.bluefors.TemperatureController(name: str, address: str, port: int = 8888)[source]#

Bases: Instrument

Bluefors temperature controller.

``` # Example usage if __name__ == “__main__”:

tc = TemperatureController(“XLD1000_Temperature_Controller”, “192.168.0.114”, 8888) tc.connect() temperature_values = tc.read_data() for temperature_value in temperature_values:

print(temperature_value)

```

connect()[source]#

Connect to the socket.

disconnect()[source]#

Disconnect from the socket.

setup()[source]#

Required by parent class, but not used here.

get_data() dict[str, dict[str, float]][source]#

Connect to the socket and get temperature data.

The typical message looks like this:

flange_name: {‘temperature’:12.345678, ‘timestamp’:1234567890.123456}

timestamp can be converted to datetime using datetime.fromtimestamp. :returns:

socket message in this format:

{“flange_name”: {‘temperature’: <value(float)>, ‘timestamp’:<value(float)>}}

Return type:

message (dict[str, dict[str, float]])

read_data()[source]#

Continously read data from the temperature controller.

qibolab.instruments.dummy module#

class qibolab.instruments.dummy.DummyPort(name: str, offset: float = 0.0, lo_frequency: int = 0, lo_power: int = 0, gain: int = 0, attenuation: int = 0, power_range: int = 0, filters: dict | None = None)[source]#

Bases: Port

name: str#

Name of the port that acts as its identifier.

offset: float = 0.0#

DC offset that is applied to this port.

lo_frequency: int = 0#

Local oscillator frequency for the given port.

Relevant only for controllers with internal local oscillators.

lo_power: int = 0#

Local oscillator power for the given port.

Relevant only for controllers with internal local oscillators.

gain: int = 0#

Gain that is applied to this port.

attenuation: int = 0#

Attenuation that is applied to this port.

power_range: int = 0#

Similar to attenuation (negative) and gain (positive) for (Zurich instruments).

filters: dict | None = None#
class qibolab.instruments.dummy.DummyDevice[source]#

Bases: object

Dummy device that does nothing but follows the QCoDeS interface.

Used by qibolab.instruments.dummy.DummyLocalOscillator.

set(name, value)[source]#

Set device property.

get(name)[source]#

Get device property.

on()[source]#

Turn device on.

off()[source]#

Turn device on.

close()[source]#

Close connection with device.

class qibolab.instruments.dummy.DummyLocalOscillator(name, address, ref_osc_source=None)[source]#

Bases: LocalOscillator

Dummy local oscillator instrument.

Useful for testing the interface defined in qibolab.instruments.oscillator.LocalOscillator.

create()[source]#

Create instance of physical device.

class qibolab.instruments.dummy.DummyInstrument(name, address)[source]#

Bases: Controller

Dummy instrument that returns random voltage values.

Useful for testing code without requiring access to hardware.

Parameters:
  • name (str) – name of the instrument.

  • address (int) – address to connect to the instrument. Not used since the instrument is dummy, it only exists to keep the same interface with other instruments.

BOUNDS = Bounds(waveforms=1, readout=1, instructions=1)#
PortType#

alias of DummyPort

property sampling_rate#

Sampling rate of control electronics in giga samples per second (GSps).

connect()[source]#

Establish connection to the physical instrument.

disconnect()[source]#

Close connection to the physical instrument.

setup(*args, **kwargs)[source]#

Set unrolling batch bounds.

get_values(options, ro_pulse, shape)[source]#
play(qubits: Dict[str | int, Qubit], couplers: Dict[str | int, Coupler], sequence: PulseSequence, options: ExecutionParameters)[source]#

Play a pulse sequence and retrieve feedback.

Returns:

(Dict[ResultType]) mapping the serial of the readout pulses used to the acquired qibolab.result.ExecutionResults object.

sweep(qubits: Dict[str | int, Qubit], couplers: Dict[str | int, Coupler], sequence: PulseSequence, options: ExecutionParameters, *sweepers: List[Sweeper])[source]#

Play a pulse sequence while sweeping one or more parameters.

Returns:

(dict) mapping the serial of the readout pulses used to the acquired qibolab.result.ExecutionResults object.

qibolab.instruments.erasynth module#

qibolab.instruments.erasynth.RECONNECTION_ATTEMPTS = 10#

Number of times to attempt sending requests to the web server in case of failure.

qibolab.instruments.erasynth.TIMEOUT = 10#

Timeout time for HTTP requests in seconds.

class qibolab.instruments.erasynth.ERASynthEthernet(name, address)[source]#

Bases: object

ERA ethernet driver that follows the QCoDeS interface.

Controls the instrument via HTTP requests to the instrument’s web server.

property url#
post(name, value)[source]#

Post a value to the instrument’s web server.

Try to post multiple times, waiting for 0.1 seconds between each attempt.

Parameters:
  • name – str = The name of the value to post.

  • value – str = The value to post.

get(name)[source]#

Get a value from the instrument’s web server.

Try to get multiple times, waiting for 0.1 seconds between each attempt.

Parameters:

name – str = The name of the value to get.

set(name, value)[source]#

Set a value to the instrument’s web server.

Parameters:
  • name (str) – Name of the paramater that we are updating. In qibolab this can be frequency, power or ref_osc_source, however the instrument’s web server may support more values.

  • value – New value to set to the given parameter. The type of value depends on the parameter being updated.

on()[source]#
off()[source]#
close()[source]#
class qibolab.instruments.erasynth.ERA(name, address, ethernet=True, ref_osc_source=None)[source]#

Bases: LocalOscillator

Driver to control the ERAsynth++ local oscillator.

This driver is using: https://qcodes.github.io/Qcodes_contrib_drivers/api/generated/qcodes_contrib_drivers.drivers.ERAInstruments.html#qcodes_contrib_drivers.drivers.ERAInstruments.erasynth.ERASynthPlusPlus

or the custom qibolab.instruments.erasynth.ERASynthEthernet object if we are connected via ethernet.

create()[source]#

Create instance of physical device.

qibolab.instruments.icarusq module#

qibolab.instruments.icarusqfpga module#

qibolab.instruments.oscillator module#

qibolab.instruments.oscillator.RECONNECTION_ATTEMPTS = 3#

Number of times to attempt connecting to instrument in case of failure.

class qibolab.instruments.oscillator.LocalOscillatorSettings(power: float | None = None, frequency: float | None = None, ref_osc_source: str | None = None)[source]#

Bases: InstrumentSettings

Local oscillator parameters that are saved in the platform runcard.

power: float | None = None#
frequency: float | None = None#
ref_osc_source: str | None = None#
dump()[source]#

Dictionary containing local oscillator settings.

The reference clock is excluded as it is not a calibrated parameter. None values are also excluded.

class qibolab.instruments.oscillator.LocalOscillator(name, address, ref_osc_source=None)[source]#

Bases: Instrument

Abstraction for local oscillator instruments.

Local oscillators are used to upconvert signals, when the controllers cannot send sufficiently high frequencies to address the qubits and resonators. They cannot be used to play or sweep pulses.

property frequency#
property power#
property ref_osc_source#
abstract create()[source]#

Create instance of physical device.

connect()[source]#

Connects to the instrument using the IP address set in the runcard.

disconnect()[source]#

Close connection to the physical instrument.

sync(parameter)[source]#

Sync parameter value between our cache and the instrument.

If the parameter value exists in our cache, it is uploaded to the instrument. If the value does not exist in our cache, it is downloaded

Parameters:

parameter (str) – Parameter name to be synced.

setup(**kwargs)[source]#

Update instrument settings.

If the instrument is connected the value is automatically uploaded to the instrument. Otherwise the value is cached and will be uploaded when connection is established.

Parameters:

**kwargs – Instrument settings loaded from the runcard.

qibolab.instruments.port module#

class qibolab.instruments.port.Port[source]#

Bases: object

Abstract interface for instrument parameters.

These parameters are exposed to the user through qibolab.channels.Channel.

Drivers should subclass this interface and implement the getters and setters for all the parameters that are available for the corresponding instruments.

Each port is identified by the name attribute. Note that the type of the identifier can be different of each port implementation.

name: str#

Name of the port that acts as its identifier.

offset: float#

DC offset that is applied to this port.

lo_frequency: float#

Local oscillator frequency for the given port.

Relevant only for controllers with internal local oscillators.

lo_power: float#

Local oscillator power for the given port.

Relevant only for controllers with internal local oscillators.

gain: float#

Gain that is applied to this port.

attenuation: float#

Attenuation that is applied to this port.

power_range: int#

Similar to attenuation (negative) and gain (positive) for (Zurich instruments).

qibolab.instruments.rohde_schwarz module#

class qibolab.instruments.rohde_schwarz.SGS100A(name, address, ref_osc_source=None)[source]#

Bases: LocalOscillator

Driver to control the Rohde-Schwarz SGS100A local oscillator.

This driver is using: https://qcodes.github.io/Qcodes/api/generated/qcodes.instrument_drivers.rohde_schwarz.html#module-qcodes.instrument_drivers.rohde_schwarz.SGS100A

create()[source]#

Create instance of physical device.