pub struct ShotContext<'a> {
pub shot: usize,
pub record: &'a ShotRecord,
pub branch_selectors: &'a [bool],
pub named_branch_selectors: &'a [(&'a str, bool)],
pub outputs: &'a [OutputLogical],
pub frames: &'a [ShotFrame],
pub saved_outputs: &'a [SavedOutput],
pub qubit_count: usize,
}Expand description
Per-shot context handed to a run_bloq_with_hook hook, evaluated after the
program finishes but before the shot’s simulator is dropped.
The hook receives the pristine post-program simulator (the output patches are still live — an ideal noiseless boundary). A hook that mutates the simulator (e.g. a destructive measurement) therefore invalidates this shot’s observable and frame reports, but never the record-based detectors.
Fields§
§shot: usizeZero-based shot number (discarded shots never reach this hook).
record: &'a ShotRecordThis shot’s measurement outcomes.
branch_selectors: &'a [bool]This shot’s stamped selector outcomes, in evaluation order — the feedforward action bits driving the terminal Pauli frame.
named_branch_selectors: &'a [(&'a str, bool)]Structural and selective choices, keyed by their source selector names.
outputs: &'a [OutputLogical]Every program output’s logical operators (shot-independent).
frames: &'a [ShotFrame]Evaluated terminal Pauli frames for this shot, keyed by output port.
saved_outputs: &'a [SavedOutput]Outputs saved at an earlier cut because their physical patch was reused.
qubit_count: usizeLive engine width. A fresh ancilla lives at this index (the engine grows on demand for the gates/measurements a hook performs).