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.emulator module#
Emulator engine.
- class qibolab.instruments.emulator.EmulatorController(*, address: str, settings: ~qibolab._core.instruments.abstract.InstrumentSettings | None = None, bounds: str = 'emulator/bounds', channels: dict[str, qibolab._core.components.channels.Channel] = <factory>, **extra_data: ~typing.Any)[source]#
Bases:
Controller
Emulator controller.
- property sampling_rate#
Sampling rate of emulator.
- play(configs: dict[str, qibolab._core.components.configs.Config], sequences: list[qibolab._core.sequence.PulseSequence], options: ExecutionParameters, sweepers: list[list[qibolab._core.sweeper.Sweeper]]) dict[int, numpy.ndarray[tuple[int, ...], numpy.dtype[numpy.float64]]] [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].
- class qibolab.instruments.emulator.DriveEmulatorConfig(*, kind: Literal['drive-emulator'] = 'drive-emulator', frequency: float, rabi_frequency: float = 1000000000.0, scale_factor: float = 1)[source]#
Bases:
Config
Configuration for an IQ channel.
- 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.emulator.FluxEmulatorConfig(*, kind: Literal['flux-emulator'] = 'flux-emulator', offset: float, voltage_to_flux: float = 1)[source]#
Bases:
Config
Configuration for a flux line.
- 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.emulator.HamiltonianConfig(*, kind: ~typing.Literal['hamiltonian'] = 'hamiltonian', transmon_levels: int = 2, single_qubit: dict[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], qibolab._core.instruments.emulator.hamiltonians.Qubit] = <factory>, pairs: dict[typing.Annotated[tuple[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], BeforeValidator(func=<function _split at 0x7efedb8f9a80>, json_schema_input_type=PydanticUndefined), PlainSerializer(func=<function _join at 0x7efedb8f9b20>, return_type=PydanticUndefined, when_used='always')], qibolab._core.instruments.emulator.hamiltonians.QubitPair] = <factory>)[source]#
Bases:
Config
Hamiltonian configuration.
- 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].
- single_qubit: dict[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], qibolab._core.instruments.emulator.hamiltonians.Qubit]#
- pairs: dict[typing.Annotated[tuple[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], BeforeValidator(func=<function _split at 0x7efedb8f9a80>, json_schema_input_type=PydanticUndefined), PlainSerializer(func=<function _join at 0x7efedb8f9b20>, return_type=PydanticUndefined, when_used='always')], qibolab._core.instruments.emulator.hamiltonians.QubitPair]#
- update_from_configs(config: dict[str, qibolab._core.components.configs.Config]) HamiltonianConfig [source]#
Update hamiltonian parameters from configs.
- property initial_state#
Initial state as ground state of the system.
- property qubits#
- property nqubits#
- property hamiltonian: Qobj#
Time independent part of Hamiltonian.
- property dissipation: Qobj#
Dissipation operators for the hamiltonian.
They are going to be passed to mesolve as collapse operators.
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.keysight_qcs module#
qibolab.instruments.qm module#
qibolab.instruments.qrng module#
Quantum random number generator drivers.
- class qibolab.instruments.qrng.QRNG(*, address: str, settings: InstrumentSettings | None = None, baudrate: int = 115200, extractor: Extractor = ShaExtractor(), port: Serial | None = None, bytes_per_number: int = 4, **extra_data: Any)[source]#
Bases:
Instrument
Driver to sample numbers from a Quantum Random Number Generator (QRNG).
See Quantum Random Number Generator for example usage.
- extractor: Extractor#
- read(n: int) List[int] [source]#
Read raw samples from the QRNG device serial output.
In the entropy mode of the device, these typically follow a normal distribution.
- Parameters:
n – Number of samples to retrieve.
- 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.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].