qat.backend.waveform_v1.codegen module

class PydWaveformContext(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_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()
class PydWaveformV1Backend(model, legacy_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=1000000, pulse_channel_if_freq_max=10000000000, passive_reset_time=1e-08), 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=1000000, pulse_channel_if_freq_max=10000000000)))

Bases: BaseBackend, 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_acquire_dict(ir, timeline_res)

Creates a dictionary of acquire data for each physical channel based on the acquire map in the IR and the timeline analysis result.

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.

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 a WaveformV1Executable.

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:

WaveformV1Executable

class WaveformContext(pulse_channel, total_duration)

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
property physical_channel
process_delay(samples)
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()
class WaveformV1Backend(model)

Bases: BaseBackend, InvokerMixin

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

Parameters:

model (QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU. As the emitter is used to generate code for some target machine, the hardware model is needed for context-aware compilation.

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

Creates a dictionary of acquire data for each physical channel based on the acquire map in the IR and the timeline analysis result.

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.

static create_pulse_channel_buffer(pulse_channel, instructions, durations, 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 a WaveformV1Executable.

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:

WaveformV1Executable