qat.backend.waveform.codegen module

PydWaveformBackend

alias of WaveformBackend

class WaveformBackend(model, target_data=TargetData(max_shots=10000, default_shots=1000, QUBIT_DATA=QubitDescription(sample_time=1e-09, samples_per_clock_cycle=1, instruction_memory_size=50000, waveform_memory_size=1500, pulse_duration_min=6.4e-08, pulse_duration_max=0.001, pulse_channel_lo_freq_min=1000000, pulse_channel_lo_freq_max=10000000000, pulse_channel_if_freq_min=0, pulse_channel_if_freq_max=10000000000, passive_reset_time=0.001), RESONATOR_DATA=ResonatorDescription(sample_time=1e-09, samples_per_clock_cycle=1, instruction_memory_size=50000, waveform_memory_size=1500, pulse_duration_min=6.4e-08, pulse_duration_max=0.001, pulse_channel_lo_freq_min=1000000, pulse_channel_lo_freq_max=10000000000, pulse_channel_if_freq_min=0, pulse_channel_if_freq_max=10000000000)))

Bases: BaseBackend[WaveformProgram], InvokerMixin

Target-machine code generation from an IR for targets that only require the explicit waveforms.

Parameters:

model (PhysicalHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.

build_pass_pipeline(*args, **kwargs)
create_acquires(ir, timeline_res)

Assembles the acquire data needed to perform acquisition, and also the acquire information needed at runtime.

Parameters:
  • ir (PartitionedIR) – The partitioned IR containing the acquire map.

  • timeline_res (TimelineAnalysisResult) – The timeline analysis result containing the number of samples for each instruction.

create_physical_channel_buffers(ir, timeline_res, upconvert=True)

Creates a buffer of waveforms for each physical channel.

Parameters:
  • ir (PartitionedIR) – The partitioned IR containing the instructions.

  • timeline_res (TimelineAnalysisResult) – The timeline analysis result containing the number of samples for each instruction.

  • upconvert (bool) – Whether to upconvert the waveforms to the target frequencies.

create_programs(channel_data, shots, batch_size, repetition_time)

Creates WaveformProgram instances from channel data.

Parameters:
  • channel_data (dict[str, WaveformChannelData]) – The channel data for each physical channel.

  • shots (int) – The total number of shots to be executed.

  • batch_size (int) – The maximum number of shots per program.

  • repetition_time (float) – The time for each shot.

Return type:

WaveformProgram

static create_pulse_channel_buffer(pulse_channel, instructions, durations, device_description, phys_channel, upconvert=True)

Creates a buffer of waveforms for a single pulse channel.

Parameters:
  • pulse_channel (PulseChannel) – The pulse channel to create the buffer for.

  • instructions (list[Instruction]) – The list of instructions to process.

  • durations (list[int]) – The list of durations for each instruction.

  • upconvert (bool) – Whether to upconvert the waveforms to the target frequencies.

emit(ir, res_mgr=None, met_mgr=None, upconvert=True, **kwargs)

Compiles InstructionBuilder into an Executable.

Translates pulse instructions into explicit waveforms at the required times, and combines them across pulse channels to give a composite waveform on the necessary physical channels. Deals with low-level details such as pulse scheduling and phase shifts.

Return type:

Executable[WaveformProgram]

class WaveformContext(pulse_channel, total_duration, device_description, phys_channel)

Bases: object

Used for waveform code generation for a particular pulse channel.

This can be considered to be the dynamical state of a pulse channel which evolves as the circuit progresses.

Parameters:
  • pulse_channel (PulseChannel) – The pulse channel that this is modelling.

  • total_duration (int) – The lifetime of the pulse channel in number of samples.

property buffer
process_delay(samples)
process_frequencyset(frequency)
process_frequencyshift(frequency)
process_phasereset()
process_phaseset(phase)
process_phaseshift(phase)
process_pulse(instruction, samples, do_upconvert=True)

Converts a waveform instruction into a discrete number of samples, handling upconversion to the target frequency if specified.

process_reset()