gettables_profiled#
This module represents the Q-Profile quantum control electronics profiler.
Profiling of the control electronics is enabled by using the
ProfiledScheduleGettable
in place of
ScheduleGettable
.
Note
The ProfiledScheduleGettable
is currently only tested to support Qblox hardware.
Module Contents#
Classes#
Subclass of |
|
To be used in place of |
Functions#
|
Decorator that reports the execution time of the decorated function |
- profiler(func: Callable) Callable [source]#
Decorator that reports the execution time of the decorated function and stores this in
ProfiledInstrumentCoordinator.profile
.- Parameters:
func (Callable) – Target function to be profiled.
- class ProfiledInstrumentCoordinator(name: str, parent_ic: quantify_scheduler.instrument_coordinator.instrument_coordinator.InstrumentCoordinator)[source]#
Bases:
quantify_scheduler.instrument_coordinator.instrument_coordinator.InstrumentCoordinator
Subclass of
InstrumentCoordinator
that implements a profiling tool to log timing results. Time results are stored inProfiledInstrumentCoordinator.profile
.ProfiledInstrumentCoordinator
is set up to be used when usingProfiledScheduleGettable
, code example:ic = InstrumentCoordinator(name="instrument_coordinator") quantum_device = QuantumDevice(name="quantum_device") quantum_device.instr_instrument_coordinator(ic.name) profiled_gettable = ProfiledScheduleGettable( quantum_device=quantum_device, schedule_function=..., schedule_kwargs=..., ) profiled_gettable.initialize() profiled_ic = ( profiled_gettable.quantum_device.instr_instrument_coordinator.get_instr() )
- Parameters:
name (str) – Name of
ProfiledInstrumentCoordinator
instance.parent_ic (InstrumentCoordinator) – Original
InstrumentCoordinator
.
- add_component(component: quantify_scheduler.instrument_coordinator.components.InstrumentCoordinatorComponentBase) None [source]#
Adds a component to the components collection.
- Parameters:
component – The component to add.
- Raises:
ValueError – If a component with a duplicated name is added to the collection.
TypeError – If
component
is not an instance of the base component.
- prepare(compiled_schedule: quantify_scheduler.schedules.schedule.CompiledSchedule) None [source]#
Prepares each component for execution of a schedule.
It attempts to configure all instrument coordinator components for which compiled instructions, typically consisting of a combination of sequence programs, waveforms and other instrument settings, are available in the compiled schedule.
- Parameters:
compiled_schedule – A schedule containing the information required to execute the program.
- Raises:
KeyError – If the compiled schedule contains instructions for a component absent in the instrument coordinator.
TypeError – If the schedule provided is not a valid
CompiledSchedule
.
- start() None [source]#
Start all of the components that appear in the compiled instructions.
The instruments will be started in the order in which they were added to the instrument coordinator.
- stop(allow_failure: bool = False) None [source]#
Stops all components.
The components are stopped in the order in which they were added.
- Parameters:
allow_failure – By default it is set to False. When set to True, the AttributeErrors raised by a component are demoted to warnings to allow other components to stop.
- retrieve_acquisition() xarray.Dataset [source]#
Retrieves the latest acquisition results of the components with acquisition capabilities.
- Returns:
The acquisition data in an
xarray.Dataset
. For each acquisition channel it contains anxarray.DataArray
.
- class ProfiledScheduleGettable(*args, **kwargs)[source]#
Bases:
quantify_scheduler.gettables.ScheduleGettable
To be used in place of
ScheduleGettable
to enable profiling of the compilation. Logged execution times can be read fromself.profile
, and plotted viaplot_profile()
.- instr_coordinator: quantify_scheduler.instrument_coordinator.instrument_coordinator.InstrumentCoordinator[source]#
- _compile(sched: quantify_scheduler.schedules.schedule.Schedule) None [source]#
Overwrite compile step for profiling.