It should be easier to get a backend instance from a Batch or Session
What is the expected feature or enhancement? It appears there is no way to get a backend instance from a Batch or Session. But they do have service instances. So if I want to get the backend associated with the Batch or Session I must write:
backend = batch.service.backend(batch.backend())
There should be a better way then this.
Acceptance criteria It is easier for an user to get a backend instance from a Batch or Session.
If I go down to the sampler or estimator level it gets messier:
backend = sampler.mode.service.backend(sampler.mode.backend())
Given passing a backend name to Session/Batch constructor is deprecated, we should change session.backend() to return a backend instance. How to make this transition backward compatible is going to be tricky though.
Yeah it's a bit unfortunate session.backend() returns a string. We could add a backend_name() method, go through a deprecation period, and then change backend() to return the instance.
For now, to get the backend instance you could just do session._backend. For the primitives: sampler.backend() or estimator.backend()