mirror of https://github.com/Qiskit/qiskit.git
15 lines
606 B
YAML
15 lines
606 B
YAML
---
|
|
features:
|
|
- |
|
|
The :meth:`.QNSPSA.get_fidelity` static method now supports an optional
|
|
``sampler`` argument which is used to provide an implementation of the
|
|
:class:`~.BaseSampler` interface (such as :class:`~.Sampler`,
|
|
:class:`~.BackendSampler`, or any provider implementations such as those
|
|
present in ``qiskit-ibm-runtime`` and ``qiskit-aer``) to compute the
|
|
fidelity of a :class:`~.QuantumCircuit`. For example::
|
|
|
|
from qiskit.primitives import Sampler
|
|
from qiskit.algorithms.optimizers import QNSPSA
|
|
|
|
fidelity = QNSPSA.get_fidelity(my_circuit, Sampler())
|