tqec.simulation.generation.generate_sinter_tasks#
- generate_sinter_tasks(compiled_graph: CompiledGraph, ks: Iterable[int], ps: Iterable[float], noise_model_factory: Callable[[float], NoiseModel], manhattan_radius: int, max_workers: int | None = None) Iterator[Task] [source]#
Generate sinter.Task instances from the provided parameters.
This function generate the sinter.Task instances for all the combinations of the given ks and ps with a noise model that depends on p and computed with noise_model_factory.
- Parameters:
compiled_graph – computation to export to stim.Circuit instances.
ks – values of k to consider.
ps – values of p, the noise strength, to consider.
noise_model_factory – a callable that builds a noise model from an input strength p.
manhattan_radius – radius used to automatically compute detectors. The best value to set this argument to is the minimum integer such that flows generated from any given reset/measurement, from any plaquette at any spatial/temporal place in the QEC computation, do not propagate outside of the qubits used by plaquettes spatially located at maximum manhattan_radius plaquettes from the plaquette the reset/measurement belongs to (w.r.t. the Manhattan distance). Default to 2, which is sufficient for regular surface code. If negative, detectors are not computed automatically and are not added to the generated circuits.
max_workers – The maximum number of processes that can be used to execute the given calls. If None or not given then as many worker processes will be created as the machine has processors.
- Yields:
tasks to be collected by a call to sinter.collect.