qsearch.solvers
¶
Defines Solver, a class used to wrap various numerical optimizers for finding parameters such that an ansatz circuit is a solution to a target unitary.
Module Contents¶
Classes¶
This class is used to wrap numerical optimizers for circuit solving. |
|
Uses cmaes gradient-free optimization from the cma package. |
|
Uses cobyla gradient-free optimization from scipy. |
|
An easier way to wrap a numerical optimizer than writing your own Solver class. |
|
A solver based on the BFGS implementation in scipy. It requires gradients. |
|
Uses the Leavenberg-Marquardt least-squares optimizer in scipy. |
Functions¶
|
Runs a complex list of tests to determine the best Solver for a specific situation. |
- qsearch.solvers.default_solver(options, x0=None)¶
Runs a complex list of tests to determine the best Solver for a specific situation.
- class qsearch.solvers.Solver¶
This class is used to wrap numerical optimizers for circuit solving.
- property distance_metric¶
- abstract solve_for_unitary(circuit, options, x0=None)¶
Finds the best parameters that minimize error_func or error_residuals between the unitary from the circuit and options.target.
- __eq__(other)¶
Return self==value.
- class qsearch.solvers.CMA_Solver¶
Bases:
Solver
Uses cmaes gradient-free optimization from the cma package.
- solve_for_unitary(circuit, options, x0=None)¶
Finds the best parameters that minimize error_func or error_residuals between the unitary from the circuit and options.target.
- class qsearch.solvers.COBYLA_Solver¶
Bases:
Solver
Uses cobyla gradient-free optimization from scipy.
- solve_for_unitary(circuit, options, x0=None)¶
Finds the best parameters that minimize error_func or error_residuals between the unitary from the circuit and options.target.
- class qsearch.solvers.DIY_Solver(f)¶
Bases:
Solver
An easier way to wrap a numerical optimizer than writing your own Solver class.
Uses the function f that takes in eval_func and initial_guess and returns the parameters that minimizes eval_func.
- solve_for_unitary(circuit, options, x0=None)¶
Finds the best parameters that minimize error_func or error_residuals between the unitary from the circuit and options.target.
- class qsearch.solvers.BFGS_Jac_Solver¶
Bases:
Solver
A solver based on the BFGS implementation in scipy. It requires gradients.
- solve_for_unitary(circuit, options, x0=None)¶
Finds the best parameters that minimize error_func or error_residuals between the unitary from the circuit and options.target.
- class qsearch.solvers.LeastSquares_Jac_Solver¶
Bases:
Solver
Uses the Leavenberg-Marquardt least-squares optimizer in scipy.
- property distance_metric¶
- solve_for_unitary(circuit, options, x0=None)¶
Finds the best parameters that minimize error_func or error_residuals between the unitary from the circuit and options.target.