qat.runtime.passes.analysis module
Runtime analysis passes for result indexing and post-selection.
This module provides analysis passes that run prior to result transformation. They are responsible for deriving mappings between acquired output variables and physical qubit indices, and for recording post-selection metadata produced by post-processing.
- class DiscriminateResult(outputs)
Bases:
ResultInfoMixinStores the string state-label arrays produced by the
Discriminatestage of the granular post-processing pipeline.- Parameters:
outputs¶ (
dict[str,ndarray]) – Mapping from output variable name to a string ndarray of state labels (e.g."0","1","2"). The global post-selection mask has already been applied when this result is stored.
-
outputs:
dict[str,ndarray]
- class EqualiseResult(outputs)
Bases:
ResultInfoMixinStores the equalised (affine-transformed) complex IQ arrays produced by the
Equalisestage of the granular post-processing pipeline.- Parameters:
outputs¶ (
dict[str,ndarray]) – Mapping from output variable name to the complex-valued IQ array after equalisation. Arrays are indexed by shot (and optionally by time for SCOPE mode). The global post-selection mask has already been applied when this result is stored.
-
outputs:
dict[str,ndarray]
- class IndexMappingAnalysis(model)
Bases:
AnalysisPassDetermines a mapping from classical bit registers to qubits.
Searches through the acquires of the package and determines their associated qubit. Also looks for classical registers of the form
<clreg_name>[<clreg_index>].Supports both
Executablepackages andInstructionBuilder.- Parameters:
model¶ (
PhysicalHardwareModel) – The hardware model is needed for the qubit mapping.
- run(acquisitions, res_mgr, *args, package, **kwargs)
- Parameters:
acquisitions¶ (
dict[str,Any]) – The dictionary of results acquired from the target machine.res_mgr¶ (
ResultManager) – The results manager to save the mapping.package¶ (
InstructionBuilder|Executable) – The executable program containing the results-processing information should be passed as a keyword argument.
- static var_to_physical_channel_executable(package)
- Return type:
dict[str,str]
- var_to_physical_channel_qat_ir(package)
- Return type:
dict[str,str]
- var_to_qubit_map(mapping)
Maps the variables in the mapping to qubit indices.
- class IndexMappingResult(mapping)
Bases:
ResultInfoMixinResult containing a mapping from output variable names to qubit indices.
- Parameters:
mapping¶ (
dict[str,int]) – Dictionary mapping variable name to physical qubit index.
-
mapping:
dict[str,int]
- class PostSelectionResult(shots_requested, shots_retained, global_mask=None)
Bases:
ResultInfoMixinRecords the outcome of post-selection applied during acquisition post-processing.
- Parameters:
-
global_mask:
ndarray|None= None
-
shots_requested:
int
-
shots_retained:
int