qibolab.instruments.rfsoc package#

RFSoC module driver for qibosoq.

Submodules#

qibolab.instruments.rfsoc.convert module#

Convert helper functions for rfsoc driver.

qibolab.instruments.rfsoc.convert.replace_pulse_shape(rfsoc_pulse: Pulse, shape: PulseShape) Pulse[source]#

Set pulse shape parameters in rfsoc_pulses pulse object.

qibolab.instruments.rfsoc.convert.pulse_lo_frequency(pulse: Pulse, qubits: dict[int, qibolab.qubits.Qubit]) int[source]#

Return local_oscillator frequency (HZ) of a pulse.

qibolab.instruments.rfsoc.convert.convert_units_sweeper(sweeper: Sweeper, sequence: PulseSequence, qubits: dict[int, qibolab.qubits.Qubit])[source]#

Convert units for qibosoq.abstract.Sweeper considering also LOs.

qibolab.instruments.rfsoc.convert.convert(*args)[source]#
qibolab.instruments.rfsoc.convert.convert(qubit: Qubit) Qubit
qibolab.instruments.rfsoc.convert.convert(sequence: PulseSequence, qubits: dict[int, qibolab.qubits.Qubit]) list[qibosoq.components.pulses.Pulse]
qibolab.instruments.rfsoc.convert.convert(pulse: Pulse, qubits: dict[int, qibolab.qubits.Qubit], start_delay: float) Pulse
qibolab.instruments.rfsoc.convert.convert(par: Parameter) Parameter
qibolab.instruments.rfsoc.convert.convert(sweeper: Sweeper, sequence: PulseSequence, qubits: dict[int, qibolab.qubits.Qubit]) Sweeper

Convert from qibolab obj to qibosoq obj, overloaded.

qibolab.instruments.rfsoc.driver module#

RFSoC FPGA driver.

class qibolab.instruments.rfsoc.driver.RFSoCPort(name: int, offset: float = 0.0)[source]#

Bases: Port

Port object of the RFSoC.

name: int#

DAC number.

offset: float = 0.0#

Amplitude factor for biasing.

class qibolab.instruments.rfsoc.driver.RFSoC(name: str, address: str, port: int)[source]#

Bases: Controller

Instrument object for controlling RFSoC FPGAs.

The two way of executing pulses are with play (for arbitrary qibolab PulseSequence) or with sweep that execute a PulseSequence object with one or more Sweeper.

cfg#

Configuration dictionary required for pulse execution.

Type:

rfsoc.Config

PortType#

alias of RFSoCPort

connect()[source]#

Empty method to comply with Instrument interface.

start()[source]#

Empty method to comply with Instrument interface.

stop()[source]#

Empty method to comply with Instrument interface.

disconnect()[source]#

Empty method to comply with Instrument interface.

setup()[source]#

Empty deprecated method.

play(qubits: dict[int, qibolab.qubits.Qubit], sequence: PulseSequence, execution_parameters: ExecutionParameters) dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]][source]#

Execute the sequence of instructions and retrieves readout results.

Each readout pulse generates a separate acquisition. The relaxation_time and the number of shots have default values.

Parameters:
  • qubits (dict) – List of qibolab.platforms.utils.Qubit objects passed from the platform.

  • execution_parameters (qibolab.ExecutionParameters) – Parameters (nshots, relaxation_time, fast_reset, acquisition_type, averaging_mode)

  • sequence (qibolab.pulses.PulseSequence) – Pulse sequence to play.

Returns:

A dictionary mapping the readout pulses serial and respective qubits to qibolab results objects

play_sequences(qubits, sequence, options)[source]#

Play pulses sequences by unrolling and retrieve feedback.

Returns:

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

static validate_input_command(sequence: PulseSequence, execution_parameters: ExecutionParameters, sweep: bool)[source]#

Check if sequence and execution_parameters are supported.

update_cfg(execution_parameters: ExecutionParameters)[source]#

Update rfsoc.Config object with new parameters.

classify_shots(i_values: ndarray[Any, dtype[float64]], q_values: ndarray[Any, dtype[float64]], qubit: Qubit) ndarray[Any, dtype[float64]][source]#

Classify IQ values using qubit threshold and rotation_angle if available in runcard.

