Skip to content

Commit

Permalink
separate tests in directories
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Dec 30, 2023
1 parent 2d4ad3d commit 9eff485
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 19 deletions.
Empty file added test/algo/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion test/test_algo.py → test/algo/test_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from qlasskit.algorithms import ConstantOracleException, QAlgorithm, oraclize
from qlasskit.types import interpret_as_qtype

from .utils import ENABLED_COMPILERS
from ..utils import ENABLED_COMPILERS


class QT(QAlgorithm):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from qlasskit import qlassf
from qlasskit.algorithms import DeutschJozsa

from .utils import ENABLED_COMPILERS, qiskit_measure_and_count
from ..utils import ENABLED_COMPILERS, qiskit_measure_and_count


@parameterized_class(("compiler"), ENABLED_COMPILERS)
Expand Down
2 changes: 1 addition & 1 deletion test/test_algo_grover.py → test/algo/test_grover.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from qlasskit import Qint2, qlassf
from qlasskit.algorithms import Grover

from .utils import qiskit_measure_and_count
from ..utils import qiskit_measure_and_count


class TestAlgoGrover(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_algo_simon.py → test/algo/test_simon.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from qlasskit import qlassf
from qlasskit.algorithms import Simon

from .utils import ENABLED_COMPILERS, qiskit_measure_and_count
from ..utils import ENABLED_COMPILERS, qiskit_measure_and_count


@parameterized_class(("compiler"), ENABLED_COMPILERS)
Expand Down
Empty file added test/ast2logic/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added test/qlassf/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion test/test_qlassf_bool.py → test/qlassf/test_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from qlasskit import exceptions, qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results

a, b, c, d, e, g, h = symbols("a,b,c,d,e,g,h")
_ret = Symbol("_ret")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results


@parameterized_class(("compiler"), ENABLED_COMPILERS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results

a, b, c, d = symbols("a,b,c,d")
_ret = Symbol("_ret")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results


@parameterized_class(("compiler"), ENABLED_COMPILERS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, qiskit_measure_and_count
from ..utils import COMPILATION_ENABLED, qiskit_measure_and_count


class TestQlassfHybridQuantum(unittest.TestCase):
Expand All @@ -26,8 +26,8 @@ def test_h(self):
count = qiskit_measure_and_count(qf.circuit().export(), 128)
[self.assertEqual(x in count, True) for x in ["0", "1"]]

# THIS IS NOT ALLOWED, since hybrid quantum is applicable only with gates that operates on 1 qubit
# a possible solution is to implement QFT directly as hybrid function.
# THIS IS NOT ALLOWED, since hybrid quantum is applicable only with gates that
# operates on 1 qubit a possible solution is to implement QFT directly as hybrid function.
# def test_qft(self):
# f = "def test(a: Qint2) -> Qint2:\n\treturn Q.QFT(a)"
# qf = qlassf(f, to_compile=False, uncompute=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from qlasskit import exceptions, qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results


@parameterized_class(("compiler"), ENABLED_COMPILERS)
Expand Down
2 changes: 1 addition & 1 deletion test/test_qlassf_int.py → test/qlassf/test_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from qlasskit import Qint2, Qint4, exceptions, qlassf

from .utils import (
from ..utils import (
COMPILATION_ENABLED,
ENABLED_COMPILERS,
compute_and_compare_results,
Expand Down
2 changes: 1 addition & 1 deletion test/test_qlassf_list.py → test/qlassf/test_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results

a, b, c, d = symbols("a,b,c,d")
_ret = Symbol("_ret")
Expand Down
2 changes: 1 addition & 1 deletion test/test_qlassf_matrix.py → test/qlassf/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results

a, b, c, d = symbols("a,b,c,d")
_ret = Symbol("_ret")
Expand Down
4 changes: 2 additions & 2 deletions test/test_qlassf.py → test/qlassf/test_qlassf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from qlasskit import Qint2, Qint4, QlassF, exceptions, qlassf
from qlasskit.boolopt.bool_optimizer import defaultOptimizerDebug

from . import utils
from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from .. import utils
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results


class TestQlassfDecorator(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_qlassf_tuple.py → test/qlassf/test_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from qlasskit import qlassf

from .utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results
from ..utils import COMPILATION_ENABLED, ENABLED_COMPILERS, compute_and_compare_results

a, b, c, d = symbols("a,b,c,d")
_ret = Symbol("_ret")
Expand Down
2 changes: 1 addition & 1 deletion test/test_decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from qlasskit.boolopt.bool_optimizer import custom_simplify_logic
from qlasskit.decompiler import Decompiler

from .utils import ENABLED_COMPILERS, compute_and_compare_results
from .utils import ENABLED_COMPILERS


def _merge_expressions(
Expand Down

0 comments on commit 9eff485

Please sign in to comment.