Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and alecandido committed Mar 1, 2024
1 parent da175b1 commit c86ab4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/qibo/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def construct_backend(backend, **kwargs):

elif backend == "qibotn": # pragma: no cover
from qibotn.backends import CuTensorNet, QuimbBackend # pylint: disable=E0401

platform = kwargs.get("platform")
if platform == "cutensornet": # pragma: no cover
return CuTensorNet(kwargs["runcard"])
Expand Down
11 changes: 6 additions & 5 deletions tests/test_backend_qibotn.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import qibo
import pytest
from qibo.backends import GlobalBackend
from qibotn.backends import CuTensorNet, QuimbBackend

import qibo
from qibo.backends import GlobalBackend


@pytest.mark.parametrize("platform", ["cutensornet", "qutensornet"])
def test_backend_qibotn(platform):

qibo.set_backend(backend="qibotn", platform=platform, runcard=None)

if platform == "qutensornet":
qibotn_backend = QuimbBackend(runcard=None)
else:
qibotn_backend = CuTensorNet(runcard=None)

assert isinstance(GlobalBackend(), type(qibotn_backend))

0 comments on commit c86ab4f

Please sign in to comment.