mitiq icon indicating copy to clipboard operation
mitiq copied to clipboard

Unify structure of executor functions in mitiq_[frontend] for all frontends

Open andreamari opened this issue 2 years ago • 1 comments

We currently have many versions of executor functions in mitiq/interface/mitiq_<frontend> for frontend in [cirq, qiskit, etc...] . Some of them have been coded years ago, some of them are more recent.

We should probably deprecate most of them in favor of 2 or 3 types of executors. For example, good executors that we should keep if present and add for all frontends are:

  • sample_bitstrings()

  • compute_density_matrix()

  • Optionally, an executor that calls sample_bitstrings() and returns an expectation value as a float (e.g. [this one].(https://github.com/unitaryfund/mitiq/blob/86d62e5f5f035e5ca3ac4ccce1edd19bd7e70755/mitiq/interface/mitiq_qiskit/qiskit_utils.py#L258))

Probably we should deprecate all executors taking a matrix observable of type np.array. If they are necessary for tests, they can be moved to test files.

andreamari avatar Aug 10 '22 10:08 andreamari

Took a look at this today to see where we're at. Looks like a slightly larger chunk of work than I expected if we want all of these interfaces to have a unified API (which I think is a great idea). Here's the current state of things:

sample_bitstrings compute_density_matrix
braket
cirq
pennylane
pyquil
qiskit

Hence we will need to implement all of the ❌ spots.

natestemen avatar Sep 28 '22 16:09 natestemen