Skip to content

Commit

Permalink
fix: args in scipy optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoRobbiati committed Jun 28, 2024
1 parent 2f541d1 commit e46995c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/boostvqe/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,38 +379,38 @@ def optimize_D(
func=loss_function_D,
x0=params,
bounds=bounds,
args=(gci,),
args=(gci, eo_d_type, mode),
maxiter=maxiter,
)
elif method == "differential_evolution":
opt_results = optimize.differential_evolution(
func=loss_function_D,
x0=params,
bounds=bounds,
args=(gci,),
args=(gci, eo_d_type, mode),
maxiter=maxiter,
)
elif method == "DIRECT":
opt_results = optimize.direct(
func=loss_function_D,
bounds=bounds,
args=(gci,),
args=(gci, eo_d_type, mode),
maxiter=maxiter,
)
elif method == "basinhopping":
opt_results = optimize.basinhopping(
func=loss_function_D,
x0=params,
niter=maxiter,
minimizer_kwargs={"method": "Powell", "args": (gci,)},
minimizer_kwargs={"method": "Powell", "args": (gci, eo_d_type, mode)},
)
# scipy local minimizers
else:
opt_results = optimize.minimize(
fun=loss_function_D,
x0=params,
bounds=bounds,
args=(gci,),
args=(gci, eo_d_type, mode),
method=method,
options={"disp": 1, "maxiter": maxiter},
)
Expand Down

0 comments on commit e46995c

Please sign in to comment.