optimizer = get_optimizer_instance(opt_params["name"])
// hard-coded params if SPSA is used.
if opt_params["name"] == "SPSA" and opt_params["parameters"] is None:
opt_params["parameters"] = np.asarray([4.0, 0.1, 0.602, 0.101, 0.0])
optimizer.init_params(opt_params)
// Set up variational form
fea_map_params = params.get(QuantumAlgorithm.SECTION_KEY_FEATURE_MAP)
After Change
self._ret = {}
def init_params(self, params, algo_input):
algo_params = params.get(QuantumAlgorithm.SECTION_KEY_ALGORITHM)
override_spsa_params = algo_params.get("override_SPSA_params")
// Set up optimizer
opt_params = params.get(QuantumAlgorithm.SECTION_KEY_OPTIMIZER)