Expand description
Compile block graphs into physical circuit programs.
Pipeline: BlockGraph → Bloq → backend emission.
The compiler walks every block in a BlockGraph, resolves its signature and
convention, generates per-block circuit templates, composes detectors and
observables from stabilizer flows, and lowers the result into Bloq
nodes suitable for backend emission.
Re-exports§
pub use bloq_ir::Bloq;pub use bloq_ir::BloqEdge;pub use bloq_ir::BloqNode;pub use bloq_ir::BloqNodeId;pub use bloq_ir::NodeProvenance;pub use bloq_ir::SourceBlockRef;pub use bloq_ir::TemporalPipeRef;
Structs§
- Compile
Artifacts - The output of a successful compilation: the lowered
Bloqprogram, how long the compile took, and any advisories the compiler raised about it. - Compile
Config - Parameters that determine how a
BlockGraphis lowered: the surface code distance and T-source mode. - Compile
Context - The main compilation context. Orchestrates the full pipeline: BlockGraph -> Bloq.
- Compiled
Object - A compiled block graph for one physical target, ready for repeated linking.
- Connectivity
- Connected faces reported by
CompileError::InvalidConnectivity. - Invalid
Distance - A surface code distance was rejected: distances must be odd and in
3..=255, limiting the quadratic grids materialized during compilation. - Shared
Compile Cache - A compile cache shareable by several
CompileContexts, including across threads.
Enums§
- Compile
Error - An error raised while validating or compiling a
BlockGraph. - Compile
Stage - A stage entered by a compilation. Stages can repeat if a planner retries.
- Walk
Error - Why a Walking block’s step construction failed, one variant per failure
class of the step walk (see
block/walk.rs).
Constants§
- CLIFFORD_
PROXY_ SEED_ METADATA_ KEY - Metadata key for the seed used to sample a random Clifford proxy path.
- CODE_
DISTANCE_ METADATA_ KEY - Metadata key for the code distance used to compile a
Bloq. - CONVENTION_
METADATA_ KEY - Metadata key for the layout convention used to compile a
Bloq. - MAX_
CODE_ DISTANCE - Largest supported surface code distance.
Functions§
- compile
- Compile
graphatdistance, returning the lowered program. - compile_
clifford_ proxy - Compile
graphwith every dynamic element replaced by a Clifford stand-in. - compile_
detslice_ proxy - Compile a pinned detector-slice proxy.
- compile_
random_ clifford_ proxy - Compile one seeded random static Clifford proxy path.
- compile_
with - Compile
graphunderconfigin a fresh context, returning the fullCompileArtifacts. - compiled_
distance - The code distance
bloqwas compiled at, orNoneif it carries noCODE_DISTANCE_METADATA_KEYentry (it was not produced by this compiler, or predates the key). - spatial_
hadamard_ distance_ warning - Return the user-facing distance warning when
graphuses a construction whose fixed-bulk circuit distance is not guaranteed to equald. - validate_
bloq_ qubit_ layout_ for_ source - Validate same-layer physical-qubit ownership in
bloq.