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] committed Sep 13, 2024
1 parent 490f0ec commit 9cb70fc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Reference docs at https://docs.codecov.com/docs/codecovyml-reference

codecov:
require_ci_to_pass: yes
require_ci_to_pass: yes
2 changes: 1 addition & 1 deletion src/qibotn/backends/cutensornet.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ def execute_circuit(
if return_array:
return state.flatten()
else:
return QuantumState(state.flatten())
return QuantumState(state.flatten())
14 changes: 8 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
"""To skip the pytests marked with gpu"""
import pytest
"""To skip the pytests marked with gpu."""

import os

tt = os.system('nvidia-smi')
import pytest

tt = os.system("nvidia-smi")


def pytest_runtest_setup(item):
if (tt!=0):
if tt != 0:
for marker in item.iter_markers(name="gpu"):
pytest.skip(f"test requires gpu")


"""Pytest fixtures.
"""


5 changes: 3 additions & 2 deletions tests/test_cuquantum_cutensor_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ def test_mps(nqubits: int, dtype="complex128"):
dtype (str): The data type for precision, 'complex64' for single,
'complex128' for double.
"""
import qibotn.eval
import cupy as cp

import qibotn.eval

# Test qibo
qibo.set_backend(backend=config.qibo.backend, platform=config.qibo.platform)

Expand All @@ -81,4 +82,4 @@ def test_mps(nqubits: int, dtype="complex128"):

print(f"State vector difference: {abs(result_tn - result_sv_cp).max():0.3e}")

assert cp.allclose(result_tn, result_sv_cp)
assert cp.allclose(result_tn, result_sv_cp)

0 comments on commit 9cb70fc

Please sign in to comment.