You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a general and extensible for Accelerator backends to supply users with custom execution-related information. A simple example of this may be the quantum state from a simulation Accelerator implementation, or perhaps to run a simulation and then to request specific local expectation values. I would still like to keep the interfaces in xacc/ somewhat co-processor type-agnostic, so I propose we provide a new method to Accelerator that enables one to query this type of execution-related information.
Maybe something like
Accelerator::getExecutionInfo() : HeterogeneousMap
Accelerator::getExecutionInfo<T>(key : string) : T
This would let us also return generators of information
auto local_exp_gen = qpu->getExecutionInfo<std::function<double(Observable&)>>("local-exp-gen");
auto x0x1_exp = local_exp_gen(createObservable("X0 X1").get());
Yeah, this is a fully dynamic approach how this can done, which looks fine to me. Essentially, each Accelerator implementation is expected to fill in its ExecutionInfo HetMap with the specific execution results. The only thing we need to be careful is what is returned by T to avoid copying large objects, like WaveFunction. As long as we store execution info in the HetMap with shared pointers, it should be OK.
We need a general and extensible for Accelerator backends to supply users with custom execution-related information. A simple example of this may be the quantum state from a simulation Accelerator implementation, or perhaps to run a simulation and then to request specific local expectation values. I would still like to keep the interfaces in xacc/ somewhat co-processor type-agnostic, so I propose we provide a new method to Accelerator that enables one to query this type of execution-related information.
Maybe something like
Accelerator::getExecutionInfo() : HeterogeneousMap Accelerator::getExecutionInfo<T>(key : string) : T
This would let us also return generators of information
This functionality is pertinent to ORNL-QCI/tnqvm#82 and ORNL-QCI/tnqvm#83
@tnguyen-ornl @DmitryLyakh
The text was updated successfully, but these errors were encountered: