qibolab.instruments package#
- class qibolab.instruments.DummyLocalOscillator(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = <factory>, device: ~qibolab._core.instruments.oscillator.Device | None = None, **extra_data: ~typing.Any)[source]#
Bases:
LocalOscillator
Dummy local oscillator instrument.
Useful for testing the interface defined in
qibolab.instruments.oscillator.LocalOscillator
.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class qibolab.instruments.DummyInstrument(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = None, bounds: str = 'dummy/bounds', channels: dict[str, qibolab._core.components.channels.Channel] = <factory>, **extra_data: ~typing.Any)[source]#
Bases:
Controller
Dummy instrument that returns random voltage values.
Useful for testing code without requiring access to hardware.
- Parameters:
- channels: dict[str, qibolab._core.components.channels.Channel]#
- property sampling_rate: int#
Sampling rate of control electronics in giga samples per second (GSps).
- play(configs: dict[str, qibolab._core.components.configs.Config], sequences: list[qibolab._core.sequence.PulseSequence], options: ExecutionParameters, sweepers: list[list[qibolab._core.sweeper.Sweeper]])[source]#
Play a pulse sequence and retrieve feedback.
If
qibolab.Sweeper
objects are passed as arguments, they are executed in real-time. If not possible, an error is raised.Returns a mapping with the id of the probe pulses used to acquired data.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Submodules#
qibolab.instruments.bluefors module#
Bluefors drivers.
- class qibolab.instruments.bluefors.TemperatureController(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = None, port: int = 8888, client_socket: ~socket.socket = <factory>, **extra_data: ~typing.Any)[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)
- 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 usingdatetime.fromtimestamp
.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
qibolab.instruments.dummy module#
Dummy drivers.
Define instruments mainly used for testing purposes.
- class qibolab.instruments.dummy.DummyLocalOscillator(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = <factory>, device: ~qibolab._core.instruments.oscillator.Device | None = None, **extra_data: ~typing.Any)[source]#
Bases:
LocalOscillator
Dummy local oscillator instrument.
Useful for testing the interface defined in
qibolab.instruments.oscillator.LocalOscillator
.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class qibolab.instruments.dummy.DummyInstrument(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = None, bounds: str = 'dummy/bounds', channels: dict[str, qibolab._core.components.channels.Channel] = <factory>, **extra_data: ~typing.Any)[source]#
Bases:
Controller
Dummy instrument that returns random voltage values.
Useful for testing code without requiring access to hardware.
- Parameters:
- channels: dict[str, qibolab._core.components.channels.Channel]#
- property sampling_rate: int#
Sampling rate of control electronics in giga samples per second (GSps).
- play(configs: dict[str, qibolab._core.components.configs.Config], sequences: list[qibolab._core.sequence.PulseSequence], options: ExecutionParameters, sweepers: list[list[qibolab._core.sweeper.Sweeper]])[source]#
Play a pulse sequence and retrieve feedback.
If
qibolab.Sweeper
objects are passed as arguments, they are executed in real-time. If not possible, an error is raised.Returns a mapping with the id of the probe pulses used to acquired data.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
qibolab.instruments.era module#
ERA drivers.
- class qibolab.instruments.era.ERASynth(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.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
qibolab.instruments.qm module#
Quantum machines drivers.
- class qibolab.instruments.qm.OpxOutputConfig(*, kind: ~typing.Literal['opx-output'] = 'opx-output', offset: float = 0.0, filter: dict[str, list[float]] = <factory>, output_mode: ~typing.Literal['direct', 'amplified'] = 'direct')[source]#
Bases:
DcConfig
DC channel config using QM OPX+.
- filter: dict[str, list[float]]#
FIR and IIR filters to be applied for correcting signal distortions.
See https://docs.quantum-machines.co/1.1.7/qm-qua-sdk/docs/Guides/output_filter/?h=filter#output-filter for more details. Changing the filters affects the calibration of single shot discrimination (threshold and angle).
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class qibolab.instruments.qm.QmAcquisitionConfig(*, kind: Literal['qm-acquisition'] = 'qm-acquisition', delay: float, smearing: float, threshold: float | None = None, iq_angle: float | None = None, kernel: ndarray[Any, dtype[_ScalarType_co]] | None = None, gain: int = 0, offset: float = 0.0)[source]#
Bases:
AcquisitionConfig
Acquisition config for QM OPX+.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class qibolab.instruments.qm.OctaveOscillatorConfig(*, kind: Literal['octave-oscillator'] = 'octave-oscillator', frequency: float, power: float, output_mode: Literal['always_on', 'always_off', 'triggered', 'triggered_reversed'] = 'triggered')[source]#
Bases:
OscillatorConfig
Oscillator confing that allows switching the output mode.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class qibolab.instruments.qm.QmController(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = None, bounds: str = 'qm/bounds', channels: dict[str, qibolab._core.components.channels.Channel] = <factory>, octaves: dict[str, qibolab._core.instruments.qm.controller.Octave] = <factory>, fems: dict[str, typing.Literal['opx1', 'LF', 'MW']] = <factory>, calibration_path: ~os.PathLike | None = None, write_calibration: bool = False, script_file_name: str | None = None, manager: ~qm.quantum_machines_manager.QuantumMachinesManager | None = None, config: ~qibolab._core.instruments.qm.config.config.Configuration = <factory>, simulation_duration: int | None = None, cloud: bool = False, **extra_data: ~typing.Any)[source]#
Bases:
Controller
qibolab.instruments.abstract.Controller
object for controlling a Quantum Machines cluster.Playing pulses on QM controllers requires a
config
dictionary and a program written in QUA language. Theconfig
file is generated using thedataclass
objects defined inqibolab.instruments.qm.config
. The QUA program is generated using the methods inqibolab.instruments.qm.program
. Controllers, elements and pulses are added in theconfig
after a pulse sequence is given, so that only elements related to the participating channels are registered.- address: str#
IP address and port for connecting to the OPX instruments.
Has the form XXX.XXX.XXX.XXX:XXX.
- octaves: dict[str, qibolab._core.instruments.qm.controller.Octave]#
Dictionary containing the Octaves used.
- fems: dict[str, Literal['opx1', 'LF', 'MW']]#
Dictionary containing the FEM types (for OPX1000 clusters).
Defaults to ‘opx1’ type to maintain original behavior for OPX+ clusters where
fems
are not given.
- script_file_name: str | None#
Name of the file that the QUA program will dumped in that after every execution.
If
None
the program will not be dumped.
- manager: QuantumMachinesManager | None#
Manager object used for controlling the Quantum Machines cluster.
- config: Configuration#
Configuration dictionary required for pulse execution on the OPXs.
- simulation_duration: int | None#
Duration for the simulation in ns.
If given the simulator will be used instead of actual hardware execution.
- cloud: bool#
If
True
the QM cloud simulator is used which does not require access to physical instruments.This assumes that a proper cloud address has been given. If
False
andsimulation_duration
was given, then the built-in simulator of the instruments is used. This requires connection to instruments. Default isFalse
.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None #
We need to both initialize private attributes and call the user-defined model_post_init method.
- property sampling_rate#
Sampling rate of Quantum Machines instruments.
- configure_channel(channel: str, configs: dict[str, qibolab._core.components.configs.Config]) str | None [source]#
Add element (QM version of channel) in the config.
When an
AcquisitionChannel
is registered it returns the corresponding probe channel in order to build an (acquisition, probe) map.
- configure_channels(configs: dict[str, qibolab._core.components.configs.Config], channels: set[str]) dict[str, str] [source]#
Register channels in the sequence in the QM
config
.Builds a map from probe channels to the corresponding
AcquisitionChannel
. This is useful when sweeping frequency of probe channels, as these are registered as acquire elements in the QM config.
- register_pulse(channel: str, config: Config, pulse: Pulse | Readout) str [source]#
Add pulse in the QM
config
.And return corresponding operation.
- register_pulses(configs: dict[str, qibolab._core.components.configs.Config], sequence: PulseSequence)[source]#
Adds all pulses except measurements of a given sequence in the QM
config
.- Returns:
Map from measurement instructions to acquisition objects.
- Return type:
acquisitions (dict)
- register_duration_sweeper_pulses(args: ExecutionArguments, configs: dict[str, qibolab._core.components.configs.Config], sweeper: Sweeper)[source]#
Register pulse with many different durations.
Needed when sweeping duration.
- register_amplitude_sweeper_pulses(args: ExecutionArguments, configs: dict[str, qibolab._core.components.configs.Config], sweeper: Sweeper)[source]#
Register pulse with different amplitude.
Needed when sweeping amplitude because the original amplitude may not sufficient to reach all the sweeper values.
- register_acquisitions(configs: dict[str, qibolab._core.components.configs.Config], sequence: PulseSequence, options: ExecutionParameters)[source]#
Add all measurements of a given sequence in the QM
config
.- Returns:
Map from measurement instructions to acquisition objects.
- Return type:
acquisitions (dict)
- preprocess_sweeps(sweepers: list[list[qibolab._core.sweeper.Sweeper]], configs: dict[str, qibolab._core.components.configs.Config], args: ExecutionArguments, probe_map: dict[str, str])[source]#
Preprocessing and checks needed before executing some sweeps.
Amplitude and duration sweeps require registering additional pulses in the QM ``config.
- play(configs: dict[str, qibolab._core.components.configs.Config], sequences: list[qibolab._core.sequence.PulseSequence], options: ExecutionParameters, sweepers: list[list[qibolab._core.sweeper.Sweeper]])[source]#
Play a pulse sequence and retrieve feedback.
If
qibolab.Sweeper
objects are passed as arguments, they are executed in real-time. If not possible, an error is raised.Returns a mapping with the id of the probe pulses used to acquired data.
qibolab.instruments.rohde_schwarz module#
Rohde & Schwarz drivers.
https://www.rohde-schwarz.com/
- class qibolab.instruments.rohde_schwarz.SGS100A(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = <factory>, device: ~qibolab._core.instruments.oscillator.Device | None = None, **extra_data: ~typing.Any)[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
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'frozen': False}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].