Closed Cryoris closed 2 years ago
So in the model above, is ExpectationValue
tasked with forming the correct circuits for the operator, i.e. appending the needed basis transform gates? Also, do we really need a class here that one can pass parameters to, i.e why can't ExpectationValue
just be a call to run the circuits on the specified backend after binding parameters that returns the results?
Closing as resolved by #7780 .
Related to #6451
Summary
Taking expectation values for opflow operators on a backend/simulator currently looks like
This workflow requires users to know about several classes before being able to calculate expectation values and constructs and copies potentially heavy opflow objects multiple times. We'd like to create a new expectation value class to (1) simplify and speed up the current flow and (2) create one universal interface for Qiskit (instead of having a quantum-info way and opflow way of doing it).
This must be (and currently is) synced with the development of expectation values in Qiskit Experiments.
On the high level, we'd like to calculate circuit-based expectation values as (this is just a sketch, naming etc. is not fixed)
This would easily allow to cache transpiled circuits, it's easy to use and variational algorithms can easily be implemented.