qiskit-community / qiskit-algorithms

A library of quantum algorithms for Qiskit.
https://qiskit-community.github.io/qiskit-algorithms/
Apache License 2.0
111 stars 54 forks source link

[from qiskit] Extend `qiskit_algorithms.eval_observables` to allow returning a callable #52

Open ElePT opened 1 year ago

ElePT commented 1 year ago

What should we add?

If we want to evaluate a set of expectation values for the same observables and circuits, but with different circuit parameters, we can cache the whole transpilation and basis transformation processes. Qiskit's opflow easily allows this and to leverage this it would be nice if we extended the eval_observables to allow returning a callable that takes as input circuit parameters and returns the (efficiently) evaluated expectation values.

Something like this is already used in #8304 and can be extracted and merged with the existing eval_observables in a follow-up.

ElePT commented 1 year ago

Opened by @Cryoris Original issue & discussion: https://github.com/Qiskit/qiskit/issues/8347