Skip to content

Commit

Permalink
add funcs
Browse files Browse the repository at this point in the history
  • Loading branch information
changsookim committed Sep 10, 2024
1 parent 583d26b commit 2419d7d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/qibo/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def transpiler(cls): # pragma: no cover
return cls._transpiler

cls._transpiler = Passes(passes=[])
# TODO: add default passes or use Passes.default()
return cls._transpiler

@classmethod
Expand All @@ -144,6 +143,7 @@ def resolve_global(cls):
if cls._backend is None:
cls._backend = cls.backend()
if cls._transpiler is None:
# TODO: add default transpiler for hardware backends
cls._transpiler = cls.transpiler()


Expand Down Expand Up @@ -188,6 +188,14 @@ def set_backend(backend, **kwargs):
_Global.set_backend(backend, **kwargs)


def get_transpiler():
return str(_Global.get_transpiler())


def set_transpiler(transpiler):
_Global.set_transpiler(transpiler)


def get_precision():
return _Global.get_backend().precision

Expand Down

0 comments on commit 2419d7d

Please sign in to comment.