Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EstimatorV2: from_backend does nothing #2123

Closed
zlatko-minev opened this issue May 3, 2024 · 1 comment
Closed

EstimatorV2: from_backend does nothing #2123

zlatko-minev opened this issue May 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@zlatko-minev
Copy link

Informations

  • Qiskit Aer version: 0.14.1
  • Python version: 3.11
  • Operating system: Mac

What is the current behavior?

from_backend seems to do nothing.

Steps to reproduce the problem

Take a look at the source code here in EstimatorV2

    def from_backend(self, backend, **options):
        """use external backend"""
        self._backend.from_backend(backend, **options)

The method from_backend is a class method. Not sure why it's called on an instance of the object and it's return is not used to replace self._backend.

What is the expected behavior?

Should update self._backend

Suggested solutions

Maybe the follwiong, not. sure if we need to also update other options, etc. such as in self.options.backend_options

    def from_backend(self, backend, **options):
        """use external backend"""
        self._backend = AerSimulator.from_backend(backend, **options)
@zlatko-minev zlatko-minev added the bug Something isn't working label May 3, 2024
@doichanj doichanj self-assigned this May 7, 2024
@hhorii
Copy link
Collaborator

hhorii commented Jun 21, 2024

#2120 resolved this issue. Thanks.

@hhorii hhorii closed this as completed Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants