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:
- property sampling_rate: int¶
Sampling rate of control electronics in giga samples per second (GSps).
- play(configs: dict[str, Config], sequences: list[PulseSequence], options: ExecutionParameters, sweepers: list[list[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:
- property sampling_rate: int¶
Sampling rate of control electronics in giga samples per second (GSps).
- play(configs: dict[str, Config], sequences: list[PulseSequence], options: ExecutionParameters, sweepers: list[list[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>, engine: ~qibolab._core.instruments.emulator.engine.abstract.SimulationEngine = QutipEngine(), **extra_data: ~typing.Any)[source]¶
Bases:
Controller
Emulator controller.
- engine: SimulationEngine¶
SimulationEngine. Default is QutipEngine.
- property sampling_rate¶
Sampling rate of emulator.
- play(configs: dict[str, Config], sequences: list[PulseSequence], options: ExecutionParameters, sweepers: list[list[Sweeper]]) dict[int, ndarray[tuple[Any, ...], dtype[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, qubits: dict[~typing.Annotated[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[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibolab._core.identifier._split, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibolab._core.identifier._join, return_type=PydanticUndefined, when_used=always)], ~qibolab._core.instruments.emulator.hamiltonians.CapacitiveCoupling] = <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].
- qubits: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Qubit]¶
- pairs: dict[Annotated[tuple[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], BeforeValidator(func=_split, json_schema_input_type=PydanticUndefined), PlainSerializer(func=_join, return_type=PydanticUndefined, when_used=always)], CapacitiveCoupling]¶
- property nqubits¶
Number of qubits.
- initial_state(engine: SimulationEngine) Operator [source]¶
Initial state as ground state of the system.
- hilbert_space_index(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) int [source]¶
Return Hilbert space index from qubit id.
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.qblox 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].