8000 "sampler" is currently a keyword argument for QNSPSA by julenl · Pull Request #218 · qiskit-community/qiskit-algorithms · GitHub
[go: up one dir, main page]

Skip to content

"sampler" is currently a keyword argument for QNSPSA #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 31, 2025
Merged
5 changes: 2 additions & 3 deletions qiskit_algorithms/optimizers/qnspsa.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 2021, 2024.
# (C) Copyright IBM 2021, 2025.
#
# 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 @@ -232,8 +232,7 @@ def settings(self) -> dict[str, Any]:
@staticmethod
def get_fidelity(
circuit: QuantumCircuit,
*,
sampler: BaseSampler | None = None,
sampler: BaseSampler,
) -> Callable[[np.ndarray, np.ndarray], float]:
r"""Get a function to compute the fidelity of ``circuit`` with itself.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
upgrade:
- |
The list of arguments for `QNSPSA.get_fidelity()` has been updated to
remove the keyword enforcement for `sampler` so also allowing it now
as positional. Additionally the `sampler` must be explicitly specified, as a
valid object, as it no longer supports `None` nor defaults to that.
Loading
0