Skip to main content

Crate bloq_compile

Crate bloq_compile 

Source
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§

CompileArtifacts
The output of a successful compilation: the lowered Bloq program, how long the compile took, and any advisories the compiler raised about it.
CompileConfig
Parameters that determine how a BlockGraph is lowered: the surface code distance and T-source mode.
CompileContext
The main compilation context. Orchestrates the full pipeline: BlockGraph -> Bloq.
CompiledObject
A compiled block graph for one physical target, ready for repeated linking.
Connectivity
Connected faces reported by CompileError::InvalidConnectivity.
InvalidDistance
A surface code distance was rejected: distances must be odd and in 3..=255, limiting the quadratic grids materialized during compilation.
SharedCompileCache
A compile cache shareable by several CompileContexts, including across threads.

Enums§

CompileError
An error raised while validating or compiling a BlockGraph.
CompileStage
A stage entered by a compilation. Stages can repeat if a planner retries.
WalkError
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 graph at distance, returning the lowered program.
compile_clifford_proxy
Compile graph with 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 graph under config in a fresh context, returning the full CompileArtifacts.
compiled_distance
The code distance bloq was compiled at, or None if it carries no CODE_DISTANCE_METADATA_KEY entry (it was not produced by this compiler, or predates the key).
spatial_hadamard_distance_warning
Return the user-facing distance warning when graph uses a construction whose fixed-bulk circuit distance is not guaranteed to equal d.
validate_bloq_qubit_layout_for_source
Validate same-layer physical-qubit ownership in bloq.