Skip to main content

Module circuit

Module circuit 

Source
Expand description

Circuit vocabulary embedded by Bloq IR templates and annotations.

Execution backends depend on bloq_ir alone and use this module instead of reaching through the IR to its bloq_circuit implementation dependency. The glob is deliberate: the whole vocabulary travels together, and enumerating it here would only add a second list to keep in step with bloq_circuit.

The few circuit types that appear in bloq_ir’s own signatures (Basis, CoordinateOverflowError, FlattenLimits) are also at the crate root, so those have two paths on purpose — the root one so a signature is nameable without this module, this one so a backend can take the lot.

Re-exports§

pub use bloq_circuit::Basis;
pub use bloq_circuit::Pauli;
pub use bloq_circuit::PauliBasis;

Modules§

prelude
The most commonly used items, for use bloq_circuit::prelude::*.

Structs§

BodyId
Index of a CircuitBody within a CoordCircuit.
Chunk
A circuit fragment paired with the stabilizer flows crossing its boundaries — the unit the compiler composes into a full program.
CircuitBody
An ordered list of operations — the entry block of a circuit or the body of a Op::Repeat.
CompletedFlow
A matched flow ready to emit as a detector.
ConditionalCorrection
One feedforward correction inside Op::ConditionalPauli.
CoordCircuit
A quantum circuit whose qubits are addressed by 2-D lattice coordinates rather than dense integer indices.
CoordinateOverflowError
A coordinate plus layout offset does not fit the signed 32-bit lattice.
DetectorParity
A mod-2 sum of DetectorTerms and a constant sign bit — the parity a detector or observable checks.
DetectorSlices
The full slice table for a segmented straight-line circuit.
ExpandedMeasurementColumns
Where each measurement id lands once every Op::Repeat is unrolled — the result of CoordCircuit::expanded_measurement_columns.
FlattenLimits
Work allowed when materializing a circuit’s repeated operation stream.
Flow
A stabilizer flow: a Pauli boundary condition start propagated through a chunk to end, together with the measurements it accumulates.
FlowEngine
Tracks open flows and completed detectors while chunks are appended.
FlowKey
A borrowed, translated open-flow boundary key.
LoopCarriedDetectorState
A detector state carried between iterations of a repeated body.
LoopStateId
Identifies a loop-carried detector state threaded across iterations of a repeated body.
MeasRecord
A measurement id paired with the qubit coordinate it measured.
MeasRegistry
Allocator and lookup table for a circuit’s measurement ids.
NoiseModel
Circuit-level Pauli noise probabilities materialized by NoiseModel::noisy_circuit.
OffsetFlows
A chunk’s flows plus their absolute XY placement offset.
PauliMap
A sparse, phaseless map from qubit coordinate to non-identity Pauli. Compose maps with ^; exact product phases are discarded.
PauliMapIter
Borrowing iterator over a PauliMap’s sorted (coordinate, pauli) entries.
PendingLoopDetectorStates
Loop-carried detector states opened for a loop body, awaiting their next parity once the body’s closing flows are known.
RegionBreak
A recorded anticommutation: the region could not continue past this point.
RegionTerm
One qubit of a tracked region and the Pauli it carries there.
ResidualFlow
A boundary flow left open after residual composition.
SliceDetector
A detector to track: an opaque id and the measurement ids whose parity it sums. Ids live in the input op stream’s id space.
SliceRegionSeed
A Pauli contribution to a tracked region at an exact segment boundary.

Enums§

ChunkOrLoop
A chunk or a loop of chunks (for repeated syndrome extraction rounds).
CircuitError
An error building, validating, or lowering a CoordCircuit.
ComposedChain
A completed flow classified for detector synthesis.
DetectorTerm
One term of a DetectorParity: either a measurement outcome or a loop-carried state.
DetsliceError
A failure preparing the op stream for reverse tracking.
FlattenEvent
A replay step produced by CoordCircuit::flatten.
FlowError
A failure while matching stabilizer flows across chunk boundaries.
FlowMarker
How a completed flow chain’s parity is consumed downstream.
GateType
A quantum gate, named after its Stim mnemonic.
MeasurementFrameError
An overflow or out-of-range condition while accounting for the measurements a repeated (REPEAT) circuit body contributes.
Op
A single coordinate-addressed circuit operation.
RegionBreakKind
Why a region stopped propagating backward.

Functions§

checked_translate_coordinate
Translate one coordinate without wrapping outside the signed 32-bit lattice.
detector_slices_with_seeds
Track detecting and logical regions with positioned Pauli contributions.
measurement_gate_name
The Stim gate name that measures in basis.
translate_detector_coords
Offsets a detector’s first two coordinates by a layout offset, leaving any further coordinates untouched.

Type Aliases§

DetectorCoords
Coordinates attached to a detector annotation, almost always an (x, y) pair; kept inline so the thousands of detector ops a compile produces do not heap-allocate their coordinates.
DetectorRegion
The region terms one detector’s region covers at one moment.
FlowEngineMeasurements
Measurements carried by an open or completed flow.
FlowMeasurements
The measurement ids a Flow carries, kept inline for the common small case.