qibosoq.components package#

Helper objects.

Submodules#

qibosoq.components.base module#

Various helper objects.

class qibosoq.components.base.Config(repetition_duration: int = 100, adc_trig_offset: int = 200, reps: int = 1000, soft_avgs: int = 1, average: bool = True)[source]#

Bases: object

General RFSoC Configuration.

repetition_duration: int = 100#

Time to wait between shots (us).

adc_trig_offset: int = 200#

Time to wait between readout pulse and acquisition (ADC clock ticks).

reps: int = 1000#

Number of shots.

soft_avgs: int = 1#

Number of software averages.

average: bool = True#

Returns integrated results if true.

class qibosoq.components.base.OperationCode(value)[source]#

Bases: IntEnum

Available operations.

EXECUTE_PULSE_SEQUENCE = 1#
EXECUTE_PULSE_SEQUENCE_RAW = 2#
EXECUTE_SWEEPS = 3#
class qibosoq.components.base.Qubit(bias: float | None = None, dac: int | None = None)[source]#

Bases: object

Qubit object, storing flux information.

bias: float | None = None#

Amplitude factor, for sweetspot.

dac: int | None = None#

DAC responsible for flux control.

class qibosoq.components.base.Parameter(value)[source]#

Bases: str, Enum

Available parameters for sweepers.

FREQUENCY = 'freq'#
AMPLITUDE = 'gain'#
RELATIVE_PHASE = 'phase'#
DELAY = 't'#
BIAS = 'bias'#
DURATION = 'duration'#
classmethod variants(parameters: str) Parameter[source]#
classmethod variants(parameters: Iterable[str]) Iterable[Parameter]

Convert from strings to Parameters.

class qibosoq.components.base.Sweeper(expts: int, parameters: List[Parameter], indexes: List[int], starts: ndarray[Any, dtype[float64]], stops: ndarray[Any, dtype[float64]])[source]#

Bases: object

Sweeper object.

expts: int#

Number of points of the sweeper.

parameters: List[Parameter]#

List of parameter to update.

indexes: List[int]#

Index of the parameter to sweep relative to list of pulses or list of qubits.

starts: ndarray[Any, dtype[float64]]#

Start value for each parameter to sweep.

stops: ndarray[Any, dtype[float64]]#

Stop value for each parameter to sweep.

property serialized: dict#

Convert a Sweeper object into a dictionary.

In particular, takes care of the convertion arrays -> lists.

qibosoq.components.pulses module#

Pulses objects.

class qibosoq.components.pulses.Element(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int)[source]#

Bases: object

Abstract common oject for pulses and measurements.

type: str#

Type of the pulse.

frequency: float#

Frequency of the pulse (MHz).

start_delay: float#

Delay before pulse is triggered (us).

duration: float#

Duration of the pulse (us).

adc: int#

ADC to acquire pulse back, for readout pulses.

dac: int#

DAC responsible for firing the pulse.

property waveform_name: str | None#

Return waveform name from parameters.

property style: str | None#

Return waveform style from parameters.

class qibosoq.components.pulses.Measurement(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int)[source]#

Bases: Element

Measurement without pulse.

type: str = 'readout'#

Type of the pulse.

frequency: float#

Frequency of the pulse (MHz).

start_delay: float#

Delay before pulse is triggered (us).

duration: float#

Duration of the pulse (us).

adc: int#

ADC to acquire pulse back, for readout pulses.

dac: int#

DAC responsible for firing the pulse.

class qibosoq.components.pulses.Pulse(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str)[source]#

Bases: Element

Abstract Pulse object.

amplitude: float#

Amplitude factor, multiplied by maximum gain of the DAC.

relative_phase: int#

Relative phase (degrees).

name: str#

Name of the pulse, typically a serial.

type: str#

Can be ‘readout’, ‘drive’, ‘flux’.

class qibosoq.components.pulses.Rectangular(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str, shape: str = 'rectangular')[source]#

Bases: Pulse

Rectangular pulse.

shape: str = 'rectangular'#
property style: str | None#

Return waveform style from parameters.

class qibosoq.components.pulses.Gaussian(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str, rel_sigma: float, shape: str = 'gaussian')[source]#

Bases: Pulse

Gaussian pulse.

rel_sigma: float#

Sigma of the gaussian as a fraction of duration.

shape: str = 'gaussian'#
property waveform_name: str | None#

Return waveform name from parameters.

class qibosoq.components.pulses.Drag(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str, rel_sigma: float, beta: float, shape: str = 'drag')[source]#

Bases: Pulse

Drag pulse.

rel_sigma: float#

Sigma of the drag as a fraction of duration.

beta: float#

Beta parameter for drag pulse.

shape: str = 'drag'#
property waveform_name: str | None#

Return waveform name from parameters.

class qibosoq.components.pulses.FlatTop(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str, rel_sigma: float, shape: str = 'flattop')[source]#

Bases: Pulse

FlatTop pulse.

rel_sigma: float#

Sigma of the FlatTop as a fraction of duration.

shape: str = 'flattop'#
property waveform_name: str | None#

Return waveform name from parameters.

property style: str | None#

Return waveform style from parameters.

class qibosoq.components.pulses.FluxExponential(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str, tau: float, upsilon: float, weight: float, shape: str = 'fluxexponential')[source]#

Bases: Pulse

Flux pulse with exponential rising edge to correct distortions.

tau: float#
upsilon: float#
weight: float#
shape: str = 'fluxexponential'#
i_values(duration: int, max_gain: int)[source]#

Compute the waveform i values.

class qibosoq.components.pulses.Arbitrary(type: str, frequency: float, start_delay: float, duration: float, adc: int, dac: int, amplitude: float, relative_phase: int, name: str, i_values: List[float], q_values: List[float], shape: str = 'arbitrary')[source]#

Bases: Pulse

Custom pulse.

i_values: List[float]#
q_values: List[float]#
shape: str = 'arbitrary'#
property waveform_name: str | None#

Return waveform name from parameters.

class qibosoq.components.pulses.Shape(value)[source]#

Bases: Enum

Map shape names to the corresponding objects.

RECTANGULAR = <class 'qibosoq.components.pulses.Rectangular'>#
GAUSSIAN = <class 'qibosoq.components.pulses.Gaussian'>#
DRAG = <class 'qibosoq.components.pulses.Drag'>#
FLUXEXPONENTIAL = <class 'qibosoq.components.pulses.FluxExponential'>#
FLATTOP = <class 'qibosoq.components.pulses.FlatTop'>#
ARBITRARY = <class 'qibosoq.components.pulses.Arbitrary'>#