qat.ir.instruction_basetypes module
qat.ir.instruction_basetypes
Module containing small enums used to describe acquisition and post-processing
semantics in the QAT IR. These types are used by instructions such as
Acquire and PostProcessing to describe how readout data should be
handled by the runtime.
The public symbols are:
PostProcessType– the kind of post-processing to apply to readout data.ProcessAxis– the axis of the readout data to operate on.AcquireMode– the hardware acquisition mode used by an acquire instruction.AcquirePurpose– the semantic purpose of an acquire instruction (e.g. circuit measurement vs pre-selection).
- class AcquireMode(value)
Bases:
EnumThe AcquireMode is used to specify the type of acquisition at the level of the control hardware.
Note that different backends will only allow selected acquisition modes.
RAW: Returns the time-series acquisition data for each shot
SCOPE: Returns the time-series acquisition data where each point is averaged over the number of shots
- INTEGRATOR: Down-conversion and integration of the acquisition data has occurred on the hardware so that a
single data point is returned for each shot
- INTEGRATOR = 'integrator'
- RAW = 'raw'
- SCOPE = 'scope'
- class AcquirePurpose(value)
Bases:
EnumSemantic purpose of an
Acquireinstruction.Used to distinguish regular circuit measurements from auxiliary acquisitions such as pre-selection checks so that downstream validation passes (e.g.
NoMidCircuitMeasurementValidation) can treat them differently.- Variables:
MEASUREMENT – A standard end-of-circuit or mid-circuit measurement requested by the user’s program.
PRE_SELECTION – An acquisition injected by the compiler to verify that a qubit is in its ground state before the circuit begins. Shots that fail are discarded via
PostSelect.
- MEASUREMENT = 'measurement'
- PRE_SELECTION = 'pre_selection'
- class PostProcessType(value)
Bases:
EnumPostProcessType is used in a PostProcessing instruction to determine how readouts should be processed. It describes a type of classical post-processing:
DOWN_CONVERT: Down-converts the readout measurement, should only be used along the axis ProcessAxis.TIME.
MEAN: Takes an average over the given axis.
- LINEAR_MAP_COMPLEX_TO_REAL: Maps the (complex) measured value onto a (real) z-projection using a supplied
linear mapping.
DISCRIMINATE: Converts a z-projection to a classical bit by comparison with a supplied discrimination threshold.
- DISCRIMINATE = 'discriminate'
- DOWN_CONVERT = 'down_convert'
- LINEAR_MAP_COMPLEX_TO_REAL = 'linear_map_real'
- MEAN = 'mean'
- MUL = 'mul'
- class ProcessAxis(value)
Bases:
EnumProcessAxis is used during classical post-processing of readouts. It specifies the axis which the post-processing should occur on. Often used in conjunction with the AcquireMode to determine the correct method for post-processing.
TIME: Instructs the post-processing to be performed over the time-series data returned from a readout.
SEQUENCE: Instructs the post-processing to be performed over the shots.
- SEQUENCE = 'sequence'
- TIME = 'time'