Skip to content

Commit

Permalink
addresses numpy 2 behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
t-imamichi committed Oct 17, 2024
1 parent 55cb492 commit abe554d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qiskit_optimization/algorithms/optimization_algorithm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2020, 2023.
# (C) Copyright IBM 2020, 2024.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down Expand Up @@ -131,7 +131,9 @@ def __init__(
f"variables: size {len(variables)} {[v.name for v in variables]}"
)
self._x = np.asarray(x)
self._variables_dict = dict(zip(self._variable_names, self._x))
self._variables_dict = {
name: val.item() for name, val in zip(self._variable_names, self._x)
}

self._fval = fval
self._raw_results = raw_results
Expand Down

0 comments on commit abe554d

Please sign in to comment.