Skip to content

Commit 18b5b63

Browse files
authored
Update qiskit/algorithms/optimizers/spsa.py
Apply suggestion Imamichi-san
1 parent 50eba6d commit 18b5b63

File tree

1 file changed

+1
-1
lines changed
  • qiskit/algorithms/optimizers

1 file changed

+1
-1
lines changed

qiskit/algorithms/optimizers/spsa.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def _batch_evaluate(function, points, max_evals_grouped, unpack_points=False):
742742

743743
def _as_list(obj):
744744
"""Convert a list or numpy array into a list."""
745-
return obj if isinstance(obj, list) else obj.tolist()
745+
return obj.tolist() if isinstance(obj, np.ndarray) else obj
746746

747747

748748
def _repack_points(points):

0 commit comments

Comments
 (0)