Skip to content

Solver Customization

The optimizer_preferences input to the GroundStateSolver class details the parameters of the VQE optimization scheme.

The GroundStateOptimizer class consists of these parameters:

  1. name: OptimizerType – Classical optimization algorithms: COBYLA, SPSA, ADAM, L_BFGS_B, NELDER_MEAD.
  2. num_shots: PositiveInt – Number of measurements of the ansatz for each assignment of variational parameters.
  3. max_iteration: PositiveInt – Maximal number of optimizer iterations.
  4. tolerance: PositiveFloat – Final accuracy of the optimization.
  5. step_size: PositiveFloat – Step size for numerically calculating the gradient in L_BFGS_B and ADAM optimizers.
  6. initial_point: List[float] – Initial values for the ansatz parameters.
  7. skip_compute_variance: bool – If True, the optimizer does 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,
)