This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Advanced Compiler Features
Marc Davis edited this page Feb 28, 2020
·
9 revisions
The SearchCompiler
class takes a few optional initializer options.
sc.SearchCompiler.init(threshold, error_func, heuristic, gateset, solver, beams)
-
threshold
- a float which specifies the stopping condition for the synthesis. The first circuit for which theerror_func
returns a value less than thethreshold
will be returned as the solution. The default value is1e-10
. -
error_func
- a function which takes two matrices and returns a float. It's value is used in guiding the search and deciding when to return a solution. The default value issc.utils.matrix_distance_squared
. -
heuristic
- a function which takes the value oferror_func
and the current search depth and returns a float. This value is used to guide the search. The default issc.heuristics.astar
. Heuristics for greedy search and breadth first search are also provided. It is recommended to switch to breadth first search if you are using a gateset with gates other than CNOT and single qubit gates. -
gateset
- asc.gatesets.Gateset
object which describes the gateset used for synthesis. The default value issc.gatesets.QubitCNOTLinear()
, which is the recommended gateset for using CNOTs and single qubit gates with the linear topology. -
solver
- asc.solver.Solver
object which performs numerical optimization. The default value issc.solver.COBYLA_Solver
, which makes a call tosp.optimize.fmin_cobyla
for numerical optimization. -
beams
- an integer which defines the number of nodes to expand at a time during each step. A negative value will result in a number of beams calculated to fully utilize the CPU threads visible to Python. The default value is-1
.