compile_block_graph#

tqec.compile.compile_block_graph(block_graph, block_builder=functools.partial(<function default_compiled_block_builder>, plaquette_builder=<function make_css_surface_code_plaquette>), substitution_builder=functools.partial(<function default_substitution_builder>, plaquette_builder=<function make_css_surface_code_plaquette>), observables='auto')[source]#

Compile a block graph.

Parameters:
  • block_graph (BlockGraph) – The block graph to compile.

  • block_builder (BlockBuilder) – A callable that specifies how to build the CompiledBlock from the specified CubeSpecs. Defaults to the block builder for the CSS type surface code.

  • substitution_builder (SubstitutionBuilder) – A callable that specifies how to build the substitution plaquettes from the specified PipeSpec. Defaults to the substitution builder for the CSS type surface code.

  • observables (list[CorrelationSurface] | Literal['auto'] | None) – correlation surfaces that should be compiled into observables and included in the compiled circuit. If set to "auto", the correlation surfaces will be automatically determined from the block graph. If a list of correlation surfaces is provided, only those surfaces will be compiled into observables and included in the compiled circuit. If set to None, no observables will be included in the compiled circuit.

Returns:

A CompiledGraph object that can be used to generate a stim.Circuit and scale easily.

Return type:

CompiledGraph