qat.middleend.middleends module
- class BaseMiddleend(model)
Bases:
ABCBase class for a middle end that takes an intermediate representation (IR)
QatIRand alters it based on optimisation and/or validation passes.- Parameters:
model¶ (
None|QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.
- abstract emit(ir, res_mgr=None, met_mgr=None, compiler_config=None)
Converts an IR
QatIRto an optimised IR. :type _sphinx_paramlinks_qat.middleend.middleends.BaseMiddleend.emit.ir: :param _sphinx_paramlinks_qat.middleend.middleends.BaseMiddleend.emit.ir: The intermediate representation. :type _sphinx_paramlinks_qat.middleend.middleends.BaseMiddleend.emit.res_mgr:Optional[ResultManager] :param _sphinx_paramlinks_qat.middleend.middleends.BaseMiddleend.emit.res_mgr: Collection of analysis results with caching and aggregationcapabilities, defaults to None.
- Parameters:
met_mgr¶ (
Optional[MetricsManager]) – Stores useful intermediary metrics that are generated during compilation, defaults to None.compiler_config¶ (
Optional[CompilerConfig]) – Compiler settings, defaults to None.
- class CustomMiddleend(model, pipeline=None)
Bases:
BaseMiddleendMiddle end that uses a custom pipeline to convert the IR to an (optimised) IR.
- Parameters:
model¶ (
None|QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.
- emit(ir, res_mgr=None, met_mgr=None, compiler_config=None)
Converts an IR
QatIRto an optimised IR with a custom pipeline. :type _sphinx_paramlinks_qat.middleend.middleends.CustomMiddleend.emit.ir: :param _sphinx_paramlinks_qat.middleend.middleends.CustomMiddleend.emit.ir: The intermediate representation. :type _sphinx_paramlinks_qat.middleend.middleends.CustomMiddleend.emit.res_mgr:Optional[ResultManager] :param _sphinx_paramlinks_qat.middleend.middleends.CustomMiddleend.emit.res_mgr: Collection of analysis results with caching and aggregationcapabilities, defaults to None.
- Parameters:
met_mgr¶ (
Optional[MetricsManager]) – Stores useful intermediary metrics that are generated during compilation, defaults to None.compiler_config¶ (
Optional[CompilerConfig]) – Compiler settings, defaults to None.
- class DefaultMiddleend(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=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=0, pulse_channel_if_freq_max=10000000000)))
Bases:
CustomMiddleendValidates the compiler settings against the hardware model, finds calibrations within the IR, compresses contiguous
PhaseShiftinstructions, checks that thePostProcessinginstructions that follow an acquisition are suitable for the acquisition mode, validates that there are no mid-circuit measurements.- Parameters:
model¶ (
QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.clock_cycle¶ – The period for a single sequencer clock cycle.
- static build_pass_pipeline(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=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=0, pulse_channel_if_freq_max=10000000000)))
Builds the default middle end pass pipeline. :type _sphinx_paramlinks_qat.middleend.middleends.DefaultMiddleend.build_pass_pipeline.model:
QuantumHardwareModel:param _sphinx_paramlinks_qat.middleend.middleends.DefaultMiddleend.build_pass_pipeline.model: The hardware model that holds calibrated information on the qubits onthe QPU.
- Return type:
- Returns:
A
PassManagercontaining a sequence of passes.
- class ExperimentalDefaultMiddleend(model, pyd_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=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=0, pulse_channel_if_freq_max=10000000000)))
Bases:
CustomMiddleendValidates the compiler settings against the hardware model, finds calibrations within the IR, compresses contiguous
PhaseShiftinstructions, checks that thePostProcessinginstructions that follow an acquisition are suitable for the acquisition mode, validates that there are no mid-circuit measurements.- Parameters:
model¶ (
QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.clock_cycle¶ – The period for a single sequencer clock cycle.
- static build_pass_pipeline(legacy_model, pyd_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=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=0, pulse_channel_if_freq_max=10000000000)))
Builds the default middle end pass pipeline. :param _sphinx_paramlinks_qat.middleend.middleends.ExperimentalDefaultMiddleend.build_pass_pipeline.model: The hardware model that holds calibrated information on the qubits on
the QPU.
- Return type:
- Returns:
A
PassManagercontaining a sequence of passes.
- class FallthroughMiddleend(model=None)
Bases:
CustomMiddleendA middle end that passes through an input
InstructionBuilderand does not alter it.- Parameters:
model¶ (
None) – The hardware model that holds calibrated information on the qubits on the QPU.