qfabric.programmer¶
programmer¶
- class qfabric.programmer.programmer.Programmer(devices)¶
Bases:
objectProgramming interface to all AWGs.
- Parameters:
devices (list[Device]) – AWG devices.
- program_memory_single_device(device_index, instructions)¶
Program the memory of a single AWG device given instructions.
- Parameters:
device_index (int) – Index of the AWG device.
instructions (Any) – Instructions to program the AWG memory.
- program_segment_step_single_device(device_index, segment_indices_and_repeats)¶
Program the segment steps of a single AWG device given instructions.
- Parameters:
device_index (int) – Index of the AWG device.
segment_indices_and_repeats (list[tuple[int, int]]) – Segment indices and segment repeats in the order of execution.
- run(wait_for_finish)¶
Executes the currently loaded sequence.
- Parameters:
wait_for_finish (bool) – Wait for the currently programmed sequence to run before return. Otherwise, call
wait_until_complete()andstop()to wait and stop.
- wait_until_complete()¶
Waits for all devices to finish.
- stop()¶
Stops all devices.
- set_principal_device_trigger(external)¶
Sets trigger mode of the principal device.
- Parameters:
external (bool) – Uses external trigger.
device¶
- class qfabric.programmer.device.Device(segmenter, resource)¶
Bases:
objectBase class of the AWG device interface.
Each AWG model should subclass
Deviceand overrideprogram_memory(),program_segment_steps(),start(),wait_until_complete(),stop(),setup_external_trigger(), andsetup_software_trigger().- Parameters:
segmenter (Segmenter) – Segmenter for this AWG device.
resource (str) – Resource name of the device.
- abstractmethod program_memory(instructions)¶
Programs the memory.
Override this function to define how the AWG memory is programmed.
- Parameters:
instructions (Any) – The instruction format should be in agreement with the segmenter.
- abstractmethod program_segment_steps(segment_indices_and_repeats)¶
Programs the segment steps.
Override this function to define how the AWG segment step is programmed.
- Parameters:
segment_indices_and_repeats (list[tuple[int, int]]) – List of (segment_index, segment_repeat).
- abstractmethod start()¶
Starts the currently programmed sequence.
- abstractmethod wait_until_complete()¶
Waits until the currently running sequence is finished.
- abstractmethod stop()¶
Stops the currently running sequence.
- abstractmethod setup_external_trigger()¶
Sets the device to use external trigger.
- abstractmethod setup_software_trigger()¶
Sets the device to use software trigger.
device.virtual¶
- class qfabric.programmer.device.virtual.VirtualDevice(segmenter, resource)¶
Bases:
DeviceA virtual device that works with
VirtualSegmenter.- program_memory(instructions)¶
Programs the memory.
Override this function to define how the AWG memory is programmed.
- Parameters:
instructions (Any) – The instruction format should be in agreement with the segmenter.
- program_segment_steps(segment_indices_and_repeats)¶
Programs the segment steps.
Override this function to define how the AWG segment step is programmed.
- Parameters:
segment_indices_and_repeats (list[tuple[int, int]]) – List of (segment_index, segment_repeat).
- start()¶
Starts the currently programmed sequence.
- wait_until_complete()¶
Waits until the currently running sequence is finished.
- stop()¶
Stops the currently running sequence.
- setup_external_trigger()¶
Sets the device to use external trigger.
- setup_software_trigger()¶
Sets the device to use software trigger.
device.m4i6622¶
- class qfabric.programmer.device.m4i6622.M4i6622Device(segmenter, resource, **kwargs)¶
Bases:
DeviceProgramming interface of the Spectrum M4i6622 AWG.
- Parameters:
segmenter (M4i6622Segmenter) – Segmenter for this AWG device.
resource (str) – Resource name of the device.
**kwargs – See
M4i6622Driverfor optional keyword arguments.
- program_memory(instructions)¶
Programs the memory.
Override this function to define how the AWG memory is programmed.
- Parameters:
instructions (Any) – The instruction format should be in agreement with the segmenter.
- program_segment_steps(segment_indices_and_repeats)¶
Programs the segment steps.
Override this function to define how the AWG segment step is programmed.
- Parameters:
segment_indices_and_repeats (list[tuple[int, int]]) – List of (segment_index, segment_repeat).
- start()¶
Starts the currently programmed sequence.
- wait_until_complete()¶
Waits until the currently running sequence is finished.
- stop()¶
Stops the currently running sequence.
- setup_external_trigger()¶
Sets the device to use external trigger.
- setup_software_trigger()¶
Sets the device to use software trigger.
device.awg710¶
- class qfabric.programmer.device.awg710.AWG710Device(segmenter, resource, **kwargs)¶
Bases:
DeviceProgramming interface of the Tektronix AWG710 AWG.
It does not support programming multiple sequences in the AWG device at the same time.
- Parameters:
segmenter (AWG710Segmenter) – Segmenter for this AWG device.
resource (str) – Resource name of the device.
**kwargs – See
AWG710Driverfor optional keyword arguments.
- program_memory(instructions)¶
Programs the memory.
Override this function to define how the AWG memory is programmed.
- Parameters:
instructions (Any) – The instruction format should be in agreement with the segmenter.
- program_segment_steps(segment_indices_and_repeats)¶
Programs the segment steps.
Override this function to define how the AWG segment step is programmed.
- Parameters:
segment_indices_and_repeats (list[tuple[int, int]]) – List of (segment_index, segment_repeat).
- start()¶
Starts the currently programmed sequence.
- wait_until_complete()¶
Waits until the currently running sequence is finished.
- stop()¶
Stops the currently running sequence.
- setup_external_trigger()¶
Sets the device to use external trigger.
- setup_software_trigger()¶
This still uses the external trigger.
The force trigger works for external trigger. If set to internal trigger, it runs a periodic trigger internally.
device.mock¶
- class qfabric.programmer.device.mock.MockDevice(segmenter, resource, show_plot)¶
Bases:
DeviceA mock
Devicethat shows a plot of the sequence programmed.- Parameters:
segmenter (MockSegmenter) – Segmenter for this AWG device.
resource (str) – Resource name of the device. This is unused as it is a mock device.
show_plot (bool) – Whether shows a plot of the analog and digital data.
- program_memory(instructions)¶
Programs the memory.
Override this function to define how the AWG memory is programmed.
- Parameters:
instructions (Any) – The instruction format should be in agreement with the segmenter.
- program_segment_steps(segment_indices_and_repeats)¶
Programs the segment steps.
Override this function to define how the AWG segment step is programmed.
- Parameters:
segment_indices_and_repeats (list[tuple[int, int]]) – List of (segment_index, segment_repeat).
- start()¶
Starts the currently programmed sequence.
- wait_until_complete()¶
Waits until the currently running sequence is finished.
- stop()¶
Stops the currently running sequence.
- setup_external_trigger()¶
Sets the device to use external trigger.
- setup_software_trigger()¶
Sets the device to use software trigger.