play_sequence_in_sweep_recursion(qubits: dict[int, qibolab.qubits.Qubit], sequence: PulseSequence, or_sequence: PulseSequence, execution_parameters: ExecutionParameters) dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]][source]#

Last recursion layer, if no sweeps are present.

After playing the sequence, the resulting dictionary keys need to be converted to the correct values. Even indexes correspond to qubit number and are not changed. Odd indexes correspond to readout pulses serials and are convert to match the original sequence (of the sweep) and not the one just executed.

recursive_python_sweep(qubits: dict[int, qibolab.qubits.Qubit], sequence: PulseSequence, or_sequence: PulseSequence, *sweepers: Sweeper, execution_parameters: ExecutionParameters) dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]][source]#

Execute a sweep of an arbitrary number of Sweepers via recursion.

Parameters:
  • qubits (list) – List of qibolab.platforms.utils.Qubit objects passed from the platform.

  • sequence (qibolab.pulses.PulseSequence) – Pulse sequence to play. This object is a deep copy of the original sequence and gets modified.

  • or_sequence (qibolab.pulses.PulseSequence) – Reference to original sequence to not modify.

  • *sweepers (qibolab.Sweeper) – Sweeper objects.

  • execution_parameters (qibolab.ExecutionParameters) – Parameters (nshots, relaxation_time, fast_reset, acquisition_type, averaging_mode)

Returns:

A dictionary mapping the readout pulses serial and respective qubits to results objects

static merge_sweep_results(dict_a: dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]], dict_b: dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]]) dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]][source]#

Merge two dictionary mapping pulse serial to Results object.

If dict_b has a key (serial) that dict_a does not have, simply add it, otherwise sum the two results

Parameters:
  • dict_a (dict) – dict mapping ro pulses serial to qibolab res objects

  • dict_b (dict) – dict mapping ro pulses serial to qibolab res objects

Returns:

A dict mapping the readout pulses serial to qibolab results objects

get_if_python_sweep(sequence: PulseSequence, *sweepers: Sweeper) bool[source]#

Check if a sweeper must be run with python loop or on hardware.

To be run on qick internal loop a sweep must:
  • not be on the readout frequency

  • not be a duration sweeper

  • only one pulse per channel supported

  • flux pulses are not compatible with sweepers

Parameters:
  • sequence (qibolab.pulses.PulseSequence) –

  • *sweepers (qibosoq.abstract.Sweeper) – Sweeper objects.

Returns:

A boolean value true if the sweeper must be executed by python loop, false otherwise

convert_sweep_results(original_ro: PulseSequence, qubits: dict[int, qibolab.qubits.Qubit], toti: list[list[list[float]]], totq: list[list[list[float]]], execution_parameters: ExecutionParameters) dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]][source]#

Convert sweep res to qibolab dict res.

Parameters:
  • original_ro (qibolab.pulses.PulseSequence) – Original PulseSequence

  • qubits (list) – List of qibolab.platforms.utils.Qubit objects passed from the platform.

  • toti (list) – i values

  • totq (list) – q values

  • results_type – qibolab results object

  • execution_parameters (qibolab.ExecutionParameters) – Parameters (nshots, relaxation_time, fast_reset, acquisition_type, averaging_mode)

Returns:

A dict mapping the readout pulses serial to qibolab results objects

sweep(qubits: dict[int, qibolab.qubits.Qubit], sequence: PulseSequence, execution_parameters: ExecutionParameters, *sweepers: Sweeper) dict[str, Union[qibolab.result.IntegratedResults, qibolab.result.SampleResults]][source]#

Execute the sweep and retrieves the readout results.

Each readout pulse generates a separate acquisition. The relaxation_time and the number of shots have default values.

Parameters:
  • qubits (list) – List of qibolab.platforms.utils.Qubit objects passed from the platform.

  • execution_parameters (qibolab.ExecutionParameters) – Parameters (nshots, relaxation_time, fast_reset, acquisition_type, averaging_mode)

  • sequence (qibolab.pulses.PulseSequence) –

  • *sweepers (qibolab.Sweeper) – Sweeper objects.

Returns:

A dictionary mapping the readout pulses serial and respective qubits to results objects