Executor

keysight.qcs.executor.Executor

A class to manipulate and alter programs.

keysight.qcs.executor.HclBackend

A pass for running a Program on hardware.

keysight.qcs.executor.LinkerPass

A pass for converting operations in a Program.

keysight.qcs.executor.Pass

An abstract base class for all passes that manipulate and return an altered program.

Executor

class keysight.qcs.executor.Executor(*passes: Pass)

A class to manipulate and alter programs.

An instance of this class stores a list of Passes that define rules for how to alter (e.g., convert gate operations to waveforms) or execute programs.

Parameters:

*passes – The passes for this executor.

property passes: tuple[keysight.qcs.executor.base.Pass]

A list of passes applied by this executor.

execute(program: Program) Program

Returns the executed program by sequentially applying each pass to the program.

Parameters:

program – The program to execute.

HclBackend

class keysight.qcs.executor.HclBackend(channel_mapper: ChannelMapper, hw_demod: bool = False, init_time: float = 0.0001, hvi_debug: bool = False, blocking: bool = True, auto_delays: bool = True, suppress_rounding_warnings: bool = False)

A pass for running a Program on hardware.

This pass supports hardware sweeping of variables. This is enabled automatically when a program’s repetitions() contain a Sweep as its innermost repetition. This can be accomplished by calling sweep() before n_shots().

Note

This feature is currently only supported with hw_demod=True and will only sweep the innermost sweep and repeat on hardware.

Parameters:
  • channel_mapper – A ChannelMapper.

  • hw_demod – Whether or not to demodulate trace data directly on the hardware.

  • init_time – The time delay between the end of one program iteration and the start of the next iteration, in seconds.

  • hvi_debug – Whether to log HVI debugging information.

  • blocking – Whether to block the Python kernel while the program is executing. When blocking is False, the program is returned immediately with its loader set to access the results once it finishes executing. This disables the progress bar.

  • auto_delays – Whether to automatically add delays based on FPGA firmware.

  • suppress_rounding_warnings – Whether to suppress warnings about rounding durations.

Raises:

ValueError – If the current platform is not Windows and no remote address was provided in the channel mapper.

property blocking: bool

Whether to block the kernel during execution of programs.

property channel_mapper: ChannelMapper

The map from virtual to physical channels.

property hw_demod: bool

Whether to demodulate trace data directly on the hardware by default.

apply(program: Program) Program

Runs the program on hardware.

Parameters:

program – The program to run.

Raises:
  • ValueError – If the system is not ready to run programs.

  • ValueError – If performing a hardware sweep without hardware demodulation.

  • ValueError – If performing a nested hardware sweep.

abort_program(accession_id: int) bool

Abort a program with a specified accession_id.

Parameters:

accession_id – The accession id of the program to abort.

get_messages(accession_id: int, skip_messages: int = 0) list[str]

Gets the messages associated with a program submission.

Parameters:
  • accession_id – The accession ID of the program.

  • skip_messages – The number of messages to skip.

is_system_ready() bool

Whether the system is ready to run programs.

is_program_completed(accession_id: int) bool

Whether a program is completed.

Parameters:

accession_id – The accession id of the program to check the status.

get_program(accession_id: int, timeout: int = 300) Program

Gets the program associated with an accession_id from the database.

Parameters:
  • accession_id – The accession ID of the program.

  • timeout – The timeout in seconds to wait.

get_program_state(accession_id: int) str

Returns a string representation of a program’s execution state

Parameters:

accession_id – The accession id of the program to check the status.

Linker Pass

class keysight.qcs.executor.LinkerPass(*linkers: BaseLinker, duration_map: dict[BaseOperation, float | Variable[float]] | None = None)

A pass for converting operations in a Program.

Note

When using linkers that contain operations without specified durations, their durations should be specified using the duration_map argument.

Note

When using this pass with conditional operations, rather than using a single linker for the entire operation, the pass will instead link each of the operations individually to create a new conditional operation.

Note

Linkers with conditional operations in their program are not supported by this pass.

Parameters:
  • *linkers – A BaseLinker to apply.

  • duration_map – A dictionary from base operations to their durations.

apply(program: Program) Program

Applies the pass.

Parameters:

program – The program to apply the pass to.

Pass

class keysight.qcs.executor.Pass

An abstract base class for all passes that manipulate and return an altered program.

Every pass has an apply method that accepts a program and returns a (potentially new) instance of the program. Pass-specific options can be provided when initializing the pass.

abstract apply(program: Program) Program

Applies the pass.

Parameters:

program – The program to apply the pass to.

On this page