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

Cleaning up device interface #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thierry-martinez
Copy link
Contributor

In the discussion on #230, there was a comment about improving the device interface implementation (see
#230 (comment) ).

In particular, I removed the except Exception path, being unable to reproduce an example where this path is reached. If we want to handle some errors (such as TranspilerError?), we should be more specific.

In the discussion on TeamGraphix#230, there was a comment about improving the
device interface implementation (see
TeamGraphix#230 (comment)
).

In particular, I removed the `except Exception` path, being unable to
reproduce an example where this path is reached. If we want to handle
some errors (such as `TranspilerError`?), we should be more specific.
This was referenced Jan 6, 2025
kwargs_get_backend["instance"] = instance
if resource is not None:
kwargs_get_backend["resource"] = resource
self.backend.get_backend(**kwargs_get_backend)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: interface here is different in the latest commit of graphix-ibmq that is compatible with qiskit 1.0, to be merged soon.

@@ -17,7 +17,7 @@ class PatternRunner:
Executes the measurement pattern.
"""

def __init__(self, pattern: Pattern, backend: str = "ibmq", **kwargs) -> None:
def __init__(self, pattern: Pattern, backend: str = "ibmq", instance: str | None = None, resource: str | None = None, save_statevector: bool = False, optimizer_level: int = 1, shots: int = 1024) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update sadly does not contribute to type-stable interface (better than **kwargs though).
My ideas:

  • define ABC for backends
  • remove = "ibmq" : we do not need to add information about the name of the class inheriting ABC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants