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:
name: OptimizerType
– Classical optimization algorithms:COBYLA
,SPSA
,ADAM
,L_BFGS_B
,NELDER_MEAD
.num_shots: PositiveInt
– Number of measurements of the ansatz for each assignment of variational parameters.max_iteration: PositiveInt
– Maximal number of optimizer iterations.tolerance: PositiveFloat
– Final accuracy of the optimization.step_size: PositiveFloat
– Step size for numerically calculating the gradient inL_BFGS_B
andADAM
optimizers.initial_point: List[float]
– Initial values for the ansatz parameters.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,
)