LEAPSynthesisPass
- class LEAPSynthesisPass(heuristic_function=<bqskit.passes.search.heuristics.astar.AStarHeuristic object>, layer_generator=None, success_threshold=1e-08, cost=<bqskit.ir.opt.cost.functions.residuals.hilbertschmidt.HilbertSchmidtResidualsGenerator object>, max_layer=None, store_partial_solutions=False, partials_per_depth=25, min_prefix_size=3, instantiate_options={})[source]
Bases:
SynthesisPass
A pass implementing the LEAP search synthesis algorithm.
References
Ethan Smith, Marc G. Davis, Jeffrey M. Larson, Ed Younis, Lindsay Bassman, Wim Lavrijsen, and Costin Iancu. 2022. LEAP: Scaling Numerical Optimization Based Synthesis Using an Incremental Approach. ACM Transactions on Quantum Computing (June 2022). https://doi.org/10.1145/3548693
- __init__(heuristic_function=<bqskit.passes.search.heuristics.astar.AStarHeuristic object>, layer_generator=None, success_threshold=1e-08, cost=<bqskit.ir.opt.cost.functions.residuals.hilbertschmidt.HilbertSchmidtResidualsGenerator object>, max_layer=None, store_partial_solutions=False, partials_per_depth=25, min_prefix_size=3, instantiate_options={})[source]
Construct a search-based synthesis pass.
- Parameters:
heuristic_function (
HeuristicFunction
) – The heuristic to guide search.layer_generator (
LayerGenerator | None
) – The successor function to guide node expansion. If left as none, then a default will be selected before synthesis based on the target model’s gate set. (Default: None)success_threshold (
float
) – The distance threshold that determines successful termintation. Measured in cost described by the cost function. (Default: 1e-8)cost (
CostFunction | None
) – The cost function that determines distance during synthesis. The goal of this synthesis pass is to implement circuits for the given unitaries that have a cost less than the success_threshold. (Default: HSDistance())max_layer (
int
) – The maximum number of layers to append without success before termination. If left as None it will default to unlimited. (Default: None)store_partial_solutions (
bool
) – Whether to store partial solutions at different depths inside of the data dict. (Default: False)partials_per_depth (
int
) – The maximum number of partials to store per search depth. No effect if store_partial_solutions is False. (Default: 25)min_prefix_size (
int
) – The minimum number of layers needed to prefix the circuit.(dict[str (instantiate_options) – Any]): Options passed directly to circuit.instantiate when instantiating circuit templates. (Default: {})
- Raises:
ValueError – If max_depth or min_prefix_size is nonpositive.
Attributes
The name of the pass.
Methods
check_leap_condition
(new_layer, best_dist, ...)Return true if the leap condition is satisfied.
check_new_best
(layer, dist, best_layer, ...)Check if the new layer depth and dist are a new best node.
execute
(*args, **kwargs)Map a function over iterable arguments in parallel.
get_connectivity
(_, data)Retrieve the current connectivity of the circuit.
get_model
(_, data)Retrieve the machine model from the data dictionary.
get_placement
(_, data)Retrieve the logical to physical qubit map from the data dictionary.
get_target
(_, data)Retrieve the target from the data dictionary.
in_parallel
(data)Return true if pass is being executed in a parallel.
run
(circuit, data)Perform the pass's operation, see
BasePass
for more.synthesize
(utry, data)Synthesize utry, see
SynthesisPass
for more.