Solver Customization¶
The optimizer_preferences
input to the GroundStateSolver
class details the parameters of the VQE optimization scheme.
The GroundStateOptimizer
class consists of the following parameters:
- name - (OptimizerType) Classical optimization algorithms: COBYLA, SPSA, ADAM, L-BFGS-B, NELDER MEAD.
- num_shots – (positive int) Number of measurements of the ansatz for each assignment of variational parameters.
- max_iteration – (positive int) Maximal number of optimizer iterations.
- tolerance – (positive float) Final accuracy of the optimization.
- step_size - (positive float) Step size for numerically calculating the gradient in L_BFGS_B and ADAM optimizers.
- initial_point - (List of floats) Initial values for the ansatz parameters.
- skip_compute_variance - (bool) If True, the optimizer will not compute the variance of the ansatz.
Example¶
{
"optimizer_preferences" : {
"type": "COBYLA",
"num_shots": 1000,
"max_iteration": 30
}
}
from classiq.applications.chemistry import GroundStateOptimizer
optimizer_preferences = GroundStateOptimizer(
max_iteration=30,
num_shots=1000,
)