Skip to content

Commit

Permalink
test_type_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
to24toro committed Nov 2, 2023
1 parent 99bc0a6 commit f80d264
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/dynamics/test_type_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_sparse_commutator_dissipator(self):
)


class Test_to_dense(NumpyTestBase):
class Test_to_dense(QiskitDynamicsTestCase):
"""Tests for to_dense."""

def test_None_to_None(self):
Expand Down Expand Up @@ -339,12 +339,10 @@ def test_to_dense_types(self):
"""Type conversion tests for to_dense"""
list_of_ops = [[[0, 1], [1, 0]], [[0, -1j], [1j, 0]], [[1, 0], [0, -1]]]
numpy_ops = np.array(list_of_ops)
normal_array = unp.asarray(np.array(list_of_ops))
op_arr = [Operator.from_label(s) for s in "XYZ"]
single_op = op_arr[0]
list_of_arrays = [Array(op) for op in list_of_ops]
assert isinstance(unp.to_dense(numpy_ops), np.ndarray)
assert isinstance(unp.to_dense(normal_array), np.ndarray)
assert isinstance(unp.to_dense(op_arr), np.ndarray)
assert isinstance(unp.to_dense(single_op), np.ndarray)
assert isinstance(unp.to_dense(list_of_arrays), np.ndarray)
Expand All @@ -357,12 +355,10 @@ def test_to_dense_types(self):
"""Type conversion tests for to_dense with jax backend"""
list_of_ops = [[[0, 1], [1, 0]], [[0, -1j], [1j, 0]], [[1, 0], [0, -1]]]
numpy_ops = np.array(list_of_ops)
normal_array = unp.asarray(np.array(list_of_ops))
op_arr = [Operator.from_label(s) for s in "XYZ"]
single_op = op_arr[0]
list_of_arrays = [unp.asarray(op) for op in list_of_ops]
assert isinstance(unp.to_dense(numpy_ops), np.ndarray)
assert isinstance(unp.to_dense(normal_array), np.ndarray)
assert isinstance(unp.to_dense(op_arr), np.ndarray)
assert isinstance(unp.to_dense(single_op), np.ndarray)
assert isinstance(unp.to_dense(list_of_arrays), np.ndarray)
Expand Down

0 comments on commit f80d264

Please sign in to comment.