Pulsar QCM
The Pulsar QCM driver is separated into three layers:
QCoDeS driver: Instrument driver based on QCoDeS and the instrument’s native interface.
Native interface: Instrument API that provides control over the instrument and is an extension of the the SCPI interface.
SCPI interface: Instrument API based on the SCPI standard which in turn is based on IEEE488.2.
QCoDeS driver
-
class
pulsar_qcm.pulsar_qcm.
pulsar_qcm_qcodes
(name, transport_inst, debug=0)[source] Bases:
pulsar_qcm.pulsar_qcm_ifc.pulsar_qcm_ifc
,qcodes.instrument.base.Instrument
This class connects QCoDeS to the Pulsar QCM native interface. Do not directly instantiate this class, but instead instantiate either the
pulsar_qcm
orpulsar_qcm_dummy
.-
__init__
(name, transport_inst, debug=0)[source] Creates Pulsar QCM QCoDeS class and adds all relevant instrument parameters. These instrument parameters call the associated methods provided by the native interface.
- Parameters
name (str) – Instrument name.
transport_inst (
transport
) – Transport class responsible for the lowest level of communication (e.g. ethernet).debug (int) – Debug level (0 = normal, 1 = no version check, >1 = no version or error checking).
- Raises
Exception – Debug level is 0 and there is a version mismatch.
Note
To get a complete of list of the QCoDeS parameters, run the following code.
from pulsar_qcm.pulsar_qcm import pulsar_qcm_dummy qcm = pulsar_qcm_dummy("qrm") for call in qcm.snapshot()['parameters']: print(getattr(qcm, call).__doc__)
-
-
class
pulsar_qcm.pulsar_qcm.
pulsar_qcm
(name, host, port=5025, debug=0)[source] Bases:
pulsar_qcm.pulsar_qcm.pulsar_qcm_qcodes
Pulsar QCM driver class based on QCoDeS that uses an IP socket to communicate with the instrument.
-
__init__
(name, host, port=5025, debug=0)[source] Creates Pulsar QCM driver object.
- Parameters
name (str) – Instrument name.
host (str) – Instrument IP address.
port (int) – Instrument port.
debug (int) – Debug level (0 = normal, 1 = no version check, >1 = no version or error checking).
- Raises
Exception – Debug level is 0 and there is a version mismatch.
-
-
class
pulsar_qcm.pulsar_qcm.
pulsar_qcm_dummy
(name, debug=1)[source] Bases:
pulsar_qcm.pulsar_qcm.pulsar_qcm_qcodes
Pulsar QCM driver class based on QCoDeS that uses the
pulsar_dummy_transport
layer to substitute an actual Pulsar QCM to allow software stack development without hardware.
QCoDeS parameters
QCoDeS parameters generated by pulsar_qcm_qcodes
.
Note
Only sequencer 0’s parameters are listed, but all other sequencers have the same parameters.
pulsar_qcm.reference_source
Sets/gets reference source (‘internal’ = internal 10 MHz, ‘external’ = external 10 MHz).
- Properties
value: Enum: {‘external’, ‘internal’}
pulsar_qcm.out0_offset
Sets/gets output 0 offset.
- Properties
unit: V
value: Numbers -2.5<=v<=2.5
pulsar_qcm.out1_offset
Sets/gets output 1 offset.
- Properties
unit: V
value: Numbers -2.5<=v<=2.5
pulsar_qcm.out2_offset
Sets/gets output 2 offset.
- Properties
unit: V
value: Numbers -2.5<=v<=2.5
pulsar_qcm.out3_offset
Sets/gets output 3 offset.
- Properties
unit: V
value: Numbers -2.5<=v<=2.5
pulsar_qcm.sequencer0_channel_map_path0_out0_en
Sets/gets sequencer 0 channel map enable of path 0 to output 0.
- Properties
value: Boolean
pulsar_qcm.sequencer0_channel_map_path1_out1_en
Sets/gets sequencer 0 channel map enable of path 1 to output 1.
- Properties
value: Boolean
pulsar_qcm.sequencer0_channel_map_path0_out2_en
Sets/gets sequencer 0 channel map enable of path 0 to output 2.
- Properties
value: Boolean
pulsar_qcm.sequencer0_channel_map_path1_out3_en
Sets/gets sequencer 0 channel map enable of path 1 to output 3.
- Properties
value: Boolean
pulsar_qcm.sequencer0_sync_en
Sets/gets sequencer 0 synchronization enable which enables party-line synchronization.
- Properties
value: Boolean
pulsar_qcm.sequencer0_nco_freq
Sets/gets sequencer 0 NCO frequency in Hz with a resolution of 0.25 Hz
- Properties
unit: Hz
value: Numbers -300000000.0<=v<=300000000.0
pulsar_qcm.sequencer0_nco_phase_offs
Sets/gets sequencer 0 NCO phase offset in degrees with a resolution of 3.6e-7 degrees.
- Properties
unit: Degrees
value: Numbers 0<=v<=360
pulsar_qcm.sequencer0_marker_ovr_en
Sets/gets sequencer 0 marker override enable.
- Properties
value: Boolean
pulsar_qcm.sequencer0_marker_ovr_value
Sets/gets sequencer 0 marker override value. Bit index corresponds to marker channel index.
- Properties
value: Numbers 0<=v<=15
pulsar_qcm.sequencer0_waveforms_and_program
Sets sequencer 0 AWG waveforms and ASM program. Valid input is a string representing the JSON filename.
- Properties
value: Strings
pulsar_qcm.sequencer0_cont_mode_en_awg_path0
Sets/gets sequencer 0 continous waveform mode enable for AWG path 0.
- Properties
value: Boolean
pulsar_qcm.sequencer0_cont_mode_en_awg_path1
Sets/gets sequencer 0 continous waveform mode enable for AWG path 1.
- Properties
value: Boolean
pulsar_qcm.sequencer0_cont_mode_waveform_idx_awg_path0
Sets/gets sequencer 0 continous waveform mode waveform index or AWG path 0.
- Properties
value: Numbers 0<=v<=1023
pulsar_qcm.sequencer0_cont_mode_waveform_idx_awg_path1
Sets/gets sequencer 0 continous waveform mode waveform index or AWG path 1.
- Properties
value: Numbers 0<=v<=1023
pulsar_qcm.sequencer0_upsample_rate_awg_path0
Sets/gets sequencer 0 upsample rate for AWG path 0.
- Properties
value: Numbers 0<=v<=65535
pulsar_qcm.sequencer0_upsample_rate_awg_path1
Sets/gets sequencer 0 upsample rate for AWG path 1
- Properties
value: Numbers 0<=v<=65535
pulsar_qcm.sequencer0_gain_awg_path0
Sets/gets sequencer 0 gain for AWG path 0.
- Properties
value: Numbers -1.0<=v<=1.0
pulsar_qcm.sequencer0_gain_awg_path1
Sets/gets sequencer 0 gain for AWG path 1
- Properties
value: Numbers -1.0<=v<=1.0
pulsar_qcm.sequencer0_offset_awg_path0
Sets/gets sequencer 0 offset for AWG path 0.
- Properties
value: Numbers -1.0<=v<=1.0
pulsar_qcm.sequencer0_offset_awg_path1
Sets/gets sequencer 0 offset for AWG path 1.
- Properties
value: Numbers -1.0<=v<=1.0
pulsar_qcm.sequencer0_mixer_corr_phase_offset_degree
Sets/gets sequencer 0 mixer phase imbalance correction for AWG; applied to AWG path 1 relative to AWG path 0 and measured in degrees
- Properties
value: Numbers -45.0<=v<=45.0
pulsar_qcm.sequencer0_mixer_corr_gain_ratio
Sets/gets sequencer 0 mixer gain imbalance correction for AWG; equal to AWG path 1 amplitude divided by AWG path 0 amplitude.
- Properties
value: Numbers 0.5<=v<=2.0
pulsar_qcm.sequencer0_mod_en_awg
Sets/gets sequencer 0 modulation enable for AWG.
- Properties
value: Boolean
Native interface
-
class
pulsar_qcm.pulsar_qcm_ifc.
pulsar_qcm_ifc
(transport_inst, debug=0)[source] Bases:
pulsar_qcm.pulsar_qcm_scpi_ifc.pulsar_qcm_scpi_ifc
Class that provides the native API for the Pulsar QCM. It provides methods to control all functions and features provided by the Pulsar QCM, like sequencer and waveform handling.
-
__init__
(transport_inst, debug=0)[source] Creates Pulsar QCM native interface object.
- Parameters
transport_inst (
transport
) – Transport class responsible for the lowest level of communication (e.g. ethernet).debug (int) – Debug level (0 = normal, 1 = no version check, >1 = no version or error checking).
- Returns
Pulsar QCM native interface object.
- Return type
- Raises
Exception – Debug level is 0 and there is a version mismatch.
-
get_idn
()[source] Get device identity and build information.
- Returns
Dictionary containing manufacturer, model, serial number and build information. The build information is subdivided into FPGA firmware, kernel module software, application software and driver software build information. Each of those consist of the version, build date, build Git hash and Git build dirty indication.
- Return type
dict
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_system_status
()[source] Get general system state.
- Returns
Dictionary containing general status and corresponding flags:
- Status
OKAY: System is okay.
CRITICAL: An error indicated by the flags occured, but has been resolved.
ERROR: An error indicated by the flags is occuring.
- Flags
CARRIER_PLL_UNLOCK: Carrier board PLL is unlocked.
FPGA_PLL_UNLOCK: FPGA PLL is unlocked.
FPGA_TEMP_OR: FPGA temperature is out-of-range.
CARRIER_TEMP_OR: Carrier board temperature is out-of-range.
AFE_TEMP_OR: Analog frontend board temperature is out-of-range.
- Return type
dict
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
arm_sequencer
(sequencer=None)[source] Prepare the indexed sequencer to start by putting it in the armed state. If no sequencer index is given, all sequencers are armed. Any sequencer that was already running is stopped and rearmed. If an invalid sequencer index is given, an error is set in system error.
- Parameters
sequencer (int) – Sequencer index.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
start_sequencer
(sequencer=None)[source] Start the indexed sequencer, thereby putting it in the running state. If an invalid sequencer index is given or the indexed sequencer was not yet armed, an error is set in system error. If no sequencer index is given, all armed sequencers are started and any sequencer not in the armed state is ignored. However, if no sequencer index is given and no sequencers are armed, and error is set in system error.
- Parameters
sequencer (int) – Sequencer index.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
stop_sequencer
(sequencer=None)[source] Stop the indexed sequencer, thereby putting it in the stopped state. If an invalid sequencer index is given, an error is set in system error. If no sequencer index is given, all sequencers are stopped.
- Parameters
sequencer (int) – Sequencer index.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_sequencer_state
(sequencer, timeout=0, timeout_poll_res=0.1)[source] Get the sequencer state. If an invalid sequencer index is given, an error is set in system error. If the timeout is set to zero, the function returns the state immediately. If a positive non-zero timeout is set, the function blocks until the sequencer completes. If the sequencer hasn’t stopped before the timeout expires, a timeout exception is thrown.
- Parameters
sequencer (int) – Sequencer index.
timeout (int) – Timeout in minutes.
timeout_poll_res (float) – Timeout polling resolution in seconds.
- Returns
Concatinated list of strings separated by the semicolon character. Status is indicated by one status string and an optional number of flags respectively ordered as:
- Status
IDLE: Sequencer waiting to be armed and started.
ARMED: Sequencer is armed and ready to start.
RUNNING: Sequencer is running.
Q1 STOPPED: Classical part of the sequencer has stopped; waiting for real-time part to stop.
STOPPED: Sequencer has completely stopped.
- Flags
DISARMED: Sequencer was disarmed.
FORCED STOP: Sequencer was stopped while still running.
SEQUENCE PROCESSOR Q1 ILLEGAL INSTRUCTION: Classical sequencer part executed an unknown instruction.
SEQUENCE PROCESSOR RT EXEC ILLEGAL INSTRUCTION: Real-time sequencer part executed an unknown instruction.
AWG WAVE PLAYBACK INDEX INVALID PATH 0: AWG path 0 tried to play an unknown waveform.
AWG WAVE PLAYBACK INDEX INVALID PATH 1: AWG path 1 tried to play an unknown waveform.
CLOCK INSTABILITY: Clock source instability occurred.
- Return type
list
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
TypeError – Timeout is not an integer.
TimeoutError – Timeout
-
get_waveforms
(sequencer)[source] Get all waveforms in the AWG waveform list of indexed sequencer. The returned dictionary is structured as follows:
name: waveform name.
data: waveform samples in a range of 1.0 to -1.0.
index: waveform index used by the sequencer Q1ASM program to refer to the waveform.
- Parameters
sequencer (int) – Sequencer index.
- Returns
Dictionary with waveforms.
- Return type
dict
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
SCPI interface
-
class
pulsar_qcm.pulsar_qcm_scpi_ifc.
pulsar_qcm_scpi_ifc
(transport_inst, debug=0)[source] Bases:
ieee488_2.ieee488_2.ieee488_2
This interface provides an API for the mandatory and required SCPI calls and adds Pulsar related functionality (see SCPI).
-
__init__
(transport_inst, debug=0)[source] Creates SCPI interface object.
- Parameters
transport_inst (
transport
) – Transport class responsible for the lowest level of communication (e.g. ethernet).debug (int) – Debug level (0 = normal, 1 = no version check, >1 = no version or error checking).
- Returns
SCPI interface object.
- Return type
- Raises
Exception – Debug level is 0 and there is a version mismatch.
-
reset
()[source] Reset device and clear all status and event registers (see SCPI).
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
clear
()[source] Clear all status and event registers (see SCPI).
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_status_byte
()[source] Get status byte register. Register is only cleared when feeding registers are cleared (see SCPI).
- Returns
Status byte register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
set_service_request_enable
(reg)[source] Set service request enable register (see SCPI).
- Parameters
reg (int) – Service request enable register.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_service_request_enable
()[source] Get service request enable register. The register is cleared after reading it (see SCPI).
- Returns
Service request enable register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
set_standard_event_status_enable
(reg)[source] Get standard event status enable register. The register is cleared after reading it (see SCPI).
- Returns
Standard event status enable register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_standard_event_status_enable
()[source] Set standard event status enable register (see SCPI).
- Parameters
reg (int) – Standard event status enable register.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_standard_event_status
()[source] Get standard event status register. The register is cleared after reading it (see SCPI).
- Returns
Standard event status register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
set_operation_complete
()[source] Set device in operation complete query active state (see SCPI).
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_operation_complete
()[source] Get operation complete state (see SCPI).
- Returns
Operation complete state (False = running, True = completed).
- Return type
bool
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
test
()[source] Run self-test. Currently not implemented (see SCPI).
- Returns
Test result (False = failed, True = success).
- Return type
bool
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
wait
()[source] Wait until operations completed before continuing (see SCPI).
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_system_error
()[source] Get system error from queue (see SCPI).
- Returns
System error description string.
- Return type
str
-
get_num_system_error
()[source] Get number of system errors (see SCPI).
- Returns
Current number of number of system errors.
- Return type
int
-
get_system_version
()[source] Get SCPI system version (see SCPI).
- Returns
SCPI system version.
- Return type
str
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
preset_system_status
()[source] Preset system status registers. Connects general system status flags for PLL unlock and temperature out-of-range indications to event status enable, status questionable temperature and status questionable frequency registers respectively (see SCPI).
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_questionable_condition
()[source] Get status questionable condition register (see SCPI).
- Returns
Status questionable condition register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_questionable_event
()[source] Get status questionable event register (see SCPI).
- Returns
Status questionable event register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
set_questionable_enable
(reg)[source] Set status questionable enable register (see SCPI).
- Parameters
reg (int) – Status questionable enable register.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_questionable_enable
()[source] Get status questionable enable register (see SCPI).
- Returns
Status questionable enable register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_operation_condition
()[source] Get status operation condition register (see SCPI).
- Returns
Status operation condition register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_operation_events
()[source] Get status operation event register (see SCPI).
- Returns
Status operation event register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
set_operation_enable
(reg)[source] Set status operation enable register (see SCPI).
- Parameters
reg (int) – Status operation enable register.
- Raises
Exception – Invalid input parameter type.
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_operation_enable
()[source] Get status operation enable register (see SCPI).
- Returns
Status operation enable register.
- Return type
int
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_current_fpga_temperature
()[source] Get current FPGA junction temperature (inside device).
- Returns
Current FPGA junction temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_maximum_fpga_temperature
()[source] Get maximum FPGA junction temperature since boot or clear (inside device).
- Returns
Maximum FPGA junction temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_current_carrier_temperature
()[source] Get current carrier board temperature (inside device).
- Returns
Current carrier board temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_maximum_carrier_temperature
()[source] Get maximum carrier board temperature since boot or clear (inside device).
- Returns
Maximum carrier board temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_current_afe_temperature
()[source] Get current analog frontend board temperature (inside device).
- Returns
Current analog frontend board temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_maximum_afe_temperature
()[source] Get maximum analog frontend board temperature since boot or clear (inside device).
- Returns
Maximum analog frontend board temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_current_lo_temperature
()[source] Get the current local oscillator board temperature (inside device).
- Returns
Current local board temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_maximum_lo_temperature
()[source] Get maximum local oscillator board temperature since boot or clear (inside device).
- Returns
Maximum local oscillator board temperature.
- Return type
float
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-
get_assembler_status
()[source] Get assembler status. Refer to the assembler log to get more information regarding the assembler result.
- Parameters
pwr (int) – PLL output power, unitless.
- Returns
Assembler status (False = failed, True = success).
- Return type
bool
- Raises
Exception – An error is reported in system error and debug <= 1. All errors are read from system error and listed in the exception.
-