ErrorAwareTreeSearchConfig

class ErrorAwareTreeSearchConfig(tolerance_error=1e-08, layout_method='trivial', optimizer='bfgs2', global_search='basin_hopping', n_trials_warm=1, n_trials_cold=1, warm_start_from_level=1, refine_best_trial=False, parallel_mode='openmp', use_float=False, round_single_qubit_rotations=None, seed=None, verbosity='silent', barrier=False, no_improvement_steps=2, warn_on_plateau=True, layer_max=25, layer_min=1)

Error-aware search that grows one layer at a time, over a tree search.

Each step enumerates the candidate entangler placements of the topology and keeps the best, so the search grows by a single layer. This handles irregular topologies and can find shorter structures, at a per-step cost that grows combinatorially with the number of placements.

The fields this strategy defines come first below. The rest are inherited from SynthesisConfig, which documents them in full.

Variables:
  • layer_max – Maximum number of layers the search may grow to.

  • layer_min – Minimum number of layers the returned circuit holds. The search still tries the shallower structures and records them in layer_history, but none of them can win. The default 1 keeps at least one entangler in the circuit; 0 lets the search return the closing single-qubit layer alone.

  • no_improvement_steps – How many search steps without an improving overall error the search tolerates before stopping. This is the knob for how far past the optimum to keep looking: raise it to record more of the trade-off curve, lower it to stop sooner and spend less time. Must be at least 1.

  • warn_on_plateau – Whether to report a PlateauWarning when no level the search tried fits better than the shallowest one, and the compiled circuit’s compilation error is above tolerance_error.

  • tolerance_error – Early exit for the search: a level whose compilation error falls below it stops the search there, even if the overall error would keep improving. (more details)

  • layout_method – Boundary qubit relabeling, or the strategy that searches for one. (more details)

  • optimizer – Backend numerical optimizer that fits the ansatz parameters. (more details)

  • global_search – Which global search wraps BFGS2’s local optimizer. Other optimizers ignore it. (more details)

  • n_trials_warm – Optimizations per candidate gate structure seeded from the previous level’s result. (more details)

  • n_trials_cold – Optimizations per candidate gate structure from a fully random point. (more details)

  • warm_start_from_level – First level whose warm trials seed from the previous one. (more details)

  • refine_best_trial – Whether a further optimization refines the best trial. (more details)

  • parallel_mode – Backend parallelization mode. (more details)

  • use_float – Whether to run the backend in single precision. (more details)

  • seed – Seed for the backend’s random number generator. (more details)

  • verbosity – How much the compiler prints. (more details)

  • round_single_qubit_rotations – The angles to round single-qubit rotation angles onto where the fit allows. (more details)

  • barrier – Whether to insert a barrier after every native entangler, for readability when drawing. (more details)

Raises:

ConfigError – If layer_min is negative or above layer_max.