QSearchSynthesisPass
- class QSearchSynthesisPass(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, instantiate_options={})[source]
Bases:
SynthesisPass
A pass implementing the QSearch A* synthesis algorithm.
References
Davis, Marc G., et al. “Towards Optimal Topology Aware Quantum Circuit Synthesis.” 2020 IEEE International Conference on Quantum Computing and Engineering (QCE). IEEE, 2020.
- __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, 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)(dict[str (instantiate_options) – Any]): Options passed directly to circuit.instantiate when instantiating circuit templates. (Default: {})
- Raises:
ValueError – If max_depth is nonpositive.
Attributes
The name of the pass.
Methods
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.