qibolab.platform package#
- class qibolab.platform.Platform(name: str, qubits: ~typing.Dict[str | int, ~qibolab.qubits.Qubit], pairs: ~typing.Dict[~typing.Tuple[str | int, str | int], ~qibolab.qubits.QubitPair], instruments: ~typing.Dict[str, ~qibolab.instruments.abstract.Instrument], settings: ~qibolab.platform.platform.Settings = <factory>, resonator_type: str | None = None, couplers: ~typing.Dict[str | int, ~qibolab.couplers.Coupler] = <factory>, is_connected: bool = False, topology: ~networkx.classes.graph.Graph = <factory>)[source]#
Bases:
object
Platform for controlling quantum devices.
- pairs: Dict[Tuple[str | int, str | int], QubitPair]#
Dictionary mapping tuples of qubit names to
qibolab.qubits.QubitPair
objects.
- instruments: Dict[str, Instrument]#
Dictionary mapping instrument names to
qibolab.instruments.abstract.Instrument
objects.
- resonator_type: str | None = None#
Type of resonator (2D or 3D) in the used QPU.
Default is 3D for single-qubit chips and 2D for multi-qubit.
- couplers: Dict[str | int, Coupler]#
Dictionary mapping coupler names to
qibolab.couplers.Coupler
objects.
- topology: Graph#
Graph representing the qubit connectivity in the quantum chip.
- property ordered_pairs#
List of qubit pairs that are connected in the QPU.
- property sampling_rate#
Sampling rate of control electronics in giga samples per second (GSps).
- execute_pulse_sequence(sequence: PulseSequence, options: ExecutionParameters, **kwargs)[source]#
- Parameters:
sequence (
qibolab.pulses.PulseSequence
) – Pulse sequences to execute.options (
qibolab.platforms.platform.ExecutionParameters
) – Object holding the execution options.**kwargs – May need them for something
- Returns:
Readout results acquired by after execution.
- execute_pulse_sequences(sequences: List[PulseSequence], options: ExecutionParameters, **kwargs)[source]#
- Parameters:
sequence (List[
qibolab.pulses.PulseSequence
]) – Pulse sequences to execute.options (
qibolab.platforms.platform.ExecutionParameters
) – Object holding the execution options.**kwargs – May need them for something
- Returns:
Readout results acquired by after execution.
- sweep(sequence: PulseSequence, options: ExecutionParameters, *sweepers: Sweeper)[source]#
Executes a pulse sequence for different values of sweeped parameters.
Useful for performing chip characterization.
Example
import numpy as np from qibolab.dummy import create_dummy from qibolab.sweeper import Sweeper, Parameter from qibolab.pulses import PulseSequence from qibolab.execution_parameters import ExecutionParameters platform = create_dummy() sequence = PulseSequence() parameter = Parameter.frequency pulse = platform.create_qubit_readout_pulse(qubit=0, start=0) sequence.add(pulse) parameter_range = np.random.randint(10, size=10) sweeper = Sweeper(parameter, parameter_range, [pulse]) platform.sweep(sequence, ExecutionParameters(), sweeper)
- Returns:
Readout results acquired by after execution.
- get_qubit(qubit)[source]#
Return the name of the physical qubit corresponding to a logical qubit.
Temporary fix for the compiler to work for platforms where the qubits are not named as 0, 1, 2, …
- get_coupler(coupler)[source]#
Return the name of the physical coupler corresponding to a logical coupler.
Temporary fix for the compiler to work for platforms where the couplers are not named as 0, 1, 2, …
- qibolab.platform.create_platform(name: str) Platform [source]#
A platform for executing quantum algorithms.
It consists of a quantum processor QPU and a set of controlling instruments.
- Parameters:
name (str) – name of the platform. Options are ‘tiiq’, ‘qili’ and ‘icarusq’.
path (pathlib.Path) – path with platform serialization
- Returns:
The plaform class.
- qibolab.platform.unroll_sequences(sequences: List[PulseSequence], relaxation_time: int) Tuple[PulseSequence, Dict[str, str]] [source]#
Unrolls a list of pulse sequences to a single pulse sequence with multiple measurements.
- Parameters:
- Returns:
- Unrolled pulse sequence containing
multiple measurements.
- readout_map (dict): Map from original readout pulse serials to the unrolled readout pulse
serials. Required to construct the results dictionary that is returned after execution.
- Return type:
total_sequence (
qibolab.pulses.PulseSequence
)
Submodules#
qibolab.platform.load module#
- qibolab.platform.load.create_platform(name: str) Platform [source]#
A platform for executing quantum algorithms.
It consists of a quantum processor QPU and a set of controlling instruments.
- Parameters:
name (str) – name of the platform. Options are ‘tiiq’, ‘qili’ and ‘icarusq’.
path (pathlib.Path) – path with platform serialization
- Returns:
The plaform class.
qibolab.platform.platform module#
A platform for executing quantum algorithms.
- qibolab.platform.platform.unroll_sequences(sequences: List[PulseSequence], relaxation_time: int) Tuple[PulseSequence, Dict[str, str]] [source]#
Unrolls a list of pulse sequences to a single pulse sequence with multiple measurements.
- Parameters:
- Returns:
- Unrolled pulse sequence containing
multiple measurements.
- readout_map (dict): Map from original readout pulse serials to the unrolled readout pulse
serials. Required to construct the results dictionary that is returned after execution.
- Return type:
total_sequence (
qibolab.pulses.PulseSequence
)
- class qibolab.platform.platform.Settings(nshots: int = 1024, relaxation_time: int = 100000)[source]#
Bases:
object
Default execution settings read from the runcard.
- relaxation_time: int = 100000#
Time in ns to wait for the qubit to relax to its ground state between shots.
- fill(options: ExecutionParameters)[source]#
Use default values for missing execution options.
- class qibolab.platform.platform.Platform(name: str, qubits: ~typing.Dict[str | int, ~qibolab.qubits.Qubit], pairs: ~typing.Dict[~typing.Tuple[str | int, str | int], ~qibolab.qubits.QubitPair], instruments: ~typing.Dict[str, ~qibolab.instruments.abstract.Instrument], settings: ~qibolab.platform.platform.Settings = <factory>, resonator_type: str | None = None, couplers: ~typing.Dict[str | int, ~qibolab.couplers.Coupler] = <factory>, is_connected: bool = False, topology: ~networkx.classes.graph.Graph = <factory>)[source]#
Bases:
object
Platform for controlling quantum devices.
- pairs: Dict[Tuple[str | int, str | int], QubitPair]#
Dictionary mapping tuples of qubit names to
qibolab.qubits.QubitPair
objects.
- instruments: Dict[str, Instrument]#
Dictionary mapping instrument names to
qibolab.instruments.abstract.Instrument
objects.
- resonator_type: str | None = None#
Type of resonator (2D or 3D) in the used QPU.
Default is 3D for single-qubit chips and 2D for multi-qubit.
- couplers: Dict[str | int, Coupler]#
Dictionary mapping coupler names to
qibolab.couplers.Coupler
objects.
- topology: Graph#
Graph representing the qubit connectivity in the quantum chip.
- property ordered_pairs#
List of qubit pairs that are connected in the QPU.
- property sampling_rate#
Sampling rate of control electronics in giga samples per second (GSps).
- execute_pulse_sequence(sequence: PulseSequence, options: ExecutionParameters, **kwargs)[source]#
- Parameters:
sequence (
qibolab.pulses.PulseSequence
) – Pulse sequences to execute.options (
qibolab.platforms.platform.ExecutionParameters
) – Object holding the execution options.**kwargs – May need them for something
- Returns:
Readout results acquired by after execution.
- execute_pulse_sequences(sequences: List[PulseSequence], options: ExecutionParameters, **kwargs)[source]#
- Parameters:
sequence (List[
qibolab.pulses.PulseSequence
]) – Pulse sequences to execute.options (
qibolab.platforms.platform.ExecutionParameters
) – Object holding the execution options.**kwargs – May need them for something
- Returns:
Readout results acquired by after execution.
- sweep(sequence: PulseSequence, options: ExecutionParameters, *sweepers: Sweeper)[source]#
Executes a pulse sequence for different values of sweeped parameters.
Useful for performing chip characterization.
Example
import numpy as np from qibolab.dummy import create_dummy from qibolab.sweeper import Sweeper, Parameter from qibolab.pulses import PulseSequence from qibolab.execution_parameters import ExecutionParameters platform = create_dummy() sequence = PulseSequence() parameter = Parameter.frequency pulse = platform.create_qubit_readout_pulse(qubit=0, start=0) sequence.add(pulse) parameter_range = np.random.randint(10, size=10) sweeper = Sweeper(parameter, parameter_range, [pulse]) platform.sweep(sequence, ExecutionParameters(), sweeper)
- Returns:
Readout results acquired by after execution.
- get_qubit(qubit)[source]#
Return the name of the physical qubit corresponding to a logical qubit.
Temporary fix for the compiler to work for platforms where the qubits are not named as 0, 1, 2, …
- get_coupler(coupler)[source]#
Return the name of the physical coupler corresponding to a logical coupler.
Temporary fix for the compiler to work for platforms where the couplers are not named as 0, 1, 2, …