qat.experimental.conversion.pulse_to_q1.waveform module

Waveform rewrite strategies for Pulse-to-Q1 conversion.

class SquareWaveformLegalisation

Bases: object

Canonicalise a square waveform’s width to integer nanoseconds.

class SquareWaveformLowering

Bases: object

Lower a canonical square pulse to latched Q1 AWG offsets.

The non-zero offset remains live for exactly the Pulse waveform width. Latching the falling edge then advances the Q1 timeline by one minimum RT duration.

split_wait_duration(duration_ns, q1asm)

Split a pulse-level wait into exactly representable normal Q1 waits.

The special wait 0 encoding is never emitted here. A final remainder below the minimum non-zero RT duration is made up by shortening the preceding chunks.

Parameters:
  • duration_ns (int) – Total pulse-level wait duration in nanoseconds.

  • q1asm (Q1AsmSpec) – Q1 instruction timing limits.

Return type:

tuple[int, ...]

Returns:

Wait-immediate durations whose exact sum is duration_ns.

Raises:

PassFailedException – If the duration cannot be represented using normal waits.