iqm.qrisp_iqm.passes.routing.core.parameter_selection.compute_parameters#
- iqm.qrisp_iqm.passes.routing.core.parameter_selection.compute_parameters(effort: int, num_2qb_gates: int, cpu_count: int = 128) dict[str, int]#
Derive transpiler parameters from a single effort level.
- Parameters:
effort (int) – Classical compute investment level (≥ 1). - effort=1 : fast — one parallel wave, C=1-2 - effort=3 : moderate — 1-2 layout waves, C=2-6 - effort=5 : thorough — several layout waves, C=4-10 Wall-clock time scales roughly linearly with effort.
cpu_count (int, optional) – Number of available CPU cores (auto-detected by default).
num_2qb_gates (int, optional) – Number of 2-qubit gates in the circuit. Controls the budget split between layout attempts (ILA) and routing diversity (C). Shallow circuits (< ~100 gates) invest more in ILA; deep circuits invest more in C. When None, a balanced 50/50 split is used.
- Returns:
Keys:
init_layout_attempts,C,layout_iterations.- Return type:
Examples
>>> params = compute_parameters(1, cpu_count=16) >>> params['init_layout_attempts'] >= 16 True >>> params['C'] >= 1 True >>> params['layout_iterations'] 3
>>> # Shallow circuit → heavy ILA, light C >>> p = compute_parameters(5, cpu_count=16, num_2qb_gates=30) >>> p['init_layout_attempts'] >= 48 True >>> p['C'] <= 5 True
>>> # Deep circuit → light ILA, heavy C >>> p = compute_parameters(5, cpu_count=16, num_2qb_gates=1000) >>> p['init_layout_attempts'] <= 32 True >>> p['C'] >= 8 True