A low-level pulse programming extension of OpenQASM 3, giving developers direct control over the physical signals that manipulate qubits.
OpenQASM3
programs. This includes parsing cal
blocks and defcal
definitions and validating pulse-level statements.
While most existing tools focus on gate-level OpenQASM
, few provide strong support for pulse-level semantics and most of them lack comprehensive semantic analysis — such as validating scope rules, deterministic durations in defcal, and hardware-level constraints
PyQASM aims to fill this gap by:
OpenQASM3
and OpenPulse
.
backend-specific
rules (duration tracking, frame limits, etc.).
defcal grammar "openpulse";
— adds these core constructs to OpenQASM3.
port
): Abstract I/O channels representing hardware control lines.
frame_limit_per_port
option that users can set when loading a program.frame
): Stateful carriers with port, timing, frequency, and phase.
defcal
blocks via the frame_in_defcal
option when loading a program.set_frequency()
/ shift_frequency()
/ shift_phase()
/ get_frequency()
/ get_phase()
.waveform
): Envelopes modulating signals on ports.
waveform
types defined in the OpenPulse specification — gaussian
, sech
, gaussian_square
, drag
, constant
, sine
, mix
, sum
, phase_shift
, scale
.capture
): Measurement/capture operations.
capture
operations defined in the OpenPulse grammar — capture_v1()
, capture_v2()
, capture_v3()
, capture_v4()
.cal
/ defcal
:
play
is intended for use inside defcal
blocks. pyqasm introduces a configurable option, play_in_cal_block
, which allows users to enable or restrict the use of play
instructions inside cal
blocks as well.time-cursor
of a frame by a given duration
.
synchronize
the time-cursor of multiple frames to the same point in time.
play
, delay
, capture
) are applied.durations
, ensuring that timing across frames remains consistent throughout the program.defcal
blocks, which must have deterministic total durations across all execution paths.defcal
blocks.
cal
blocks, which is useful for debugging and visualization. Since, defcal
are acted as functions, we are not unrolling them.
extern
declarations in OpenPulse
blocks.