Skip to content

Commit ac7f29f

Browse files
julenlwoodsp-ibm
andauthored
"sampler" is currently a keyword argument for QNSPSA (#218)
Co-authored-by: Steve Wood <40241007+woodsp-ibm@users.noreply.github.com>
1 parent 7570295 commit ac7f29f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

qiskit_algorithms/optimizers/qnspsa.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This code is part of a Qiskit project.
22
#
3-
# (C) Copyright IBM 2021, 2024.
3+
# (C) Copyright IBM 2021, 2025.
44
#
55
# This code is licensed under the Apache License, Version 2.0. You may
66
# obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -232,8 +232,7 @@ def settings(self) -> dict[str, Any]:
232232
@staticmethod
233233
def get_fidelity(
234234
circuit: QuantumCircuit,
235-
*,
236-
sampler: BaseSampler | None = None,
235+
sampler: BaseSampler,
237236
) -> Callable[[np.ndarray, np.ndarray], float]:
238237
r"""Get a function to compute the fidelity of ``circuit`` with itself.
239238
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
upgrade:
3+
- |
4+
The list of arguments for `QNSPSA.get_fidelity()` has been updated to
5+
remove the keyword enforcement for `sampler` so also allowing it now
6+
as positional. Additionally the `sampler` must be explicitly specified, as a
7+
valid object, as it no longer supports `None` nor defaults to that.

0 commit comments

Comments
 (0)